ソースを参照

完成对exceL销售主表的校验逻辑

胡北宽 2週間前
コミット
28dacfb0f4

+ 6
- 0
src/main/java/com/example/backend/mapper/contract/CustCtrlMapper.java ファイルの表示

@@ -25,5 +25,11 @@ public interface CustCtrlMapper extends BaseMapper<CustCtrl> {
25 25
     List<CustCtrl> selectByAgentNoSo(@Param("agentNoSo") String agentNoSo);
26 26
 
27 27
 
28
+    List<CustCtrl> selectCommContrNo(@Param("commContrNo") String commContrNo);
29
+
30
+
31
+
32
+
33
+
28 34
 
29 35
 }

+ 9
- 0
src/main/java/com/example/backend/mapper/contract/DicMapper.java ファイルの表示

@@ -25,4 +25,13 @@ public interface DicMapper extends BaseMapper<DataDic> {
25 25
     List<DataDic> selectDicByServiceType(@Param("serviceType") String serviceType);
26 26
 
27 27
 
28
+    List<DataDic> selectBySettIndex(@Param("settIndex") String settIndex);
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
28 37
 }

+ 20
- 0
src/main/java/com/example/backend/service/contract/impl/SalesContractServiceImpl.java ファイルの表示

@@ -311,6 +311,26 @@ public class SalesContractServiceImpl implements SalesContractService {
311 311
 
312 312
                     }
313 313
 
314
+                    if ("钢产品".equals(entity.getBizProductType())||"设备备件".equals(entity.getBizProductType())) {
315
+                        if (!StringUtils.isEmpty(entity.getCommContrNo())) {
316
+                            List<CustCtrl> commContrNoSoList = custCtrlMapper.selectCommContrNo(entity.getCommContrNo());
317
+                            if(commContrNoSoList==null||commContrNoSoList.isEmpty()){
318
+                                errors.add("佣金合同号 有误!");
319
+                            }
320
+                        }
321
+
322
+                    }
323
+
324
+                    if ("铁矿石".equals(entity.getBizProductType())) {
325
+                        if (!StringUtils.isEmpty(entity.getSettIndex())) {
326
+                            List<DataDic> settIndexList = dicMapper.selectBySettIndex(entity.getSettIndex());
327
+                            if(settIndexList==null||settIndexList.isEmpty()){
328
+                                errors.add("结算指标在数据字典中不存在!");
329
+                            }
330
+                        }
331
+
332
+                    }
333
+
314 334
 
315 335
                     salesContractMapper.insert(entity);
316 336
                     contractId = entity.getId();

+ 13
- 0
src/main/resources/mapper/CustCtrlMapper.xml ファイルの表示

@@ -41,4 +41,17 @@
41 41
         and a.fno =#{agentNoSo}
42 42
         order by a.fdate desc
43 43
     </select>
44
+    <select id="selectCommContrNo" resultType="com.example.backend.entity.common.CustCtrl">
45
+        select a.fno
46
+        from SGGMIIP.otherTContract a
47
+        where ifnull(a.del_flag, 0) != 1
48
+        and ifnull(a.contrType, '') = '佣金合同'
49
+        and a.fno =#{commContrNo}
50
+        and not exists (
51
+        select 1
52
+        from SGGMIIP.t_ctc_sales_Contract B
53
+        where B.commContrNo = A.fno
54
+        )
55
+        order by a.fdate desc
56
+    </select>
44 57
 </mapper>

+ 9
- 0
src/main/resources/mapper/DicMapper.xml ファイルの表示

@@ -30,4 +30,13 @@
30 30
           and i.status = '0'
31 31
           and d.status = '0'
32 32
     </select>
33
+    <select id="selectBySettIndex" resultType="com.example.backend.entity.common.DataDic">
34
+        select d.dic_name, i.item_value
35
+        from SGGMIIP.data_dic d
36
+                 left join SGGMIIP.data_item i on d.id = i.dic_id
37
+        where i.item_value = #{settIndex}
38
+          and d.dic_name = '结算指标'
39
+          and i.status = '0'
40
+          and d.status = '0'
41
+    </select>
33 42
 </mapper>

読み込み中…
キャンセル
保存