瀏覽代碼

入库页面测试0403

石岩 2 月之前
父節點
當前提交
6a25f78208

+ 160
- 0
src/main/java/com/th/demo/controller/ware/InStoreController.java 查看文件

1
+package com.th.demo.controller.ware;
2
+
3
+import com.th.demo.model.system.ResponseCodeMsg;
4
+import com.th.demo.model.system.Type;
5
+import com.th.demo.service.ware.InStoreService;
6
+import com.th.demo.tools.JSONTools;
7
+import org.activiti.rest.editor.model.ModelEditorJsonRestResource;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RestController;
13
+import javax.servlet.http.HttpServletRequest;
14
+
15
+@RestController
16
+@RequestMapping(value = "/WareInStore")
17
+public class InStoreController {
18
+    @Autowired
19
+    public InStoreService inStoreService;
20
+    String result = Type.FAIL;
21
+    protected static final Logger logger = LoggerFactory.getLogger(ModelEditorJsonRestResource.class);
22
+    @RequestMapping(value = "/query.do")//查询方法 前两个参数是分页参数
23
+    public String query(
24
+            int page,
25
+            int rows,
26
+            String wareName,
27
+            String stackName,
28
+            HttpServletRequest request) {
29
+
30
+        try {
31
+            String userId = (String) request.getAttribute("userId");
32
+            String belongId = (String) request.getAttribute("belongId");
33
+            result = inStoreService.query(page,rows,wareName, stackName, userId, belongId);
34
+        } catch (Exception ex) {
35
+            ex.printStackTrace();
36
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
37
+        } finally {
38
+            return result;
39
+        }
40
+    }
41
+
42
+
43
+    @RequestMapping(value = "/queryLayerByStackId.do")//查询方法 前两个参数是分页参数
44
+    public String queryLayerByStackId(  String stackId,
45
+                                        HttpServletRequest request) {
46
+
47
+        try {
48
+            String userId = (String) request.getAttribute("userId");
49
+            String belongId = (String) request.getAttribute("belongId");
50
+            result = inStoreService.queryLayerByStackId(stackId, userId, belongId);
51
+        } catch (Exception ex) {
52
+            ex.printStackTrace();
53
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
54
+        } finally {
55
+            return result;
56
+        }
57
+    }
58
+
59
+    @RequestMapping(value = "/queryByWareIdStackId.do")//查询方法 前两个参数是分页参数
60
+    public String queryByWareIdStackId(String wareId,
61
+                                           String stackId,
62
+                                           HttpServletRequest request) {
63
+
64
+        try {
65
+            String userId = (String) request.getAttribute("userId");
66
+            String belongId = (String) request.getAttribute("belongId");
67
+            result = inStoreService.queryByWareIdStackId(wareId, stackId, userId, belongId);
68
+        } catch (Exception ex) {
69
+            ex.printStackTrace();
70
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
71
+        } finally {
72
+            return result;
73
+        }
74
+    }
75
+
76
+    @RequestMapping(value = "/modify.do")
77
+    public String updateStore(String json,HttpServletRequest request){
78
+
79
+        try{
80
+            String userId = (String) request.getAttribute("userId");
81
+            String belongId = (String) request.getAttribute("belongId");
82
+            result = inStoreService.modify(json,userId,belongId);
83
+        }catch (Exception ex){
84
+            ex.printStackTrace();
85
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
86
+        }finally {
87
+            return result;
88
+        }
89
+
90
+    }
91
+
92
+    //根据部分字段查询库存记录
93
+    @RequestMapping(value = "/queryStore.do")
94
+    public String queryStore(int page,int rows,
95
+                              String wareName,
96
+                              String areaName,
97
+                              String stackName,
98
+                              String plateNo,
99
+                              String ordNo,
100
+                              HttpServletRequest request) {
101
+
102
+        try {
103
+            String userId = (String) request.getAttribute("userId");
104
+            String belongId = (String) request.getAttribute("belongId");
105
+            // 参数校验
106
+            if (userId == null || belongId == null) {
107
+                result = JSONTools.toString(ResponseCodeMsg.CODE_EX, "用户ID或归属ID缺失");
108
+                return result;
109
+            }
110
+            result = inStoreService.queryStore(page,rows,
111
+                    wareName,
112
+                    areaName,
113
+                    stackName,
114
+                    plateNo,
115
+                    ordNo,
116
+                    userId,
117
+                    belongId);
118
+        } catch (Exception ex) {
119
+            ex.printStackTrace();
120
+            logger.error("业务逻辑异常", ex);
121
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
122
+        } finally {
123
+            logger.info("业务逻辑正常");
124
+            return result;
125
+        }
126
+    }
127
+
128
+    @RequestMapping(value = "/modifyCustomer.do")
129
+    public String modifyCustomer(String id,String customerNameOld,String customerNameNew,HttpServletRequest request) {
130
+
131
+        try {
132
+            String userId = (String) request.getAttribute("userId");
133
+            String belongId = (String) request.getAttribute("belongId");
134
+            result=inStoreService.modifyCustomer(id,customerNameOld,customerNameNew);
135
+
136
+        } catch (Exception ex) {
137
+            ex.printStackTrace();
138
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
139
+        } finally {
140
+            return result;
141
+        }
142
+    }
143
+
144
+    @RequestMapping(value = "/updateCustomerAddress.do")
145
+    public String updateCustomerAddress(String id,String customerAddressOld,String customerAddressNew,HttpServletRequest request) {
146
+
147
+        try {
148
+            String userId = (String) request.getAttribute("userId");
149
+            String belongId = (String) request.getAttribute("belongId");
150
+            result=inStoreService.modifyCustomeradress(id,customerAddressOld,customerAddressNew);
151
+
152
+        } catch (Exception ex) {
153
+            ex.printStackTrace();
154
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
155
+        } finally {
156
+            return result;
157
+        }
158
+    }
159
+
160
+}

+ 55
- 0
src/main/java/com/th/demo/mapping/ware/InStoreMapper.java 查看文件

