소스 검색

Merge remote-tracking branch 'origin/master'

张庆宇 10 달 전
부모
커밋
29ffc753db

+ 1
- 1
pom.xml 파일 보기

5
     <modelVersion>4.0.0</modelVersion>
5
     <modelVersion>4.0.0</modelVersion>
6
 
6
 
7
     <groupId>com.th.demo</groupId>
7
     <groupId>com.th.demo</groupId>
8
-    <artifactId>thware</artifactId>
8
+    <artifactId>thware_zg</artifactId>
9
     <version>1.0-SNAPSHOT</version>
9
     <version>1.0-SNAPSHOT</version>
10
     <packaging>war</packaging>
10
     <packaging>war</packaging>
11
 
11
 

+ 19
- 0
src/main/java/com/th/demo/controller/ware/OutRecordController.java 파일 보기

123
         }
123
         }
124
     }
124
     }
125
 
125
 
126
+    @RequestMapping(value = "/saveCar.do" , method = RequestMethod.POST)
127
+    public String saveCar(String json,
128
+                               String truckNo,
129
+                               String driverName,
130
+                               String driverPhone,
131
+                               HttpServletRequest request) {
132
+
133
+        try {
134
+            String userId = (String) request.getAttribute("userId");
135
+            String belongId = (String) request.getAttribute("belongId");
136
+            result = outRecordService.saveCar(json,truckNo,driverName,driverPhone,userId,belongId);
137
+        } catch (Exception ex) {
138
+            ex.printStackTrace();
139
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
140
+        } finally {
141
+            return result;
142
+        }
143
+    }
144
+
126
 
145
 
127
 }
146
 }

+ 32
- 1
src/main/java/com/th/demo/controller/ware/StoreController.java 파일 보기

99
                               String materialName,
99
                               String materialName,
100
                              String standard,
100
                              String standard,
101
                              String customerName,
101
                              String customerName,
102
+                             String fkcustmerName,
103
+                             String plateNo,
104
+                             String ordNo,
105
+                             String contractNo,
102
                               HttpServletRequest request) {
106
                               HttpServletRequest request) {
103
 
107
 
104
         try {
108
         try {
112
                     standard,
116
                     standard,
113
                       customerName,
117
                       customerName,
114
                     userId,
118
                     userId,
115
-                    belongId);
119
+                    belongId,plateNo,ordNo,contractNo,fkcustmerName);
116
         } catch (Exception ex) {
120
         } catch (Exception ex) {
117
             ex.printStackTrace();
121
             ex.printStackTrace();
118
             result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
122
             result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
153
         }
157
         }
154
     }
158
     }
155
 
159
 
160
+    @RequestMapping(value = "/changeAll.do")//查询方法 前两个参数是分页参数
161
+    public String changeAll(
162
+
163
+            String json,
164
+            String newCustomername,
165
+            String newFKCustomername,
166
+            String newContractno,
167
+            String newOrdno,
168
+            String newReceiveaddress,
169
+            String newProductionplace,
170
+            String newPackno,
171
+
172
+            HttpServletRequest request) {
173
+
174
+        try {
175
+            String userId = (String) request.getAttribute("userId");
176
+            String belongId = (String) request.getAttribute("belongId");
177
+            result = storeService.changeAll( json,newCustomername,newFKCustomername,newContractno,newOrdno,newReceiveaddress,
178
+                    newProductionplace,newPackno,userId, belongId);
179
+        } catch (Exception ex) {
180
+            ex.printStackTrace();
181
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
182
+        } finally {
183
+            return result;
184
+        }
185
+    }
186
+
156
 }
187
 }

+ 1
- 1
src/main/java/com/th/demo/mapping/ware/DistributionMapper.java 파일 보기

11
 
11
 
12
     int insertSelective(Distribution record);
12
     int insertSelective(Distribution record);
13
 
13
 
14
-    Distribution selectByPrimaryKey(Integer id);
14
+    Distribution selectByPrimaryKey(String id);
15
 
15
 
16
     int updateByPrimaryKeySelective(Distribution record);
16
     int updateByPrimaryKeySelective(Distribution record);
17
 
17
 

