胡北宽 1 giorno fa
parent
commit
cfe07f97fd

+ 4
- 0
src/main/java/com/example/backend/entity/common/CustCtrl.java Vedi File

@@ -496,6 +496,10 @@ public class CustCtrl {
496 496
     @TableField(exist = false)
497 497
     private String signLoc;
498 498
 
499
+    //签约地
500
+    @TableField(exist = false)
501
+    private String cpal;
502
+
499 503
 
500 504
 
501 505
 

+ 20
- 0
src/main/java/com/example/backend/entity/common/SysUser.java Vedi File

@@ -270,6 +270,9 @@ public class SysUser {
270 270
     @TableField(exist = false)
271 271
     private BigDecimal rateUs;
272 272
 
273
+    @TableField(exist = false)
274
+    private BigDecimal rateUsd;
275
+
273 276
     //制单人部门编码
274 277
     @TableField(exist = false)
275 278
     private String deptCode;
@@ -278,6 +281,18 @@ public class SysUser {
278 281
     @TableField(exist = false)
279 282
     private String cpny;
280 283
 
284
+    @TableField(exist = false)
285
+    private String fourscode;
286
+
287
+//    @TableField(value="deptcode",exist = false)
288
+//    private String deptcode;
289
+
290
+    @TableField(exist = false)
291
+    private String fours;
292
+
293
+    @TableField(exist = false)
294
+    private String deptname;
295
+
281 296
     @TableField(exist = false)
282 297
     private String ctrylmbAddr;
283 298
 
@@ -285,4 +300,9 @@ public class SysUser {
285 300
 
286 301
 
287 302
 
303
+
304
+
305
+
306
+
307
+
288 308
 }

+ 1
- 1
src/main/java/com/example/backend/excel/SalesCollectExcelDTO.java Vedi File

@@ -23,7 +23,7 @@ public class SalesCollectExcelDTO {
23 23
     @ExcelProperty("账期(天)")
24 24
     private Integer payDays;
25 25
 
26
-    @ExcelProperty("款方式")
26
+    @ExcelProperty("款方式")
27 27
     private String payMode;
28 28
 
29 29
 

+ 5
- 5
src/main/java/com/example/backend/mapper/contract/SysUserMapper.java Vedi File

@@ -14,11 +14,11 @@ import java.util.List;
14 14
 @Mapper
15 15
 public interface SysUserMapper extends BaseMapper<SysUser> {
16 16
     @Select("select\n" +
17
-            "       b.user_code,b.user_name,b.user_desc\n" +
18
-            "from SGGMIIP.View_Dept_Code a\n" +
19
-            "         left join SGGMIIP.View_User_Code b on a.deptid = b.dept_id\n" +
20
-            "         left join SGGMIIP.addrctrl c on a.fourscode = c.hrDeptCode\n" +
21
-            "where b.user_code =#{userCode}")
17
+            "    b.user_auto_id as id ,\n" +
18
+            "    c.fno,c.cpny,a.deptcode as deptCode,a.*,b.* from SGGMIIP.View_Dept_Code a\n" +
19
+            "    left join SGGMIIP.View_User_Code b on a.deptid=b.dept_id\n" +
20
+            "     left join SGGMIIP.addrctrl  c on a.fourscode=c.hrDeptCode\n" +
21
+            "where b.user_code = #{userCode}")
22 22
     List<SysUser> selectContractByNo(@Param("userCode") String userCode);
23 23
 
24 24
 

+ 83
- 35
src/main/java/com/example/backend/service/contract/impl/SalesContractServiceImpl.java Vedi File

@@ -167,10 +167,37 @@ public class SalesContractServiceImpl implements SalesContractService {
167 167
                         currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:合同执行人代码有误!");
168 168
                         currentContractValid = false;
169 169
                     }
170
+
170 171
                     if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getUserDesc().isEmpty()) {
171 172
                         entity.setContrExecNm(contractUserList.get(0).getUserDesc());
172 173
                     }
173 174
 
175
+                    if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getDeptId().isEmpty()) {
176
+                        entity.setDeptId(contractUserList.get(0).getDeptId());
177
+                    }
178
+
179
+
180
+
181
+                    if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getFno().isEmpty()) {
182
+                        entity.setFno(contractUserList.get(0).getFno());
183
+                    }
184
+
185
+                    if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getFourscode().isEmpty()) {
186
+                        entity.setContrExecCdInstitutionId(contractUserList.get(0).getFourscode());
187
+                    }
188
+
189
+                    if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getCpny().isEmpty()) {
190
+                        entity.setContrExecCdInstitutionNm(contractUserList.get(0).getCpny());
191
+                    }
192
+
193
+                    if (contractUserList != null && !contractUserList.isEmpty() && !StringUtils.isEmpty(contractUserList.get(0).getDeptCode())) {
194
+                        entity.setContrExecCdDeptId(contractUserList.get(0).getDeptCode());
195
+                    }
196
+
197
+                    if (contractUserList != null && !contractUserList.isEmpty() && !StringUtils.isEmpty(contractUserList.get(0).getDeptName())) {
198
+                        entity.setContrExecCdDeptNm(contractUserList.get(0).getDeptName());
199
+                    }
200
+
174 201
                     if (StringUtils.isEmpty(entity.getCtName())) {
175 202
                         currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:客户名称不能为空!");
176 203
                         currentContractValid = false;
@@ -211,6 +238,11 @@ public class SalesContractServiceImpl implements SalesContractService {
211 238
                         entity.setCtNo(ctNameList.get(0).getFno());
212 239
                     }
213 240
 
241
+
242
+                    if (ctNameList != null && !ctNameList.isEmpty() && !ctNameList.get(0).getCtrylmbAddr().isEmpty()) {
243
+                        entity.setTrdCtry(ctNameList.get(0).getCtrylmbAddr());
244
+                    }
245
+
214 246
                     if (ctNameList != null && !ctNameList.isEmpty() && !ctNameList.get(0).getCtContNm().isEmpty()) {
215 247
                         entity.setCtContNm(ctNameList.get(0).getCtContNm());
216 248
                     }
@@ -227,6 +259,9 @@ public class SalesContractServiceImpl implements SalesContractService {
227 259
                         currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:币别不能为空!");
228 260
                         currentContractValid = false;
229 261
                     }
262
+                    if (!StringUtils.isEmpty(entity.getCurcy())) {
263
+                        entity.setCurcy(entity.getCurcy().split("-")[0]);
264
+                    }
230 265
 
231 266
                     List<SysUser> curcyList = sysUserMapper.selectByCurcy(entity.getCurcy());
232 267
                     if (curcyList == null || curcyList.isEmpty()) {
@@ -249,6 +284,10 @@ public class SalesContractServiceImpl implements SalesContractService {
249 284
                         entity.setRateUs(curcyList.get(0).getRateUs());
250 285
                     }
251 286
 
287
+                    if (curcyList != null && !curcyList.isEmpty() && !Objects.isNull(curcyList.get(0).getRateUsd())) {
288
+                        entity.setRateUsd(curcyList.get(0).getRateUsd());
289
+                    }
290
+
252 291
                     if ("出口销售".equals(entity.getBizType()) || "转口销售".equals(entity.getBizType())) {
253 292
                         if (entity.getEstLoadDt() == null) {
254 293
                             currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:合同类型为出口销售或转口销售时,最迟装运日期不能为空!");
@@ -285,6 +324,10 @@ public class SalesContractServiceImpl implements SalesContractService {
285 324
                         entity.setOurBankNm(foursnameList.get(0).getOurBankNm());
286 325
                     }
287 326
 
327
+                    if (foursnameList != null && !foursnameList.isEmpty() && !foursnameList.get(0).getOurBankNm().isEmpty()) {
328
+                        entity.setOurBankNm(foursnameList.get(0).getOurBankNm());
329
+                    }
330
+
288 331
                     if (foursnameList != null && !foursnameList.isEmpty() && !foursnameList.get(0).getOurBankAcct().isEmpty()) {
289 332
                         entity.setOurBankAcct(foursnameList.get(0).getOurBankAcct());
290 333
                     }
@@ -293,10 +336,33 @@ public class SalesContractServiceImpl implements SalesContractService {
293 336
                         entity.setSignLoc(foursnameList.get(0).getSignLoc());
294 337
                     }
295 338
 
339
+
340
+
296 341
                     if (StringUtils.isEmpty(entity.getIfClearBottom())) {
297 342
                         entity.setIfClearBottom("否");
298 343
                     }
299 344
 
345
+
346
+                    // 设置默认值
347
+                    if (StringUtils.isEmpty(entity.getWhetherChartering())) {
348
+                        entity.setWhetherChartering("否");
349
+                    }
350
+                    if (StringUtils.isEmpty(entity.getIfLongTerm())) {
351
+                        entity.setIfLongTerm("否");
352
+                    }
353
+                    if (StringUtils.isEmpty(entity.getIfClearBottom())) {
354
+                        entity.setIfClearBottom("否");
355
+                    }
356
+                    if (StringUtils.isEmpty(entity.getIfLegalCheck())) {
357
+                        entity.setIfLegalCheck("是");
358
+                    }
359
+                    if (StringUtils.isEmpty(entity.getIfPayMultiple())) {
360
+                        entity.setIfPayMultiple("是");
361
+                    }
362
+                    if (StringUtils.isEmpty(entity.getIfBidding())) {
363
+                        entity.setIfBidding("是");
364
+                    }
365
+
300 366
                     if ("铁矿石".equals(entity.getBizProductType()) || "煤炭".equals(entity.getBizProductType())) {
301 367
                         if (StringUtils.isEmpty(entity.getIfLongTerm())) {
302 368
                             currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:合同产品类型为铁矿石或煤炭时,是否长协不能为空");
@@ -381,25 +447,7 @@ public class SalesContractServiceImpl implements SalesContractService {
381 447
                         currentContractValid = false;
382 448
                     }
383 449
 
384
-                    // 设置默认值
385
-                    if (StringUtils.isEmpty(entity.getWhetherChartering())) {
386
-                        entity.setWhetherChartering("否");
387
-                    }
388
-                    if (StringUtils.isEmpty(entity.getIfLongTerm())) {
389
-                        entity.setIfLongTerm("否");
390
-                    }
391
-                    if (StringUtils.isEmpty(entity.getIfClearBottom())) {
392
-                        entity.setIfClearBottom("否");
393
-                    }
394
-                    if (StringUtils.isEmpty(entity.getIfLegalCheck())) {
395
-                        entity.setIfLegalCheck("是");
396
-                    }
397
-                    if (StringUtils.isEmpty(entity.getIfPayMultiple())) {
398
-                        entity.setIfPayMultiple("是");
399
-                    }
400
-                    if (StringUtils.isEmpty(entity.getIfBidding())) {
401
-                        entity.setIfBidding("是");
402
-                    }
450
+
403 451
 
404 452
                     // 额外校验逻辑
405 453
                     boolean needValidate = false;
@@ -551,23 +599,23 @@ public class SalesContractServiceImpl implements SalesContractService {
551 599
                                 }
552 600
                             }
553 601
 
554
-                            if (StringUtils.isEmpty(entity1.getCurcyPo())) {
555
-                                currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购币种不能为空!");
556
-                                currentContractValid = false;
557
-                            }
558
-
559
-                            List<CustCtrl> curcyList1 = custCtrlMapper.selectByCurcyPo(entity1.getCurcyPo());
560
-                            if (curcyList1 == null || curcyList1.isEmpty()) {
561
-                                currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购币种有误!");
562
-                                currentContractValid = false;
563
-                            }
602
+//                            if (StringUtils.isEmpty(entity1.getCurcyPo())) {
603
+//                                currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购币种不能为空!");
604
+//                                currentContractValid = false;
605
+//                            }
564 606
 
565
-                            if (curcyList1 != null && !curcyList1.isEmpty() && !Objects.isNull(curcyList1.get(0).getRate()) && !Objects.isNull(entity1.getRatePo())) {
566
-                                if (entity1.getRatePo().compareTo(curcyList1.get(0).getRate()) != 0) {
567
-                                    currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购汇率和匹配到的采购汇率不符!");
568
-                                    currentContractValid = false;
569
-                                }
570
-                            }
607
+//                            List<CustCtrl> curcyList1 = custCtrlMapper.selectByCurcyPo(entity1.getCurcyPo());
608
+//                            if (curcyList1 == null || curcyList1.isEmpty()) {
609
+//                                currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购币种有误!");
610
+//                                currentContractValid = false;
611
+//                            }
612
+//
613
+//                            if (curcyList1 != null && !curcyList1.isEmpty() && !Objects.isNull(curcyList1.get(0).getRate()) && !Objects.isNull(entity1.getRatePo())) {
614
+//                                if (entity1.getRatePo().compareTo(curcyList1.get(0).getRate()) != 0) {
615
+//                                    currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购汇率和匹配到的采购汇率不符!");
616
+//                                    currentContractValid = false;
617
+//                                }
618
+//                            }
571 619
 
572 620
                             // 产品类型特定校验
573 621
                             if ("铁矿石".equals(bizProductType)) {

+ 1
- 1
src/main/resources/mapper/SysUserMapper.xml Vedi File

@@ -68,7 +68,7 @@
68 68
         order by a.fno
69 69
     </select>
70 70
     <select id="selectByCreateBy" resultType="com.example.backend.entity.common.SysUser">
71
-        select a.id,a.dept_code, a.DEPT_NAME,c.user_desc,c.USER_CODE
71
+        select a.id,a.dept_code as deptCode, a.DEPT_NAME,c.user_desc,c.USER_CODE
72 72
         from SGGMIIP.SYS_DEPARTMENT a
73 73
                  join SGGMIIP.SYS_USER_DEPARTMENT b on a.id = b.DEPT_ID
74 74
                  join SGGMIIP.SYS_USER c on b.USER_ID = c.id

Loading…
Annulla
Salva