wms成品部分修改32

master
mengjiao 9 months ago
parent 90b4eac108
commit 5ca685d78e

@ -340,6 +340,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
String formattedDate = dateFormat.format(date);//批次 String formattedDate = dateFormat.format(date);//批次
//List<WmsProductPut> wmsProductPutList= new ArrayList<>(); //List<WmsProductPut> wmsProductPutList= new ArrayList<>();
List<wmsReportWork> wmsReportWorkList = new ArrayList<>(); List<wmsReportWork> wmsReportWorkList = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListTWO = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListRk = new ArrayList<>(); List<wmsReportWork> wmsReportWorkListRk = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListagain = new ArrayList<>(); List<wmsReportWork> wmsReportWorkListagain = new ArrayList<>();
//获取当前所选工厂 //获取当前所选工厂
@ -362,12 +363,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutk.setStatus("1"); wmsProductPutk.setStatus("1");
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit()); wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());// wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
wmsProductPutk.setSapStatus("2");//过账失败的 // wmsProductPutk.setSapStatus("2");//过账失败的
List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
if (wmsProductPutList.size() > 0) { if (wmsProductPutList.size() > 0) {
String id = wmsProductPutList.get(0).getId(); String id = wmsProductPutList.get(0).getId();
mesReportWork.setId(id); mesReportWork.setId(id);
wmsReportWorkList.add(mesReportWork);//已经插入过并且过账失败的 wmsReportWorkList.add(mesReportWork);//已经插入
} else { } else {
wmsReportWorkListRk.add(mesReportWork);//第一次的 wmsReportWorkListRk.add(mesReportWork);//第一次的
} }
@ -387,11 +388,33 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
// wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit()); // wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
// wmsProductPutk.setBatchNumber(mesReportWork.getBatch());// // wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
// wmsProductPutk.setSapStatus("2"); // wmsProductPutk.setSapStatus("2");
// List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); // List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
// if (wmsProductPutList.size() > 0) { // if (wmsProductPutList.size() > 0) {//已经插入
wmsReportWorkListagain.add(mesReportWork);// wmsReportWorkListagain.add(mesReportWork);//
// } // }
}
for (wmsReportWork mesReportWork :
wmsReportWorkList) {
WmsProductPut wmsProductPutk = new WmsProductPut();
wmsProductPutk.setWorkOrder(mesReportWork.getReportCode());
wmsProductPutk.setFactoryCode(factoryCode);
wmsProductPutk.setWhCode(mesReportWork.getWhCode());//仓库编码
wmsProductPutk.setProductName(mesReportWork.getProductName());
wmsProductPutk.setProductCode(mesReportWork.getProductCode());
wmsProductPutk.setProductOrder(mesReportWork.getWorkorderCodeSap());
wmsProductPutk.setPlanQuantity(mesReportWork.getQuantityFeedback());
wmsProductPutk.setPutQuantity(mesReportWork.getQuantityQualified());
wmsProductPutk.setStatus("1");
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
wmsProductPutk.setSapStatus("2");
List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
if (wmsProductPutList.size() > 0) {//已经插入且失败的
wmsReportWorkListTWO.add(mesReportWork);//
} }
}
//先屏蔽起来 //先屏蔽起来
for (wmsReportWork mesReportWork : for (wmsReportWork mesReportWork :
wmsReportWorkListRk) { wmsReportWorkListRk) {
@ -494,10 +517,10 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2); wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
} }
} }
if (wmsReportWorkList.size() > 0) { if (wmsReportWorkListTWO.size() > 0) {
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
for (wmsReportWork mesReportWork : for (wmsReportWork mesReportWork :
wmsReportWorkList) { wmsReportWorkListTWO) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("AUFNR", mesReportWork.getWorkorderCodeSap()); map.put("AUFNR", mesReportWork.getWorkorderCodeSap());
map.put("WERKS", factoryCode); map.put("WERKS", factoryCode);
@ -515,7 +538,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
int code = result.getCode(); int code = result.getCode();
String msg = result.getMsg(); String msg = result.getMsg();
for (wmsReportWork mesReportWork : for (wmsReportWork mesReportWork :
wmsReportWorkList) { wmsReportWorkListTWO) {
WmsProductPut wmsProductPut2 = new WmsProductPut(); WmsProductPut wmsProductPut2 = new WmsProductPut();
wmsProductPut2.setId(mesReportWork.getId()); wmsProductPut2.setId(mesReportWork.getId());
wmsProductPut2.setSapMessage(msg); wmsProductPut2.setSapMessage(msg);

@ -81,6 +81,7 @@
<if test="attr9 != null and attr9 != ''">and attr9 = #{attr9}</if> <if test="attr9 != null and attr9 != ''">and attr9 = #{attr9}</if>
<if test="attr10 != null and attr10 != ''">and attr10 = #{attr10}</if> <if test="attr10 != null and attr10 != ''">and attr10 = #{attr10}</if>
</where> </where>
ORDER BY create_time DESC
</select> </select>
<select id="selectWmsProductPutById" parameterType="String" resultMap="WmsProductPutResult"> <select id="selectWmsProductPutById" parameterType="String" resultMap="WmsProductPutResult">
@ -325,6 +326,10 @@
mes_report_work.end_report mes_report_work.end_report
</select> </select>
<!-- <select id="selectWmsProductPutNum" resultType="java.lang.String">-->
<!-- </select>-->
<select id="selectWmsProductPutSAPByProDuct" parameterType="String" resultMap="WmsProductPutResult"> <select id="selectWmsProductPutSAPByProDuct" parameterType="String" resultMap="WmsProductPutResult">
SELECT DISTINCT SELECT DISTINCT
wms_product_put.id, wms_product_put.id,
@ -379,4 +384,5 @@
#{item.id} #{item.id}
</foreach> </foreach>
</update> </update>
</mapper> </mapper>

Loading…
Cancel
Save