+ 4
- 1
src/main/java/com/th/demo/mapping/ware/StoreMapper.java 파일 보기

31
 
31
 
32
     Store selectByOutId(String id,String noUserParam,String userId, String belongId);
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
     int updateForUpDownByLayer(String wareName, String stackName, String userId, String belongId, int min, int max, int i);
39
     int updateForUpDownByLayer(String wareName, String stackName, String userId, String belongId, int min, int max, int i);
37
 
40
 

+ 17
- 4
src/main/java/com/th/demo/service/impl/ware/DistributionServiceImpl.java 파일 보기

79
         });
79
         });
80
         List<Store> list = JSON.parseObject(jsonList, new TypeReference<List<Store>>() {
80
         List<Store> list = JSON.parseObject(jsonList, new TypeReference<List<Store>>() {
81
         });
81
         });
82
-        if (distribution.getListDetail().size() == list.size()) {
83
-            distribution.setOutFlag("2");
84
-            num += distributionMapper.updateByPrimaryKey(distribution);
85
-        }
82
+
83
+        double cancelWeight = 0;
84
+        double cancelNum = 0;
85
+
86
         for (int i = 0; i < list.size(); i++) {
86
         for (int i = 0; i < list.size(); i++) {
87
+            cancelWeight+=list.get(i).getWeight();
88
+            cancelNum+=list.get(i).getCount();
87
             list.get(i).setLockFlag("0");
89
             list.get(i).setLockFlag("0");
88
             num += storeMapper.updateByPrimaryKey(list.get(i));
90
             num += storeMapper.updateByPrimaryKey(list.get(i));
89
         }
91
         }