1
+package com.th.demo.mapping.ware;
2
+
3
+import com.th.demo.model.ware.Store;
4
+import com.th.demo.model.ware.InStore;
5
+
6
+import com.th.demo.model.ware.StoreOfWareStack;
7
+import com.th.demo.model.ware.TotalRecord;
8
+
9
+import java.util.List;
10
+import java.util.Map;
11
+
12
+public interface InStoreMapper {
13
+    int deleteByPrimaryKey(String id);
14
+
15
+    int insert(Store record);
16
+
17
+    int insertSelective(Store record);
18
+
19
+    InStore selectByPrimaryKey(String id);
20
+
21
+    int updateByPrimaryKeySelective(Store record);
22
+
23
+    int updateByPrimaryKey(Store record);
24
+
25
+    String selectLayerByStackId(String stackId, String belongId);
26
+
27
+    List<InStore> selectByWareIdStackId(String wareId, String stackId, String belongId);
28
+
29
+    List<InStore> select(String wareName, String stackName, String userId, String belongId);
30
+
31
+    List<InStore>  selectForUpDown(String wareName, String stackName, String userId, String belongId, int min, int max);
32
+
33
+    InStore selectByOutId(String id, String noUserParam, String userId, String belongId);
34
+
35
+    List<InStore> selectStore(String wareName, String areaName, String stackName, String plateNo, String ordNo, String userId, String belongId);
36
+
37
+    int updateForUpDownByLayer(String wareName, String stackName, String userId, String belongId, int min, int max, int i);
38
+
39
+    int updateForUpDownByStep(String wareName, String stackName, String userId, String belongId, int min, int max, int i);
40
+
41
+    List<StoreOfWareStack> selectWareStackByDistributionStore(Map<String, Object> map);
42
+
43
+    List<InStore> selectByWareIdStackIdInStoreId(Map<String, Object> mapParam);
44
+
45
+    int updateDistributionById(Map<String, Object> map);
46
+
47
+    List<InStore> selectForCustomer(String wareName, String stackName, String model, String materialName, String standard, String customerName, String plateNo, String beginDate,
48
+                                  String endDate, String userId, String ordNo);
49
+
50
+    List<TotalRecord> queryTotal(String wareName, String stackName, String model, String materialName, String standard, String customerName, String plateNo, String beginDate, String endDate, String userId, String ordNo);
51
+
52
+    int selEffStore(String plateNo);
53
+
54
+    void updateByOutId(String id, String noUserParam, String userId, String belongId);
55
+}

+ 421
- 0
src/main/java/com/th/demo/model/ware/InStore.java 查看文件

