2 コミット

作成者 SHA1 メッセージ 日付
  YL2767 cf9c23a8d2 1111 2週間前
  YL2767 fd3802c350 1111 2週間前

+ 34
- 0
src/main/java/com/th/demo/controller/ware/StoreController.java ファイルの表示

@@ -204,4 +204,38 @@ public class StoreController {
204 204
         }
205 205
     }
206 206
 
207
+    @RequestMapping(value = "/lockAndUnlock.do")
208
+    public String lockAndUnlock(String json,String lockFlag,
209
+                              HttpServletRequest request) {
210
+
211
+        try {
212
+            String userId = (String) request.getAttribute("userId");
213
+            String belongId = (String) request.getAttribute("belongId");
214
+            result=storeService.lockAndUnlock(json,lockFlag,userId,belongId);
215
+
216
+        } catch (Exception ex) {
217
+            ex.printStackTrace();
218
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
219
+        } finally {
220
+            return result;
221
+        }
222
+    }
223
+
224
+    @RequestMapping(value = "/Outbound.do")
225
+    public String Outbound(String json,String outbound,
226
+                       HttpServletRequest request) {
227
+
228
+        try {
229
+            String userId = (String) request.getAttribute("userId");
230
+            String belongId = (String) request.getAttribute("belongId");
231
+            result=storeService.Outbound(json,outbound,userId,belongId);
232
+
233
+        } catch (Exception ex) {
234
+            ex.printStackTrace();
235
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
236
+        } finally {
237
+            return result;
238
+        }
239
+    }
240
+
207 241
 }

+ 2
- 0
src/main/java/com/th/demo/mapping/ware/DistributionDetailMapper.java ファイルの表示

@@ -21,4 +21,6 @@ public interface DistributionDetailMapper {
21 21
    List<DistributionDetail> selectByFid(String distributionId);
22 22
 
23 23
     int updateCancelFlagById(Map<String,Object> map);
24
+
25
+    List<DistributionDetail> selectByStoreId(String storeId);
24 26
 }

+ 2
- 0
src/main/java/com/th/demo/mapping/ware/StoreMapper.java ファイルの表示

@@ -57,4 +57,6 @@ public interface StoreMapper {
57 57
     void updateByOutId(String id, String noUserParam, String userId, String belongId);
58 58
 
59 59
     int updateFKByPKey(Store store);
60
+
61
+    int updateOutBoundByPrimaryKey(Store record);
60 62
 }

+ 10
- 0
src/main/java/com/th/demo/model/ware/Store.java ファイルの表示