92
+        if (distribution.getListDetail().size() == list.size()) {
93
+            distribution.setOutFlag("2");
94
+            distribution.setSumCount(distribution.getSumCount()-cancelNum);
95
+            distribution.setSumWeight(distribution.getSumWeight()-cancelWeight);
96
+            num += distributionMapper.updateByPrimaryKey(distribution);
97
+        }else{
98
+            distribution.setSumCount(distribution.getSumCount()-cancelNum);
99
+            distribution.setSumWeight(distribution.getSumWeight()-cancelWeight);
100
+            num += distributionMapper.updateByPrimaryKey(distribution);
101
+
102
+        }
90
         for (int i = 0; i < distribution.getListDetail().size(); i++) {
103
         for (int i = 0; i < distribution.getListDetail().size(); i++) {
91
             for (int j = 0; j < list.size(); j++) {
104
             for (int j = 0; j < list.size(); j++) {
92
                 if (distribution.getListDetail().get(i).getStore().getId().equals(list.get(j).getId())) {
105
                 if (distribution.getListDetail().get(i).getStore().getId().equals(list.get(j).getId())) {

+ 20
- 19
src/main/java/com/th/demo/service/impl/ware/InServiceImpl.java 파일 보기

152
             int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
152
             int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
153
             int min = listStore.get(0).getLayer();
153
             int min = listStore.get(0).getLayer();
154
             int max = listStore.get(listStore.size() - 1).getLayer();
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
         return result;
178
         return result;
178
     }
179
     }
274
         String standard = listJO.get(0).get("钢种").toString();
275
         String standard = listJO.get(0).get("钢种").toString();
275
         String customerName = listJO.get(0).get("客户名称").toString();
276
         String customerName = listJO.get(0).get("客户名称").toString();
276
         String fk_compony_name = listJO.get(0).get("货权单位").toString();
277
         String fk_compony_name = listJO.get(0).get("货权单位").toString();
277
-        String addUserName = listJO.get(0).get("入库操作人").toString();
278
+        String addUserName = listJO.get(0).get("入库操作人").toString();
278
         //验证信息增加多条信息验证
279
         //验证信息增加多条信息验证
279
         Ware ware = wareMapper.selectByWareName(wareName, userId, belongId);
280
         Ware ware = wareMapper.selectByWareName(wareName, userId, belongId);
280
         if (ware == null) {
281
         if (ware == null) {

+ 17
- 0
src/main/java/com/th/demo/service/impl/ware/OutRecordServiceImpl.java 파일 보기

6
 import com.github.pagehelper.PageInfo;
6
 import com.github.pagehelper.PageInfo;
7
 import com.th.demo.mapping.finance.ModPriceLogMapper;
7
 import com.th.demo.mapping.finance.ModPriceLogMapper;
8
 import com.th.demo.mapping.finance.VerifyAccountMapper;
8
 import com.th.demo.mapping.finance.VerifyAccountMapper;
9
+import com.th.demo.mapping.ware.DistributionMapper;
9
 import com.th.demo.mapping.ware.OutRecordMapper;
10
 import com.th.demo.mapping.ware.OutRecordMapper;
10
 import com.th.demo.model.finance.ModPriceLog;
11
 import com.th.demo.model.finance.ModPriceLog;
11
 import com.th.demo.model.finance.VerifyAccount;
12
 import com.th.demo.model.finance.VerifyAccount;
12
 import com.th.demo.model.system.Type;
13
 import com.th.demo.model.system.Type;
14
+import com.th.demo.model.ware.Distribution;
13
 import com.th.demo.model.ware.OutRecord;
15
 import com.th.demo.model.ware.OutRecord;
14
 import com.th.demo.model.ware.Store;
16
 import com.th.demo.model.ware.Store;
15
 import com.th.demo.model.ware.TotalRecord;
17
 import com.th.demo.model.ware.TotalRecord;
30
     public OutRecordMapper outRecordMapper;
32
     public OutRecordMapper outRecordMapper;
31
     @Autowired
33
     @Autowired
32
     public VerifyAccountMapper verifyAccountMapper;
34
     public VerifyAccountMapper verifyAccountMapper;
35
+    @Autowired
36
+    public DistributionMapper distributionMapper;
33
 
37
 
34
     @Autowired
38
     @Autowired
35
     public ModPriceLogMapper modPriceLogMapper;
39
     public ModPriceLogMapper modPriceLogMapper;
140
         }
144
         }
141
         return Tools.moreThanZeroResultJSON(num);
145
         return Tools.moreThanZeroResultJSON(num);
142
     }
146
     }
147
+
148
+    @Override
149
+    public String saveCar(String json,String truckNo,String driverName,String driverPhone,String userId,String belongId) {
150
+        List<OutRecord> list = JSON.parseObject(json, new TypeReference<List<OutRecord>>() {
151
+        });
152
+        Distribution distribution = distributionMapper.selectByPrimaryKey(list.get(0).getDistributionId());
153
+        distribution.setTruckNo(truckNo);
154
+        distribution.setDriverName(driverName);
155
+        distribution.setDriverPhone(driverPhone);
156
+        num = distributionMapper.updateByPrimaryKey(distribution);
157
+
158
+        return Tools.moreThanZeroResultJSON(num);
159
+    }
143
 }
160
 }
144
 
161
 
145
 
162
 

+ 26
- 17
src/main/java/com/th/demo/service/impl/ware/OutServiceImpl.java 파일 보기

113
                 OutRecord outRecord = getOutRecord(store, "", "0", userId);
113
                 OutRecord outRecord = getOutRecord(store, "", "0", userId);
114
                 num += outRecordMapper.insert(outRecord);
114
                 num += outRecordMapper.insert(outRecord);
115
                 num += storeMapper.insert(store);
115
                 num += storeMapper.insert(store);
116
+                Distribution distribution = distributionMapper.selectByPrimaryKey(listOutRecord.get(i).getDistributionId());
117
+                distribution.setSumWeight(distribution.getSumWeight()- store.getWeight());
118
+                distribution.setSumCount(distribution.getSumCount()- store.getCount());
119
+                num=distributionMapper.updateByPrimaryKey(distribution);
116
             }
120
             }
117
             result = Tools.moreThanZeroResultJSON(num);
121
             result = Tools.moreThanZeroResultJSON(num);
118
         } else {
122
         } else {
129
                 OutRecord outRecord = getOutRecord(store, "", "0", userId);
133
                 OutRecord outRecord = getOutRecord(store, "", "0", userId);
130
                 num += outRecordMapper.insert(outRecord);
134
                 num += outRecordMapper.insert(outRecord);
131
                 num += storeMapper.insert(store);
135
                 num += storeMapper.insert(store);
136
+                Distribution distribution = distributionMapper.selectByPrimaryKey(listOutRecord.get(i).getDistributionId());
137
+                distribution.setSumWeight(distribution.getSumWeight()- store.getWeight());
138
+                distribution.setSumCount(distribution.getSumCount()- store.getCount());
139
+                num=distributionMapper.updateByPrimaryKey(distribution);
132
             }