1
+package com.th.demo.model.ware;
2
+
3
+import com.th.demo.model.maint.Customer;
4
+import com.th.demo.model.maint.Material;
5
+import com.th.demo.model.maint.Stack;
6
+import com.th.demo.model.maint.Ware;
7
+
8
+import com.th.demo.model.system.SysUser;
9
+
10
+import java.util.Date;
11
+
12
+public class InStore  implements Comparable<InStore>{
13
+    private String id;
14
+
15
+    private Ware ware;
16
+
17
+    private Stack stack;
18
+
19
+    private Integer layer;
20
+
21
+    private Material material;
22
+
23
+    private String model;
24
+
25
+    private Customer customer;
26
+    private Double count;
27
+
28
+    private Double weight;
29
+
30
+    private String remark;
31
+
32
+    private String addId;
33
+
34
+    private Date addTime;
35
+
36
+    private String modifyId;
37
+
38
+    private Date modifyTime;
39
+
40
+    private String cancelId;
41
+
42
+    private Date cancelTime;
43
+
44
+    private String cancelFlag;
45
+
46
+    private String belongId;
47
+
48
+    private String plateNo;
49
+
50
+    private String inId;
51
+
52
+    private String outId;
53
+
54
+    private String receiveAddress;
55
+
56
+    private String outFlag;
57
+
58
+    private String lockFlag;
59
+
60
+    private String wgtDcnMtcCd;
61
+
62
+    private String edgeTy;
63
+
64
+    private String productionPlace;
65
+
66
+    private String ordNo;
67
+
68
+    private SysUser addUser;
69
+
70
+    private String carNo;
71
+
72
+    private String tallyPeople;
73
+
74
+    private String fkComponyId ;
75
+
76
+    private Double invoicePrice;
77
+    private String contractNo;
78
+    private String customerName;
79
+
80
+    public String getCustomerName() {
81
+        return customerName;
82
+    }
83
+
84
+    public void setCustomerName(String customerName) {
85
+        this.customerName = customerName;
86
+    }
87
+
88
+    public String getContractNo() {
89
+        return contractNo;
90
+    }
91
+
92
+    public void setContractNo(String contractNo) {
93
+        this.contractNo = contractNo;
94
+    }
95
+
96
+    public Double getInvoicePrice() {
97
+        return invoicePrice;
98
+    }
99
+
100
+    public void setInvoicePrice(Double invoicePrice) {
101
+        this.invoicePrice = invoicePrice;
102
+    }
103
+
104
+    public String getFkComponyId() {
105
+        return fkComponyId;
106
+    }
107
+
108
+    public void setFkComponyId(String fkComponyId) {
109
+        this.fkComponyId = fkComponyId;
110
+    }
111
+
112
+    public String getTallyPeople() {
113
+        return tallyPeople;
114
+    }
115
+
116
+    public void setTallyPeople(String tallyPeople) {
117
+        this.tallyPeople = tallyPeople;
118
+    }
119
+
120
+    public String getCarNo() {
121
+        return carNo;
122
+    }
123
+
124
+    public void setCarNo(String carNo) {
125
+        this.carNo = carNo;
126
+    }
127
+
128
+    public SysUser getAddUser() {
129
+        return addUser;
130
+    }
131
+
132
+    public void setAddUser(SysUser addUser) {
133
+        this.addUser = addUser;
134
+    }
135
+
136
+    public String getOrdNo() {
137
+        return ordNo;
138
+    }
139
+
140
+    public void setOrdNo(String ordNo) {
141
+        this.ordNo = ordNo;
142
+    }
143
+
144
+    public String getId() {
145
+        return id;
146
+    }
147
+
148
+    public void setId(String id) {
149
+        this.id = id == null ? null : id.trim();
150
+    }
151
+
152
+//    public String getWareName() {
153
+//        return wareName;
154
+//    }
155
+//
156
+
157
+    public String getWgtDcnMtcCd() {
158
+        return wgtDcnMtcCd;
159
+    }
160
+
161
+    public void setWgtDcnMtcCd(String wgtDcnMtcCd) {
162
+        this.wgtDcnMtcCd = wgtDcnMtcCd;
163
+    }
164
+
165
+    public String getEdgeTy() {
166
+        return edgeTy;
167
+    }
168
+
169
+    public void setEdgeTy(String edgeTy) {
170
+        this.edgeTy = edgeTy;
171
+    }
172
+
173
+    public String getProductionPlace() {
174
+        return productionPlace;
175
+    }
176
+
177
+    public void setProductionPlace(String productionPlace) {
178
+        this.productionPlace = productionPlace;
179
+    }
180
+
181
+//    public void setWareName(String wareName) {
182
+//        this.wareName = wareName == null ? null : wareName.trim();
183
+//    }
184
+//
185
+//    public String getStackName() {
186
+//        return stackName;
187
+//    }
188
+//
189
+//    public void setStackName(String stackName) {
190
+//        this.stackName = stackName == null ? null : stackName.trim();
191
+//    }
192
+
193
+    public Integer getLayer() {
194
+        return layer;
195
+    }
196
+
197
+    public void setLayer(Integer layer) {
198
+        this.layer = layer;
199
+    }
200
+
201
+//    public String getMaterialName() {
202
+//        return materialName;
203
+//    }
204
+//
205
+//    public void setMaterialName(String materialName) {
206
+//        this.materialName = materialName == null ? null : materialName.trim();
207
+//    }
208
+//
209
+//    public String getMaterialNo() {
210
+//        return materialNo;
211
+//    }
212
+//
213
+//    public void setMaterialNo(String materialNo) {
214
+//        this.materialNo = materialNo == null ? null : materialNo.trim();
215
+//    }
216
+//
217
+//    public String getStandard() {
218
+//        return standard;
219
+//    }
220
+//
221
+//    public void setStandard(String standard) {
222
+//        this.standard = standard == null ? null : standard.trim();
223
+//    }
224
+
225
+    public String getModel() {
226
+        return model;
227
+    }
228
+
229
+    public void setModel(String model) {
230
+        this.model = model == null ? null : model.trim();
231
+    }
232
+
233
+//    public String getCustomerName() {
234
+//        return customerName;
235
+//    }
236
+//
237
+//    public void setCustomerName(String customerName) {
238
+//        this.customerName = customerName == null ? null : customerName.trim();
239
+//    }
240
+
241
+//    public String getCustomerNo() {
242
+//        return customerNo;
243
+//    }
244
+//
245
+//    public void setCustomerNo(String customerNo) {
246
+//        this.customerNo = customerNo == null ? null : customerNo.trim();
247
+//    }
248
+
249
+    public Double getCount() {
250
+        return count;
251
+    }
252
+
253
+    public void setCount(Double count) {
254
+        this.count = count;
255
+    }
256
+
257
+    public Double getWeight() {
258
+        return weight;
259
+    }
260
+
261
+    public void setWeight(Double weight) {
262
+        this.weight = weight;
263
+    }
264
+
265
+    public String getRemark() {
266
+        return remark;
267
+    }
268
+
269
+    public void setRemark(String remark) {
270
+        this.remark = remark == null ? null : remark.trim();
271
+    }
272
+
273
+    public String getAddId() {
274
+        return addId;
275
+    }
276
+
277
+    public void setAddId(String addId) {
278
+        this.addId = addId == null ? null : addId.trim();
279
+    }
280
+
281
+    public Date getAddTime() {
282
+        return addTime;
283
+    }
284
+
285
+    public void setAddTime(Date addTime) {
286
+        this.addTime = addTime;
287
+    }
288
+
289
+    public String getModifyId() {
290
+        return modifyId;
291
+    }
292
+
293
+    public void setModifyId(String modifyId) {
294
+        this.modifyId = modifyId == null ? null : modifyId.trim();
295
+    }
296
+
297
+    public Date getModifyTime() {
298
+        return modifyTime;
299
+    }
300
+
301
+    public void setModifyTime(Date modifyTime) {
302
+        this.modifyTime = modifyTime;
303
+    }
304
+
305
+    public String getCancelId() {
306
+        return cancelId;
307
+    }
308
+
309
+    public void setCancelId(String cancelId) {
310
+        this.cancelId = cancelId == null ? null : cancelId.trim();
311
+    }
312
+
313
+    public Date getCancelTime() {
314
+        return cancelTime;
315
+    }
316
+
317
+    public void setCancelTime(Date cancelTime) {
318
+        this.cancelTime = cancelTime;
319
+    }
320
+
321
+    public String getCancelFlag() {
322
+        return cancelFlag;
323
+    }
324
+
325
+    public void setCancelFlag(String cancelFlag) {
326
+        this.cancelFlag = cancelFlag == null ? null : cancelFlag.trim();
327
+    }
328
+
329
+    public String getBelongId() {
330
+        return belongId;
331
+    }
332
+
333
+    public void setBelongId(String belongId) {
334
+        this.belongId = belongId == null ? null : belongId.trim();
335
+    }
336
+
337
+    public String getPlateNo() {
338
+        return plateNo;
339
+    }
340
+
341
+    public void setPlateNo(String plateNo) {
342
+        this.plateNo = plateNo == null ? null : plateNo.trim();
343
+    }
344
+
345
+    public String getInId() {
346
+        return inId;
347
+    }
348
+
349
+    public void setInId(String inId) {
350
+        this.inId = inId == null ? null : inId.trim();
351
+    }
352
+
353
+    public String getOutId() {
354
+        return outId;
355
+    }
356
+
357
+    public void setOutId(String outId) {
358
+        this.outId = outId == null ? null : outId.trim();
359
+    }
360
+
361
+    public String getReceiveAddress() {
362
+        return receiveAddress;
363
+    }
364
+
365
+    public void setReceiveAddress(String receiveAddress) {
366
+        this.receiveAddress = receiveAddress == null ? null : receiveAddress.trim();
367
+    }
368
+
369
+    public String getOutFlag() {
370
+        return outFlag;
371
+    }
372
+
373
+    public void setOutFlag(String outFlag) {
374
+        this.outFlag = outFlag;
375
+    }
376
+
377
+    public String getLockFlag() {
378
+        return lockFlag;
379
+    }
380
+
381
+    public void setLockFlag(String lockFlag) {
382
+        this.lockFlag = lockFlag;
383
+    }
384
+
385
+    public Ware getWare() {
386
+        return ware;
387
+    }
388
+
389
+    public void setWare(Ware ware) {
390
+        this.ware = ware;
391
+    }
392
+
393
+    public Stack getStack() {
394
+        return stack;
395
+    }
396
+
397
+    public void setStack(Stack stack) {
398
+        this.stack = stack;
399
+    }
400
+
401
+    public Material getMaterial() {
402
+        return material;
403
+    }
404
+
405
+    public void setMaterial(Material material) {
406
+        this.material = material;
407
+    }
408
+
409
+    public Customer getCustomer() {
410
+        return customer;
411
+    }
412
+
413
+    public void setCustomer(Customer customer) {
414
+        this.customer = customer;
415
+    }
416
+
417
+    @Override
418
+    public int compareTo(InStore o) {
419
+        return 0;
420
+    }
421
+}

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

