浏览代码

明晋仓储管理修改内容

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

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

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

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

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

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

+ 16
- 0
src/main/java/com/th/demo/controller/ware/OutRecordController.java 查看文件

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 查看文件

57
     int updateFkById(Store store);
57
     int updateFkById(Store store);
58
 
58
 
59
     int selectByInId(String id);
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 查看文件

104
     }
104
     }
105
 
105
 
106
 public void lockAndInsertDetail(  List<Store> list,  Distribution distribution , String userId, String belongId){
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
     for (int i = 0; i < list.size(); i++) {
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
     public DistributionDetail getDistributionDetail(Distribution distribution, Store store, String userId, String belongId) {
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 查看文件

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

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

7
 import com.th.demo.mapping.finance.ModPriceLogMapper;
7
 import com.th.demo.mapping.finance.ModPriceLogMapper;
8
 import com.th.demo.mapping.finance.VerifyAccountMapper;
8
 import com.th.demo.mapping.finance.VerifyAccountMapper;
9
 import com.th.demo.mapping.ware.OutRecordMapper;
9
 import com.th.demo.mapping.ware.OutRecordMapper;
10
+import com.th.demo.mapping.ware.StoreMapper;
10
 import com.th.demo.model.finance.ModPriceLog;
11
 import com.th.demo.model.finance.ModPriceLog;
11
 import com.th.demo.model.finance.VerifyAccount;
12
 import com.th.demo.model.finance.VerifyAccount;
12
 import com.th.demo.model.system.Type;
13
 import com.th.demo.model.system.Type;
14
+import com.th.demo.model.ware.InRecord;
13
 import com.th.demo.model.ware.OutRecord;
15
 import com.th.demo.model.ware.OutRecord;
14
 import com.th.demo.model.ware.Store;
16
 import com.th.demo.model.ware.Store;
15
 import com.th.demo.model.ware.TotalRecord;
17
 import com.th.demo.model.ware.TotalRecord;
35
 
37
 
36
     @Autowired
38
     @Autowired
37
     public ModPriceLogMapper modPriceLogMapper;
39
     public ModPriceLogMapper modPriceLogMapper;
40
+    @Autowired
41
+    public StoreMapper storeMapper;
38
 
42
 
39
     String result = Type.FAIL;
43
     String result = Type.FAIL;
40
     int num = 0;
44
     int num = 0;
162
         }
166
         }
163
         return Tools.moreThanZeroResultJSON(num);
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 查看文件

14
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
14
     String saveVerifyAcc(String json, String accWgt, String accAmt, String invoiceAmt, String accDate, String accReminder, String userId, String belongId);
15
 
15
 
16
     String savePriceMod(String json, String modPrice, String userId, String belongId);
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 查看文件

4
 #jdbc.password=root
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
 #jdbc.driverClass=com.mysql.jdbc.Driver
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
 #jdbc.user=root
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 查看文件

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

+ 4
- 4
src/main/resource/mapper/ware/OutRecordMapper.xml 查看文件

107
     from t_ware_out_record
107
     from t_ware_out_record
108
     where id = #{id,jdbcType=VARCHAR}
108
     where id = #{id,jdbcType=VARCHAR}
109
   </select>
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
   <insert id="insert" parameterType="com.th.demo.model.ware.OutRecord" >
114
   <insert id="insert" parameterType="com.th.demo.model.ware.OutRecord" >
115
     <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
115
     <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
116
       SELECT  REPLACE(UUID(),'-','') as id from dual
116
       SELECT  REPLACE(UUID(),'-','') as id from dual

+ 9
- 0
src/main/resource/mapper/ware/StoreMapper.xml 查看文件

550
       select count(*)
550
       select count(*)
551
       from t_ware_store t
551
       from t_ware_store t
552
       where t.cancel_flag = '0'
552
       where t.cancel_flag = '0'
553
+        and IFNULL(t.out_flag,'0') = '0'
553
       and t.plate_no = #{param1,jdbcType=VARCHAR};
554
       and t.plate_no = #{param1,jdbcType=VARCHAR};
554
 
555
 
555
   </select>
556
   </select>
566
       and t.in_id = #{param1,jdbcType=VARCHAR};
567
       and t.in_id = #{param1,jdbcType=VARCHAR};
567
 
568
 
568
   </select>
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
 </mapper>
578
 </mapper>

正在加载...
取消
保存