Browse Source

库龄 多卷号查询

LiuCheng 2 weeks ago
parent
commit
5f2f55450b

+ 2
- 0
src/main/java/com/th/demo/mapping/ware/DistributionDetailMapper.java View File

21
    List<DistributionDetail> selectByFid(String distributionId);
21
    List<DistributionDetail> selectByFid(String distributionId);
22
 
22
 
23
     int updateCancelFlagById(Map<String,Object> map);
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 View File

23
                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
23
                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
24
     List<OutRecord>  selectExpt(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
24
     List<OutRecord>  selectExpt(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
25
                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople,
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
     List<TotalRecord>  selectTotal(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
27
     List<TotalRecord>  selectTotal(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
28
                                    String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
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 View File

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

+ 8
- 0
src/main/java/com/th/demo/service/impl/ware/OutServiceImpl.java View File

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

+ 7
- 0
src/main/resource/mapper/ware/DistributionDetailMapper.xml View File

98
     where id = #{id,jdbcType=VARCHAR}
98
     where id = #{id,jdbcType=VARCHAR}
99
   </update>
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
   <select id="selectByFid" resultMap="BaseResultMap">
109
   <select id="selectByFid" resultMap="BaseResultMap">
103
     select
110
     select

+ 8
- 3
src/main/resource/mapper/ware/OutRecordMapper.xml View File

469
     LEFT JOIN t_maint_customer e on d.fk_compony_name = e.id
469
     LEFT JOIN t_maint_customer e on d.fk_compony_name = e.id
470
 
470
 
471
     where t.ware_name  like concat('%',#{param1,jdbcType=VARCHAR},'%')
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
     and t.model like concat('%',#{param3,jdbcType=INTEGER},'%')
473
     and t.model like concat('%',#{param3,jdbcType=INTEGER},'%')
474
     and t.material_name like concat('%',#{param4,jdbcType=VARCHAR},'%')
474
     and t.material_name like concat('%',#{param4,jdbcType=VARCHAR},'%')
475
     and t.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
475
     and t.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
476
     <if test="param6 != null and param6 != ''" >
476
     <if test="param6 != null and param6 != ''" >
477
       and t.customer_name  = #{param6,jdbcType=VARCHAR}
477
       and t.customer_name  = #{param6,jdbcType=VARCHAR}
478
     </if>
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
     and t.add_time between #{param8,jdbcType=TIMESTAMP} and #{param9,jdbcType=TIMESTAMP}
485
     and t.add_time between #{param8,jdbcType=TIMESTAMP} and #{param9,jdbcType=TIMESTAMP}
481
     and t.distribution_id = p.id
486
     and t.distribution_id = p.id
482
     and t.plate_no = c.plate_no
487
     and t.plate_no = c.plate_no
485
     and t.cancel_flag = '0'
490
     and t.cancel_flag = '0'
486
     and ((t.belong_id=#{param11,jdbcType=VARCHAR} and t.ware_name in (
491
     and ((t.belong_id=#{param11,jdbcType=VARCHAR} and t.ware_name in (
487
     select b.name from t_maint_userware a ,t_maint_ware b  where a.ware_id = b.id
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
     )  or t.customer_name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%') )
494
     )  or t.customer_name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%') )
490
     and ifnull(p.tally_people,'*') like concat('%',#{param13,jdbcType=VARCHAR},'%')
495
     and ifnull(p.tally_people,'*') like concat('%',#{param13,jdbcType=VARCHAR},'%')
491
     and ifnull(c.ord_no,'*') like concat('%',#{param14,jdbcType=VARCHAR},'%')
496
     and ifnull(c.ord_no,'*') like concat('%',#{param14,jdbcType=VARCHAR},'%')

Loading…
Cancel
Save