140
             }
133
             result = Tools.moreThanZeroResultJSON(num);
141
             result = Tools.moreThanZeroResultJSON(num);
134
         }
142
         }
181
                 int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
189
                 int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(listStore.get(0).getStack().getId(), belongId));
182
                 int min = listStore.get(0).getLayer();
190
                 int min = listStore.get(0).getLayer();
183
                 int max = listStore.get(listStore.size() - 1).getLayer();
191
                 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);
192
+//                if (currentLayer != max) {
193
+//                    throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
194
+//                    // result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "必须选择最上层出库!");
195
+//                } else if (!WareTools.checkOrder(listStore)) {
196
+//                    throw new Exception("库房:" + listStore.get(m).getWare().getName() + ",垛位:" + listStore.get(m).getStack().getName() + ",出库物料不在最上层,无法出库!");
197
+//                    //  result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "请选中连续数据移动!");
198
+//                } else {
199
+//
200
+//                }
201
+                for (int i = 0; i < listStore.size(); i++) {
202
+                    OutRecord outRecord = getOutRecord(listStore.get(i), distribution.getId(), "1", userId);
203
+                    num += outRecordMapper.insert(outRecord);
194
 
204
 
195
-                        AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
196
-                        num += accountDetailMapper.insert(accountDetail);
205
+                    AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
206
+                    num += accountDetailMapper.insert(accountDetail);
197
 
207
 
198
-                        listStore.get(i).setOutId(outRecord.getId());
199
-                        listStore.get(i).setOutFlag("1");
200
-                        num += storeMapper.updateByPrimaryKey(listStore.get(i));
208
+                    listStore.get(i).setOutId(outRecord.getId());
209
+                    listStore.get(i).setOutFlag("1");
210
+                    num += storeMapper.updateByPrimaryKey(listStore.get(i));
201
 
211
 
202
-                    }
203
-                    result = Tools.moreThanZeroResultJSON(num);
204
                 }
212
                 }
213
+                result = Tools.moreThanZeroResultJSON(num);
205
             }
214
             }
206
         }
215
         }
207
         return result;
216
         return result;

+ 122
- 5
src/main/java/com/th/demo/service/impl/ware/StoreServiceImpl.java 파일 보기

6
 import com.github.pagehelper.PageInfo;
6
 import com.github.pagehelper.PageInfo;
7
 import com.th.demo.mapping.maint.CustomerMapper;
7
 import com.th.demo.mapping.maint.CustomerMapper;
8
 import com.th.demo.mapping.ware.ChangeRecordMapper;
8
 import com.th.demo.mapping.ware.ChangeRecordMapper;
9
+import com.th.demo.mapping.ware.InRecordMapper;
9
 import com.th.demo.mapping.ware.StoreMapper;
10
 import com.th.demo.mapping.ware.StoreMapper;
10
 import com.th.demo.model.maint.Customer;
11
 import com.th.demo.model.maint.Customer;
11
 import com.th.demo.model.maint.Stack;
12
 import com.th.demo.model.maint.Stack;
12
 import com.th.demo.model.system.Type;
13
 import com.th.demo.model.system.Type;
13
 import com.th.demo.model.ware.ChangeRecord;
14
 import com.th.demo.model.ware.ChangeRecord;
15
+import com.th.demo.model.ware.InRecord;
14
 import com.th.demo.model.ware.SplitRecord;
16
 import com.th.demo.model.ware.SplitRecord;
15
 import com.th.demo.model.ware.Store;
17
 import com.th.demo.model.ware.Store;
16
 import com.th.demo.service.maint.CustomerService;
18
 import com.th.demo.service.maint.CustomerService;
22
 
24
 
23
 import java.text.SimpleDateFormat;
25
 import java.text.SimpleDateFormat;
24
 import java.util.ArrayList;
