微信用户选择仪器后,通过扫码绑定仪器

master
382696293@qq.com 2 years ago
parent 98a68d71eb
commit cc1ce4d87e

@ -70,6 +70,15 @@ public class WxInstrumentController extends BaseController {
return R.ok();
}
/**
*
*/
@GetMapping(value = "/scanCodeBinding")
public R scanCodeBinding(@NotBlank(message = "序列号不能为空") @RequestParam("serial") String serial,
@NotBlank(message = "仪器ID不能为空") @RequestParam("instrumentId") Long instrumentId) {
return R.ok(wxInstrumentService.scanCodeBinding(serial, instrumentId));
}
/**
*
*/
@ -88,8 +97,6 @@ public class WxInstrumentController extends BaseController {
/**
*
*
* @return 203
*/
@GetMapping(value = "/getInstrumentInfoBySerial")
public R getInstrumentInfoBySerial(@NotBlank(message = "序列号不能为空") @RequestParam("serial") String serial) {

@ -354,4 +354,15 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
wxInstrumentMode.setStatus(Status.OK.getCode());
return wxInstrumentModeMapper.selectWxInstrumentModeList(wxInstrumentMode);
}
@Override
public WxInstrumentSerial scanCodeBinding(String serial, Long instrumentId) {
/* 1、获取序列号信息 */
WxInstrumentSerial wxInstrumentSerial = getInstrumentInfoBySerial(serial);
if (wxInstrumentSerial.getInstrumentId() == instrumentId) {
logger.info("用户选择的仪器与序列号对应的仪器不一致,序列号:{} 仪器ID{}", serial, instrumentId);
throw new ServiceReturnCodeException("用户选择的仪器与序列号对应的仪器不一致", 204);
}
return wxInstrumentSerial;
}
}

Loading…
Cancel
Save