Browse Source

修改细节内容 5.12 1.0

YL2767 1 month ago
parent
commit
1f07e7607b

+ 5
- 1
src/main/java/com/th/demo/controller/ware/StoreController.java View File

@@ -99,6 +99,10 @@ public class StoreController {
99 99
                               String materialName,
100 100
                              String standard,
101 101
                              String customerName,
102
+                             String fkcustmerName,
103
+                             String plateNo,
104
+                             String ordNo,
105
+                             String contractNo,
102 106
                               HttpServletRequest request) {
103 107
 
104 108
         try {
@@ -112,7 +116,7 @@ public class StoreController {
112 116
                     standard,
113 117
                       customerName,
114 118
                     userId,
115
-                    belongId);
119
+                    belongId,plateNo,ordNo,contractNo,fkcustmerName);
116 120
         } catch (Exception ex) {
117 121
             ex.printStackTrace();
118 122
             result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());

+ 4
- 1
src/main/java/com/th/demo/mapping/ware/StoreMapper.java View File

@@ -31,7 +31,10 @@ public interface StoreMapper {
31 31
 
32 32
     Store selectByOutId(String id,String noUserParam,String userId, String belongId);
33 33
 
34
-    List<Store> selectStore(String wareName, String stackName, String model, String materialName, String standard,   String customerName, String userId,String belongId);
34
+    List<Store> selectStore(String wareName, String stackName, String model, String materialName, String standard,
35
+                            String customerName, String userId,String belongId,
36
+                            String fkcustmerName, String plateNo,String ordNo,String contractNo,
37
+                            List<String> plateNos,List<String> ordNos, List<String> contractNos);
35 38
 
36 39
     int updateForUpDownByLayer(String wareName, String stackName, String userId, String belongId, int min, int max, int i);
37 40
 

+ 19
- 18
src/main/java/com/th/demo/service/impl/ware/InServiceImpl.java View File

@@ -152,27 +152,28 @@ public class InServiceImpl implements InService {
152 152
             int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
153 153
             int min = listStore.get(0).getLayer();
154 154
             int max = listStore.get(listStore.size() - 1).getLayer();
155
-            if (currentLayer != max) {
156
-                result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "必须包含最上层取消出库!");
157
-            } else if (!WareTools.checkOrder(listStore)) {
158
-                result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "请选中连续数据取消出库!");
159
-            } else {
160
-                for (int i = 0; i < listStore.size(); i++) {
161
-                    int effStoreCnt = storeMapper.selEffStore(listStore.get(i).getPlateNo());
162
-                    if(effStoreCnt == 0){
163
-                        return JSONTools.toString(1,"库存中不存在板号"+listStore.get(i).getPlateNo()+",无法取消出库");
164
-                    }
165
-                    InRecord inRecord = getInRecord(listStore.get(i), "0", userId);
166
-                    num += inRecordMapper.insert(inRecord);
155
+//            if (currentLayer != max) {
156
+//                result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "必须包含最上层取消出库!");
157
+//            } else if (!WareTools.checkOrder(listStore)) {
158
+//                result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "请选中连续数据取消出库!");
159
+//            } else {
160
+//
161
+//            }
162
+            for (int i = 0; i < listStore.size(); i++) {
163
+                int effStoreCnt = storeMapper.selEffStore(listStore.get(i).getPlateNo());
164
+                if(effStoreCnt == 0){
165
+                    return JSONTools.toString(1,"库存中不存在板号"+listStore.get(i).getPlateNo()+",无法取消出库");
166
+                }
167
+                InRecord inRecord = getInRecord(listStore.get(i), "0", userId);
168
+                num += inRecordMapper.insert(inRecord);
167 169
 
168
-                    //listStore.get(i).setOutId(outRecord.getId());
169
-                    listStore.get(i).setCancelFlag("1");
170
-                    num += storeMapper.updateByPrimaryKey(listStore.get(i));
171
-                    num += inRecordMapper.deleteByPrimaryKey(listStore.get(i).getInId());
170
+                //listStore.get(i).setOutId(outRecord.getId());
171
+                listStore.get(i).setCancelFlag("1");
172
+                num += storeMapper.updateByPrimaryKey(listStore.get(i));
173
+                num += inRecordMapper.deleteByPrimaryKey(listStore.get(i).getInId());
172 174
 
173
-                }
174
-                result = Tools.moreThanZeroResultJSON(num);
175 175
             }
176
+            result = Tools.moreThanZeroResultJSON(num);
176 177
         }
177 178
         return result;
178 179
     }

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

@@ -181,27 +181,28 @@ public class OutServiceImpl implements OutService {
181 181
                 int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
182 182
                 int min = listStore.get(0).getLayer();
183 183
                 int max = listStore.get(listStore.size() - 1).getLayer();
184
-                if (currentLayer != max) {
185
-                    throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
186
-                    // result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "必须选择最上层出库!");
187
-                } else if (!WareTools.checkOrder(listStore)) {
188
-                    throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
189
-                    //  result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "请选中连续数据移动!");
190
-                } else {
191
-                    for (int i = 0; i < listStore.size(); i++) {
192
-                        OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
193
-                        num += outRecordMapper.insert(outRecord);
184
+//                if (currentLayer != max) {
185
+//                    throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
186
+//                    // result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "必须选择最上层出库!");
187
+//                } else if (!WareTools.checkOrder(listStore)) {
188
+//                    throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
189
+//                    //  result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "请选中连续数据移动!");
190
+//                } else {
191
+//
192
+//                }
193
+                for (int i = 0; i < listStore.size(); i++) {
194
+                    OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
195
+                    num += outRecordMapper.insert(outRecord);
194 196
 
195
-                        AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
196
-                        num += accountDetailMapper.insert(accountDetail);
197
+                    AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
198
+                    num += accountDetailMapper.insert(accountDetail);
197 199
 
198
-                        listStore.get(i).setOutId(outRecord.getId());
199
-                        listStore.get(i).setOutFlag("1");
200
-                        num += storeMapper.updateByPrimaryKey(listStore.get(i));
200
+                    listStore.get(i).setOutId(outRecord.getId());
201
+                    listStore.get(i).setOutFlag("1");
202
+                    num += storeMapper.updateByPrimaryKey(listStore.get(i));
201 203
 
202
-                    }
203
-                    result = Tools.moreThanZeroResultJSON(num);
204 204
                 }
205
+                result = Tools.moreThanZeroResultJSON(num);
205 206
             }
206 207
         }