26
 import java.util.ArrayList;
27
+import java.util.Arrays;
25
 import java.util.Date;
28
 import java.util.Date;
26
 import java.util.List;
29
 import java.util.List;
27
 
30
 
32
     public ChangeRecordMapper changeRecordMapper;
35
     public ChangeRecordMapper changeRecordMapper;
33
     @Autowired//自动注入Mapper
36
     @Autowired//自动注入Mapper
34
     public StoreMapper storeMapper;
37
     public StoreMapper storeMapper;
38
+    @Autowired//自动注入Mapper
39
+    public CustomerMapper customerMapper;
40
+    @Autowired//自动注入Mapper
41
+    public InRecordMapper inRecordMapper;
35
     String result = Type.FAIL;
42
     String result = Type.FAIL;
36
     int num = 0;
43
     int num = 0;
37
 
44
 
80
                              String standard,
87
                              String standard,
81
                              String customerName,
88
                              String customerName,
82
                              String userId,
89
                              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);
90
+                             String belongId,
91
+                             String plateNo,
92
+                             String ordNo,
93
+                             String contractNo,
94
+                             String fkcustmerName) {
95
+        List<String> pltNos =new ArrayList<>() ;
96
+        List<String> ordNos =new ArrayList<>() ;
97
+        List<String> contractNos =new ArrayList<>() ;
98
+        if (plateNo.indexOf(",") != -1){
99
+            pltNos = Arrays.asList(plateNo.split(","));
100
+        }
101
+        if (ordNo.indexOf(",") != -1){
102
+            ordNos = Arrays.asList(ordNo.split(","));
103
+        }
104
+        if (contractNo.indexOf(",") != -1){
105
+            contractNos = Arrays.asList(contractNo.split(","));
106
+        }
107
+
108
+        if (page == -1 && rows == -1){
109
+            List<Store> list=storeMapper.selectStore(wareName,stackName,model,materialName,standard,    customerName,   userId,belongId,
110
+                    fkcustmerName,plateNo,ordNo,contractNo,pltNos,ordNos,contractNos);
111
+            result = JSONTools.toStringyyyyMMddHHmmss(list);
112
+        }else {
113
+            PageHelper.startPage(page, rows);
114
+            List<Store> list=storeMapper.selectStore(wareName,stackName,model,materialName,standard,    customerName,   userId,belongId,
115
+                    fkcustmerName,plateNo,ordNo,contractNo,pltNos,ordNos,contractNos);
116
+            PageInfo<Store> pageInfo = new PageInfo<>(list);
117
+            result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
118
+        }
119
+
88
         return result;
120
         return result;
89
     }
121
     }
90
 
122
 
216
 //        return result;
248
 //        return result;
217
 //
249
 //
218
 //    }
250
 //    }
