Explorar el Código

明晋仓储管理修改内容

出库记录界面增加记录删除功能;(已完成)

库存操作界面调整按钮位置,将"导出记录"按钮移至"修改垛位备注"后面;(已完成)

出库记录界面增加"更多操作"按钮,该按钮中包含"取消出库"和"删除记录"按钮,以及增加确认功能,防止误操作;(已完成)

入库记录界面增加"更多操作"按钮,该按钮中包含"取消出库"和"删除记录"按钮,以及增加确认功能,防止误操作;(已完成)

修复逻辑内容
返修材料可以入库,(已完成)
货权转移的时候无论增加还是减少都不要保留上次的客户名,(已完成)
配货增加限制,防止出现配货配重的情况(已完成)

说明内容:出库记录界面和入库记录界面的删除功能只能删除多余的信息,并不会将正在使用的信息删除
例子,一块板子按照以下次序操作,入库->取消入库->再入库,入库界面出现三条记录,此时全部选中点击删除记录的话,只会删除第一次的入库记录和取消入库的记录,最后一次的入库记录是不会删除的。
YL2767 hace 2 meses
padre
commit
aa6d3d337d

+ 16
- 0
src/main/java/com/th/demo/controller/ware/OutRecordController.java Ver fichero

@@ -125,5 +125,21 @@ public class OutRecordController {
125 125
         }
126 126
     }
127 127
 
128
+    @RequestMapping(value = "/deleterecord.do" , method = RequestMethod.POST)
129
+    public String deleterecord(String json,
130
+                               HttpServletRequest request) {
131
+
132
+        try {
133
+            String userId = (String) request.getAttribute("userId");
134
+            String belongId = (String) request.getAttribute("belongId");
135
+            result = outRecordService.deleteRecord(json,userId,belongId);
136
+        } catch (Exception ex) {
137
+            ex.printStackTrace();
138
+            result = JSONTools.toString(ResponseCodeMsg.CODE_EX, ex.getMessage());
139
+        } finally {
140
+            return result;
141
+        }
142
+    }
143
+
128 144
 
129 145
 }

+ 1
- 0
src/main/java/com/th/demo/mapping/ware/StoreMapper.java Ver fichero

@@ -57,4 +57,5 @@ public interface StoreMapper {
57 57
     int updateFkById(Store store);
58 58
 
59 59
     int selectByInId(String id);
60
+    int selectByOutIdNum(String id);
60 61
 }

+ 16
- 6
src/main/java/com/th/demo/service/impl/ware/DistributionServiceImpl.java Ver fichero

@@ -104,13 +104,23 @@ public class DistributionServiceImpl implements DistributionService {
104 104
     }
105 105
 
106 106
 public void lockAndInsertDetail(  List<Store> list,  Distribution distribution , String userId, String belongId){
107
+    // 重新获取ID,第一次配车的时候会出现没有ID的情况
108
+    Distribution distribution1 = distributionMapper.selectByTruckNo(distribution.getTruckNo(), belongId);
107 109
     for (int i = 0; i < list.size(); i++) {
108
-        list.get(i).setLockFlag("1");
109
-        num += storeMapper.updateByPrimaryKey(list.get(i));
110
-        DistributionDetail detail = getDistributionDetail(distribution, list.get(i), userId, belongId);
111
-        num += distributionDetailMapper.insert(detail);
112
-        DistributionRecord record  = getDistributionRecord(distribution, list.get(i), "1",userId, belongId);
113
-        num += distributionRecordMapper.insert(record);
110
+        Store store = storeMapper.selectByPrimaryKey(list.get(i).getId());
111
+        // 存在赋值为空的情况,追加一次赋值
112
+        // 2025.4.20 数据库增加默认为0的修改临时解决,此处其他项目中要注意
113
+        if (store.getLockFlag() == null || store.getLockFlag() == ""){
114
+            store.setLockFlag("0");
115
+        }
116
+        if (!store.getLockFlag().equals("1") && distribution1.getId() != null && distribution1.getId() != ""){
117
+            list.get(i).setLockFlag("1");
118
+            num += storeMapper.updateByPrimaryKey(list.get(i));
119
+            DistributionDetail detail = getDistributionDetail(distribution1, list.get(i), userId, belongId);
120
+            num += distributionDetailMapper.insert(detail);
121
+            DistributionRecord record  = getDistributionRecord(distribution1, list.get(i), "1",userId, belongId);
122
+            num += distributionRecordMapper.insert(record);
123
+        }
114 124
     }
115 125
 }
