张庆宇 3 hafta önce
ebeveyn
işleme
d03d8dcbfd

+ 3
- 0
src/main/java/com/th/demo/mapping/ware/DistributionDetailMapper.java Dosyayı Görüntüle

@@ -23,4 +23,7 @@ public interface DistributionDetailMapper {
23 23
     int updateCancelFlagById(Map<String,Object> map);
24 24
 
25 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 Dosyayı Görüntüle

@@ -45,6 +45,8 @@ public class OutServiceImpl implements OutService {
45 45
     @Autowired
46 46
     public DistributionMapper distributionMapper;
47 47
     @Autowired
48
+    public DistributionDetailMapper distributionDetailMapper;
49
+    @Autowired
48 50
     public AccountDetailMapper accountDetailMapper;
49 51
     @Autowired
50 52
     public ChangeRecordMapper changeRecordMapper;
@@ -117,8 +119,11 @@ public class OutServiceImpl implements OutService {
117 119
             store.setLayer(currentLayer + 1);
118 120
             //store.setStack(stack);
119 121
             OutRecord outRecord = getOutRecord(store, "", "0", userId);
122
+            //取消出库之后配车明细中进行删除
123
+            num += distributionDetailMapper.updateByStoreAndDis(listOutRecord.get(i).getDistributionId(),store.getId());
120 124
             num += outRecordMapper.insert(outRecord);
121 125
             num += storeMapper.insert(store);
126
+
122 127
             Distribution distribution = distributionMapper.selectByPrimaryKey(listOutRecord.get(i).getDistributionId());
123 128
             distribution.setSumWeight(distribution.getSumWeight()- store.getWeight());
124 129
             distribution.setSumCount(distribution.getSumCount()- store.getCount());
@@ -135,6 +140,8 @@ public class OutServiceImpl implements OutService {
135 140
     public String outByDistribution(String json, String userId, String belongId) throws Exception {
136 141
         Distribution distribution1 = JSON.parseObject(json, new TypeReference<Distribution>() {
137 142
         });
143
+        String pay_for = "";
144
+        double pay_money = 0;
138 145
         Distribution distribution = distributionMapper.selectByPrimaryKey(distribution1.getId());
139 146
         if (distribution.getOutFlag().equals("1")){
140 147
             return JSONTools.toString(1,"该车已出库,请勿重复操作");
@@ -164,6 +171,10 @@ public class OutServiceImpl implements OutService {
164 171
                     for (int i = 0; i < listStore.size(); i++) {
165 172
                         Store store = storeMapper.selectByPrimaryKey(listStore.get(i).getId());
166 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 178
                         num += outRecordMapper.insert(outRecord);
168 179
                         AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
169 180
                         num += accountDetailMapper.insert(accountDetail);
@@ -180,6 +191,10 @@ public class OutServiceImpl implements OutService {
180 191
                     for (int i = 0; i < listStore.size(); i++) {
181 192
                         Store store = storeMapper.selectByPrimaryKey(listStore.get(i).getId());
182 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 198
                         num += outRecordMapper.insert(outRecord);
184 199
 
185 200
                         AccountDetail accountDetail = getAccountDetail(listStore.get(i), distribution.getSumWeight(), distribution.getSuttle(), userId, belongId);
@@ -193,6 +208,11 @@ public class OutServiceImpl implements OutService {
193 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 218
         return result;

+ 7
- 7
src/main/resource/localhost/db.properties Dosyayı Görüntüle

@@ -3,12 +3,12 @@
3 3
 #jdbc.user=root
4 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 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 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 Dosyayı Görüntüle

@@ -122,4 +122,11 @@
122 122
     and ifnull(cancel_flag,'0') = '0'
123 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 132
 </mapper>

Loading…
İptal
Kaydet