Browse Source

客户名称(单位名称)字段添加

liujing-123 3 weeks ago
parent
commit
ea0bd1261a

+ 2 - 2
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/controller/admin/caxx/CaxxController.java

@@ -71,10 +71,10 @@ public class CaxxController {
71 71
         CaxxDO caxx = caxxService.getCaxx(id);
72 72
         return success(BeanUtils.toBean(caxx, CaxxRespVO.class));
73 73
     }
74
-    @GetMapping("/getByKqBm")
74
+    @PostMapping("/getByKqBm")
75 75
     @Operation(summary = "库区人员获得仓廒信息;分页;")
76 76
     @PreAuthorize("@ss.hasPermission('coding:caxx:queryByKqBm')")
77
-    public CommonResult<PageResult<CaxxRespVO>> getCaxx(@Valid CaxxPageReqVO pageReqVO) {
77
+    public CommonResult<PageResult<CaxxRespVO>> getCaxx(@Valid @RequestBody CaxxPageReqVO pageReqVO) {
78 78
         PageResult<CaxxDO> pageResult = caxxService.getCaxxByKqBm(pageReqVO);
79 79
         return success(BeanUtils.toBean(pageResult, CaxxRespVO.class));
80 80
     }

+ 7 - 0
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/controller/admin/caxx/vo/CaxxPageReqVO.java

@@ -4,10 +4,14 @@ import lombok.*;
4 4
 
5 5
 import java.time.LocalDate;
6 6
 import java.util.*;
7
+
7 8
 import io.swagger.v3.oas.annotations.media.Schema;
8 9
 import com.unis.framework.common.pojo.PageParam;
10
+
9 11
 import java.math.BigDecimal;
12
+
10 13
 import org.springframework.format.annotation.DateTimeFormat;
14
+
11 15
 import java.time.LocalDateTime;
12 16
 
13 17
 import static com.unis.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -84,4 +88,7 @@ public class CaxxPageReqVO extends PageParam {
84 88
 
85 89
     @Schema(description = "已选仓房(0:未选,1:已选)")
86 90
     private Integer yxcf;
91
+
92
+    @Schema(description = "客户名称(单位名称)")
93
+    private String khmc;
87 94
 }

+ 5 - 0
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/controller/admin/caxx/vo/CaxxRespVO.java

@@ -114,4 +114,9 @@ public class CaxxRespVO {
114 114
 
115 115
     @Schema(description = "0:备选,1:被认定,2:被选定")
116 116
     private Integer bxzt;
117
+
118
+    @Schema(description = "客户名称(单位名称)")
119
+    @ExcelProperty("客户名称(单位名称)")
120
+    private String khmc;
121
+
117 122
 }

+ 3 - 0
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/controller/admin/caxx/vo/CaxxSaveReqVO.java

@@ -84,4 +84,7 @@ public class CaxxSaveReqVO {
84 84
     @Schema(description = "交收库备选状态(0:备选,1:被认定,2:被选定)")
85 85
     private Integer bxzt;
86 86
 
87
+    @Schema(description = "客户名称(单位名称)")
88
+    private String khmc;
89
+
87 90
 }

+ 1 - 1
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/controller/admin/delivery/DeliveryController.java

@@ -114,7 +114,7 @@ public class DeliveryController {
114 114
 
115 115
     @PostMapping("/createByAll")
116 116
     @Operation(summary = "创建单位/库区/仓房/财务/交通运输")
117
-    @PreAuthorize("@ss.hasPermission('coding:delivery:createByAll')")
117
+    @PreAuthorize("@ss.hasPermission('coding:kqxx:creat')")
118 118
     public CommonResult<Object> createByAll(@Valid @RequestBody DeliverySaveVO createReqVO) {
119 119
         return success(deliveryService.createByAll(createReqVO));
120 120
     }

+ 7 - 1
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/caxx/CaxxDO.java

@@ -102,10 +102,16 @@ public class CaxxDO extends BaseDO {
102 102
      * 数据来源
103 103
      */
104 104
     private Integer sjly;
105
-    /** 是否空仓(0:否,1:是) */
105
+    /**
106
+     * 是否空仓(0:否,1:是)
107
+     */
106 108
     private Integer sfkc;
107 109
     /**
108 110
      * 仓房代码
109 111
      */
110 112
     private String cfdm;
113
+    /**
114
+     * 客户名称(单位名称)
115
+     */
116
+    private String khmc;
111 117
 }

+ 7 - 10
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/service/delivery/DeliveryServiceImpl.java

@@ -25,6 +25,7 @@ import com.unis.module.coding.service.cwxx.CwxxService;
25 25
 import com.unis.module.coding.service.cwxxyear.CwxxYearService;
26 26
 import com.unis.module.coding.service.dwxx.DwxxService;
27 27
 import com.unis.module.coding.service.kqxx.KqxxService;
28
+import lombok.extern.slf4j.Slf4j;
28 29
 import org.springframework.stereotype.Service;
29 30
 import org.springframework.transaction.annotation.Transactional;
30 31
 
@@ -41,6 +42,7 @@ import static com.unis.module.infra.enums.ErrorCodeConstants.ERROR;
41 42
  * @create 2025-01-22 15:28
42 43
  */
43 44
 @Service
45
+@Slf4j
44 46
 public class DeliveryServiceImpl implements DeliveryService {
45 47
     @Resource
46 48
     private DwxxService dwxxService;
@@ -79,12 +81,16 @@ public class DeliveryServiceImpl implements DeliveryService {
79 81
     public Object createByAll(DeliverySaveVO createReqVO) {
80 82
         // 单位信息
81 83
         if (ObjectUtils.isNotEmpty(createReqVO.getDwxxReqVO())) {
84
+            if (ObjectUtils.isEmpty(createReqVO.getDwxxReqVO().getTyxydm())) {
85
+                throw exception(ERROR, "统一信用编码为空");
86
+            }
82 87
             //根据统一信用编码----添加之前查询是否已经添加过该单位
83 88
             List<DwxxDO> tyxydm1 = dwxxMapper.selectList(new QueryWrapper<DwxxDO>().eq("TYXYDM", createReqVO.getDwxxReqVO().getTyxydm()));
84 89
             Long dwxx = null;
85 90
             if (CollectionUtils.isEmpty(tyxydm1)) {
86 91
                 dwxx = dwxxService.createDwxx(createReqVO.getDwxxReqVO());
87 92
             } else {
93
+                log.info("根据统一信用编码查询之前已经添加过该单位({})", tyxydm1.get(0).getId());
88 94
                 dwxx = tyxydm1.get(0).getId();
89 95
             }
90 96
             // 库区信息
@@ -111,21 +117,11 @@ public class DeliveryServiceImpl implements DeliveryService {
111 117
                 String kqbm = "";
112 118
                 // 单位信息社会统一信用编码
113 119
                 String tyxydm = createReqVO.getDwxxReqVO().getTyxydm();
114
-                if (tyxydm == null) {
115
-                    throw exception(ERROR, "统一信用编码为空");
116
-                }
117 120
                 tyxydm = tyxydm.length() <= 18 ? tyxydm : tyxydm.substring(0, 18);
118 121
                 //企业性质
119 122
                 String qyxz = createReqVO.getDwxxReqVO().getQyxz();
120 123
                 //企业性质变成两位
121 124
                 kqbm = KQBMUtils.createKQBM(qyxz, tyxydm, kqdm);
122
-/*                if (qyxz == null) {
123
-                    kqbm = "01" + tyxydm + kqdm;
124
-                } else if (qyxz < 10) {
125
-                    kqbm = "0" + qyxz + tyxydm + kqdm;
126
-                } else {
127
-                    kqbm = qyxz + tyxydm + kqdm;
128
-                }*/
129 125
                 createReqVO.getKqxxReqVO().setKqbm(kqbm);
130 126
                 Long kqxx = kqxxService.createKqxx(createReqVO.getKqxxReqVO());
131 127
 
@@ -133,6 +129,7 @@ public class DeliveryServiceImpl implements DeliveryService {
133 129
                 // 仓房信息
134 130
                 if (CollectionUtils.isNotEmpty(createReqVO.getCaxxReqVOList())) {
135 131
                     createReqVO.getCaxxReqVOList().forEach(caxx -> {
132
+                        caxx.setYxcf(1);
136 133
                         caxx.setKqid(kqxx);
137 134
                         caxxService.createCaxx(caxx);
138 135
                     });