116 126
     public DistributionDetail getDistributionDetail(Distribution distribution, Store store, String userId, String belongId) {

+ 2
- 0
src/main/java/com/th/demo/service/impl/ware/InServiceImpl.java Ver fichero

@@ -117,6 +117,8 @@ public class InServiceImpl implements InService {
117 117
             }else{
118 118
                 storeArray.add(listStore.get(i).getPlateNo());
119 119
             }
120
+            // 修改sql内容判断是否在库的时候增加out_flag的判断
121
+            // 出过库的可以重复入库
120 122
             int effStoreCnt = storeMapper.selEffStore(listStore.get(i).getPlateNo());
121 123
             if(effStoreCnt > 0){
122 124
                 return JSONTools.toString(1,"库存中已存在板号"+listStore.get(i).getPlateNo()+",请勿重复入库");

+ 20
- 0
src/main/java/com/th/demo/service/impl/ware/OutRecordServiceImpl.java Ver fichero

@@ -7,9 +7,11 @@ import com.github.pagehelper.PageInfo;
7 7
 import com.th.demo.mapping.finance.ModPriceLogMapper;
8 8
 import com.th.demo.mapping.finance.VerifyAccountMapper;
9 9
 import com.th.demo.mapping.ware.OutRecordMapper;
10
+import com.th.demo.mapping.ware.StoreMapper;
10 11
 import com.th.demo.model.finance.ModPriceLog;
11 12
 import com.th.demo.model.finance.VerifyAccount;
12 13
 import com.th.demo.model.system.Type;
14
+import com.th.demo.model.ware.InRecord;
13 15
 import com.th.demo.model.ware.OutRecord;
14 16
 import com.th.demo.model.ware.Store;
15 17
 import com.th.demo.model.ware.TotalRecord;
@@ -35,6 +37,8 @@ public class OutRecordServiceImpl implements OutRecordService {
35 37
 
36 38
     @Autowired
37 39
     public ModPriceLogMapper modPriceLogMapper;
40
+    @Autowired
41
+    public StoreMapper storeMapper;
38 42
 
39 43
     String result = Type.FAIL;
40 44
     int num = 0;
@@ -162,6 +166,22 @@ public class OutRecordServiceImpl implements OutRecordService {
162 166
         }
163 167
         return Tools.moreThanZeroResultJSON(num);
164 168
     }
169
+
170
+    @Override
171
+    public String deleteRecord(String json, String userId, String belongId){
172
+        List<OutRecord> outRecords = JSON.parseObject(json, new TypeReference<List<OutRecord>>() {
173
+        });
174
+        for (int i = 0; i < outRecords.size(); i++) {
175
+            int num  =storeMapper.selectByOutIdNum(outRecords.get(i).getId());
176
+            if(num == 0 ){
177
+                outRecords.get(i).setCancelFlag("1");
178
+                num = outRecordMapper.deleteByPrimaryKey(outRecords.get(i).getId());
179
+            }
180
+            result = JSONTools.toString(num);
181
+        }
182
+
183
+        return result;
184
+    }
165 185
 }
166 186
 
167 187
 

+ 2
- 0
src/main/java/com/th/demo/service/ware/OutRecordService.java Ver fichero

@@ -14,4 +14,6 @@ public interface OutRecordService {
14 14
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
15 15
 
16 16
     String savePriceMod(String json, String modPrice, String userId, String belongId);
17
+
18
+    String deleteRecord(String json, String userId, String belongId);
17 19
 }

+ 7
- 7
src/main/resource/localhost/db.properties Ver fichero

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

+ 1
- 0
src/main/resource/mapper/ware/CargoChangeRecordMapper.xml Ver fichero

@@ -61,6 +61,7 @@
61 61
     from t_ware_cargochange_record
62 62
     where uper_customer_id = #{param1,jdbcType=VARCHAR}
63 63
     and customer_id = #{param2,jdbcType=VARCHAR}
64
+    order by modify_time desc
64 65
   </select>
65 66
 
66 67
 

+ 4
- 4
src/main/resource/mapper/ware/OutRecordMapper.xml Ver fichero

@@ -107,10 +107,10 @@
107 107
     from t_ware_out_record
108 108
     where id = #{id,jdbcType=VARCHAR}
109 109
   </select>
110
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
111
-    delete from t_ware_out_record
112
-    where id = #{id,jdbcType=VARCHAR}
113
-  </delete>
110
+  <update id="deleteByPrimaryKey" parameterType="java.lang.String" >
111
+    update t_ware_out_record set cancel_flag = '1'
112
+    where id = #{param1,jdbcType=VARCHAR}
113
+  </update>
114 114
   <insert id="insert" parameterType="com.th.demo.model.ware.OutRecord" >
115 115
     <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
116 116
       SELECT  REPLACE(UUID(),'-','') as id from dual

+ 9
- 0
src/main/resource/mapper/ware/StoreMapper.xml Ver fichero

@@ -550,6 +550,7 @@ update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
550 550
       select count(*)
551 551
       from t_ware_store t
552 552
       where t.cancel_flag = '0'
553
+        and IFNULL(t.out_flag,'0') = '0'
553 554
       and t.plate_no = #{param1,jdbcType=VARCHAR};
554 555
 
555 556
   </select>
@@ -566,4 +567,12 @@ update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
566 567
       and t.in_id = #{param1,jdbcType=VARCHAR};
567 568
 
568 569
   </select>
570
+
571
+  <select id="selectByOutIdNum" resultType="java.lang.Integer" parameterType="java.lang.String">
572
+    select COUNT(*)
573
+    from t_ware_store t
574
+    where t.cancel_flag = '0'
575
+      and t.out_id = #{param1,jdbcType=VARCHAR};
576
+
577
+  </select>
569 578
 </mapper>

Loading…
Cancelar
Guardar