251
+    @Override
252
+    public String changeAll(String json,
253
+                            String newCustomername,
254
+                            String newFKCustomername,
255
+                            String newContractno,
256
+                            String newOrdno,
257
+                            String newReceiveaddress,
258
+                            String newProductionplace,
259
+                            String newPackno,
260
+                            String userId,
261
+                            String belongId) {
262
+        List<Store> list = JSON.parseObject(json, new TypeReference<List<Store>>() {
263
+        });
264
+        Customer customer = new Customer();
265
+        Customer kfcustomer = new Customer();
266
+        if(newCustomername != null && !newCustomername.equals("")){
267
+            customer = customerMapper.selectByName(newCustomername,belongId);
268
+
269
+        }
270
+
271
+        if(newFKCustomername != null && !newFKCustomername.equals("")){
272
+            kfcustomer = customerMapper.selectByName(newFKCustomername,belongId);
273
+
274
+        }
275
+
276
+        for(int i = 0; i < list.size(); i++){
277
+            InRecord inRecord = inRecordMapper.selectByPrimaryKey(list.get(i).getInId());
278
+            if (newCustomername != null && !newCustomername.equals("")){
279
+                list.get(i).setCustomer(customer);
280
+                inRecord.setCustomerName(newCustomername);
281
+            }
282
+            if(newFKCustomername != null && !newFKCustomername.equals("")){
283
+                list.get(i).setFkComponyId(kfcustomer.getId());
284
+                num += storeMapper.updateFKByPKey(list.get(i));
285
+                inRecord.setFkComponyName(kfcustomer.getId());
286
+            }
287
+
288
+
289
+            if (newContractno != null && !newContractno.equals("")){
290
+                list.get(i).setContractNo(newContractno);
291
+                inRecord.setContractNo(newContractno);
292
+            } else if (newContractno.equals("0")) {
293
+                list.get(i).setContractNo("");
294
+                inRecord.setContractNo("");
295
+            }
296
+
297
+            if (newOrdno != null && !newOrdno.equals("")){
298
+                list.get(i).setOrdNo(newOrdno);
299
+                inRecord.setOrdNo(newOrdno);
300
+            } else if (newOrdno.equals("0")) {
301
+                list.get(i).setOrdNo("");
302
+                inRecord.setOrdNo("");
303
+            }
304
+
305
+            if (newReceiveaddress != null && !newReceiveaddress.equals("")){
306
+                list.get(i).setReceiveAddress(newReceiveaddress);
307
+                inRecord.setReceiveAddress(newReceiveaddress);
308
+            } else if (newReceiveaddress.equals("0")) {
309
+                list.get(i).setReceiveAddress("");
310
+                inRecord.setReceiveAddress("");
311
+            }
312
+
313
+            if (newProductionplace != null && !newProductionplace.equals("")){
314
+                list.get(i).setProductionPlace(newProductionplace);
315
+                inRecord.setProductionPlace(newProductionplace);
316
+            } else if (newProductionplace.equals("0")) {
317
+                list.get(i).setProductionPlace("");
318
+                inRecord.setProductionPlace("");
319
+            }
320
+
321
+            if (newPackno != null && !newPackno.equals("")){
322
+                list.get(i).setPackNo(newPackno);
323
+                inRecord.setPackNo(newPackno);
324
+            } else if (newPackno.equals("0")) {
325
+                list.get(i).setPackNo("");
326
+                inRecord.setPackNo("");
327
+            }
328
+            num += storeMapper.updateByPrimaryKey(list.get(i));
329
+
330
+
331
+            num += inRecordMapper.updateIn(inRecord);
332
+
333
+        }
334
+        return Tools.moreThanZeroResultJSON(num);
335
+    }
219
 }
336
 }

+ 3
- 0
src/main/java/com/th/demo/service/ware/OutRecordService.java 파일 보기

12
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
12
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
13
 
13
 
14
     String savePriceMod(String json, String modPrice, String userId, String belongId);
14
     String savePriceMod(String json, String modPrice, String userId, String belongId);
15
+
16
+    String saveCar(String json,String truckNo,String driverName,String driverPhone,String userId,String belongId);
17
+
15
 }
18
 }

+ 15
- 1
src/main/java/com/th/demo/service/ware/StoreService.java 파일 보기

11
     
11
     
12
     String modify(String json, String userId, String belongId);
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
     String modifyCustomer(String id,String customerNameOld,String customerNameNew);
18
     String modifyCustomer(String id,String customerNameOld,String customerNameNew);
17
 
19
 
18
     String modifyCustomeradress(String id,String customerAddressOld,String customerAddressNew);
20
     String modifyCustomeradress(String id,String customerAddressOld,String customerAddressNew);
21
+
22
+    String changeAll(String json,
23
+                     String newCustomername,
24
+                     String newFKCustomername,
25
+                     String newContractno,
26
+                     String newOrdno,
27
+                     String newReceiveaddress,
28
+                     String newProductionplace,
29
+                     String newPackno,
30
+                     String userId,
31
+                     String belongId);
32
+
19
 }
33
 }

+ 6
- 1
src/main/resource/mapper/ware/InRecordMapper.xml 파일 보기

323
     receive_address = #{receiveAddress,jdbcType=VARCHAR},
323
     receive_address = #{receiveAddress,jdbcType=VARCHAR},
324
         contract_no= #{contractNo,jdbcType=VARCHAR},
324
         contract_no= #{contractNo,jdbcType=VARCHAR},
325
         pack_no= #{packNo,jdbcType=VARCHAR},