@@ -102,6 +102,8 @@ public class Store  implements Comparable<Store>{
102 102
 
103 103
     private String payWay;
104 104
 
105
+    private String OutBound;
106
+
105 107
 
106 108
     public Double getInvoicePrice() {
107 109
         return invoicePrice;
@@ -576,6 +578,14 @@ public class Store  implements Comparable<Store>{
576 578
         this.changeCount = changeCount;
577 579
     }
578 580
 
581
+    public String getOutBound() {
582
+        return OutBound;
583
+    }
584
+
585
+    public void setOutBound(String outBound) {
586
+        OutBound = outBound;
587
+    }
588
+
579 589
     @Override
580 590
     public int compareTo(Store o) {
581 591
         if (this.layer > o.getLayer()) {

+ 36
- 4
src/main/java/com/th/demo/service/impl/ware/StoreServiceImpl.java ファイルの表示

@@ -6,10 +6,7 @@ import com.github.pagehelper.PageHelper;
6 6
 import com.github.pagehelper.PageInfo;
7 7
 import com.th.demo.mapping.maint.CustomerMapper;
8 8
 import com.th.demo.mapping.maint.StackMapper;
9
-import com.th.demo.mapping.ware.ChangeRecordMapper;
10
-import com.th.demo.mapping.ware.InRecordMapper;
11
-import com.th.demo.mapping.ware.MoveRecordMapper;
12
-import com.th.demo.mapping.ware.StoreMapper;
9
+import com.th.demo.mapping.ware.*;
13 10
 import com.th.demo.model.maint.Customer;
14 11
 import com.th.demo.model.maint.Stack;
15 12
 import com.th.demo.model.system.SysUser;
@@ -43,6 +40,8 @@ public class StoreServiceImpl implements StoreService {
43 40
     public MoveRecordMapper moveRecordMapper;
44 41
     @Autowired//自动注入Mapper
45 42
     public StackMapper stackMapper;
43
+    @Autowired//自动注入Mapper
44
+    public DistributionDetailMapper distributionDetailMapper;
46 45
     String result = Type.FAIL;
47 46
     int num = 0;
48 47
 
@@ -391,6 +390,39 @@ public class StoreServiceImpl implements StoreService {
391 390
         return result;
392 391
     }
393 392
 
393
+    @Override
394
+    public String lockAndUnlock(String json,String lockFlag,String userId,String belongId) {
395
+        List<Store> listStore = JSON.parseObject(json, new TypeReference<List<Store>>() {});
396
+        if (lockFlag.equals("0")  ){
397
+            for (int i = 0; i < listStore.size(); i++) {
398
+                List<DistributionDetail> distributionDetailList = distributionDetailMapper.selectByStoreId(listStore.get(i).getId());
399
+                if (distributionDetailList.size()>0){
400
+                    return JSONTools.toString(1,"存在配车封锁,此类封锁无法解封,请配车取消解除封锁");
401
+                }
402
+                listStore.get(i).setLockFlag(lockFlag);
403
+                num += storeMapper.updateByPrimaryKey(listStore.get(i));
404
+            }
405
+        } else if (lockFlag.equals("1")) {
406
+            for (int i = 0; i < listStore.size(); i++) {
407
+                listStore.get(i).setLockFlag(lockFlag);
408
+                num += storeMapper.updateByPrimaryKey(listStore.get(i));
409
+            }
410
+        }
411
+        result = Tools.moreThanZeroResultJSON(num);
412
+        return result;
413
+    }
414
+
415
+    @Override
416
+    public String Outbound(String json,String outbound,String userId,String belongId) {
417
+        List<Store> listStore = JSON.parseObject(json, new TypeReference<List<Store>>() {});
418
+        for (int i = 0; i < listStore.size(); i++) {
419
+            listStore.get(i).setOutBound(outbound);
420
+            num += storeMapper.updateOutBoundByPrimaryKey(listStore.get(i));
421
+        }
422
+        result = Tools.moreThanZeroResultJSON(num);
423
+        return result;
424
+    }
425
+
394 426
     private MoveRecord getMoveRecord(Store store, Stack fromStack, Stack toStack, int layerNew, int layerOld, String userId) {
395 427
         MoveRecord moveRecord = new MoveRecord();
396 428
         moveRecord.setWareNameOld(fromStack.getWare().getName());

+ 4
- 0
src/main/java/com/th/demo/service/ware/StoreService.java ファイルの表示

@@ -32,4 +32,8 @@ public interface StoreService {
32 32
 
33 33
     String changeStack(String json,String newWare,String newStack,String newRemark1,
34 34
                        String newRemark, String userId,String belongId);
35
+
36
+    String lockAndUnlock(String json,String lockFlag,String userId,String belongId);
37
+
38
+    String Outbound(String json,String outbound,String userId,String belongId);
35 39
 }

+ 4
- 4
src/main/resource/localhost/db.properties ファイルの表示

@@ -8,7 +8,7 @@
8 8
 #jdbc.user=root
9 9
 #jdbc.password=root
10 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
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 ファイルの表示

@@ -115,4 +115,11 @@
115 115
     and ifnull(cancel_flag,'0') = '0'
116 116
   </select>
117 117
 
118
+  <select id="selectByStoreId" resultMap="BaseResultMap">
119
+    select *
120
+    from t_ware_distribution_detail
121
+    where store_id = #{param1,jdbcType=VARCHAR}
122
+    and ifnull(cancel_flag,'0') = '0'
123
+  </select>
124
+
118 125
 </mapper>

+ 7
- 0
src/main/resource/mapper/ware/StoreMapper.xml ファイルの表示

@@ -55,6 +55,8 @@
55 55
 
56 56
     <result column="change_count" property="changeCount" jdbcType="DOUBLE" />
57 57
 
58
+    <result column="out_bound" property="outBound" jdbcType="VARCHAR" />
59
+
58 60
 
59 61
     <association  column="ware_id" property="ware" select="com.th.demo.mapping.maint.WareMapper.selectByPrimaryKey" />
60 62
     <association  column="stack_id" property="stack" select="com.th.demo.mapping.maint.StackMapper.selectByPrimaryKey" />
@@ -616,4 +618,9 @@ update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
616 618
       and t.plate_no = #{param1,jdbcType=VARCHAR};
617 619
 
618 620
   </select>
621
+
622
+  <update id="updateOutBoundByPrimaryKey" parameterType="com.th.demo.model.ware.Store" >
623
+    update  t_ware_store t
624
+    set t.out_bound = #{outBound,jdbcType=VARCHAR} where t.id = #{id,jdbcType=VARCHAR}
625
+  </update>
619 626
 </mapper>

読み込み中…
キャンセル
保存