Browse Source

删除字段,退回兼容省新建库区

lfy 3 weeks ago
parent
commit
1efa1f911d
13 changed files with 54 additions and 221 deletions
  1. 1 0
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/controller/admin/delivery/vo/CaxxUpdateReqVO.java
  2. 0 10
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/codingcaxx/CodingCaxxDO.java
  3. 0 55
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/codingdwxx/CodingDwxxDO.java
  4. 0 35
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/codingkqxx/CodingKqxxDO.java
  5. 0 63
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/dwxx/DwxxDO.java
  6. 0 45
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/kqxx/KqxxDO.java
  7. 3 2
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/bank/BankMapper.java
  8. 9 1
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/caxx/CaxxMapper.java
  9. 9 0
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/cwxxyear/CwxxYearMapper.java
  10. 0 6
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/kqxx/KqxxMapper.java
  11. 4 2
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/province/ProvinceMapper.java
  12. 27 1
      delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/service/dwxx/DwxxServiceImpl.java
  13. 1 1
      delivery-module-system/delivery-module-system-biz/src/main/java/com/unis/module/system/dal/mysql/arealevel/AreaLevelMapper.java

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

@@ -2,6 +2,7 @@ package com.unis.module.coding.controller.admin.delivery.vo;
2 2
 
3 3
 import io.swagger.v3.oas.annotations.media.Schema;
4 4
 import lombok.Data;
5
+import org.jetbrains.annotations.NotNull;
5 6
 
6 7
 import java.util.List;
7 8
 

+ 0 - 10
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/codingcaxx/CodingCaxxDO.java

@@ -107,14 +107,4 @@ public class CodingCaxxDO {
107 107
      */
108 108
     private String cfcxt;
109 109
 
110
-    /**
111
-     * 交收库备选状态(0:备选,1:被认定,2:被选定)
112
-     */
113
-    private Integer bxzt;
114
-
115
-    /**
116
-     * 数据来源
117
-     */
118
-    private Integer sjly;
119
-
120 110
 }

+ 0 - 55
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/codingdwxx/CodingDwxxDO.java

