LiuCheng преди 2 седмици
родител
ревизия
5f2f55450b

+ 2
- 0
src/main/java/com/th/demo/mapping/ware/DistributionDetailMapper.java Целия файл

@@ -21,4 +21,6 @@ public interface DistributionDetailMapper {
21 21
    List<DistributionDetail> selectByFid(String distributionId);
22 22
 
23 23
     int updateCancelFlagById(Map<String,Object> map);
24
+
25
+    int updateCancelFlagByStoreId(String distributionId,String storeId);
24 26
 }

+ 1
- 1
src/main/java/com/th/demo/mapping/ware/OutRecordMapper.java Целия файл

@@ -23,7 +23,7 @@ public interface OutRecordMapper {
23 23
                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
24 24
     List<OutRecord>  selectExpt(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
25 25
                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople,
26
-                            String ordNo, String fkComponyName,String contractNo);
26
+                            String ordNo, String fkComponyName,String contractNo,List<String> plateNos);
27 27
     List<TotalRecord>  selectTotal(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
28 28
                                    String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
29 29
 

+ 9
- 2
src/main/java/com/th/demo/service/impl/ware/OutRecordServiceImpl.java Целия файл

@@ -18,6 +18,8 @@ import com.th.demo.tools.JSONTools;
18 18
 import com.th.demo.tools.Tools;
19 19
 import org.springframework.beans.factory.annotation.Autowired;
20 20
 import org.springframework.stereotype.Service;
21
+import java.util.ArrayList;
22
+import java.util.Arrays;
21 23
 
22 24
 
23 25
 import java.util.Date;
@@ -40,14 +42,19 @@ public class OutRecordServiceImpl implements OutRecordService {
40 42
     public String query(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
41 43
                         String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName,
42 44
                         String contractNo) {
45
+        List<String> pltNos = new ArrayList<>() ;
46
+        if (plateNo.indexOf(",") != -1){
47
+            pltNos = Arrays.asList(plateNo.split(","));
48
+        }
43 49
         if(page == -1 && rows == -1){
44 50
             List<OutRecord> list=outRecordMapper.selectExpt(wareName,stackName,model,materialName,standard,  customerName,
45
-                    plateNo, fromDate,  toDate,   userId, belongId,carNo, tallyPeople,ordNo,fkComponyName,contractNo);
51
+                    plateNo, fromDate,  toDate,   userId, belongId,carNo, tallyPeople,ordNo,fkComponyName,contractNo,pltNos);
46 52
             result = JSONTools.toStringyyyyMMddHHmmss(list);
47 53
         }else{
48 54
             PageHelper.startPage(page, rows);
49 55
             List<OutRecord> list=outRecordMapper.selectExpt(wareName,stackName,model,materialName,standard,  customerName,
50
-                    plateNo, fromDate,  toDate,   userId, belongId,carNo,tallyPeople,ordNo,fkComponyName,contractNo);
56
+                    plateNo, fromDate,  toDate,   userId, belongId,carNo,tallyPeople,ordNo,fkComponyName,contractNo,pltNos);
57
+
51 58
             PageInfo<OutRecord> pageInfo = new PageInfo<>(list);
52 59
 //        result = JSONTools.toString(pageInfo);
53 60
             result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);

+ 8
- 0
src/main/java/com/th/demo/service/impl/ware/OutServiceImpl.java Целия файл

@@ -41,6 +41,9 @@ public class OutServiceImpl implements OutService {
41 41
     public MaterialMapper materialMapper;
42 42
     @Autowired
43 43
     public DistributionMapper distributionMapper;
44
+
45
+    @Autowired
46
+    public DistributionDetailMapper distributionDetailMapper;
44 47
     @Autowired
45 48
     public AccountDetailMapper accountDetailMapper;
46 49
     @Autowired
@@ -122,6 +125,8 @@ public class OutServiceImpl implements OutService {
122 125
                 distribution.setSumCount(distribution.getSumCount()- store.getCount());
123 126
                 num += distributionMapper.updateByPrimaryKey(distribution);
124 127
 
128
+                num += distributionDetailMapper.updateCancelFlagByStoreId(distribution.getId(), store.getId());
129
+
125 130
             }
126 131
             result = Tools.moreThanZeroResultJSON(num);
127 132
         } else {
@@ -143,6 +148,9 @@ public class OutServiceImpl implements OutService {
143 148
                 distribution.setSumWeight(distribution.getSumWeight()- store.getWeight());
144 149
                 distribution.setSumCount(distribution.getSumCount()- store.getCount());
145 150
                 num += distributionMapper.updateByPrimaryKey(distribution);
151
+
152
+                num += distributionDetailMapper.updateCancelFlagByStoreId(distribution.getId(), store.getId());
153
+
146 154
             }
147 155
             result = Tools.moreThanZeroResultJSON(num);
148 156
         }

+ 7
- 0
src/main/resource/mapper/ware/DistributionDetailMapper.xml Целия файл

@@ -98,6 +98,13 @@
98 98
     where id = #{id,jdbcType=VARCHAR}
99 99
   </update>
100 100
 
101
+  <update id="updateCancelFlagByStoreId">
102
+    update t_ware_distribution_detail
103
+    set cancel_flag = '1'
104
+    where distribution_id = #{param1,jdbcType=VARCHAR}
105
+    and store_id = #{param2,jdbcType=VARCHAR}
106
+  </update>
107
+
101 108
 
102 109
   <select id="selectByFid" resultMap="BaseResultMap">
103 110
     select

+ 8
- 3
src/main/resource/mapper/ware/OutRecordMapper.xml Целия файл

@@ -469,14 +469,19 @@
469 469
     LEFT JOIN t_maint_customer e on d.fk_compony_name = e.id
470 470
 
471 471
     where t.ware_name  like concat('%',#{param1,jdbcType=VARCHAR},'%')
472
-    and t.stack_name like concat('%',#{param2,jdbcType=VARCHAR},'%')
472
+   and t.stack_name like concat('%',#{param2,jdbcType=VARCHAR},'%')
473 473
     and t.model like concat('%',#{param3,jdbcType=INTEGER},'%')
474 474
     and t.material_name like concat('%',#{param4,jdbcType=VARCHAR},'%')
475 475
     and t.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
476 476
     <if test="param6 != null and param6 != ''" >
477 477
       and t.customer_name  = #{param6,jdbcType=VARCHAR}
478 478
     </if>
479
-    and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
479
+    and (t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
480
+    <if test="param17 != null and param17.size() !=0" >
481
+      OR t.plate_no IN <foreach  item="item" collection="param17" index="index"  open="(" separator="," close=")">
482
+      #{item,jdbcType=VARCHAR}  </foreach>
483
+    </if>
484
+    )
480 485
     and t.add_time between #{param8,jdbcType=TIMESTAMP} and #{param9,jdbcType=TIMESTAMP}
481 486
     and t.distribution_id = p.id
482 487
     and t.plate_no = c.plate_no
@@ -485,7 +490,7 @@
485 490
     and t.cancel_flag = '0'
486 491
     and ((t.belong_id=#{param11,jdbcType=VARCHAR} and t.ware_name in (
487 492
     select b.name from t_maint_userware a ,t_maint_ware b  where a.ware_id = b.id
488
-    and  a.user_id = #{param10,jdbcType=VARCHAR}  )
493
+    and  a.user_id = #{param10,jdbcType=VARCHAR} )
489 494
     )  or t.customer_name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%') )
490 495
     and ifnull(p.tally_people,'*') like concat('%',#{param13,jdbcType=VARCHAR},'%')
491 496
     and ifnull(c.ord_no,'*') like concat('%',#{param14,jdbcType=VARCHAR},'%')

Loading…
Отказ
Запис