修改空指针问题,添加非空判断

release
yishiqihuasheng 2 years ago
parent a67735e834
commit cd3572939a
  1. 12
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java

@ -136,13 +136,13 @@ public class SDNYMainProcessController extends AbstractController {
//查验类发票,执行查验操作后入库
log.info("查验类发票,执行查验操作后入库");
//权限校验
if (pramsMap.get("invoiceNumber").isEmpty()) {
if (StringUtils.isBlank(pramsMap.get("invoiceNumber"))) {
return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票号码不能为空!")));
}
pramsMap.put("invoiceNo", pramsMap.get("invoiceNumber"));
if (!pramsMap.get("billingDate").isEmpty()) {
if (StringUtils.isNotBlank(pramsMap.get("billingDate"))) {
String billingDate = pramsMap.get("billingDate").replaceAll("-", "");
iu.setKprq(pramsMap.get("billingDate"));
pramsMap.put("invoiceDate", billingDate);
@ -151,8 +151,8 @@ public class SDNYMainProcessController extends AbstractController {
return ResponseEntity.ok(JSONObject.toJSONString(R.error("开票日期不能为空!")));
}
if (pramsMap.get("invoiceType").isEmpty()) {
return ResponseEntity.ok(JSONObject.toJSONString(R.error("开票日期不能为空!")));
if (StringUtils.isBlank(pramsMap.get("invoiceType"))) {
return ResponseEntity.ok(JSONObject.toJSONString(R.error("发票类型不能为空!")));
}
if (SNFplxEnum.ZP.getSnFplxDm().equals(pramsMap.get("invoiceType"))
@ -161,11 +161,11 @@ public class SDNYMainProcessController extends AbstractController {
|| SNFplxEnum.ESC.getSnFplxDm().equals(pramsMap.get("invoiceType"))
|| SNFplxEnum.QDZP.getSnFplxDm().equals(pramsMap.get("invoiceType"))
|| SNFplxEnum.QDPP.getSnFplxDm().equals(pramsMap.get("invoiceType"))) {
if (pramsMap.get("totalAmount").isEmpty()) {
if (StringUtils.isBlank(pramsMap.get("totalAmount"))) {
return ResponseEntity.ok(JSONObject.toJSONString(R.error("金额不能为空!")));
}
} else {
if (pramsMap.get("checkCode").isEmpty()) {
if (StringUtils.isBlank(pramsMap.get("checkCode"))){
return ResponseEntity.ok(JSONObject.toJSONString(R.error("校验码不能为空!")));
}
}

Loading…
Cancel
Save