提交代码

yy_dev
胡锐 1 year ago
parent 6f90108a41
commit 35d64043f8
  1. 34
      cweb/src/main/java/com/cweb/controller/BsPayQrCodeController.java
  2. 2
      service/src/main/java/com/hfkj/service/impl/BsPayQrCodeServiceImpl.java

@ -133,12 +133,42 @@ public class BsPayQrCodeController {
public ResponseData bindStore(@RequestBody JSONObject body) {
try {
if (body.getLong("qrCodeId") == null || body.getLong("storeId") == null) {
if ((body.getLong("qrCodeId") == null && StringUtils.isBlank(body.getString("serialNumber"))) || body.getLong("storeId") == null) {
log.error("configAccount error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
payQrCodeService.bindStore(body.getLong("storeId"),body.getLong("qrCodeId"));
Long qrCodeId = body.getLong("qrCodeId");
if (StringUtils.isNotBlank(body.getString("serialNumber"))) {
BsPayQrCode payQrCode = payQrCodeService.getDetailBySN(body.getString("serialNumber"));
if (payQrCode == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的支付码");
}
qrCodeId = payQrCode.getId();
}
payQrCodeService.bindStore(body.getLong("storeId"),qrCodeId);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/unbindStore",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "解绑门店")
public ResponseData unbindStore(@RequestBody JSONObject body) {
try {
if (body.getLong("qrCodeId") == null) {
log.error("BsDeviceController error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
payQrCodeService.unbindStore(body.getLong("qrCodeId"));
return ResponseMsgUtil.success("操作成功");

@ -260,6 +260,8 @@ public class BsPayQrCodeServiceImpl implements BsPayQrCodeService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "二维码序未绑定门店");
}
qrCode.setSalesmanId(null);
qrCode.setSalesmanName(null);
qrCode.setStoreId(null);
qrCode.setStoreName(null);
qrCode.setStoreBindTime(null);

Loading…
Cancel
Save