张庆宇 9 月之前
父節點
當前提交
6e705e5997

+ 19
- 15
src/main/java/com/th/demo/controller/ware/InRecordController.java 查看文件

@@ -35,6 +35,8 @@ public class InRecordController {
35 35
                         String carNo,
36 36
                         String tallyPeople,
37 37
                         String fkComponyName,
38
+                        String contractNo,
39
+                        String packNo,
38 40
                         HttpServletRequest request) {
39 41
 
40 42
         try {
@@ -43,7 +45,7 @@ public class InRecordController {
43 45
             Date fromDate2 = DateTools.StrToDate(fromDate, "yyyy-MM-dd HH:mm:ss");
44 46
             Date toDate2 = DateTools.StrToDate(toDate, "yyyy-MM-dd HH:mm:ss");
45 47
             result = inRecordService.query(page, rows, wareName, stackName, model, materialName, standard, customerName,
46
-                    plateNo,fromDate2,toDate2,userId, belongId,ordNo,carNo,tallyPeople,fkComponyName);
48
+                    plateNo,fromDate2,toDate2,userId, belongId,ordNo,carNo,tallyPeople,fkComponyName,contractNo,packNo);
47 49
         } catch (Exception ex) {
48 50
             ex.printStackTrace();
49 51
             result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
@@ -69,19 +71,21 @@ public class InRecordController {
69 71
     }
70 72
     @RequestMapping(value = "/queryTotal.do")
71 73
     public String queryTotal(int page, int rows,
72
-                        String wareName,
73
-                        String stackName,
74
-                        String model,
75
-                        String materialName,
76
-                        String standard,
77
-                        String customerName,
78
-                        String plateNo,
79
-                        String fromDate,
80
-                        String toDate,
81
-                        String ordNo,
82
-                        String carNo,
83
-                        String tallyPeople,
84
-                        String fkComponyName,
74
+                             String wareName,
75
+                             String stackName,
76
+                             String model,
77
+                             String materialName,
78
+                             String standard,
79
+                             String customerName,
80
+                             String plateNo,
81
+                             String fromDate,
82
+                             String toDate,
83
+                             String ordNo,
84
+                             String carNo,
85
+                             String tallyPeople,
86
+                             String fkComponyName,
87
+                             String contractNo,
88
+                             String packNo,
85 89
                         HttpServletRequest request) {
86 90
 
87 91
         try {
@@ -90,7 +94,7 @@ public class InRecordController {
90 94
             Date fromDate2 = DateTools.StrToDate(fromDate, "yyyy-MM-dd HH:mm:ss");
91 95
             Date toDate2 = DateTools.StrToDate(toDate, "yyyy-MM-dd HH:mm:ss");
92 96
             result = inRecordService.queryTotal(page, rows, wareName, stackName, model, materialName, standard, customerName,
93
-                    plateNo,fromDate2,toDate2 ,userId, belongId,ordNo,carNo,tallyPeople,fkComponyName);
97
+                    plateNo,fromDate2,toDate2 ,userId, belongId,ordNo,carNo,tallyPeople,fkComponyName,contractNo,packNo);
94 98
         } catch (Exception ex) {
95 99
             ex.printStackTrace();
96 100
             result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());

+ 6
- 2
src/main/java/com/th/demo/controller/ware/OutRecordController.java 查看文件

@@ -33,6 +33,8 @@ public class OutRecordController {
33 33
                            String tallyPeople,
34 34
                            String ordNo,
35 35
                            String fkComponyName,
36
+                           String contractNo,
37
+                           String packNo,
36 38
                            HttpServletRequest request) {
37 39
 
38 40
         try {
@@ -42,7 +44,7 @@ public class OutRecordController {
42 44
             Date toDate = DateTools.StrToDate(pToDate, "yyyy-MM-dd HH:mm:ss");
43 45
 
44 46
             result = outRecordService.query(page, rows, wareName, stackName, model, materialName, standard, customerName,
45
-                    plateNo,fromDate,toDate, userId, belongId,carNo,tallyPeople,ordNo,fkComponyName);
47
+                    plateNo,fromDate,toDate, userId, belongId,carNo,tallyPeople,ordNo,fkComponyName,contractNo,packNo);
46 48
         } catch (Exception ex) {
47 49
             ex.printStackTrace();
48 50
             result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
@@ -64,6 +66,8 @@ public class OutRecordController {
64 66
                         String tallyPeople,
65 67
                         String ordNo,
66 68
                         String fkComponyName,
69
+                             String contractNo,
70
+                             String packNo,
67 71
                         HttpServletRequest request) {
68 72
 
69 73
         try {
@@ -72,7 +76,7 @@ public class OutRecordController {
72 76
             Date fromDate = DateTools.StrToDate(pFromDate, "yyyy-MM-dd HH:mm:ss");
73 77
             Date toDate = DateTools.StrToDate(pToDate, "yyyy-MM-dd HH:mm:ss");
74 78
             result = outRecordService.queryTotal(page, rows, wareName, stackName, model, materialName, standard, customerName,
75
-                    plateNo,fromDate,toDate, userId, belongId,carNo,tallyPeople,ordNo,fkComponyName);
79
+                    plateNo,fromDate,toDate, userId, belongId,carNo,tallyPeople,ordNo,fkComponyName,contractNo,packNo);
76 80
         } catch (Exception ex) {
77 81
             ex.printStackTrace();
78 82
             result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());

+ 2
- 1
src/main/java/com/th/demo/controller/ware/StoreController.java 查看文件

@@ -103,6 +103,7 @@ public class StoreController {
103 103
                              String plateNo,
104 104
                              String ordNo,
105 105
                              String contractNo,
106
+                             String packNo,
106 107
                               HttpServletRequest request) {
107 108
 
108 109
         try {
@@ -116,7 +117,7 @@ public class StoreController {
116 117
                     standard,
117 118
                       customerName,
118 119
                     userId,
119
-                    belongId,plateNo,ordNo,contractNo,fkcustmerName);
120
+                    belongId,plateNo,ordNo,contractNo,fkcustmerName,packNo);
120 121
         } catch (Exception ex) {
121 122
             ex.printStackTrace();
122 123
             result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());

+ 6
- 2
src/main/java/com/th/demo/mapping/ware/InRecordMapper.java 查看文件

@@ -23,12 +23,16 @@ public interface InRecordMapper {
23 23
     //根据条件查询全部数据
24 24
     List<InRecord> select(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
25 25
                           String plateNo, Date fromDate,
26
-                          Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople, String fkComponyName);
26
+                          Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople,
27
+                          String fkComponyName,String contractNo,String packNo,List<String> pltNos,
28
+                          List<String> ordNos,List<String> contractNos,List<String> packNos);
27 29
 
28 30
     int updateIn(InRecord inRecord);
29 31
 
30 32
     List<TrackRecord> selectTrackRecord(String plateNo, String userId, String belongId);
31 33
 
32 34
     List<TotalRecord> selectTotal(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
33
-                                  String plateNo, Date fromDate, Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople, String fkComponyName);
35
+                                  String plateNo, Date fromDate, Date toDate, String userId, String belongId, String ordNo,
36
+                                  String carNo, String tallyPeople, String fkComponyName,String contractNo,String packNo,List<String> pltNos,
37
+                                  List<String> ordNos,List<String> contractNos,List<String> packNos);
34 38
 }

+ 8
- 3
src/main/java/com/th/demo/mapping/ware/OutRecordMapper.java 查看文件

@@ -20,11 +20,16 @@ public interface OutRecordMapper {
20 20
     int updateByPrimaryKey(OutRecord record);
21 21
 
22 22
     List<OutRecord>  select(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
23
-                            String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
23
+                            String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo,
24
+                            String tallyPeople, String ordNo, String fkComponyName);
24 25
     List<OutRecord>  selectExpt(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
25
-                            String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
26
+                            String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo,
27
+                                String tallyPeople, String ordNo, String fkComponyName,String contractNo,String packNo,List<String> pltNos,
28
+                                List<String> ordNos,List<String> contractNos,List<String> packNos);
26 29
     List<TotalRecord>  selectTotal(String wareName, String stackName, String layer, String materialName, String standard, String customerName,
27
-                                   String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
30
+                                   String plateNo, Date fromDate, Date toDate, String userId, String belongId,
31
+                                   String carNo, String tallyPeople, String ordNo, String fkComponyName,String contractNo,String packNo,List<String> pltNos,
32
+                                   List<String> ordNos,List<String> contractNos,List<String> packNos);
28 33
 
29 34
     int updateVerifyAccount(String id, String uuid);
30 35
 

+ 2
- 1
src/main/java/com/th/demo/mapping/ware/StoreMapper.java 查看文件

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

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

@@ -68,8 +68,10 @@ public class ChangeServiceImpl implements ChangeService {
68 68
             num += changeRecordMapper.insert(changeRecord);
69 69
 
70 70
 
71
-            list.get(i).setFkComponyId(list.get(i).getCustomer().getId());
72
-            list.get(i).setCustomer(c);
71
+//            list.get(i).setFkComponyId(list.get(i).getCustomer().getId());
72
+//            list.get(i).setCustomer(c);
73
+            list.get(i).setFkComponyId(c.getId());
74
+            list.get(i).setCustomer(list.get(i).getCustomer());
73 75
             list.get(i).setReceiveAddress(address);
74 76
             list.get(i).setChangeCount(list.get(i).getChangeCount()+1);
75 77
             num += storeMapper.updateFKByPKey(list.get(i));

+ 45
- 5
src/main/java/com/th/demo/service/impl/ware/InRecordServiceImpl.java 查看文件

@@ -12,6 +12,8 @@ import com.th.demo.tools.JSONTools;
12 12
 import org.springframework.beans.factory.annotation.Autowired;
13 13
 import org.springframework.stereotype.Service;
14 14
 
15
+import java.util.ArrayList;
16
+import java.util.Arrays;
15 17
 import java.util.Date;
16 18
 import java.util.List;
17 19
 
@@ -27,16 +29,36 @@ public class InRecordServiceImpl implements InRecordService {
27 29
     @Override
28 30
     public String query(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
29 31
                         String plateNo, Date fromDate,
30
-                        Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople, String fkComponyName) {
32
+                        Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople,
33
+                        String fkComponyName,String contractNo,String packNo) {
34
+        List<String> pltNos =new ArrayList<>() ;
35
+        List<String> ordNos =new ArrayList<>() ;
36
+        List<String> contractNos =new ArrayList<>() ;
37
+        List<String> packNos =new ArrayList<>() ;
38
+        if (plateNo.indexOf(",") != -1){
39
+            pltNos = Arrays.asList(plateNo.split(","));
40
+        }
41
+        if (ordNo.indexOf(",") != -1){
42
+            ordNos = Arrays.asList(ordNo.split(","));
43
+        }
44
+        if (contractNo.indexOf(",") != -1){
45
+            contractNos = Arrays.asList(contractNo.split(","));
46
+        }
47
+        if (packNo.indexOf(",") != -1){
48
+            packNos = Arrays.asList(packNo.split(","));
49
+        }
50
+
31 51
         if(page == -1 && rows == -1){
32 52
             List<InRecord> list=inRecordMapper.select(wareName,stackName,model,materialName,standard,    customerName,
33
-                    plateNo, fromDate,toDate , userId, belongId,ordNo,carNo,tallyPeople,fkComponyName);;
53
+                    plateNo, fromDate,toDate , userId, belongId,ordNo,carNo,tallyPeople,fkComponyName,
54
+                    contractNo,packNo,pltNos,ordNos,contractNos,packNos);
34 55
             result = JSONTools.toStringyyyyMMddHHmmss(list);
35 56
         }else{
36 57
             PageHelper.startPage(page, rows);
37 58
 
38 59
             List<InRecord> list=inRecordMapper.select(wareName,stackName,model,materialName,standard,    customerName,
39
-                    plateNo, fromDate,toDate , userId, belongId, ordNo, carNo,tallyPeople,fkComponyName);
60
+                    plateNo, fromDate,toDate , userId, belongId, ordNo, carNo,tallyPeople,fkComponyName,
61
+                    contractNo,packNo,pltNos,ordNos,contractNos,packNos);
40 62
 
41 63
             PageInfo<InRecord> pageInfo = new PageInfo<>(list);
42 64
             result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
@@ -60,9 +82,27 @@ public class InRecordServiceImpl implements InRecordService {
60 82
     }
61 83
     @Override
62 84
     public String queryTotal(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
63
-                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople, String fkComponyName) {
85
+                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String ordNo,
86
+                             String carNo, String tallyPeople, String fkComponyName, String contractNo,String packNo) {
87
+        List<String> pltNos =new ArrayList<>() ;
88
+        List<String> ordNos =new ArrayList<>() ;
89
+        List<String> contractNos =new ArrayList<>() ;
90
+        List<String> packNos =new ArrayList<>() ;
91
+        if (plateNo.indexOf(",") != -1){
92
+            pltNos = Arrays.asList(plateNo.split(","));
93
+        }
94
+        if (ordNo.indexOf(",") != -1){
95
+            ordNos = Arrays.asList(ordNo.split(","));
96
+        }
97
+        if (contractNo.indexOf(",") != -1){
98
+            contractNos = Arrays.asList(contractNo.split(","));
99
+        }
100
+        if (packNo.indexOf(",") != -1){
101
+            packNos = Arrays.asList(packNo.split(","));
102
+        }
64 103
         List<TotalRecord> list=inRecordMapper.selectTotal(wareName,stackName,model,materialName,standard,    customerName,
65
-                plateNo,fromDate,toDate,   userId, belongId,ordNo,carNo,tallyPeople,fkComponyName);
104
+                plateNo,fromDate,toDate,   userId, belongId,ordNo,carNo,tallyPeople,fkComponyName,
105
+                contractNo,packNo,pltNos,ordNos,contractNos,packNos);
66 106
         result = JSONTools.toStringyyyyMMddHHmmss(list);
67 107
         return result;
68 108
     }

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

@@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
22 22
 import org.springframework.stereotype.Service;
23 23
 
24 24
 
25
+import java.util.ArrayList;
26
+import java.util.Arrays;
25 27
 import java.util.Date;
26 28
 import java.util.List;
27 29
 
@@ -42,15 +44,34 @@ public class OutRecordServiceImpl implements OutRecordService {
42 44
     int num = 0;
43 45
 
44 46
     public String query(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
45
-                        String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName) {
47
+                        String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo,
48
+                        String tallyPeople, String ordNo, String fkComponyName, String contractNo, String packNo) {
49
+        List<String> pltNos =new ArrayList<>() ;
50
+        List<String> ordNos =new ArrayList<>() ;
51
+        List<String> contractNos =new ArrayList<>() ;
52
+        List<String> packNos =new ArrayList<>() ;
53
+        if (plateNo.indexOf(",") != -1){
54
+            pltNos = Arrays.asList(plateNo.split(","));
55
+        }
56
+        if (ordNo.indexOf(",") != -1){
57
+            ordNos = Arrays.asList(ordNo.split(","));
58
+        }
59
+        if (contractNo.indexOf(",") != -1){
60
+            contractNos = Arrays.asList(contractNo.split(","));
61
+        }
62
+        if (packNo.indexOf(",") != -1){
63
+            packNos = Arrays.asList(packNo.split(","));
64
+        }
46 65
         if(page == -1 && rows == -1){
47 66
             List<OutRecord> list=outRecordMapper.selectExpt(wareName,stackName,model,materialName,standard,  customerName,
48
-                    plateNo, fromDate,  toDate,   userId, belongId,carNo, tallyPeople,ordNo,fkComponyName);
67
+                    plateNo, fromDate,  toDate,   userId, belongId,carNo, tallyPeople,ordNo,fkComponyName,
68
+                    contractNo,packNo,pltNos,ordNos,contractNos,packNos);
49 69
             result = JSONTools.toStringyyyyMMddHHmmss(list);
50 70
         }else{
51 71
             PageHelper.startPage(page, rows);
52 72
             List<OutRecord> list=outRecordMapper.selectExpt(wareName,stackName,model,materialName,standard,  customerName,
53
-                    plateNo, fromDate,  toDate,   userId, belongId,carNo,tallyPeople,ordNo,fkComponyName);
73
+                    plateNo, fromDate,  toDate,   userId, belongId,carNo,tallyPeople,ordNo,fkComponyName,
74
+                    contractNo,packNo,pltNos,ordNos,contractNos,packNos);
54 75
             PageInfo<OutRecord> pageInfo = new PageInfo<>(list);
55 76
 //        result = JSONTools.toString(pageInfo);
56 77
             result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
@@ -59,9 +80,27 @@ public class OutRecordServiceImpl implements OutRecordService {
59 80
         return result;
60 81
     }
61 82
     public String queryTotal(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
62
-                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName) {
83
+                             String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo,
84
+                             String tallyPeople, String ordNo, String fkComponyName, String contractNo, String packNo) {
85
+        List<String> pltNos =new ArrayList<>() ;
86
+        List<String> ordNos =new ArrayList<>() ;
87
+        List<String> contractNos =new ArrayList<>() ;
88
+        List<String> packNos =new ArrayList<>() ;
89
+        if (plateNo.indexOf(",") != -1){
90
+            pltNos = Arrays.asList(plateNo.split(","));
91
+        }
92
+        if (ordNo.indexOf(",") != -1){
93
+            ordNos = Arrays.asList(ordNo.split(","));
94
+        }
95
+        if (contractNo.indexOf(",") != -1){
96
+            contractNos = Arrays.asList(contractNo.split(","));
97
+        }
98
+        if (packNo.indexOf(",") != -1){
99
+            packNos = Arrays.asList(packNo.split(","));
100
+        }
63 101
         List<TotalRecord> list=outRecordMapper.selectTotal(wareName,stackName,model,materialName,standard,  customerName,
64
-                plateNo,fromDate,toDate,   userId, belongId,carNo,tallyPeople,ordNo,fkComponyName);
102
+                plateNo,fromDate,toDate,   userId, belongId,carNo,tallyPeople,ordNo,fkComponyName,
103
+                contractNo,packNo,pltNos,ordNos,contractNos,packNos);
65 104
         result = JSONTools.toString(list);
66 105
         return result;
67 106
     }

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

@@ -96,50 +96,30 @@ public class OutServiceImpl implements OutService {
96 96
         });
97 97
         Stack stack = JSON.parseObject(to, new TypeReference<Stack>() {
98 98
         });
99
-        int currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(stack.getId(), belongId));
99
+        int currentLayer = 0;
100 100
         Store store;
101 101
         String noUserParam = "a";
102
-        if (stack.getIsLayer().equals("0")) {
103
-            for (int i = 0; i < listOutRecord.size(); i++) {
104
-                listOutRecord.get(i).setBackFlag("1");
105
-                num += outRecordMapper.updateByPrimaryKey(listOutRecord.get(i));
106
-                store = storeMapper.selectByOutId(listOutRecord.get(i).getId(), noUserParam,userId, belongId);
107
-                storeMapper.updateByOutId(listOutRecord.get(i).getId(), noUserParam, userId, belongId);
108
-                store.setOutFlag("0");
109
-                store.setOutId("");
110
-                store.setLayer(0);
111
-                store.setLockFlag("0");
112
-                store.setStack(stack);
113
-                OutRecord outRecord = getOutRecord(store, "", "0", userId);
114
-                num += outRecordMapper.insert(outRecord);
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);
120
-            }
121
-            result = Tools.moreThanZeroResultJSON(num);
122
-        } else {
123
-            for (int i = 0; i < listOutRecord.size(); i++) {
124
-                listOutRecord.get(i).setBackFlag("1");
125
-                num += outRecordMapper.updateByPrimaryKey(listOutRecord.get(i));
126
-                store = storeMapper.selectByOutId(listOutRecord.get(i).getId(), noUserParam, userId, belongId);
127
-                storeMapper.updateByOutId(listOutRecord.get(i).getId(), noUserParam, userId, belongId);
128
-                store.setOutFlag("0");   //孙雪松 取消出库恢复原有状态
129
-                store.setOutId("");
130
-                store.setLockFlag("0");
131
-                store.setLayer(currentLayer + i + 1);
132
-                store.setStack(stack);
133
-                OutRecord outRecord = getOutRecord(store, "", "0", userId);
134
-                num += outRecordMapper.insert(outRecord);
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);
140
-            }
141
-            result = Tools.moreThanZeroResultJSON(num);
102
+        for (int i = 0; i < listOutRecord.size(); i++) {
103
+            listOutRecord.get(i).setBackFlag("1");
104
+            listOutRecord.get(i).setCancelFlag("9");
105
+            num += outRecordMapper.updateByPrimaryKey(listOutRecord.get(i));
106
+            store = storeMapper.selectByOutId(listOutRecord.get(i).getId(), noUserParam, userId, belongId);
107
+            storeMapper.updateByOutId(listOutRecord.get(i).getId(), noUserParam, userId, belongId);
108
+            store.setOutFlag("0");   //孙雪松 取消出库恢复原有状态
109
+            store.setOutId("");
110
+            store.setLockFlag("0");
111
+            currentLayer = Integer.parseInt(storeMapper.selectLayerByStackId(store.getStack().getId(), belongId));
112
+            store.setLayer(currentLayer + 1);
113
+            //store.setStack(stack);
114
+            OutRecord outRecord = getOutRecord(store, "", "0", userId);
115
+            num += outRecordMapper.insert(outRecord);
116
+            num += storeMapper.insert(store);
117
+            Distribution distribution = distributionMapper.selectByPrimaryKey(listOutRecord.get(i).getDistributionId());
118
+            distribution.setSumWeight(distribution.getSumWeight()- store.getWeight());
119
+            distribution.setSumCount(distribution.getSumCount()- store.getCount());
120
+            num=distributionMapper.updateByPrimaryKey(distribution);
142 121
         }
122
+        result = Tools.moreThanZeroResultJSON(num);
143 123
         return result;
144 124
 
145 125
 
@@ -302,6 +282,7 @@ public class OutServiceImpl implements OutService {
302 282
 
303 283
         outRecord.setPackNo(store.getPackNo());
304 284
         outRecord.setContractNo(store.getContractNo());
285
+        outRecord.setOrdNo(store.getOrdNo());
305 286
 
306 287
         outRecord.setRemark(store.getRemark());
307 288
         outRecord.setBelongId(store.getBelongId());

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

@@ -91,10 +91,12 @@ public class StoreServiceImpl implements StoreService {
91 91
                              String plateNo,
92 92
                              String ordNo,
93 93
                              String contractNo,
94
-                             String fkcustmerName) {
94
+                             String fkcustmerName,
95
+                             String packNo) {
95 96
         List<String> pltNos =new ArrayList<>() ;
96 97
         List<String> ordNos =new ArrayList<>() ;
97 98
         List<String> contractNos =new ArrayList<>() ;
99
+        List<String> packNos =new ArrayList<>() ;
98 100
         if (plateNo.indexOf(",") != -1){
99 101
             pltNos = Arrays.asList(plateNo.split(","));
100 102
         }
@@ -104,15 +106,18 @@ public class StoreServiceImpl implements StoreService {
104 106
         if (contractNo.indexOf(",") != -1){
105 107
             contractNos = Arrays.asList(contractNo.split(","));
106 108
         }
109
+        if (packNo.indexOf(",") != -1){
110
+            packNos = Arrays.asList(packNo.split(","));
111
+        }
107 112
 
108 113
         if (page == -1 && rows == -1){
109 114
             List<Store> list=storeMapper.selectStore(wareName,stackName,model,materialName,standard,    customerName,   userId,belongId,
110
-                    fkcustmerName,plateNo,ordNo,contractNo,pltNos,ordNos,contractNos);
115
+                    fkcustmerName,plateNo,ordNo,contractNo,pltNos,ordNos,contractNos,packNo,packNos);
111 116
             result = JSONTools.toStringyyyyMMddHHmmss(list);
112 117
         }else {
113 118
             PageHelper.startPage(page, rows);
114 119
             List<Store> list=storeMapper.selectStore(wareName,stackName,model,materialName,standard,    customerName,   userId,belongId,
115
-                    fkcustmerName,plateNo,ordNo,contractNo,pltNos,ordNos,contractNos);
120
+                    fkcustmerName,plateNo,ordNo,contractNo,pltNos,ordNos,contractNos,packNo,packNos);
116 121
             PageInfo<Store> pageInfo = new PageInfo<>(list);
117 122
             result = JSONTools.toStringyyyyMMddHHmmss(pageInfo);
118 123
         }

+ 4
- 2
src/main/java/com/th/demo/service/ware/InRecordService.java 查看文件

@@ -5,10 +5,12 @@ import java.util.Date;
5 5
 public interface InRecordService {
6 6
     String query(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
7 7
                  String plateNo, Date fromDate,
8
-                 Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople, String fkComponyName);
8
+                 Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople,
9
+                 String fkComponyName, String contractNo,String packNo);
9 10
 
10 11
     String updateIn(String json, String userId, String belongId);
11 12
 
12 13
     String queryTotal(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
13
-                      String plateNo, Date fromDate, Date toDate, String userId, String belongId, String ordNo, String carNo, String tallyPeople, String fkComponyName);
14
+                      String plateNo, Date fromDate, Date toDate, String userId, String belongId, String ordNo,
15
+                      String carNo, String tallyPeople, String fkComponyName, String contractNo,String packNo);
14 16
 }

+ 4
- 2
src/main/java/com/th/demo/service/ware/OutRecordService.java 查看文件

@@ -5,9 +5,11 @@ import java.util.Date;
5 5
 public interface OutRecordService {
6 6
 
7 7
     String query(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
8
-                 String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
8
+                 String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo,
9
+                 String tallyPeople, String ordNo, String fkComponyName, String contractNo, String packNo);
9 10
     String queryTotal(int page, int rows, String wareName, String stackName, String model, String materialName, String standard, String customerName,
10
-                      String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo, String tallyPeople, String ordNo, String fkComponyName);
11
+                      String plateNo, Date fromDate, Date toDate, String userId, String belongId, String carNo,
12
+                      String tallyPeople, String ordNo, String fkComponyName, String contractNo, String packNo);
11 13
 
12 14
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
13 15
 

+ 1
- 1
src/main/java/com/th/demo/service/ware/StoreService.java 查看文件

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

+ 49
- 5
src/main/resource/mapper/ware/InRecordMapper.xml 查看文件

@@ -346,11 +346,8 @@
346 346
     <if test="param6 != null and param6 != ''" >
347 347
       and t.customer_name  = #{param6,jdbcType=VARCHAR}
348 348
     </if>
349
-
350
-      and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
351 349
       and t.add_time between #{param8,jdbcType=TIMESTAMP} and #{param9,jdbcType=TIMESTAMP}
352 350
     and t.cancel_flag = '0'
353
-    and ifnull(t.ord_no,'*') like concat('%',#{param12,jdbcType=VARCHAR},'%')
354 351
     and ifnull(t.car_no,'*') like concat('%',#{param13,jdbcType=VARCHAR},'%')
355 352
     and ((t.belong_id=#{param11,jdbcType=VARCHAR} and  t.ware_name in (
356 353
             select b.name from t_maint_userware a ,t_maint_ware b  where a.ware_id = b.id
@@ -358,6 +355,31 @@
358 355
             )  or t.customer_name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%') )
359 356
     and ifnull(t.tally_people,'*') like concat('%',#{param14,jdbcType=VARCHAR},'%')
360 357
     and ifnull(a.name,'*') like concat('%',#{param15,jdbcType=VARCHAR},'%')
358
+
359
+    and  (t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
360
+    <if test="param18 != null and param18.size() !=0" >
361
+      or t.plate_no IN <foreach  item="item" collection="param18" index="index"  open="(" separator="," close=")">
362
+      #{item,jdbcType=VARCHAR}  </foreach>
363
+    </if>
364
+    )
365
+    and  (t.ord_no like concat('%',#{param12,jdbcType=VARCHAR},'%')
366
+    <if test="param19 != null and param19.size() !=0" >
367
+      OR t.ord_no IN <foreach  item="item" collection="param19" index="index"  open="(" separator="," close=")">
368
+      #{item,jdbcType=VARCHAR}  </foreach>
369
+    </if>
370
+    )
371
+    and  (t.contract_no like concat('%',#{param16,jdbcType=VARCHAR},'%')
372
+    <if test="param20 != null and param20.size() !=0" >
373
+      OR t.contract_no IN <foreach  item="item" collection="param20" index="index"  open="(" separator="," close=")">
374
+      #{item,jdbcType=VARCHAR}  </foreach>
375
+    </if>
376
+    )
377
+    and  (t.pack_no like concat('%',#{param17,jdbcType=VARCHAR},'%')
378
+    <if test="param21 != null and param21.size() !=0" >
379
+      OR t.pack_no IN <foreach  item="item" collection="param21" index="index"  open="(" separator="," close=")">
380
+      #{item,jdbcType=VARCHAR}  </foreach>
381
+    </if>
382
+    )
361 383
     order by t.add_time desc
362 384
   </select>
363 385
 
@@ -375,10 +397,8 @@
375 397
     <if test="param6 != null and param6 != ''" >
376 398
       and t.customer_name = #{param6,jdbcType=VARCHAR}
377 399
     </if>
378
-    and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
379 400
     and t.add_time between #{param8,jdbcType=TIMESTAMP} and #{param9,jdbcType=TIMESTAMP}
380 401
     and t.cancel_flag = '0'
381
-    and ifnull(t.ord_no,'*') like concat('%',#{param12,jdbcType=VARCHAR},'%')
382 402
     and ifnull(t.car_no,'*') like concat('%',#{param13,jdbcType=VARCHAR},'%')
383 403
     and ((t.belong_id=#{param11,jdbcType=VARCHAR} and t.ware_name in (
384 404
             select b.name from t_maint_userware a ,t_maint_ware b  where a.ware_id = b.id
@@ -386,6 +406,30 @@
386 406
             )  or t.customer_name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%') )
387 407
     and ifnull(t.tally_people,'*') like concat('%',#{param14,jdbcType=VARCHAR},'%')
388 408
     and ifnull(a.name,'*') like concat('%',#{param15,jdbcType=VARCHAR},'%')
409
+    and  (t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
410
+    <if test="param18 != null and param18.size() !=0" >
411
+      or t.plate_no IN <foreach  item="item" collection="param18" index="index"  open="(" separator="," close=")">
412
+      #{item,jdbcType=VARCHAR}  </foreach>
413
+    </if>
414
+    )
415
+    and  (t.ord_no like concat('%',#{param12,jdbcType=VARCHAR},'%')
416
+    <if test="param19 != null and param19.size() !=0" >
417
+      OR t.ord_no IN <foreach  item="item" collection="param19" index="index"  open="(" separator="," close=")">
418
+      #{item,jdbcType=VARCHAR}  </foreach>
419
+    </if>
420
+    )
421
+    and  (t.contract_no like concat('%',#{param16,jdbcType=VARCHAR},'%')
422
+    <if test="param20 != null and param20.size() !=0" >
423
+      OR t.contract_no IN <foreach  item="item" collection="param20" index="index"  open="(" separator="," close=")">
424
+      #{item,jdbcType=VARCHAR}  </foreach>
425
+    </if>
426
+    )
427
+    and  (t.pack_no like concat('%',#{param17,jdbcType=VARCHAR},'%')
428
+    <if test="param21 != null and param21.size() !=0" >
429
+      OR t.pack_no IN <foreach  item="item" collection="param21" index="index"  open="(" separator="," close=")">
430
+      #{item,jdbcType=VARCHAR}  </foreach>
431
+    </if>
432
+    )
389 433
     order by t.add_time desc
390 434
   </select>
391 435
 

+ 54
- 11
src/main/resource/mapper/ware/OutRecordMapper.xml 查看文件

@@ -125,7 +125,7 @@
125 125
       modify_id, modify_time, cancel_id, 
126 126
       cancel_time, cancel_flag, belong_id, 
127 127
       plate_no,in_id, record_type,back_flag,receive_address,distribution_id
128
-    ,wgt_dcn_mtc_cd,edge_ty,production_place,tally_people,invoice_price,pack_no,contract_no)
128
+    ,wgt_dcn_mtc_cd,edge_ty,production_place,tally_people,invoice_price,pack_no,contract_no,ord_no)
129 129
     values (#{id,jdbcType=VARCHAR}, #{wareName,jdbcType=VARCHAR}, #{stackName,jdbcType=VARCHAR}, 
130 130
       #{layer,jdbcType=INTEGER}, #{materialName,jdbcType=VARCHAR}, #{materialNo,jdbcType=VARCHAR}, 
131 131
       #{standard,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, 
@@ -136,7 +136,7 @@
136 136
     #{plateNo,jdbcType=VARCHAR},  #{inId,jdbcType=VARCHAR}, #{recordType,jdbcType=VARCHAR},
137 137
     #{backFlag,jdbcType=VARCHAR}, #{receiveAddress,jdbcType=VARCHAR}, #{distributionId,jdbcType=VARCHAR}
138 138
     ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE},
139
-    #{packNo,jdbcType=VARCHAR},#{contractNo,jdbcType=VARCHAR})
139
+    #{packNo,jdbcType=VARCHAR},#{contractNo,jdbcType=VARCHAR},#{ordNo,jdbcType=VARCHAR})
140 140
   </insert>
141 141
   <insert id="insertSelective" parameterType="com.th.demo.model.ware.OutRecord" >
142 142
     insert into t_ware_out_record
@@ -431,7 +431,7 @@
431 431
     select
432 432
       sum(t.count) as total_amount
433 433
       ,sum(t.weight) as total_weight
434
-    from t_ware_out_record t,t_ware_distribution p,(select t.plate_no,max(t.ord_no) ord_no from t_ware_store t group by t.plate_no) c,t_ware_in_record d LEFT JOIN t_maint_customer e on d.fk_compony_name = e.id
434
+    from t_ware_out_record t,t_ware_distribution p,t_ware_in_record d LEFT JOIN t_maint_customer e on d.fk_compony_name = e.id
435 435
     where  t.ware_name  like concat('%',#{param1,jdbcType=VARCHAR},'%')
436 436
     and t.stack_name like concat('%',#{param2,jdbcType=VARCHAR},'%')
437 437
     and t.model like concat('%',#{param3,jdbcType=INTEGER},'%')
@@ -440,10 +440,8 @@
440 440
     <if test="param6 != null and param6 != ''" >
441 441
       and t.customer_name = #{param6,jdbcType=VARCHAR}
442 442
     </if>
443
-    and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
444 443
     and t.add_time between #{param8,jdbcType=TIMESTAMP} and #{param9,jdbcType=TIMESTAMP}
445 444
     and t.distribution_id = p.id
446
-    and t.plate_no = c.plate_no
447 445
     and t.in_id = d.id
448 446
     and p.truck_no like concat('%',#{param12,jdbcType=VARCHAR},'%')
449 447
     and t.cancel_flag = '0'
@@ -452,18 +450,41 @@
452 450
             and  a.user_id = #{param10,jdbcType=VARCHAR}  )
453 451
             )  or t.customer_name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%') )
454 452
     and ifnull(p.tally_people,'*') like concat('%',#{param13,jdbcType=VARCHAR},'%')
455
-    and ifnull(c.ord_no,'*') like concat('%',#{param14,jdbcType=VARCHAR},'%')
456 453
     and ifnull(e.name,'*') like concat('%',#{param15,jdbcType=VARCHAR},'%')
457 454
     and ifnull(t.back_flag,0) &lt;> '1'
455
+    and  (t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
456
+    <if test="param18 != null and param18.size() !=0" >
457
+      or t.plate_no IN <foreach  item="item" collection="param18" index="index"  open="(" separator="," close=")">
458
+      #{item,jdbcType=VARCHAR}  </foreach>
459
+    </if>
460
+    )
461
+    and  (t.ord_no like concat('%',#{param14,jdbcType=VARCHAR},'%')
462
+    <if test="param19 != null and param19.size() !=0" >
463
+      OR t.ord_no IN <foreach  item="item" collection="param19" index="index"  open="(" separator="," close=")">
464
+      #{item,jdbcType=VARCHAR}  </foreach>
465
+    </if>
466
+    )
467
+    and  (t.contract_no like concat('%',#{param16,jdbcType=VARCHAR},'%')
468
+    <if test="param20 != null and param20.size() !=0" >
469
+      OR t.contract_no IN <foreach  item="item" collection="param20" index="index"  open="(" separator="," close=")">
470
+      #{item,jdbcType=VARCHAR}  </foreach>
471
+    </if>
472
+    )
473
+    and  (t.pack_no like concat('%',#{param17,jdbcType=VARCHAR},'%')
474
+    <if test="param21 != null and param21.size() !=0" >
475
+      OR t.pack_no IN <foreach  item="item" collection="param21" index="index"  open="(" separator="," close=")">
476
+      #{item,jdbcType=VARCHAR}  </foreach>
477
+    </if>
478
+    )
458 479
     order by t.add_time desc
459 480
   </select>
460 481
   <select id="selectExpt" resultMap="CleanResultMap" >
461 482
     select
462
-    e.name as fk_compony_name,p.tally_people as tally_people,p.truck_no as out_car_no,f.user_desc as add_id,t.*,c.ord_no,DATE_FORMAT(d.add_time, '%Y-%m-%d %H:%i:%s') as in_time
483
+    e.name as fk_compony_name,p.tally_people as tally_people,p.truck_no as out_car_no,f.user_desc as add_id,t.*,DATE_FORMAT(d.add_time, '%Y-%m-%d %H:%i:%s') as in_time
463 484
     ,(select tt.user_desc as in_user from sys_user tt where tt.id = d.add_id) as in_user,d.car_no as in_car_no
464 485
     ,t.invoice_price,t.distribution_id
465 486
     from t_ware_out_record t LEFT JOIN sys_user f on t.add_id = f.id
466
-    ,t_ware_distribution p,(select t.plate_no,max(t.ord_no) ord_no from t_ware_store t group by t.plate_no) c,t_ware_in_record d
487
+    ,t_ware_distribution p,t_ware_in_record d
467 488
     LEFT JOIN t_maint_customer e on d.fk_compony_name = e.id
468 489
 
469 490
     where t.ware_name  like concat('%',#{param1,jdbcType=VARCHAR},'%')
@@ -474,10 +495,8 @@
474 495
     <if test="param6 != null and param6 != ''" >
475 496
       and t.customer_name  = #{param6,jdbcType=VARCHAR}
476 497
     </if>
477
-    and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
478 498
     and t.add_time between #{param8,jdbcType=TIMESTAMP} and #{param9,jdbcType=TIMESTAMP}
479 499
     and t.distribution_id = p.id
480
-    and t.plate_no = c.plate_no
481 500
     and t.in_id = d.id
482 501
     and p.truck_no like concat('%',#{param12,jdbcType=VARCHAR},'%')
483 502
     and t.cancel_flag = '0'
@@ -486,9 +505,33 @@
486 505
     and  a.user_id = #{param10,jdbcType=VARCHAR}  )
487 506
     )  or t.customer_name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%') )
488 507
     and ifnull(p.tally_people,'*') like concat('%',#{param13,jdbcType=VARCHAR},'%')
489
-    and ifnull(c.ord_no,'*') like concat('%',#{param14,jdbcType=VARCHAR},'%')
490 508
     and ifnull(e.name,'*') like concat('%',#{param15,jdbcType=VARCHAR},'%')
491 509
     and ifnull(t.back_flag,0) &lt;> '1'
510
+
511
+    and  (t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
512
+    <if test="param18 != null and param18.size() !=0" >
513
+      or t.plate_no IN <foreach  item="item" collection="param18" index="index"  open="(" separator="," close=")">
514
+      #{item,jdbcType=VARCHAR}  </foreach>
515
+    </if>
516
+    )
517
+    and  (t.ord_no like concat('%',#{param14,jdbcType=VARCHAR},'%')
518
+    <if test="param19 != null and param19.size() !=0" >
519
+      OR t.ord_no IN <foreach  item="item" collection="param19" index="index"  open="(" separator="," close=")">
520
+      #{item,jdbcType=VARCHAR}  </foreach>
521
+    </if>
522
+    )
523
+    and  (t.contract_no like concat('%',#{param16,jdbcType=VARCHAR},'%')
524
+    <if test="param20 != null and param20.size() !=0" >
525
+      OR t.contract_no IN <foreach  item="item" collection="param20" index="index"  open="(" separator="," close=")">
526
+      #{item,jdbcType=VARCHAR}  </foreach>
527
+    </if>
528
+    )
529
+    and  (t.pack_no like concat('%',#{param17,jdbcType=VARCHAR},'%')
530
+    <if test="param21 != null and param21.size() !=0" >
531
+      OR t.pack_no IN <foreach  item="item" collection="param21" index="index"  open="(" separator="," close=")">
532
+      #{item,jdbcType=VARCHAR}  </foreach>
533
+    </if>
534
+    )
492 535
     order by t.add_time desc
493 536
   </select>
494 537
 </mapper>

+ 6
- 0
src/main/resource/mapper/ware/StoreMapper.xml 查看文件

@@ -515,6 +515,12 @@ update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
515 515
       #{item,jdbcType=VARCHAR}  </foreach>
516 516
     </if>
517 517
     )
518
+    and  (t.pack_no like concat('%',#{param16,jdbcType=VARCHAR},'%')
519
+    <if test="param17 != null and param17.size() !=0" >
520
+      OR t.pack_no IN <foreach  item="item" collection="param17" index="index"  open="(" separator="," close=")">
521
+      #{item,jdbcType=VARCHAR}  </foreach>
522
+    </if>
523
+    )
518 524
     and t.belong_id = #{param8,jdbcType=VARCHAR}
519 525
     and t.cancel_flag = '0'
520 526
     and t.out_flag = '0'

Loading…
取消
儲存