YL2767 3 週之前
父節點
當前提交
02b0b5c935

+ 0
- 2
src/main/java/com/th/demo/service/impl/ware/OutRecordServiceImpl.java 查看文件

@@ -73,10 +73,8 @@ public class OutRecordServiceImpl implements OutRecordService {
73 73
                     plateNo, fromDate,  toDate,   userId, belongId,carNo,tallyPeople,ordNo,fkComponyName,
74 74
                     contractNo,packNo,pltNos,ordNos,contractNos,packNos);
75 75
             PageInfo<OutRecord> pageInfo = new PageInfo<>(list);
76
-//        result = JSONTools.toString(pageInfo);
77 76
             result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
78 77
         }
79
-
80 78
         return result;
81 79
     }
82 80
     public String queryTotal(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,

+ 55
- 58
src/main/java/com/th/demo/service/impl/ware/OutServiceImpl.java 查看文件

@@ -128,71 +128,68 @@ public class OutServiceImpl implements OutService {
128 128
     @Transactional(rollbackFor = Exception.class)
129 129
     @Override
130 130
     public String outByDistribution(String json, String userId, String belongId) throws Exception {
131
-        Distribution distribution = JSON.parseObject(json, new TypeReference<Distribution>() {
131
+        Distribution distribution1 = JSON.parseObject(json, new TypeReference<Distribution>() {
132 132
         });
133
-        distribution.setOutFlag("1");
134
-        num += distributionMapper.updateByPrimaryKey(distribution);
135
-        List<String> listStoreId = new ArrayList<String>();
136
-        for (int i = 0; i < distribution.getListDetail().size(); i++) {
137
-            listStoreId.add(distribution.getListDetail().get(i).getStore().getId());
138
-        }
139
-        Map<String, Object> map = new HashMap<String, Object>();
140
-        map.put("storeId", listStoreId);
141
-        for(int i = 0 ;i < listStoreId.size();i++){
142
-            System.out.println(listStoreId.get(i));
143
-        }
144
-        List<StoreOfWareStack> listSows = storeMapper.selectWareStackByDistributionStore(map);
145
-
146
-        for (int m = 0; m < listSows.size(); m++) {
147
-
148
-
149
-            Stack stack = stackMapper.selectByPrimaryKey(listSows.get(m).getStackId());
150
-            Map<String, Object> mapParam = new HashMap<String, Object>();
151
-            mapParam.put("storeId", listStoreId);
152
-            mapParam.put("wareId", listSows.get(m).getWareId());
153
-            mapParam.put("stackId", listSows.get(m).getStackId());
154
-
155
-            List<Store> listStore = storeMapper.selectByWareIdStackIdInStoreId(mapParam);
156
-            if (stack.getIsLayer().equals("0") || stack.getIsLayer().equals("2")) {
157
-                for (int i = 0; i < listStore.size(); i++) {
158
-                    OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
159
-                    num += outRecordMapper.insert(outRecord);
160
-                    AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
161
-                    num += accountDetailMapper.insert(accountDetail);
162
-                    listStore.get(i).setOutId(outRecord.getId());
163
-                    listStore.get(i).setOutFlag("1");
164
-                    num += storeMapper.updateByPrimaryKey(listStore.get(i));
165
-                }
166
-                result = Tools.moreThanZeroResultJSON(num);
167
-            } else {
168
-                Collections.sort(listStore);
169
-                int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
170
-                int min = listStore.get(0).getLayer();
171
-                int max = listStore.get(listStore.size() - 1).getLayer();
172
-//                if (currentLayer != max) {
173
-//                    throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
174
-//                    // result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "必须选择最上层出库!");
175
-//                } else if (!WareTools.checkOrder(listStore)) {
176
-//                    throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
177
-//                    //  result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "请选中连续数据移动!");
178
-//                } else {
179
-//
180
-//                }
181
-                for (int i = 0; i < listStore.size(); i++) {
182
-                    OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
183
-                    num += outRecordMapper.insert(outRecord);
133
+        Distribution distribution = distributionMapper.selectByPrimaryKey(distribution1.getId());
134
+        if (distribution.getOutFlag().equals("1")){
135
+            return JSONTools.toString(1,"该车已出库,请勿重复操作");
136
+        }else{
137
+            distribution.setOutFlag("1");
138
+            num += distributionMapper.updateByPrimaryKey(distribution);
139
+            List<String> listStoreId = new ArrayList<String>();
140
+            for (int i = 0; i < distribution.getListDetail().size(); i++) {
141
+                listStoreId.add(distribution.getListDetail().get(i).getStore().getId());
142
+            }
143
+            Map<String, Object> map = new HashMap<String, Object>();
144
+            map.put("storeId", listStoreId);
145
+            for(int i = 0 ;i < listStoreId.size();i++){
146
+                System.out.println(listStoreId.get(i));
147
+            }
148
+            List<StoreOfWareStack> listSows = storeMapper.selectWareStackByDistributionStore(map);
149
+
150
+            for (int m = 0; m < listSows.size(); m++) {
151
+
184 152
 
185
-                    AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
186
-                    num += accountDetailMapper.insert(accountDetail);
153
+                Stack stack = stackMapper.selectByPrimaryKey(listSows.get(m).getStackId());
154
+                Map<String, Object> mapParam = new HashMap<String, Object>();
155
+                mapParam.put("storeId", listStoreId);
156
+                mapParam.put("wareId", listSows.get(m).getWareId());
157
+                mapParam.put("stackId", listSows.get(m).getStackId());
187 158
 
188
-                    listStore.get(i).setOutId(outRecord.getId());
189
-                    listStore.get(i).setOutFlag("1");
190
-                    num += storeMapper.updateByPrimaryKey(listStore.get(i));
159
+                List<Store> listStore = storeMapper.selectByWareIdStackIdInStoreId(mapParam);
160
+                if (stack.getIsLayer().equals("0") || stack.getIsLayer().equals("2")) {
161
+                    for (int i = 0; i < listStore.size(); i++) {
162
+                        OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
163
+                        num += outRecordMapper.insert(outRecord);
164
+                        AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
165
+                        num += accountDetailMapper.insert(accountDetail);
166
+                        listStore.get(i).setOutId(outRecord.getId());
167
+                        listStore.get(i).setOutFlag("1");
168
+                        num += storeMapper.updateByPrimaryKey(listStore.get(i));
169
+                    }
170
+                    result = Tools.moreThanZeroResultJSON(num);
171
+                } else {
172
+                    Collections.sort(listStore);
173
+                    int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
174
+                    int min = listStore.get(0).getLayer();
175
+                    int max = listStore.get(listStore.size() - 1).getLayer();
176
+                    for (int i = 0; i < listStore.size(); i++) {
177
+                        OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
178
+                        num += outRecordMapper.insert(outRecord);
191 179
 
180
+                        AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
181
+                        num += accountDetailMapper.insert(accountDetail);
182
+
183
+                        listStore.get(i).setOutId(outRecord.getId());
184
+                        listStore.get(i).setOutFlag("1");
185
+                        num += storeMapper.updateByPrimaryKey(listStore.get(i));
186
+
187
+                    }
188
+                    result = Tools.moreThanZeroResultJSON(num);
192 189
                 }
193
-                result = Tools.moreThanZeroResultJSON(num);
194 190
             }
195 191
         }
192
+
196 193
         return result;
197 194
     }
198 195
 

+ 36
- 26
src/main/java/com/th/demo/service/impl/ware/StoreServiceImpl.java 查看文件

@@ -296,43 +296,53 @@ public class StoreServiceImpl implements StoreService {
296 296
 
297 297
 
298 298
             if (newContractno != null && !newContractno.equals("")){
299
-                list.get(i).setContractNo(newContractno);
300
-                inRecord.setContractNo(newContractno);
301
-            } else if (newContractno.equals("0")) {
302
-                list.get(i).setContractNo("");
303
-                inRecord.setContractNo("");
299
+                if (newContractno.equals("0")) {
300
+                    list.get(i).setContractNo("");
301
+                    inRecord.setContractNo("");
302
+                }else {
303
+                    list.get(i).setContractNo(newContractno);
304
+                    inRecord.setContractNo(newContractno);
305
+                }
304 306
             }
305 307
 
306 308
             if (newOrdno != null && !newOrdno.equals("")){
307
-                list.get(i).setOrdNo(newOrdno);
308
-                inRecord.setOrdNo(newOrdno);
309
-            } else if (newOrdno.equals("0")) {
310
-                list.get(i).setOrdNo("");
311
-                inRecord.setOrdNo("");
309
+                if (newOrdno.equals("0")) {
310
+                    list.get(i).setOrdNo("");
311
+                    inRecord.setOrdNo("");
312
+                }else {
313
+                    list.get(i).setOrdNo(newOrdno);
314
+                    inRecord.setOrdNo(newOrdno);
315
+                }
312 316
             }
313 317
 
314 318
             if (newReceiveaddress != null && !newReceiveaddress.equals("")){
315
-                list.get(i).setReceiveAddress(newReceiveaddress);
316
-                inRecord.setReceiveAddress(newReceiveaddress);
317
-            } else if (newReceiveaddress.equals("0")) {
318
-                list.get(i).setReceiveAddress("");
319
-                inRecord.setReceiveAddress("");
319
+                if (newReceiveaddress.equals("0")){
320
+                    list.get(i).setReceiveAddress("");
321
+                    inRecord.setReceiveAddress("");
322
+                }else {
323
+                    list.get(i).setReceiveAddress(newReceiveaddress);
324
+                    inRecord.setReceiveAddress(newReceiveaddress);
325
+                }
320 326
             }
321 327
 
322 328
             if (newProductionplace != null && !newProductionplace.equals("")){
323
-                list.get(i).setProductionPlace(newProductionplace);
324
-                inRecord.setProductionPlace(newProductionplace);
325
-            } else if (newProductionplace.equals("0")) {
326
-                list.get(i).setProductionPlace("");
327
-                inRecord.setProductionPlace("");
329
+                if (newProductionplace.equals("0")) {
330
+                    list.get(i).setProductionPlace("");
331
+                    inRecord.setProductionPlace("");
332
+                }else {
333
+                    list.get(i).setProductionPlace(newProductionplace);
334
+                    inRecord.setProductionPlace(newProductionplace);
335
+                }
328 336
             }
329 337
 
330
-            if (newPackno != null && !newPackno.equals("")){
331
-                list.get(i).setPackNo(newPackno);
332
-                inRecord.setPackNo(newPackno);
333
-            } else if (newPackno.equals("0")) {
334
-                list.get(i).setPackNo("");
335
-                inRecord.setPackNo("");
338
+            if (newPackno != null && !newPackno.equals("")) {
339
+                if (newPackno.equals("0")) {
340
+                    list.get(i).setPackNo("");
341
+                    inRecord.setPackNo("");
342
+                } else {
343
+                    list.get(i).setPackNo(newPackno);
344
+                    inRecord.setPackNo(newPackno);
345
+                }
336 346
             }
337 347
             num += storeMapper.updateByPrimaryKey(list.get(i));
338 348
 

+ 6
- 6
src/main/resource/localhost/db.properties 查看文件

@@ -1,13 +1,13 @@
1
-jdbc.driverClass=com.mysql.jdbc.Driver
2
-jdbc.jdbcUrl=jdbc:mysql://172.18.200.32:3306/ware_zg?characterEncoding=utf8
3
-jdbc.user=root
4
-jdbc.password=root
5
-
6 1
 #jdbc.driverClass=com.mysql.jdbc.Driver
7
-#jdbc.jdbcUrl=jdbc:mysql://localhost:3306/ware_zg?characterEncoding=utf8
2
+#jdbc.jdbcUrl=jdbc:mysql://172.18.200.32:3306/ware_zg?characterEncoding=utf8
8 3
 #jdbc.user=root
9 4
 #jdbc.password=root
10 5
 
6
+jdbc.driverClass=com.mysql.jdbc.Driver
7
+jdbc.jdbcUrl=jdbc:mysql://localhost:3306/ware_zg?characterEncoding=utf8
8
+jdbc.user=root
9
+jdbc.password=root
10
+
11 11
 #jdbc.driverClass=com.mysql.jdbc.Driver
12 12
 #jdbc.jdbcUrl=jdbc:mysql://60.205.9.174:3309/ware_zg?useUnicode=true&characterEncoding=utf8
13 13
 #jdbc.user=root

+ 27
- 0
导入数据、配车单、出库单模板/out.ureport.xml
文件差異過大導致無法顯示
查看文件


Loading…
取消
儲存