微信用户选择仪器后,通过手动输入序列号绑定仪器

master
382696293@qq.com 2 years ago
parent cc1ce4d87e
commit 7a6561913e

@ -56,6 +56,7 @@ public class WxInstrumentController extends BaseController {
*/
@PostMapping("/manualCodeBinding")
public R manualCodeBinding(@NotNull(message = "请上传序列号图片") @RequestParam(value = "serialImage") MultipartFile file,
@NotBlank(message = "仪器ID不能为空") @RequestParam("instrumentId") Long instrumentId,
@NotBlank(message = "请输入序列号") String serial) {
String serialImage = "";
if (file != null) {
@ -66,6 +67,7 @@ public class WxInstrumentController extends BaseController {
}
serialImage = result.getData().getUrl();
}
wxInstrumentService.determineSerialIsSameInstrument(serial, instrumentId);
wxInstrumentService.binding(serial, serialImage);
return R.ok();
}
@ -76,7 +78,7 @@ public class WxInstrumentController extends BaseController {
@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));
return R.ok(wxInstrumentService.determineSerialIsSameInstrument(serial, instrumentId));
}
/**

@ -27,4 +27,6 @@ public interface IWxInstrumentService {
List<WxInstrumentFileRelate> getInstrumentFileRelateByInstrumentId(Long instrumentId, Integer classify);
List<WxInstrumentMode> getInstrumentModeByInstrumentId(Long instrumentId);
WxInstrumentSerial determineSerialIsSameInstrument(String serial, Long instrumentId);
}

@ -355,8 +355,11 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
return wxInstrumentModeMapper.selectWxInstrumentModeList(wxInstrumentMode);
}
/**
* instrumentId
*/
@Override
public WxInstrumentSerial scanCodeBinding(String serial, Long instrumentId) {
public WxInstrumentSerial determineSerialIsSameInstrument(String serial, Long instrumentId) {
/* 1、获取序列号信息 */
WxInstrumentSerial wxInstrumentSerial = getInstrumentInfoBySerial(serial);
if (wxInstrumentSerial.getInstrumentId() == instrumentId) {

Loading…
Cancel
Save