Преглед изворни кода

1.新增修改收货地址功能

2.新增货权转移地址修改判断
dw пре 3 месеци
родитељ
комит
ad776e0059

+ 21
- 0
src/main/java/com/th/demo/controller/ware/StoreController.java Прегледај датотеку

@@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
11 11
 import org.springframework.web.bind.annotation.RestController;
12 12
 
13 13
 import javax.servlet.http.HttpServletRequest;
14
+import java.util.Arrays;
15
+import java.util.List;
14 16
 
15 17
 @RestController
16 18
 @RequestMapping(value = "/WareStore")
@@ -199,4 +201,23 @@ public class StoreController {
199 201
             return result;
200 202
         }
201 203
     }
204
+
205
+
206
+    /**
207
+     * 根据id修改(入库表,库存表)收货地址
208
+     */
209
+    @RequestMapping(value = "/modifyReceiveAddress.do")
210
+    public String modifyReceiveAddress(String id,String inId, String receiveAddressNew){
211
+        try {
212
+            List<String> list = Arrays.asList(id.split(","));
213
+            List<String> inList = Arrays.asList(inId.split(","));
214
+
215
+            result=storeService.modifyReceiveAddress(list,inList,receiveAddressNew);
216
+        } catch (Exception ex) {
217
+            ex.printStackTrace();
218
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
219
+        } finally {
220
+            return result;
221
+        }
222
+    }
202 223
 }

+ 11
- 0
src/main/java/com/th/demo/mapping/ware/StoreMapper.java Прегледај датотеку

@@ -4,6 +4,7 @@ import com.th.demo.model.ware.SplitRecord;
4 4
 import com.th.demo.model.ware.Store;
5 5
 import com.th.demo.model.ware.StoreOfWareStack;
6 6
 import com.th.demo.model.ware.TotalRecord;
7
+import org.apache.ibatis.annotations.Param;
7 8
 
8 9
 import java.util.List;
9 10
 import java.util.Map;
@@ -61,4 +62,14 @@ public interface StoreMapper {
61 62
     int selectByOutIdNum(String id);
62 63
 
63 64
     int updateInDtmByInId(String id,Date ChangeInDtm);
65
+
66
+    /**
67
+     *  修改库存表收货地址
68
+     */
69
+    int  updateAddressById(@Param("id") List<String> id,@Param( "address") String  address);
70
+
71
+    /**
72
+     * 修改入库表收货地址
73
+     */
74
+    int  updateInAddressById(@Param( "inId") List<String> inId,@Param( "address") String  address);
64 75
 }

+ 8
- 1
src/main/java/com/th/demo/service/impl/ware/ChangeServiceImpl.java Прегледај датотеку

@@ -96,7 +96,14 @@ public class ChangeServiceImpl implements ChangeService {
96 96
             num += changeRecordMapper.insert(changeRecord);
97 97
             list.get(i).setCustomer(c);
98 98
             list.get(i).setFkComponyId(fk_cus.getId());
99
-            list.get(i).setReceiveAddress(address);
99
+//            新增判断 地址为空不做处理 地址不为空时 0:清空地址 其他:更新地址
100
+            if (address!=null && !address.equals("")){
101
+                if(address.equals("0")){
102
+                    list.get(i).setReceiveAddress("");
103
+                } else {
104
+                    list.get(i).setReceiveAddress(address);
105
+                }
106
+            }
100 107
             num += storeMapper.updateByPrimaryKey(list.get(i));
101 108
             num += storeMapper.updateFkById(list.get(i));
102 109
             use_weight = use_weight + list.get(i).getWeight();

+ 18
- 0
src/main/java/com/th/demo/service/impl/ware/StoreServiceImpl.java Прегледај датотеку

@@ -341,6 +341,8 @@ public class StoreServiceImpl implements StoreService {
341 341
         return result;
342 342
     }
343 343
 
344
+
345
+
344 346
     private MoveRecord getMoveRecord(Store store, Stack fromStack, Stack toStack, int layerNew, int layerOld, String userId) {
345 347
         MoveRecord moveRecord = new MoveRecord();
346 348
         moveRecord.setWareNameOld(fromStack.getWare().getName());
@@ -369,4 +371,20 @@ public class StoreServiceImpl implements StoreService {
369 371
         moveRecord.setCancelFlag("0");
370 372
         return moveRecord;
371 373
     }
374
+
375
+    /**
376
+     * 修改收货地址
377
+     * @param id
378
+     * @param inId
379
+     * @param newCustomerAddress
380
+     * @return
381
+     */
382
+    @Override
383
+    public String modifyReceiveAddress(List<String> id, List<String> inId, String newCustomerAddress) {
384
+//        修改库存表收货地址
385
+        int i = storeMapper.updateAddressById(id,newCustomerAddress);
386
+//        修改入库表收货地址
387
+        int i1 = storeMapper.updateInAddressById(inId, newCustomerAddress);
388
+        return result;
389
+    }
372 390
 }

+ 7
- 0
src/main/java/com/th/demo/service/ware/StoreService.java Прегледај датотеку

@@ -2,6 +2,8 @@ package com.th.demo.service.ware;
2 2
 
3 3
 import com.th.demo.model.ware.Store;
4 4
 
5
+import java.util.List;
6
+
5 7
 public interface StoreService {
6 8
     String queryLayerByStackId(String stackId, String userId, String belongId);
7 9
 
@@ -23,4 +25,9 @@ public interface StoreService {
23 25
 
24 26
     String changeCustName(String json,String newCustomername,String newFKCustomername,
25 27
                           String userId,String belongId);
28
+
29
+    /**
30
+     * 修改收货地址
31
+     */
32
+    String modifyReceiveAddress(List<String> id, List<String> inId, String newCustomerAddress);
26 33
 }

+ 18
- 0
src/main/resource/mapper/ware/StoreMapper.xml Прегледај датотеку

@@ -581,4 +581,22 @@ update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
581 581
     set add_time = #{param2,jdbcType=TIMESTAMP}
582 582
     where in_id = #{param1,jdbcType=VARCHAR}
583 583
   </update>
584
+
585
+    <update id="updateAddressById">
586
+        update t_ware_store
587
+        set receive_address = #{address,jdbcType=VARCHAR}
588
+        where id in
589
+        <foreach collection="id" item="item" index="index" open="(" separator="," close=")">
590
+            #{item,jdbcType=VARCHAR}
591
+        </foreach>
592
+    </update>
593
+
594
+    <update id="updateInAddressById">
595
+        update t_ware_in_record
596
+        set receive_address = #{address,jdbcType=VARCHAR}
597
+        where id in
598
+        <foreach collection="inId" item="item" index="index" open="(" separator="," close=")">
599
+            #{item,jdbcType=VARCHAR}
600
+        </foreach>
601
+    </update>
584 602
 </mapper>

Loading…
Откажи
Сачувај