1
+package com.th.demo.service.impl.ware;
2
+
3
+import com.alibaba.fastjson.JSON;
4
+import com.github.pagehelper.PageHelper;
5
+import com.github.pagehelper.PageInfo;
6
+import com.th.demo.mapping.ware.ChangeRecordMapper;
7
+import com.th.demo.mapping.ware.StoreMapper;
8
+import com.th.demo.mapping.ware.InStoreMapper;
9
+
10
+import com.th.demo.model.system.Type;
11
+import com.th.demo.model.ware.Store;
12
+import com.th.demo.model.ware.InStore;
13
+import com.th.demo.service.ware.StoreService;
14
+import com.th.demo.service.ware.InStoreService;
15
+import com.th.demo.tools.JSONTools;
16
+import com.th.demo.tools.Tools;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.stereotype.Service;
19
+
20
+import java.util.List;
21
+
22
+@Service("InStoreService")
23
+public class InStoreServiceImpl implements InStoreService {
24
+
25
+    @Autowired//自动注入Mapper
26
+    public ChangeRecordMapper changeRecordMapper;
27
+    @Autowired//自动注入Mapper
28
+    public StoreMapper storeMapper;
29
+    @Autowired//自动注入Mapper
30
+    public InStoreMapper inStoreMapper;
31
+    String result = Type.FAIL;
32
+    int num = 0;
33
+
34
+    @Override
35
+    public String queryLayerByStackId(String stackId, String userId, String belongId) {
36
+
37
+        String layer = inStoreMapper.selectLayerByStackId(stackId, belongId);
38
+        if (layer == null) {
39
+            layer = "0";
40
+        }
41
+        int currentLayer = Integer.parseInt(layer) + 1;
42
+        result = JSONTools.toStringyyyyMMddHHmmss(currentLayer);
43
+        return result;
44
+    }
45
+
46
+    @Override
47
+    public String queryByWareIdStackId(String wareId, String stackId, String userId, String belongId) {
48
+       List<InStore> list =  inStoreMapper.selectByWareIdStackId(  wareId,   stackId, belongId);
49
+        result = JSONTools.toStringyyyyMMddHHmmss(list);
50
+        return result;
51
+    }
52
+
53
+    @Override
54
+    public String query(int page, int rows, String wareName, String stackName, String userId, String belongId) {
55
+        PageHelper.startPage(page, rows);
56
+        List<InStore> list   = inStoreMapper.select(wareName, stackName, userId,belongId);
57
+        PageInfo<InStore> pageInfo = new PageInfo<>(list);
58
+        result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
59
+        return result;
60
+    }
61
+
62
+    @Override
63
+    public String modify(String json, String userId, String belongId) {
64
+        Store store = JSON.parseObject(json,Store.class);
65
+        int num =inStoreMapper.updateByPrimaryKey(store);
66
+        result=Tools.moreThanZeroResultJSON(num);
67
+        return result;
68
+    }
69
+
70
+    @Override
71
+    public String queryStore(int page, int rows,
72
+                             String wareName,
73
+                             String areaName,
74
+                             String stackName,
75
+                             String plateNo,
76
+                             String ordNo,
77
+                             String userId,
78
+                             String belongId) {
79
+        PageHelper.startPage(page, rows);
80
+        List<InStore> list=inStoreMapper.selectStore(wareName, areaName, stackName, plateNo, ordNo, userId,belongId);
81
+        PageInfo<InStore> pageInfo = new PageInfo<>(list);
82
+        result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
83
+        return result;
84
+    }
85
+
86
+    @Override
87
+    public String modifyCustomer(String id,String customerNameOld,String customerNameNew) {
88
+//        Store store =inStoreMapper.selectByPrimaryKey(id);
89
+//        store.setCustomerName(customerNameNew);
90
+//        ChangeRecord changeRecord =new ChangeRecord();
91
+//        changeRecord.setWareName(store.getWareName());
92
+//        changeRecord.setStackName(store.getStackName());
93
+//        changeRecord.setId(store.getId());
94
+//        changeRecord.setLayer(store.getLayer());
95
+//        changeRecord.setMaterialName(store.getMaterialName());
96
+//        changeRecord.setMaterialNo(store.getMaterialNo());
97
+//        changeRecord.setStandard(store.getStandard());
98
+//        changeRecord.setModel(store.getModel());
99
+//        changeRecord.setCustomerNameOld(customerNameOld);
100
+//        changeRecord.setCustomerNameNew(customerNameNew);
101
+//        changeRecord.setCount(store.getCount());
102
+//        changeRecord.setRemark(store.getRemark());
103
+//        changeRecord.setAddTime(store.getAddTime());
104
+//        changeRecord.setModifyId(store.getModifyId());
105
+//        changeRecord.setModifyTime(store.getModifyTime());
106
+//        changeRecord.setCancelId(store.getCancelId());
107
+//        changeRecord.setCancelTime(store.getCancelTime());
108
+//        changeRecord.setCancelFlag(store.getCancelFlag());
109
+//        changeRecord.setBelongId(store.getBelongId());
110
+//        changeRecord.setPlateNo(store.getPlateNo());
111
+//        changeRecord.setOutId(store.getOutId());
112
+//        changeRecord.setAddId(store.getAddId());
113
+//
114
+//        changeRecordMapper.insert(changeRecord);
115
+//        num = inStoreMapper.updateByPrimaryKey(store);
116
+//        result = JSONTools.toString(num);
117
+        return result;
118
+    }
119
+
120
+    @Override
121
+    public String modifyCustomeradress(String id, String customerAddressOld, String customerAddressNew) {
122
+//        Store store =inStoreMapper.selectByPrimaryKey(id);
123
+//        store.setReceiveAddress(customerAddressNew);
124
+//        ChangeRecord changeRecord =new ChangeRecord();
125
+//        changeRecord.setWareName(store.getWareName());
126
+//        changeRecord.setStackName(store.getStackName());
127
+//        changeRecord.setId(store.getId());
128
+//        changeRecord.setLayer(store.getLayer());
129
+//        changeRecord.setMaterialName(store.getMaterialName());
130
+//        changeRecord.setMaterialNo(store.getMaterialNo());
131
+//        changeRecord.setStandard(store.getStandard());
132
+//        changeRecord.setModel(store.getModel());
133
+//        changeRecord.setReceiveAddressNew(store.getReceiveAddress());
134
+//        changeRecord.setCustomerNameNew(customerAddressNew);
135
+//        changeRecord.setCustomerNameOld(customerAddressOld);
136
+//        changeRecord.setCount(store.getCount());
137
+//        changeRecord.setRemark(store.getRemark());
138
+//        changeRecord.setAddTime(store.getAddTime());
139
+//        changeRecord.setModifyId(store.getModifyId());
140
+//        changeRecord.setModifyTime(store.getModifyTime());
141
+//        changeRecord.setCancelId(store.getCancelId());
142
+//        changeRecord.setCancelTime(store.getCancelTime());
143
+//        changeRecord.setCancelFlag(store.getCancelFlag());
144
+//        changeRecord.setBelongId(store.getBelongId());
145
+//        changeRecord.setPlateNo(store.getPlateNo());
146
+//        changeRecord.setOutId(store.getOutId());
147
+//        changeRecord.setAddId(store.getAddId());
148
+//
149
+//        changeRecordMapper.insert(changeRecord);
150
+//        num = inStoreMapper.updateByPrimaryKey(store);
151
+//        result = JSONTools.toString(num);
152
+        return result;
153
+    }
154
+
155
+    //
156
+
157
+
158
+
159
+//    @Override
160
+//    public String save(String json, String userId) {
161
+//        Assets  assets = JSON.parseObject(json, Assets.class);
162
+//        Assets isnull = assetsMapper.selectByPrimaryKey(assets.getId());
163
+//        assets.setStatus("正常");
164
+//        if(isnull==null){
165
+//        /*assets.setAddId(userId);
166
+//        assets.setAddTime(new Date());
167
+//        assets.setCancelFlag("0");*/
168
+//            num = assetsMapper.insert(assets);
169
+//            result =JSONTools.toString(num);
170
+//        }else{
171
+//        /*arcd.setModifyId(userId);
172
+//        arcd.setModifyTime(new Date());*/
173
+//            num = assetsMapper.updateByPrimaryKey(assets);
174
+//            result =JSONTools.toString(num);
175
+//        }
176
+//        return result;
177
+//    }
178
+
179
+//
180
+//    @Override
181
+//    public String save(String json, String userId, String belongId) {
182
+//        result = Type.FAIL;
183
+//        Customer customer = JSON.parseObject(json, new TypeReference<Customer>() {
184
+//        });
185
+//        if (customer.getId() == null || customer.getId().equals("")) {
186
+//            customer.setAddId(userId);
187
+//            customer.setAddTime(new Date());
188
+//            customer.setModifyId(userId);
189
+//            customer.setModifyTime(new Date());
190
+//            customer.setCancelFlag("0");
191
+//            customer.setBelongId(belongId);
192
+//            num = customerMapper.insert(customer);
193
+//        } else {
194
+//            customer.setModifyId(userId);
195
+//            customer.setModifyTime(new Date());
196
+//            num = customerMapper.updateByPrimaryKey(customer);
197
+//        }
198
+//        result = Tools.moreThanZeroResultJSON(num);
199
+//        return result;
200
+//    }
201
+//
202
+//
203
+//    @Override
204
+//    public String remove(String id, String userId) {
205
+//        Customer customer = customerMapper.selectByPrimaryKey(id);
206
+//        customer.setCancelFlag("9");
207
+//        customer.setCancelId(userId);
208
+//        customer.setCancelTime(new Date());
209
+//        num = customerMapper.updateByPrimaryKey(customer);
210
+//        result = Tools.moreThanZeroResultJSON(num);
211
+//        return result;
212
+//
213
+//    }
214
+}