@@ -130,10 +130,6 @@ public class CodingDwxxDO extends BaseDO {
130 130
      */
131 131
     private Integer sbid;
132 132
     /**
133
-     * 数据来源
134
-     */
135
-    private Integer sjly;
136
-    /**
137 133
      * 行政区划代码
138 134
      */
139 135
     private String xzqhdm;
@@ -154,55 +150,4 @@ public class CodingDwxxDO extends BaseDO {
154 150
     // 已选仓房
155 151
     @TableField(exist = false)
156 152
     private Integer yxcfnum;
157
-
158
-    /**
159
-     * 库区数量
160
-     */
161
-//    private Integer kqnum;
162
-
163
-    /**
164
-     * 注册资本
165
-     */
166
-//    private String zczb;
167
-    /**
168
-     * 资产总额
169
-     */
170
-//    private BigDecimal zcze;
171
-
172
-    /**
173
-     * 企业联系人
174
-     */
175
-//    private String qylxr;
176
-    /**
177
-     * 办公电话
178
-     */
179
-//    private String bgdh;
180
-    /**
181
-     * 企业邮箱
182
-     */
183
-//    private String qyemail;
184
-    /**
185
-     * 企业网站地址
186
-     */
187
-//    private String qywzdz;
188
-    /**
189
-     * 传真号码
190
-     */
191
-//    private String czhm;
192
-    /**
193
-     * 上级单位名称
194
-     */
195
-//    private String sjdwmc;
196
-    /**
197
-     * 上级单位统一编码
198
-     */
199
-//    private String sjdwtybm;
200
-    /**
201
-     * 油罐数量
202
-     */
203
-//    private Integer ygnum;
204
-    /**
205
-     * 单位状态
206
-     */
207
-//    private Integer dwzt;
208 153
 }

+ 0 - 35
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/codingkqxx/CodingKqxxDO.java

@@ -81,16 +81,6 @@ public class CodingKqxxDO extends BaseDO {
81 81
      */
82 82
     private String resid;
83 83
 
84
-
85
-    /**
86
-     * 租仓参考价(元)
87
-     */
88
-    private Integer zcckj;
89
-
90
-    /**
91
-     * 委托保管参考价(元/吨)
92
-     */
93
-    private Integer wtbgckj;
94 84
     /**
95 85
      * 上报状态 0、未上报   1、已上报
96 86
      */
@@ -139,30 +129,5 @@ public class CodingKqxxDO extends BaseDO {
139 129
      * 行政区划代码
140 130
      */
141 131
     private String xzqhdm;
142
-    /**
143
-     * 库区产权
144
-     */
145
-    private String kqcq;
146
-    /**
147
-     * 有效仓容
148
-     */
149
-    private BigDecimal yxcr;
150
-    /**
151
-     * 有效罐容
152
-     */
153
-    private BigDecimal yxgr;
154
-    /**
155
-     * 仓廒数量
156
-     */
157
-    private Integer canum;
158
-    /**
159
-     * 油罐数量
160
-     */
161
-    private Integer ygnum;
162
-
163
-    /**
164
-     * 数据来源
165
-     */
166
-    private Integer sjly;
167 132
 
168 133
 }

+ 0 - 63
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/dwxx/DwxxDO.java

@@ -96,14 +96,6 @@ public class DwxxDO extends BaseDO {
96 96
      */
97 97
     private String resid;
98 98
     /**
99
-     * 上报状态	0、未上报   1、已上报
100
-     */
101
-    private Integer sbzt;
102
-    /**
103
-     * 是否注销:0未注销、1已注销
104
-     */
105
-    private String sfzx;
106
-    /**
107 99
      * 审核状态 0、未审核  1、已审核
108 100
      */
109 101
     private Integer shzt;
@@ -125,10 +117,6 @@ public class DwxxDO extends BaseDO {
125 117
      */
126 118
     private String dwDeptId;
127 119
     /**
128
-     * 变更状态 0未变更,1已变更未保存,2变更并保存流程数据;3发起流程
129
-     */
130
-    private Integer bgzt;
131
-    /**
132 120
      * 上报id
133 121
      */
134 122
     private Integer sbid;
@@ -157,55 +145,4 @@ public class DwxxDO extends BaseDO {
157 145
     // 已选仓房
158 146
     @TableField(exist = false)
159 147
     private Integer yxcfnum;
160
-
161
-    /**
162
-     * 库区数量
163
-     */
164
-//    private Integer kqnum;
165
-
166
-    /**
167
-     * 注册资本
168
-     */
169
-//    private String zczb;
170
-    /**
171
-     * 资产总额
172
-     */
173
-//    private BigDecimal zcze;
174
-
175
-    /**
176
-     * 企业联系人
177
-     */
178
-//    private String qylxr;
179
-    /**
180
-     * 办公电话
181
-     */
182
-//    private String bgdh;
183
-    /**
184
-     * 企业邮箱
185
-     */
186
-//    private String qyemail;
187
-    /**
188
-     * 企业网站地址
189
-     */
190
-//    private String qywzdz;
191
-    /**
192
-     * 传真号码
193
-     */
194
-//    private String czhm;
195
-    /**
196
-     * 上级单位名称
197
-     */
198
-//    private String sjdwmc;
199
-    /**
200
-     * 上级单位统一编码
201
-     */
202
-//    private String sjdwtybm;
203
-    /**
204
-     * 油罐数量
205
-     */
206
-//    private Integer ygnum;
207
-    /**
208
-     * 单位状态
209
-     */
210
-//    private Integer dwzt;
211 148
 }

+ 0 - 45
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/dataobject/kqxx/KqxxDO.java

@@ -73,10 +73,6 @@ public class KqxxDO extends BaseDO {
73 73
      */
74 74
     private BigDecimal zdmj;
75 75
     /**
76
-     * 库区状态  1、正常  2、退出储备粮承储
77
-     */
78
-    private String kqzt;
79
-    /**
80 76
      * 上传库区图id
81 77
      */
82 78
     private String resid;
@@ -92,26 +88,6 @@ public class KqxxDO extends BaseDO {
92 88
      */
93 89
     private Integer wtbgckj;
94 90
     /**
95
-     * 上报状态 0、未上报   1、已上报
96
-     */
97
-    private Integer sbzt;
98
-    /**
99
-     * 变更状态 0未变更,1已变更未保存,2变更并保存流程数据;3发起流程
100
-     */
101
-    private Integer bgzt;
102
-    /**
103
-     * 变更审核状态,0未审核,1已审核
104
-     */
105
-    private Integer bgshzt;
106
-    /**
107
-     * 审核状态 0、未审核  1、已审核
108
-     */
109
-    private Integer shzt;
110
-    /**
111
-     * 是否注销
112
-     */
113
-    private String sfzx;
114
-    /**
115 91
      * 标识  区分省级库区还是中储粮
116 92
      */
117 93
     private String bs;
@@ -136,31 +112,10 @@ public class KqxxDO extends BaseDO {
136 112
      */
137 113
     private String shxydm;
138 114
     /**
139
-     * 行政区划代码
140
-     */
141
-    private String xzqhdm;
142
-    /**
143 115
      * 库区产权
144 116
      */
145 117
     private String kqcq;
146 118
     /**
147
-     * 有效仓容
148
-     */
149
-    private BigDecimal yxcr;
150
-    /**
151
-     * 有效罐容
152
-     */
153
-    private BigDecimal yxgr;
154
-    /**
155
-     * 仓廒数量
156
-     */
157
-    private Integer canum;
158
-    /**
159
-     * 油罐数量
160
-     */
161
-    private Integer ygnum;
162
-
163
-    /**
164 119
      * 数据来源
165 120
      */
166 121
     private Integer sjly;

+ 3 - 2
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/bank/BankMapper.java

@@ -1,5 +1,6 @@
1 1
 package com.unis.module.coding.dal.mysql.bank;
2 2
 
3
+import cn.hutool.core.util.ObjectUtil;
3 4
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
4 5
 import com.unis.framework.common.pojo.PageResult;
5 6
 import com.unis.framework.mybatis.core.mapper.BaseMapperX;
@@ -36,8 +37,8 @@ public interface BankMapper extends BaseMapperX<BankDO> {
36 37
     default int deleteListByKqIdAndCaIds(Long  kqId, List<Long> caIds) {
37 38
         return delete(
38 39
                 new LambdaUpdateWrapper<BankDO>()
39
-                        .eq(BankDO::getKqId, kqId)
40
-                        .in(BankDO::getCaId, caIds)
40
+                        .eq(kqId!=null,BankDO::getKqId, kqId)
41
+                        .in(!ObjectUtil.isEmpty(caIds),BankDO::getCaId, caIds)
41 42
         );
42 43
     }
43 44
 

+ 9 - 1
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/caxx/CaxxMapper.java

@@ -3,6 +3,8 @@ package com.unis.module.coding.dal.mysql.caxx;
3 3
 import java.util.*;
4 4
 import java.util.stream.Collectors;
5 5
 
6
+import cn.hutool.core.util.ObjectUtil;
7
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
6 8
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 9
 import com.unis.framework.common.pojo.PageResult;
8 10
 import com.unis.framework.common.util.object.ObjectUtils;
@@ -10,6 +12,7 @@ import com.unis.framework.mybatis.core.query.LambdaQueryWrapperX;
10 12
 import com.unis.framework.mybatis.core.mapper.BaseMapperX;
11 13
 import com.unis.module.coding.controller.admin.delivery.vo.SparePageReqVO;
12 14
 import com.unis.module.coding.controller.admin.delivery.vo.SpareRespVO;
15
+import com.unis.module.coding.dal.dataobject.bank.BankDO;
13 16
 import com.unis.module.coding.dal.dataobject.caxx.CaxxDO;
14 17
 import org.apache.ibatis.annotations.Mapper;
15 18
 import com.unis.module.coding.controller.admin.caxx.vo.*;
@@ -60,5 +63,10 @@ public interface CaxxMapper extends BaseMapperX<CaxxDO> {
60 63
         );
61 64
         return caxxList;
62 65
     }
63
-
66
+    default int deleteListByKqId(Long  kqId) {
67
+        return delete(
68
+                new LambdaUpdateWrapper<CaxxDO>()
69
+                        .eq(kqId!=null,CaxxDO::getKqid, kqId)
70
+        );
71
+    }
64 72
 }

+ 9 - 0
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/cwxxyear/CwxxYearMapper.java

@@ -1,9 +1,12 @@
1 1
 package com.unis.module.coding.dal.mysql.cwxxyear;
2 2
 
3
+import cn.hutool.core.util.ObjectUtil;
4
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
3 5
 import com.unis.framework.common.pojo.PageResult;
4 6
 import com.unis.framework.mybatis.core.mapper.BaseMapperX;
5 7
 import com.unis.framework.mybatis.core.query.LambdaQueryWrapperX;
6 8
 import com.unis.module.coding.controller.admin.cwxxyear.vo.CwxxYearPageReqVO;
9
+import com.unis.module.coding.dal.dataobject.bank.BankDO;
7 10
 import com.unis.module.coding.dal.dataobject.cwxxyear.CwxxYearDO;
8 11
 import org.apache.ibatis.annotations.Mapper;
9 12
 
@@ -32,4 +35,10 @@ public interface CwxxYearMapper extends BaseMapperX<CwxxYearDO> {
32 35
                 .eq(CwxxYearDO::getCwxxId, cwxxId)
33 36
                 .orderByDesc(CwxxYearDO::getCn));
34 37
     }
38
+    default int deleteListByCwxxId(Long  cwxxId) {
39
+        return delete(
40
+                new LambdaUpdateWrapper<CwxxYearDO>()
41
+                        .eq(cwxxId!=null,CwxxYearDO::getCwxxId, cwxxId)
42
+        );
43
+    }
35 44
 }

+ 0 - 6
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/kqxx/KqxxMapper.java

@@ -31,13 +31,7 @@ public interface KqxxMapper extends BaseMapperX<KqxxDO> {
31 31
                 .eqIfPresent(KqxxDO::getKqfzr, reqVO.getKqfzr())
32 32
                 .eqIfPresent(KqxxDO::getLxdh, reqVO.getLxdh())
33 33
                 .eqIfPresent(KqxxDO::getZdmj, reqVO.getZdmj())
34
-                .eqIfPresent(KqxxDO::getKqzt, reqVO.getKqzt())
35 34
                 .eqIfPresent(KqxxDO::getResid, reqVO.getResid())
36
-                .eqIfPresent(KqxxDO::getSbzt, reqVO.getSbzt())
37
-                .eqIfPresent(KqxxDO::getBgzt, reqVO.getBgzt())
38
-                .eqIfPresent(KqxxDO::getBgshzt, reqVO.getBgshzt())
39
-                .eqIfPresent(KqxxDO::getShzt, reqVO.getShzt())
40
-                .eqIfPresent(KqxxDO::getSfzx, reqVO.getSfzx())
41 35
                 .eqIfPresent(KqxxDO::getBs, reqVO.getBs())
42 36
                 .betweenIfPresent(KqxxDO::getCreateTime, reqVO.getCreateTime())
43 37
                 .eqIfPresent(KqxxDO::getShi, reqVO.getShi())

+ 4 - 2
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/dal/mysql/province/ProvinceMapper.java

@@ -2,8 +2,10 @@ package com.unis.module.coding.dal.mysql.province;
2 2
 
3 3
 import java.util.*;
4 4
 
5
+import cn.hutool.core.util.ObjectUtil;
5 6
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
6 7
 import com.unis.framework.common.pojo.PageResult;
8
+import com.unis.framework.common.util.object.ObjectUtils;
7 9
 import com.unis.framework.mybatis.core.mapper.BaseMapperX;
8 10
 import com.unis.framework.mybatis.core.query.LambdaQueryWrapperX;
9 11
 import com.unis.module.coding.controller.admin.delivery.vo.StoreRespVO;
@@ -52,8 +54,8 @@ public interface ProvinceMapper extends BaseMapperX<ProvinceDO> {
52 54
     default int deleteListByKqIdAndCaIds(Long  kqId, List<Long> caIds) {
53 55
         return delete(
54 56
                 new LambdaUpdateWrapper<ProvinceDO>()
55
-                        .eq(ProvinceDO::getKqId, kqId)
56
-                        .in(ProvinceDO::getCaId, caIds)
57
+                        .eq(kqId!=null,ProvinceDO::getKqId, kqId)
58
+                        .in(!ObjectUtil.isEmpty(caIds),ProvinceDO::getCaId, caIds)
57 59
 
58 60
         );
59 61
     }

+ 27 - 1
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/service/dwxx/DwxxServiceImpl.java

@@ -1,5 +1,6 @@
1 1
 package com.unis.module.coding.service.dwxx;
2 2
 
3
+import cn.hutool.core.util.ObjectUtil;
3 4
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
4 5
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
5 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -14,6 +15,7 @@ import com.unis.module.coding.dal.dataobject.caxx.CaxxDO;
14 15
 import com.unis.module.coding.dal.dataobject.codingcaxx.CodingCaxxDO;
15 16
 import com.unis.module.coding.dal.dataobject.codingdwxx.CodingDwxxDO;
16 17
 import com.unis.module.coding.dal.dataobject.codingkqxx.CodingKqxxDO;
18
+import com.unis.module.coding.dal.dataobject.cwxx.CwxxDO;
17 19
 import com.unis.module.coding.dal.dataobject.kqxx.KqxxDO;
18 20
 import com.unis.module.coding.dal.dataobject.province.ProvinceDO;
19 21
 import com.unis.module.coding.dal.mysql.bank.BankMapper;
@@ -21,6 +23,8 @@ import com.unis.module.coding.dal.mysql.caxx.CaxxMapper;
21 23
 import com.unis.module.coding.dal.mysql.codingcaxx.CodingCaxxMapper;
22 24
 import com.unis.module.coding.dal.mysql.codingdwxx.CodingDwxxMapper;
23 25
 import com.unis.module.coding.dal.mysql.codingkqxx.CodingKqxxMapper;
26
+import com.unis.module.coding.dal.mysql.cwxx.CwxxMapper;
27
+import com.unis.module.coding.dal.mysql.cwxxyear.CwxxYearMapper;
24 28
 import com.unis.module.coding.dal.mysql.kqxx.KqxxMapper;
25 29
 import com.unis.module.coding.dal.mysql.province.ProvinceMapper;
26 30
 import com.unis.module.core.enums.XZQHLEVEL;
@@ -90,7 +94,10 @@ public class DwxxServiceImpl implements DwxxService {
90 94
     private ProvinceMapper provinceMapper;
91 95
     @Resource
92 96
     private BankMapper bankMapper;
93
-
97
+    @Resource
98
+    private CwxxMapper  cwxxMapper;
99
+    @Resource
100
+    private CwxxYearMapper cwxxYearMapper;
94 101
     @Override
95 102
     public Long createDwxx(DwxxSaveReqVO createReqVO) {
96 103
         // 插入
@@ -344,6 +351,25 @@ public class DwxxServiceImpl implements DwxxService {
344 351
             }else{
345 352
                 // 省已选
346 353
                 provinceMapper.deleteListByKqIdAndCaIds(updateReqVO.getKqId(), updateReqVO.getIds());
354
+                KqxxDO kqxxDO = kqxxMapper.selectById(updateReqVO.getKqId());
355
+                if (ObjectUtils.isEmpty(kqxxDO)){
356
+                    throw exception(ERROR,"库区信息不存在");
357
+                }
358
+                Integer sjly = kqxxDO.getSjly();
359
+                if (sjly!=null&&sjly==0){
360
+                    //新建的库区,如果省退回全部的仓房则删除库区的全部信息
361
+                    List<ProvinceDO> provinceDOS = provinceMapper.selectListByKqId(updateReqVO.getKqId());
362
+                    if (ObjectUtils.isEmpty(provinceDOS)){
363
+                        dwxxMapper.deleteById(updateReqVO.getDeptId());
364
+                        kqxxMapper.deleteById(updateReqVO.getKqId());
365
+                        caxxMapper.deleteListByKqId(updateReqVO.getKqId());
366
+                        CwxxDO cwxxDO = cwxxMapper.selectBYKqId(updateReqVO.getKqId());
367
+                        if (!ObjectUtil.isEmpty(cwxxDO)){
368
+                            Long cwxxDOId = cwxxDO.getId();
369
+                            cwxxYearMapper.deleteListByCwxxId(cwxxDOId);
370
+                        }
371
+                    }
372
+                }
347 373
             }
348 374
         }
349 375
 

+ 1 - 1
delivery-module-system/delivery-module-system-biz/src/main/java/com/unis/module/system/dal/mysql/arealevel/AreaLevelMapper.java

@@ -43,6 +43,6 @@ public interface AreaLevelMapper extends BaseMapperX<AreaLevelDO> {
43 43
     }
44 44
     default List<AreaLevelDO> selectListByName(List<String> names) {
45 45
         return selectList(new LambdaQueryWrapperX<AreaLevelDO>()
46
-                .eqIfPresent(AreaLevelDO::getAreaName,names));
46
+                .inIfPresent(AreaLevelDO::getAreaName,names));
47 47
     }
48 48
 }