张庆宇 3 周前
父节点
当前提交
d03d8dcbfd

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

23
     int updateCancelFlagById(Map<String,Object> map);
23
     int updateCancelFlagById(Map<String,Object> map);
24
 
24
 
25
     List<DistributionDetail> selectByStoreId(String storeId);
25
     List<DistributionDetail> selectByStoreId(String storeId);
26
+
27
+    int updateByStoreAndDis(String distributionId,String storeId);
28
+
26
 }
29
 }

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

45
     @Autowired
45
     @Autowired
46
     public DistributionMapper distributionMapper;
46
     public DistributionMapper distributionMapper;
47
     @Autowired
47
     @Autowired
48
+    public DistributionDetailMapper distributionDetailMapper;
49
+    @Autowired
48
     public AccountDetailMapper accountDetailMapper;
50
     public AccountDetailMapper accountDetailMapper;
49
     @Autowired
51
     @Autowired
50
     public ChangeRecordMapper changeRecordMapper;
52
     public ChangeRecordMapper changeRecordMapper;
117
             store.setLayer(currentLayer + 1);
119
             store.setLayer(currentLayer + 1);
118
             //store.setStack(stack);
120
             //store.setStack(stack);
119
             OutRecord outRecord = getOutRecord(store, "", "0", userId);
121
             OutRecord outRecord = getOutRecord(store, "", "0", userId);
122
+            //取消出库之后配车明细中进行删除
123
+            num += distributionDetailMapper.updateByStoreAndDis(listOutRecord.get(i).getDistributionId(),store.getId());
120
             num += outRecordMapper.insert(outRecord);
124
             num += outRecordMapper.insert(outRecord);
121
             num += storeMapper.insert(store);
125
             num += storeMapper.insert(store);
126
+
122
             Distribution distribution = distributionMapper.selectByPrimaryKey(listOutRecord.get(i).getDistributionId());
127
             Distribution distribution = distributionMapper.selectByPrimaryKey(listOutRecord.get(i).getDistributionId());
123
             distribution.setSumWeight(distribution.getSumWeight()- store.getWeight());
128
             distribution.setSumWeight(distribution.getSumWeight()- store.getWeight());
124
             distribution.setSumCount(distribution.getSumCount()- store.getCount());
129
             distribution.setSumCount(distribution.getSumCount()- store.getCount());
135
     public String outByDistribution(String json, String userId, String belongId) throws Exception {
140
     public String outByDistribution(String json, String userId, String belongId) throws Exception {
136
         Distribution distribution1 = JSON.parseObject(json, new TypeReference<Distribution>() {
141
         Distribution distribution1 = JSON.parseObject(json, new TypeReference<Distribution>() {
137
         });
142
         });
143
+        String pay_for = "";
144
+        double pay_money = 0;
138
         Distribution distribution = distributionMapper.selectByPrimaryKey(distribution1.getId());
145
         Distribution distribution = distributionMapper.selectByPrimaryKey(distribution1.getId());
139
         if (distribution.getOutFlag().equals("1")){
146
         if (distribution.getOutFlag().equals("1")){
140
             return JSONTools.toString(1,"该车已出库,请勿重复操作");
147
             return JSONTools.toString(1,"该车已出库,请勿重复操作");
164
                     for (int i = 0; i < listStore.size(); i++) {
171
                     for (int i = 0; i < listStore.size(); i++) {
165
                         Store store = storeMapper.selectByPrimaryKey(listStore.get(i).getId());
172
                         Store store = storeMapper.selectByPrimaryKey(listStore.get(i).getId());
166
                         OutRecord outRecord = getOutRecord(store, distribution.getId(), "1", userId);
173
                         OutRecord outRecord = getOutRecord(store, distribution.getId(), "1", userId);
174
+                        if (outRecord.getPayWay().equals("现金")){
175
+                            pay_for="现金";
176
+                            pay_money = pay_money+outRecord.getInvoicePrice();
177
+                        }
167
                         num += outRecordMapper.insert(outRecord);
178
                         num += outRecordMapper.insert(outRecord);
168
                         AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
179
                         AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
169
                         num += accountDetailMapper.insert(accountDetail);
180
                         num += accountDetailMapper.insert(accountDetail);
180
                     for (int i = 0; i < listStore.size(); i++) {
191
                     for (int i = 0; i < listStore.size(); i++) {
181
                         Store store = storeMapper.selectByPrimaryKey(listStore.get(i).getId());
192
                         Store store = storeMapper.selectByPrimaryKey(listStore.get(i).getId());
182
                         OutRecord outRecord = getOutRecord(store, distribution.getId(), "1", userId);
193
                         OutRecord outRecord = getOutRecord(store, distribution.getId(), "1", userId);
194
+                        if (outRecord.getPayWay().equals("现金")){
195
+                            pay_for="现金";
196
+                            pay_money = pay_money+outRecord.getInvoicePrice();
197
+                        }
183
                         num += outRecordMapper.insert(outRecord);
198
                         num += outRecordMapper.insert(outRecord);
184
 
199
 
185
                         AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
200
                         AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
193
                     result = Tools.moreThanZeroResultJSON(num);
208
                     result = Tools.moreThanZeroResultJSON(num);
194
                 }
209
                 }
195
             }
210
             }
211
+
212
+        }
213
+        if (pay_for.equals("现金")){
214
+            result = result.substring(0, result.length() - 1) + ",\"payWay\":\"" + pay_for + "\",\"InvoicePrice\":" + pay_money + "}";
215
+
196
         }
216
         }
197
 
217
 
198
         return result;
218
         return result;

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

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

+ 7
- 0
src/main/resource/mapper/ware/DistributionDetailMapper.xml 查看文件

122
     and ifnull(cancel_flag,'0') = '0'
122
     and ifnull(cancel_flag,'0') = '0'
123
   </select>
123
   </select>
124
 
124
 
125
+  <update id="updateByStoreAndDis" >
126
+    update t_ware_distribution_detail
127
+    set cancel_flag = '9'
128
+    where distribution_id = #{param1,jdbcType=VARCHAR}
129
+      and store_id = #{param2,jdbcType=VARCHAR}
130
+  </update>
131
+
125
 </mapper>
132
 </mapper>

正在加载...
取消
保存