This commit is contained in:
2022-11-17 10:33:00 +08:00
parent 65a85d9285
commit 2874adc42c
9 changed files with 101 additions and 9 deletions

View File

@@ -278,15 +278,15 @@ public class LmsToMesServiceImpl implements LmsToMesService {
return result;
}
String contain_name = param.getString("contain_name");
String container_name = param.getString("container_name");
String package_box_sn = param.getString("package_box_sn");
String warehouse = param.getString("warehouse");
JSONObject jo = new JSONObject();
jo.put("ContainerName",contain_name);
jo.put("ContainerName",container_name);
jo.put("isSourceRollDeliveryComplete",1);
jo.put("PackageBoxSN",package_box_sn);
jo.put("PackageBoxSN",warehouse);
jo.put("Warehouse",warehouse);
// String url = acsUrl + api;
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();

View File

@@ -7,16 +7,20 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.ext.mes.service.LmsToMesService;
import org.nl.wms.pda.mps.service.BakingService;
import org.nl.wms.pda.mps.service.PointStatusService;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@Service
@RequiredArgsConstructor
@Slf4j
public class PointStatusServiceImpl implements PointStatusService {
private final LmsToMesService lmsToMesService;
@Override
public JSONObject pointOperate(JSONObject whereJson) {
@@ -64,6 +68,21 @@ public class PointStatusServiceImpl implements PointStatusService {
}
}
WQLObject.getWQLObject("ST_IVT_CutPointIvt").update(cut_point);
JSONObject cut_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("parent_container_name = '"+container_name+"' AND IFNULL(is_parent_ok,'0') = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(cut_jo)){
//更新该母卷对应分切计划的状态
HashMap<String,String> map = new HashMap<>();
map.put("is_parent_ok","1");
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map,"parent_container_name = '"+container_name+"'");
//回传MES
JSONObject mom_jo = new JSONObject();
mom_jo.put("contain_name",container_name);
mom_jo.put("warehouse","1");
lmsToMesService.cutPlanMomRollDeliveryComplete(mom_jo);
}
}
//2-解绑
if (option.equals("2")) {

View File

@@ -3,10 +3,12 @@ package org.nl.wms.pda.st.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
@@ -16,6 +18,7 @@ import org.nl.wms.pda.st.service.ProductInstorService;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.tasks.InTask;
import org.nl.wms.st.inbill.service.RawAssistIStorService;
import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.inbill.service.impl.InbillServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -37,6 +40,8 @@ public class ProductInstorServiceImpl implements ProductInstorService {
private final RawAssistIStorService rawAssistIStorService;
private final StorPublicService storPublicService;
@Override
public JSONObject boxQuery(JSONObject whereJson) {
String box_no = whereJson.getString("box_no");
@@ -82,6 +87,9 @@ public class ProductInstorServiceImpl implements ProductInstorService {
WQLObject.getWQLObject("pdm_bi_subpackagerelation").update(sub_map, "package_box_SN = '" + box_no + "'");
}
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
//如果是入虚拟库直接入库并确认,如果是入成品库则生成入库单,生成一个二楼去一楼的任务
JSONObject mst_jo = new JSONObject();
mst_jo.put("tableData", box_rows);
@@ -122,6 +130,47 @@ public class ProductInstorServiceImpl implements ProductInstorService {
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "iostorinv_id = '" + iostorinv_id + "'");
//修改库存
//直接取出入库分配表的库存
mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' AND box_no = '" + map.get("box_no") + "'").getResultJSONArray(0);
for (int i = 0; i < dis_rows.size(); i++) {
JSONObject dis_jo = dis_rows.getJSONObject(i);
JSONObject i_form = new JSONObject();
i_form.put("struct_id", dis_jo.getString("struct_id"));
i_form.put("material_id", dis_jo.getString("material_id"));
i_form.put("pcsn", dis_jo.getString("pcsn"));
i_form.put("change_qty", dis_jo.getString("plan_qty"));
i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
i_form.put("quality_scode", "01");
i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
i_form.put("bill_code", mst_jo.getString("bill_code"));
i_form.put("bill_table", "ST_IVT_IOStorInv");
i_form.put("qty_unit_id", dis_jo.getString("qty_unit_id"));
i_form.put("qty_unit_name", dis_jo.getString("qty_unit_name"));
storPublicService.IOStor(i_form, "31");
//更新明细表状态
JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "'").uniqueResult(0);
if (dtl_jo.getDoubleValue("unassign_qty") == 0) {
//判断该明细下是否还存在未分配货位的分配明细
JSONArray disdiv_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "' AND (struct_id = '' OR struct_id is null) AND (point_id = '' OR point_id is null)").getResultJSONArray(0);
if (disdiv_rows.size() == 0) {
dtl_jo.put("bill_status", "40");
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
//判断主表下的明细是否都为40
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + dis_jo.getString("iostorinv_id") + "' AND bill_status < '40'").getResultJSONArray(0);
if (dtl_rows.size() == 0) {
mst_jo.put("bill_status", "40");
mst_jo.put("dis_optid", currentUserId);
mst_jo.put("dis_optname", nickName);
mst_jo.put("dis_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
}
}
}
}
//调用入库分配确认方法
InbillServiceImpl inbillService = SpringContextHolder.getBean(InbillServiceImpl.class);
JSONObject dis_form = new JSONObject();

View File

@@ -14,6 +14,7 @@ import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.mes.service.LmsToMesService;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.sch.AcsTaskDto;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum;
@@ -159,6 +160,17 @@ public class CoolCutTask extends AbstractAcsTask {
jsonCoolIvt2.put("update_optname", currentUsername);
jsonCoolIvt2.put("update_time", DateUtil.now());
WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2);
//更新该母卷对应分切计划的状态
HashMap<String,String> map = new HashMap<>();
map.put("is_parent_ok","1");
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map,"parent_container_name = '"+container_name+"'");
//回传MES
JSONObject mom_jo = new JSONObject();
mom_jo.put("contain_name",container_name);
mom_jo.put("warehouse","1");
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mom_jo);
}
if (jsonTask.getString("task_type").equals("010302")) {
@@ -190,6 +202,17 @@ public class CoolCutTask extends AbstractAcsTask {
cut_jo.put("update_optname", currentUsername);
cut_jo.put("update_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_CutPointIvt").update(cut_jo);
//更新该母卷对应分切计划的状态
HashMap<String,String> map = new HashMap<>();
map.put("is_parent_ok","1");
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map,"parent_container_name = '"+container_name+"'");
//回传MES
JSONObject mom_jo = new JSONObject();
mom_jo.put("contain_name",container_name);
mom_jo.put("warehouse","1");
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mom_jo);
}
if (jsonTask.getString("task_type").equals("010303")) {

View File

@@ -134,7 +134,7 @@ public class InbillServiceImpl {
}
//更新目的点位,仓位、加库存
JSONArray dis_rows = dis_table.query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
JSONArray dis_rows = dis_table.query("iostorinv_id = '" + iostorinv_id + "' AND work_status < '99'").getResultJSONArray(0);
for (int i = 0; i < dis_rows.size(); i++) {
JSONObject dis_row = dis_rows.getJSONObject(i);
JSONObject point_form = new JSONObject();

View File

@@ -33,7 +33,7 @@ public class InAndOutReturnlController {
@PostMapping("/upload")
@Log("回传")
@ApiOperation("回传")
public ResponseEntity<Object> upload(@RequestBody Map whereJson) {
public ResponseEntity<Object> upload(@RequestBody JSONObject whereJson) {
inAndOutReturnService.upload(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}

View File

@@ -16,7 +16,7 @@ public interface InAndOutReturnService {
*/
Map<String, Object> pageQuery(Map whereJson, Pageable page);
void upload(Map whereJson);
void upload(JSONObject whereJson);
void uploadMES(Map whereJson);

View File

@@ -19,6 +19,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@@ -65,7 +66,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
}
@Override
public void upload(Map whereJson) {
public void upload(JSONObject whereJson) {
//出库分配表
WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
//出库明细表
@@ -77,9 +78,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
//根据出入单类型判断回传业务
//1、生产入库回传MES手工入库回传SAP
//1、销售出库回传MES、SAP改切出库回传SAP
JSONArray rows = (JSONArray) whereJson.get("rows");
JSONArray rows = whereJson.getJSONArray("rows");
for (int i = 0; i < rows.size(); i++) {
JSONObject jo_mst = new JSONObject();
JSONObject jo_mst = rows.getJSONObject(i);
String isUpload = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("is_upload").getValue();
if (StrUtil.equals(isUpload, "1")) {
String bill_type = jo_mst.getString("bill_type");