207 208
         return result;

+ 31
- 5
src/main/java/com/th/demo/service/impl/ware/StoreServiceImpl.java View File

@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
22 22
 
23 23
 import java.text.SimpleDateFormat;
24 24
 import java.util.ArrayList;
25
+import java.util.Arrays;
25 26
 import java.util.Date;
26 27
 import java.util.List;
27 28
 
@@ -80,11 +81,36 @@ public class StoreServiceImpl implements StoreService {
80 81
                              String standard,
81 82
                              String customerName,
82 83
                              String userId,
83
-                             String belongId) {
84
-        PageHelper.startPage(page, rows);
85
-        List<Store> list=storeMapper.selectStore(wareName,stackName,model,materialName,standard,    customerName,   userId,belongId);
86
-        PageInfo<Store> pageInfo = new PageInfo<>(list);
87
-        result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
84
+                             String belongId,
85
+                             String plateNo,
86
+                             String ordNo,
87
+                             String contractNo,
88
+                             String fkcustmerName) {
89
+        List<String> pltNos =new ArrayList<>() ;
90
+        List<String> ordNos =new ArrayList<>() ;
91
+        List<String> contractNos =new ArrayList<>() ;
92
+        if (plateNo.indexOf(",") != -1){
93
+            pltNos = Arrays.asList(plateNo.split(","));
94
+        }
95
+        if (ordNo.indexOf(",") != -1){
96
+            ordNos = Arrays.asList(ordNo.split(","));
97
+        }
98
+        if (contractNo.indexOf(",") != -1){
99
+            contractNos = Arrays.asList(contractNo.split(","));
100
+        }
101
+
102
+        if (page == -1 && rows == -1){
103
+            List<Store> list=storeMapper.selectStore(wareName,stackName,model,materialName,standard,    customerName,   userId,belongId,
104
+                    fkcustmerName,plateNo,ordNo,contractNo,pltNos,ordNos,contractNos);
105
+            result = JSONTools.toStringyyyyMMddHHmmss(list);
106
+        }else {
107
+            PageHelper.startPage(page, rows);
108
+            List<Store> list=storeMapper.selectStore(wareName,stackName,model,materialName,standard,    customerName,   userId,belongId,
109
+                    fkcustmerName,plateNo,ordNo,contractNo,pltNos,ordNos,contractNos);
110
+            PageInfo<Store> pageInfo = new PageInfo<>(list);
111
+            result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
112
+        }
113
+
88 114
         return result;
89 115
     }
90 116
 

+ 3
- 1
src/main/java/com/th/demo/service/ware/StoreService.java View File

@@ -11,7 +11,9 @@ public interface StoreService {
11 11
     
12 12
     String modify(String json, String userId, String belongId);
13 13
 
14
-    String queryStore(int page,int rows,String wareName,String stackName,String model,String materialName,String standard,  String customerName, String userId,String belongId);
14
+    String queryStore(int page,int rows,String wareName,String stackName,String model,String materialName,String standard,
15
+                      String customerName, String userId,String belongId,
16
+                      String plateNo, String ordNo, String contractNo,String fkcustmerName);
15 17
 
16 18
     String modifyCustomer(String id,String customerNameOld,String customerNameNew);
17 19
 

+ 20
- 0
src/main/resource/mapper/ware/StoreMapper.xml View File

@@ -493,6 +493,26 @@ update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
493 493
     and  c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
494 494
     and  c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
495 495
     and  d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
496
+    and  e.name like concat('%',#{param9,jdbcType=VARCHAR},'%')
497
+
498
+      and  (t.plate_no like concat('%',#{param10,jdbcType=VARCHAR},'%')
499
+    <if test="param13 != null and param13.size() !=0" >
500
+      or t.plate_no IN <foreach  item="item" collection="param13" index="index"  open="(" separator="," close=")">
501
+      #{item,jdbcType=VARCHAR}  </foreach>
502
+    </if>
503
+    )
504
+    and  (t.ord_no like concat('%',#{param11,jdbcType=VARCHAR},'%')
505
+    <if test="param14 != null and param14.size() !=0" >
506
+      OR t.ord_no IN <foreach  item="item" collection="param14" index="index"  open="(" separator="," close=")">
507
+      #{item,jdbcType=VARCHAR}  </foreach>
508
+    </if>
509
+    )
510
+    and  (t.contract_no like concat('%',#{param12,jdbcType=VARCHAR},'%')
511
+    <if test="param15 != null and param15.size() !=0" >
512
+      OR t.contract_no IN <foreach  item="item" collection="param15" index="index"  open="(" separator="," close=")">
513
+      #{item,jdbcType=VARCHAR}  </foreach>
514
+    </if>
515
+    )
496 516
     and t.belong_id = #{param8,jdbcType=VARCHAR}
497 517
     and t.cancel_flag = '0'
498 518
     and t.out_flag = '0'

Loading…
Cancel
Save