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);//批次
//List<WmsProductPut> wmsProductPutList= new ArrayList<>();
List<wmsReportWork> wmsReportWorkList = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListTWO = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListRk = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListagain = new ArrayList<>();
//获取当前所选工厂
@ -362,12 +363,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutk.setStatus("1");
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
wmsProductPutk.setSapStatus("2");//过账失败的
// wmsProductPutk.setSapStatus("2");//过账失败的
List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
if (wmsProductPutList.size() > 0) {
String id = wmsProductPutList.get(0).getId();
mesReportWork.setId(id);
wmsReportWorkList.add(mesReportWork);//已经插入过并且过账失败的
wmsReportWorkList.add(mesReportWork);//已经插入
} else {
wmsReportWorkListRk.add(mesReportWork);//第一次的
}
@ -388,10 +389,32 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
// wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
// wmsProductPutk.setSapStatus("2");
// List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
// if (wmsProductPutList.size() > 0) {
// if (wmsProductPutList.size() > 0) {//已经插入
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 :
wmsReportWorkListRk) {
@ -494,10 +517,10 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
}
}
if (wmsReportWorkList.size() > 0) {
if (wmsReportWorkListTWO.size() > 0) {
List<Map<String, Object>> mapList = new ArrayList<>();
for (wmsReportWork mesReportWork :
wmsReportWorkList) {
wmsReportWorkListTWO) {
Map<String, Object> map = new HashMap<>();
map.put("AUFNR", mesReportWork.getWorkorderCodeSap());
map.put("WERKS", factoryCode);
@ -515,7 +538,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
int code = result.getCode();
String msg = result.getMsg();
for (wmsReportWork mesReportWork :
wmsReportWorkList) {
wmsReportWorkListTWO) {
WmsProductPut wmsProductPut2 = new WmsProductPut();
wmsProductPut2.setId(mesReportWork.getId());
wmsProductPut2.setSapMessage(msg);

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

Loading…
Cancel
Save