325
         pack_no= #{packNo,jdbcType=VARCHAR},
326
-        out_flag= #{outFlag,jdbcType=VARCHAR}
326
+        out_flag= #{outFlag,jdbcType=VARCHAR},
327
+      ord_no= #{ordNo,jdbcType=VARCHAR},
328
+        fk_compony_name= #{fkComponyName,jdbcType=VARCHAR},
329
+        production_place= #{productionPlace,jdbcType=VARCHAR}
330
+
331
+
327
     where id = #{id,jdbcType=VARCHAR}
332
     where id = #{id,jdbcType=VARCHAR}
328
   </update>
333
   </update>
329
 
334
 

+ 1
- 0
src/main/resource/mapper/ware/OutRecordMapper.xml 파일 보기

390
     set t.invoice_price = #{invoicePrice,jdbcType=DOUBLE}
390
     set t.invoice_price = #{invoicePrice,jdbcType=DOUBLE}
391
     where id = #{id,jdbcType=VARCHAR}
391
     where id = #{id,jdbcType=VARCHAR}
392
   </update>
392
   </update>
393
+
393
   <update id="cleanVerifyInfo" parameterType="java.lang.String" >
394
   <update id="cleanVerifyInfo" parameterType="java.lang.String" >
394
     update t_ware_out_record t
395
     update t_ware_out_record t
395
     set t.verify_account_id = null
396
     set t.verify_account_id = null

+ 23
- 1
src/main/resource/mapper/ware/StoreMapper.xml 파일 보기

371
         keep_day = #{keepDay,jdbcType=DOUBLE},
371
         keep_day = #{keepDay,jdbcType=DOUBLE},
372
         ord_price = #{ordPrice,jdbcType=DOUBLE},
372
         ord_price = #{ordPrice,jdbcType=DOUBLE},
373
         out_ord_price = #{outOrdPrice,jdbcType=DOUBLE},
373
         out_ord_price = #{outOrdPrice,jdbcType=DOUBLE},
374
-        pay_way = #{payWay,jdbcType=VARCHAR}
374
+        pay_way = #{payWay,jdbcType=VARCHAR},
375
+        ord_no= #{ordNo,jdbcType=VARCHAR},
376
+        production_place= #{productionPlace,jdbcType=VARCHAR}
375
     where id = #{id,jdbcType=VARCHAR}
377
     where id = #{id,jdbcType=VARCHAR}
376
   </update>
378
   </update>
377
 
379
 
493
     and  c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
495
     and  c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
494
     and  c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
496
     and  c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
495
     and  d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
497
     and  d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
498
+    and  e.name like concat('%',#{param9,jdbcType=VARCHAR},'%')
499
+
500
+      and  (t.plate_no like concat('%',#{param10,jdbcType=VARCHAR},'%')
501
+    <if test="param13 != null and param13.size() !=0" >
502
+      or t.plate_no IN <foreach  item="item" collection="param13" index="index"  open="(" separator="," close=")">
503
+      #{item,jdbcType=VARCHAR}  </foreach>
504
+    </if>
505
+    )
506
+    and  (t.ord_no like concat('%',#{param11,jdbcType=VARCHAR},'%')
507
+    <if test="param14 != null and param14.size() !=0" >
508
+      OR t.ord_no IN <foreach  item="item" collection="param14" index="index"  open="(" separator="," close=")">
509
+      #{item,jdbcType=VARCHAR}  </foreach>
510
+    </if>
511
+    )
512
+    and  (t.contract_no like concat('%',#{param12,jdbcType=VARCHAR},'%')
513
+    <if test="param15 != null and param15.size() !=0" >
514
+      OR t.contract_no IN <foreach  item="item" collection="param15" index="index"  open="(" separator="," close=")">
515
+      #{item,jdbcType=VARCHAR}  </foreach>
516
+    </if>
517
+    )
496
     and t.belong_id = #{param8,jdbcType=VARCHAR}
518
     and t.belong_id = #{param8,jdbcType=VARCHAR}
497
     and t.cancel_flag = '0'
519
     and t.cancel_flag = '0'
498
     and t.out_flag = '0'
520
     and t.out_flag = '0'

Loading…
취소
저장