+ 20
- 0
src/main/java/com/th/demo/service/ware/InStoreService.java 查看文件

1
+package com.th.demo.service.ware;
2
+import com.th.demo.model.ware.Store;
3
+import com.th.demo.model.ware.InStore;
4
+
5
+
6
+public interface InStoreService {
7
+    String queryLayerByStackId(String stackId, String userId, String belongId);
8
+
9
+    String queryByWareIdStackId(String wareId, String stackId, String userId, String belongId);
10
+
11
+    String query(int page, int rows, String wareName, String stackName, String userId, String belongId);
12
+    
13
+    String modify(String json, String userId, String belongId);
14
+
15
+    String queryStore(int page, int rows, String wareName, String areaName, String stackName, String plateNo, String ordNo, String userId, String belongId);
16
+
17
+    String modifyCustomer(String id, String customerNameOld, String customerNameNew);
18
+
19
+    String modifyCustomeradress(String id, String customerAddressOld, String customerAddressNew);
20
+}

+ 534
- 0
src/main/resource/mapper/ware/InStoreMapper.xml 查看文件

1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.th.demo.mapping.ware.InStoreMapper" >
4
+  <resultMap id="BaseResultMap" type="com.th.demo.model.ware.InStore" >
5
+    <id column="id" property="id" jdbcType="VARCHAR" />
6
+    <result column="layer" property="layer" jdbcType="INTEGER" />
7
+    <result column="model" property="model" jdbcType="VARCHAR" />
8
+    <result column="plate_no" property="plateNo" jdbcType="VARCHAR" />
9
+    <result column="count" property="count" jdbcType="DOUBLE" />
10
+    <result column="weight" property="weight" jdbcType="DOUBLE" />
11
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
12
+    <result column="add_id" property="addId" jdbcType="VARCHAR" />
13
+    <result column="add_time" property="addTime" jdbcType="TIMESTAMP" />
14
+    <result column="modify_id" property="modifyId" jdbcType="VARCHAR" />
15
+    <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
16
+    <result column="cancel_id" property="cancelId" jdbcType="VARCHAR" />
17
+    <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP" />
18
+    <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
19
+    <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
20
+    <result column="in_id" property="inId" jdbcType="VARCHAR" />
21
+    <result column="out_id" property="outId" jdbcType="VARCHAR" />
22
+    <result column="receive_address" property="receiveAddress" jdbcType="VARCHAR" />
23
+    <result column="out_flag" property="outFlag" jdbcType="VARCHAR" />
24
+    <result column="lock_flag" property="lockFlag" jdbcType="VARCHAR" />
25
+
26
+    <result column="wgt_dcn_mtc_cd" property="wgtDcnMtcCd" jdbcType="VARCHAR" />
27
+    <result column="edge_ty" property="edgeTy" jdbcType="VARCHAR" />
28
+    <result column="production_place" property="productionPlace" jdbcType="VARCHAR" />
29
+    <result column="ord_no" property="ordNo" jdbcType="VARCHAR" />
30
+    <result column="car_no" property="carNo" jdbcType="VARCHAR" />
31
+    <result column="tally_people" property="tallyPeople" jdbcType="VARCHAR" />
32
+    <result column="fk_compony_id" property="fkComponyId" jdbcType="VARCHAR" />
33
+    <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
34
+    <result column="contract_no" property="contractNo" jdbcType="VARCHAR" />
35
+    <result column="customer_name" property="customerName" jdbcType="VARCHAR" />
36
+
37
+    <association  column="ware_id" property="ware" select="com.th.demo.mapping.maint.WareMapper.selectByPrimaryKey" />
38
+    <association  column="stack_id" property="stack" select="com.th.demo.mapping.maint.StackMapper.selectByPrimaryKey" />
39
+    <association  column="material_id" property="material" select="com.th.demo.mapping.maint.MaterialMapper.selectByPrimaryKey" />
40
+    <association  column="customer_id" property="customer" select="com.th.demo.mapping.maint.CustomerMapper.selectByPrimaryKey" />
41
+    <association  column="add_id" property="addUser" select="com.th.demo.mapping.system.SysUserMapper.selectByPrimaryKey" />
42
+  </resultMap>
43
+
44
+
45
+
46
+  <resultMap id="StoreOfWareStack" type="com.th.demo.model.ware.StoreOfWareStack" >
47
+    <result column="ware_id" property="wareId" jdbcType="VARCHAR" />
48
+    <result column="stack_id" property="stackId" jdbcType="VARCHAR" />
49
+  </resultMap>
50
+
51
+  <resultMap id="TotalResultMap" type="com.th.demo.model.ware.TotalRecord">
52
+    <result column="total_amount" property="totalAmount" jdbcType="DOUBLE" />
53
+    <result column="total_weight" property="totalWeight" jdbcType="DOUBLE" />
54
+  </resultMap>
55
+
56
+  <sql id="Base_Column_List" >
57
+    id, ware_id, stack_id, layer, material_id, model, plate_no, customer_id, count, weight,
58
+    remark, add_id, add_time, modify_id, modify_time, cancel_id, cancel_time, cancel_flag,
59
+    belong_id, in_id, out_id, receive_address, out_flag, lock_flag,wgt_dcn_mtc_cd,edge_ty,production_place
60
+  </sql>
61
+
62
+
63
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
64
+    select 
65
+    <include refid="Base_Column_List" />
66
+    from t_ware_store
67
+    where id = #{id,jdbcType=VARCHAR}
68
+  </select>
69
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
70
+    delete from t_ware_store
71
+    where id = #{id,jdbcType=VARCHAR}
72
+  </delete>
73
+
74
+  <insert id="insert" parameterType="com.th.demo.model.ware.Store" >
75
+
76
+   <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
77
+     SELECT  REPLACE(UUID(),'-','') as id from dual
78
+   </selectKey>
79
+
80
+    insert into t_ware_store (id, ware_id, stack_id,
81
+      layer, material_id, model,
82
+      plate_no, customer_id, count,
83
+      weight, remark, add_id,
84
+      add_time, modify_id, modify_time,
85
+      cancel_id, cancel_time, cancel_flag,
86
+      belong_id, in_id, out_id,
87
+      receive_address, out_flag, lock_flag
88
+      ,wgt_dcn_mtc_cd,edge_ty,production_place,ord_no
89
+      ,car_no,tally_people,fk_compony_id,invoice_price
90
+    )
91
+    values (#{id,jdbcType=VARCHAR}, #{ware.id,jdbcType=VARCHAR}, #{stack.id,jdbcType=VARCHAR},
92
+      #{layer,jdbcType=INTEGER}, #{material.id,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR},
93
+      #{plateNo,jdbcType=VARCHAR}, #{customer.id,jdbcType=VARCHAR}, #{count,jdbcType=DOUBLE},
94
+      #{weight,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, #{addId,jdbcType=VARCHAR},
95
+      #{addTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
96
+      #{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{cancelFlag,jdbcType=VARCHAR},
97
+      #{belongId,jdbcType=VARCHAR}, #{inId,jdbcType=VARCHAR}, #{outId,jdbcType=VARCHAR},
98
+      #{receiveAddress,jdbcType=VARCHAR}, #{outFlag,jdbcType=VARCHAR}, #{lockFlag,jdbcType=VARCHAR}
99
+      ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{ordNo,jdbcType=VARCHAR}
100
+     ,#{carNo,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{fkComponyId,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE}
101
+      )
102
+  </insert>
103
+
104
+  <insert id="insertSelective" parameterType="com.th.demo.model.ware.Store" >
105
+    insert into t_ware_store
106
+    <trim prefix="(" suffix=")" suffixOverrides="," >
107
+      <if test="id != null" >
108
+        id,
109
+      </if>
110
+      <if test="wareName != null" >
111
+        ware_name,
112
+      </if>
113
+      <if test="stackName != null" >
114
+        stack_name,
115
+      </if>
116
+      <if test="layer != null" >
117
+        layer,
118
+      </if>
119
+      <if test="materialName != null" >
120
+        material_name,
121
+      </if>
122
+      <if test="materialNo != null" >
123
+        material_no,
124
+      </if>
125
+      <if test="standard != null" >
126
+        standard,
127
+      </if>
128
+      <if test="model != null" >
129
+        model,
130
+      </if>
131
+      <if test="customerName != null" >
132
+        customer_name,
133
+      </if>
134
+      <if test="customerNo != null" >
135
+        customer_no,
136
+      </if>
137
+      <if test="count != null" >
138
+        count,
139
+      </if>
140
+      <if test="weight != null" >
141
+        weight,
142
+      </if>
143
+      <if test="remark != null" >
144
+        remark,
145
+      </if>
146
+      <if test="addId != null" >
147
+        add_id,
148
+      </if>
149
+      <if test="addTime != null" >
150
+        add_time,
151
+      </if>
152
+      <if test="modifyId != null" >
153
+        modify_id,
154
+      </if>
155
+      <if test="modifyTime != null" >
156
+        modify_time,
157
+      </if>
158
+      <if test="cancelId != null" >
159
+        cancel_id,
160
+      </if>
161
+      <if test="cancelTime != null" >
162
+        cancel_time,
163
+      </if>
164
+      <if test="cancelFlag != null" >
165
+        cancel_flag,
166
+      </if>
167
+      <if test="belongId != null" >
168
+        belong_id,
169
+      </if>
170
+    </trim>
171
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
172
+      <if test="id != null" >
173
+        #{id,jdbcType=VARCHAR},
174
+      </if>
175
+      <if test="wareName != null" >
176
+        #{wareName,jdbcType=VARCHAR},
177
+      </if>
178
+      <if test="stackName != null" >
179
+        #{stackName,jdbcType=VARCHAR},
180
+      </if>
181
+      <if test="layer != null" >
182
+        #{layer,jdbcType=INTEGER},
183
+      </if>
184
+      <if test="materialName != null" >
185
+        #{materialName,jdbcType=VARCHAR},
186
+      </if>
187
+      <if test="materialNo != null" >
188
+        #{materialNo,jdbcType=VARCHAR},
189
+      </if>
190
+      <if test="standard != null" >
191
+        #{standard,jdbcType=VARCHAR},
192
+      </if>
193
+      <if test="model != null" >
194
+        #{model,jdbcType=VARCHAR},
195
+      </if>
196
+      <if test="customerName != null" >
197
+        #{customerName,jdbcType=VARCHAR},
198
+      </if>
199
+      <if test="customerNo != null" >
200
+        #{customerNo,jdbcType=VARCHAR},
201
+      </if>
202
+      <if test="count != null" >
203
+        #{count,jdbcType=DOUBLE},
204
+      </if>
205
+      <if test="weight != null" >
206
+        #{weight,jdbcType=DOUBLE},
207
+      </if>
208
+      <if test="remark != null" >
209
+        #{remark,jdbcType=VARCHAR},
210
+      </if>
211
+      <if test="addId != null" >
212
+        #{addId,jdbcType=VARCHAR},
213
+      </if>
214
+      <if test="addTime != null" >
215
+        #{addTime,jdbcType=TIMESTAMP},
216
+      </if>
217
+      <if test="modifyId != null" >
218
+        #{modifyId,jdbcType=VARCHAR},
219
+      </if>
220
+      <if test="modifyTime != null" >
221
+        #{modifyTime,jdbcType=TIMESTAMP},
222
+      </if>
223
+      <if test="cancelId != null" >
224
+        #{cancelId,jdbcType=VARCHAR},
225
+      </if>
226
+      <if test="cancelTime != null" >
227
+        #{cancelTime,jdbcType=TIMESTAMP},
228
+      </if>
229
+      <if test="cancelFlag != null" >
230
+        #{cancelFlag,jdbcType=VARCHAR},
231
+      </if>
232
+      <if test="belongId != null" >
233
+        #{belongId,jdbcType=VARCHAR},
234
+      </if>
235
+    </trim>
236
+  </insert>
237
+  <update id="updateByPrimaryKeySelective" parameterType="com.th.demo.model.ware.Store" >
238
+    update t_ware_store
239
+    <set >
240
+      <if test="wareName != null" >
241
+        ware_name = #{wareName,jdbcType=VARCHAR},
242
+      </if>
243
+      <if test="stackName != null" >
244
+        stack_name = #{stackName,jdbcType=VARCHAR},
245
+      </if>
246
+      <if test="layer != null" >
247
+        layer = #{layer,jdbcType=INTEGER},
248
+      </if>
249
+      <if test="materialName != null" >
250
+        material_name = #{materialName,jdbcType=VARCHAR},
251
+      </if>
252
+      <if test="materialNo != null" >
253
+        material_no = #{materialNo,jdbcType=VARCHAR},
254
+      </if>
255
+      <if test="standard != null" >
256
+        standard = #{standard,jdbcType=VARCHAR},
257
+      </if>
258
+      <if test="model != null" >
259
+        model = #{model,jdbcType=VARCHAR},
260
+      </if>
261
+      <if test="customerName != null" >
262
+        customer_name = #{customerName,jdbcType=VARCHAR},
263
+      </if>
264
+      <if test="customerNo != null" >
265
+        customer_no = #{customerNo,jdbcType=VARCHAR},
266
+      </if>
267
+      <if test="count != null" >
268
+        count = #{count,jdbcType=DOUBLE},
269
+      </if>
270
+      <if test="weight != null" >
271
+        weight = #{weight,jdbcType=DOUBLE},
272
+      </if>
273
+      <if test="remark != null" >
274
+        remark = #{remark,jdbcType=VARCHAR},
275
+      </if>
276
+      <if test="addId != null" >
277
+        add_id = #{addId,jdbcType=VARCHAR},
278
+      </if>
279
+      <if test="addTime != null" >
280
+        add_time = #{addTime,jdbcType=TIMESTAMP},
281
+      </if>
282
+      <if test="modifyId != null" >
283
+        modify_id = #{modifyId,jdbcType=VARCHAR},
284
+      </if>
285
+      <if test="modifyTime != null" >
286
+        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
287
+      </if>
288
+      <if test="cancelId != null" >
289
+        cancel_id = #{cancelId,jdbcType=VARCHAR},
290
+      </if>
291
+      <if test="cancelTime != null" >
292
+        cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
293
+      </if>
294
+      <if test="cancelFlag != null" >
295
+        cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
296
+      </if>
297
+      <if test="belongId != null" >
298
+        belong_id = #{belongId,jdbcType=VARCHAR},
299
+      </if>
300
+    </set>
301
+    where id = #{id,jdbcType=VARCHAR}
302
+  </update>
303
+  <update id="updateByPrimaryKey" parameterType="com.th.demo.model.ware.Store" >
304
+    update t_ware_store
305
+    set ware_id = #{ware.id,jdbcType=VARCHAR},
306
+      stack_id = #{stack.id,jdbcType=VARCHAR},
307
+      layer = #{layer,jdbcType=INTEGER},
308
+      material_id = #{material.id,jdbcType=VARCHAR},
309
+      model = #{model,jdbcType=VARCHAR},
310
+      plate_no = #{plateNo,jdbcType=VARCHAR},
311
+      customer_id = #{customer.id,jdbcType=VARCHAR},
312
+      count = #{count,jdbcType=DOUBLE},
313
+      weight = #{weight,jdbcType=DOUBLE},
314
+      remark = #{remark,jdbcType=VARCHAR},
315
+      add_id = #{addId,jdbcType=VARCHAR},
316
+      add_time = #{addTime,jdbcType=TIMESTAMP},
317
+      modify_id = #{modifyId,jdbcType=VARCHAR},
318
+      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
319
+      cancel_id = #{cancelId,jdbcType=VARCHAR},
320
+      cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
321
+      cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
322
+      belong_id = #{belongId,jdbcType=VARCHAR},
323
+      in_id = #{inId,jdbcType=VARCHAR},
324
+      out_id = #{outId,jdbcType=VARCHAR},
325
+      receive_address = #{receiveAddress,jdbcType=VARCHAR},
326
+      out_flag = #{outFlag,jdbcType=VARCHAR},
327
+      lock_flag = #{lockFlag,jdbcType=VARCHAR}
328
+    where id = #{id,jdbcType=VARCHAR}
329
+  </update>
330
+
331
+
332
+
333
+  <select id="selectLayerByStackId" resultType="java.lang.String" >
334
+  SELECT ifnull(max(t.layer),0) from t_ware_store t
335
+  where t.stack_id =#{param1,jdbcType=VARCHAR}
336
+  and t.belong_id = #{param2,jdbcType=VARCHAR}
337
+  and ifnull(t.cancel_flag,'0') = '0'
338
+      and ifnull(t.out_flag,'0') = '0'
339
+  </select>
340
+
341
+  <select id="selectByWareIdStackId"  resultMap="BaseResultMap" >
342
+  SELECT b.name as fk_compony_id,t.* from t_ware_store t left join t_maint_customer b
343
+  on t.fk_compony_id = b.id
344
+  where t.ware_id =  #{param1,jdbcType=VARCHAR}
345
+  and t.stack_id =  #{param2,jdbcType=VARCHAR}
346
+  and t.belong_id = #{param3,jdbcType=VARCHAR}
347
+    and ifnull(t.cancel_flag,'0') = '0'
348
+    and ifnull(t.out_flag,'0') = '0'
349
+  order by layer desc
350
+  </select>
351
+
352
+  <select id="select"  resultMap="BaseResultMap" >
353
+
354
+select t.* from t_ware_store t where t.ware_name in (
355
+select b.name from t_maint_userware a ,t_maint_ware b  where a.ware_id = b.id
356
+and  user_id = #{param3,jdbcType=VARCHAR}  )  and t.belong_id = #{param4,jdbcType=VARCHAR}
357
+    <if test="param1 != ''" >
358
+      and  t.ware_name = #{param1,jdbcType=VARCHAR}
359
+    </if>
360
+    <if test="param2 != ''" >
361
+      and  t.stack_name = #{param2,jdbcType=VARCHAR}
362
+    </if>
363
+    and ifnull(t.cancel_flag,'0') = '0'
364
+    and ifnull(t.out_flag,'0') = '0'
365
+order by t.stack_name asc , t.layer desc
366
+
367
+  </select>
368
+
369
+
370
+  <select id="selectForUpDown"   resultMap="BaseResultMap"  >
371
+select t.*  from  t_ware_store t
372
+    where t.ware_id in (
373
+    select a.ware_id from t_maint_userware a  where a.user_id = #{param3,jdbcType=VARCHAR}
374
+     )  and t.belong_id = #{param4,jdbcType=VARCHAR}
375
+    and  t.ware_id = #{param1,jdbcType=VARCHAR}
376
+    and  t.stack_id = #{param2,jdbcType=VARCHAR}
377
+    and t.layer &gt;=  #{param5,jdbcType=INTEGER}
378
+    and t.layer &lt;=  #{param6,jdbcType=INTEGER}
379
+      and ifnull(t.cancel_flag,'0') = '0'
380
+          and ifnull(t.out_flag,'0') = '0'
381
+  </select>
382
+
383
+  <update id="updateForUpDownByStep"    >
384
+update t_ware_store t set t.layer = t.layer +  #{param7,jdbcType=INTEGER}
385
+    where t.ware_id in (
386
+    select a.ware_id from t_maint_userware a  where a.user_id = #{param3,jdbcType=VARCHAR}
387
+     )  and t.belong_id = #{param4,jdbcType=VARCHAR}
388
+    and  t.ware_id = #{param1,jdbcType=VARCHAR}
389
+    and  t.stack_id = #{param2,jdbcType=VARCHAR}
390
+    and t.layer &gt;=  #{param5,jdbcType=INTEGER}
391
+    and t.layer &lt;=  #{param6,jdbcType=INTEGER}
392
+      and ifnull(t.cancel_flag,'0') = '0'
393
+          and ifnull(t.out_flag,'0') = '0'
394
+  </update>
395
+
396
+  <update id="updateForUpDownByLayer"    >
397
+update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
398
+      where t.ware_id in (
399
+    select a.ware_id from t_maint_userware a  where a.user_id = #{param3,jdbcType=VARCHAR}
400
+     )  and t.belong_id = #{param4,jdbcType=VARCHAR}
401
+    and  t.ware_id = #{param1,jdbcType=VARCHAR}
402
+    and  t.stack_id = #{param2,jdbcType=VARCHAR}
403
+    and t.layer &gt;=  #{param5,jdbcType=INTEGER}
404
+    and t.layer &lt;=  #{param6,jdbcType=INTEGER}
405
+      and ifnull(t.cancel_flag,'0') = '0'
406
+          and ifnull(t.out_flag,'0') = '0'
407
+  </update>
408
+
409
+  <select id="selectByOutId"   resultMap="BaseResultMap"  >
410
+    select t.*  from  t_ware_store t
411
+      where t.ware_id in (
412
+    select a.ware_id from t_maint_userware a  where a.user_id = #{param3,jdbcType=VARCHAR}
413
+     )  and t.belong_id = #{param4,jdbcType=VARCHAR}
414
+    and  t.out_id = #{param1,jdbcType=VARCHAR}
415
+  </select>
416
+
417
+
418
+  <update id="updateByOutId"  >
419
+    update  t_ware_store t set t.cancel_flag = '1'
420
+      where t.ware_id in (
421
+    select a.ware_id from t_maint_userware a  where a.user_id = #{param3,jdbcType=VARCHAR}
422
+     )  and t.belong_id = #{param4,jdbcType=VARCHAR}
423
+    and  t.out_id = #{param1,jdbcType=VARCHAR}
424
+  </update>
425
+
426
+
427
+  <select id="selectStore" resultMap="BaseResultMap" >
428
+    select ws.*, wi.*, mm.*, mc.* from t_ware_store ws,t_ware_in_record wi, t_maint_ware mw, t_maint_stack ms, t_maint_material mm,t_maint_customer mc
429
+    where ws.ware_id = mw.id
430
+    and ws.stack_id = ms.id
431
+    and ws.material_id  = mm.id
432
+    and ws.customer_id = mc.id
433
+    and ws.in_id = wi.id
434
+    and mw.id like concat('%',#{param1,jdbcType=VARCHAR},'%')
435
+    and ms.code like concat('_',#{param2,jdbcType=VARCHAR},'%')
436
+    and ms.name like concat('%',#{param3,jdbcType=VARCHAR},'%')
437
+    and ws.plate_no like concat('%',#{param4,jdbcType=VARCHAR},'%')
438
+    and ws.ord_no like concat('%',#{param5,jdbcType=VARCHAR},'%')
439
+    and ws.belong_id = #{param7,jdbcType=VARCHAR}
440
+    and ws.cancel_flag = '0'
441
+    and ws.out_flag = '0'
442
+    and ws.ware_id in (
443
+    select m.ware_id from t_maint_userware m  where m.user_id = #{param6,jdbcType=VARCHAR}
444
+     )
445
+    order by ms.code,ws.layer desc
446
+  </select>
447
+  <select id="selectWareStackByDistributionStore" resultMap="StoreOfWareStack" >
448
+    select distinct  t.ware_id ,t.stack_id
449
+    from t_ware_store t where t.id in
450
+    <foreach item="item" index="index" collection="storeId"
451
+             open="(" separator="," close=")">
452
+      #{item}
453
+    </foreach>
454
+
455
+  </select>
456
+
457
+
458
+  <select id="selectByWareIdStackIdInStoreId" resultMap="BaseResultMap" >
459
+    select *
460
+    from t_ware_store t where t.id in
461
+    <foreach item="item" index="index" collection="storeId"
462
+             open="(" separator="," close=")">
463
+      #{item}
464
+    </foreach>
465
+    and t.ware_id like concat('%',#{wareId,jdbcType=VARCHAR},'%')
466
+    and t.stack_id like concat('%',#{stackId,jdbcType=VARCHAR},'%')
467
+  </select>
468
+
469
+
470
+  <update id="updateDistributionById"  >
471
+    update  t_ware_store t
472
+    set t.lock_flag = #{lockFlag,jdbcType=VARCHAR} where t.id in
473
+    <foreach item="item" index="index" collection="storeId"
474
+             open="(" separator="," close=")">
475
+      #{item}
476
+    </foreach>
477
+
478
+  </update>
479
+
480
+
481
+
482
+
483
+  <select id="selectForCustomer" resultMap="BaseResultMap" >
484
+    select e.name as fk_compony_id,t.*
485
+    from t_ware_store t left join t_maint_customer e
486
+		on t.fk_compony_id = e.id
487
+		, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d
488
+    where t.ware_id = a.id
489
+    and t.stack_id = b.id
490
+    and t.material_id  = c.id
491
+    and t.customer_id = d.id
492
+    and  a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
493
+    and  b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
494
+    and  t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
495
+    and  c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
496
+    and  c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
497
+    <if test="param6 != null and param6 != ''" >
498
+      and  d.name = #{param6,jdbcType=VARCHAR}
499
+    </if>
500
+    and  t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
501
+    and t.cancel_flag = '0'
502
+    and t.out_flag = '0'
503
+    and IFNULL(t.ord_no,'*') like  concat('%',#{param11,jdbcType=VARCHAR},'%')
504
+    and d.name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%')
505
+  </select>
506
+  <select id="queryTotal" resultMap="TotalResultMap" >
507
+    select sum(t.weight) as total_weight,
508
+			 sum(t.count) as total_amount
509
+	from t_ware_store t, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d
510
+    where t.ware_id = a.id
511
+    and t.stack_id = b.id
512
+    and t.material_id  = c.id
513
+    and t.customer_id = d.id
514
+    and  a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
515
+    and  b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
516
+    and  t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
517
+    and  c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
518
+    and  c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
519
+    and  d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
520
+    and  t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
521
+    and t.cancel_flag = '0'
522
+    and t.out_flag = '0'
523
+    and IFNULL(t.ord_no,'*') like  concat('%',#{param11,jdbcType=VARCHAR},'%')
524
+    and d.name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%')
525
+  </select>
526
+
527
+  <select id="selEffStore" resultType="java.lang.Integer" parameterType="java.lang.String">
528
+      select count(*)
529
+      from t_ware_store t
530
+      where t.cancel_flag = '0'
531
+      and t.plate_no = #{param1,jdbcType=VARCHAR};
532
+
533
+  </select>
534
+</mapper>

Loading…
取消
儲存