Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.nl.modules.common.exception;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
|
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Zheng Jie
|
||||||
|
* @date 2018-11-23
|
||||||
|
* 统一异常处理
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public class BadRequestException extends RuntimeException{
|
||||||
|
|
||||||
|
private Integer status = BAD_REQUEST.value();
|
||||||
|
|
||||||
|
public BadRequestException(String msg){
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BadRequestException(HttpStatus status,String msg){
|
||||||
|
super(msg);
|
||||||
|
this.status = status.value();
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -275,7 +275,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
if (ObjectUtil.isEmpty(bakingTimer)) throw new BadRequestException("烘烤时间不能为空");
|
if (ObjectUtil.isEmpty(bakingTimer)) throw new BadRequestException("烘烤时间不能为空");
|
||||||
|
|
||||||
String point_code = "";
|
String point_code = "";
|
||||||
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '03'").uniqueResult(0);
|
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(jsonCoolIvt)) {
|
if (ObjectUtil.isEmpty(jsonCoolIvt)) {
|
||||||
JSONObject jsonPoint = pointTab.query("material_code ='" + containerName + "'").uniqueResult(0);
|
JSONObject jsonPoint = pointTab.query("material_code ='" + containerName + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(jsonPoint)) point_code = jsonPoint.getString("point_code");
|
if (ObjectUtil.isNotEmpty(jsonPoint)) point_code = jsonPoint.getString("point_code");
|
||||||
@@ -740,24 +740,21 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
try {
|
try {
|
||||||
// String is_mesTolms = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("is_mesTolms").getValue();
|
// String is_mesTolms = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("is_mesTolms").getValue();
|
||||||
// if (StrUtil.equals(is_mesTolms, "1")) {
|
// if (StrUtil.equals(is_mesTolms, "1")) {
|
||||||
String isUnPlanProductionBox = param.getString("isUnPlanProductionBox"); // 生产订单
|
String isUnPlanProductionBox = param.getString("isUnPlanProductionBox"); // 是否计划外子卷
|
||||||
String QuanlityInBox = param.getString("QuanlityInBox"); // 产品编码
|
String QuanlityInBox = param.getString("QuanlityInBox"); // 产品编码
|
||||||
String QualityGuaranPeriod = param.getString("QualityGuaranPeriod"); // 保质期
|
String QualityGuaranPeriod = param.getString("QualityGuaranPeriod"); // 保质期
|
||||||
String ProductName = param.getString("ProductName"); // 来源卷位置
|
String ProductName = param.getString("ProductName"); // 来源卷位置
|
||||||
String Description = param.getString("Description"); // 来源卷位置
|
String Description = param.getString("Description"); // 来源卷位置
|
||||||
String DateOfFGInbound = param.getString("DateOfFGInbound"); // 来源卷位置
|
String DateOfFGInbound = param.getString("DateOfFGInbound"); // 来源卷位置
|
||||||
|
String BoxWeight = param.getString("BoxWeight"); // 来源卷位置
|
||||||
String box_type = param.getString("Attribute1"); // 木箱料号
|
String box_type = param.getString("Attribute1"); // 木箱料号
|
||||||
String box_length = param.getString("Attribute2"); // 木箱料号
|
String box_length = param.getString("Attribute2"); // 木箱料号
|
||||||
String box_width = param.getString("Attribute3"); // 木箱料号
|
String box_width = param.getString("Attribute3"); // 木箱料号
|
||||||
String box_high = param.getString("Attribute4"); // 木箱料号
|
String box_high = param.getString("Attribute4"); // 木箱料号
|
||||||
|
|
||||||
double BoxWeight = 0; // 木箱自身重量
|
|
||||||
|
|
||||||
JSONArray details = param.getJSONArray("details");
|
JSONArray details = param.getJSONArray("details");
|
||||||
if (ObjectUtil.isEmpty(details)) throw new BadRequestException("明细为空");
|
if (ObjectUtil.isEmpty(details)) throw new BadRequestException("明细为空");
|
||||||
for (int i = 0; i < details.size(); i++) {
|
for (int i = 0; i < details.size(); i++) {
|
||||||
JSONObject detail = details.getJSONObject(i);
|
JSONObject detail = details.getJSONObject(i);
|
||||||
BoxWeight = NumberUtil.add(BoxWeight, detail.getDoubleValue("NetWeight"));
|
|
||||||
|
|
||||||
String PackageBoxSN = detail.getString("PackageBoxSN"); // 分切订单类型
|
String PackageBoxSN = detail.getString("PackageBoxSN"); // 分切订单类型
|
||||||
String ContainerName = detail.getString("ContainerName"); // 子卷号
|
String ContainerName = detail.getString("ContainerName"); // 子卷号
|
||||||
@@ -787,7 +784,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
jo.put("box_width", box_width);
|
jo.put("box_width", box_width);
|
||||||
jo.put("box_high", box_high);
|
jo.put("box_high", box_high);
|
||||||
jo.put("quanlity_in_box", QuanlityInBox);
|
jo.put("quanlity_in_box", QuanlityInBox);
|
||||||
// jo.put("box_weight", BoxWeight);
|
jo.put("box_weight", BoxWeight);
|
||||||
if (QualityGuaranPeriod.equals("0天")){
|
if (QualityGuaranPeriod.equals("0天")){
|
||||||
jo.put("quality_guaran_period", "90天");
|
jo.put("quality_guaran_period", "90天");
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
|||||||
for (int i = 0; i < rows.size(); i++) {
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
JSONObject row = rows.getJSONObject(i);
|
JSONObject row = rows.getJSONObject(i);
|
||||||
String MATNR = row.getString("MATNR");
|
String MATNR = row.getString("MATNR");
|
||||||
|
String MATNR01 = row.getString("MATNR01");
|
||||||
|
String MEINS = row.getString("MEINS");
|
||||||
if (StrUtil.isEmpty(MATNR)) {
|
if (StrUtil.isEmpty(MATNR)) {
|
||||||
throw new BadRequestException("物料编码不能为空!");
|
throw new BadRequestException("物料编码不能为空!");
|
||||||
}
|
}
|
||||||
@@ -48,6 +50,39 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
|||||||
} else {
|
} else {
|
||||||
WQLObject.getWQLObject("md_me_materialbaseext").update(row);
|
WQLObject.getWQLObject("md_me_materialbaseext").update(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JSONObject base_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '"+MATNR+"'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(base_jo)){
|
||||||
|
JSONObject mater_base_jo = new JSONObject();
|
||||||
|
mater_base_jo.put("material_id",IdUtil.getSnowflake(1,1).nextId());
|
||||||
|
mater_base_jo.put("material_code",MATNR);
|
||||||
|
mater_base_jo.put("material_name",MATNR01);
|
||||||
|
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("unit_code = '"+MEINS+"'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(unit)){
|
||||||
|
throw new BadRequestException("未查询到相关计量单位,请进行维护!");
|
||||||
|
}
|
||||||
|
mater_base_jo.put("base_unit_id",unit.getString("measure_unit_id"));
|
||||||
|
mater_base_jo.put("create_id", "1");
|
||||||
|
mater_base_jo.put("create_name", "管理员");
|
||||||
|
mater_base_jo.put("create_time", DateUtil.now());
|
||||||
|
mater_base_jo.put("update_optid", "1");
|
||||||
|
mater_base_jo.put("update_optname", "管理员");
|
||||||
|
mater_base_jo.put("update_time", DateUtil.now());
|
||||||
|
mater_base_jo.put("is_used","1");
|
||||||
|
mater_base_jo.put("is_delete","0");
|
||||||
|
WQLObject.getWQLObject("md_me_materialbase").insert(mater_base_jo);
|
||||||
|
}else {
|
||||||
|
base_jo.put("material_name",MATNR01);
|
||||||
|
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("unit_code = '"+MEINS+"'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(unit)){
|
||||||
|
throw new BadRequestException("未查询到相关计量单位,请进行维护!");
|
||||||
|
}
|
||||||
|
base_jo.put("base_unit_id",unit.getString("measure_unit_id"));
|
||||||
|
base_jo.put("update_optid", "1");
|
||||||
|
base_jo.put("update_optname", "管理员");
|
||||||
|
base_jo.put("update_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("md_me_materialbase").update(base_jo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
result.put("RTYPE", "E");
|
result.put("RTYPE", "E");
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package org.nl.wms.pda.mps.rest;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.logging.annotation.Log;
|
||||||
|
import org.nl.wms.pda.mps.service.BakingService;
|
||||||
|
import org.nl.wms.pda.mps.service.RawFoilService;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "烘烤工序")
|
||||||
|
@RequestMapping("api/pda/baking")
|
||||||
|
@Slf4j
|
||||||
|
public class BakingController {
|
||||||
|
|
||||||
|
private final BakingService bakingService;
|
||||||
|
|
||||||
|
@PostMapping("/ovenInAndOut")
|
||||||
|
@Log("烘箱出入")
|
||||||
|
@ApiOperation("烘箱出入")
|
||||||
|
public ResponseEntity<Object> queryRawFoil(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(bakingService.ovenInAndOut(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/inCoolIvt")
|
||||||
|
@Log("入冷却")
|
||||||
|
@ApiOperation("入冷却")
|
||||||
|
public ResponseEntity<Object> inCoolIvt(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(bakingService.inCoolIvt(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package org.nl.wms.pda.mps.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public interface BakingService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 烘箱出入
|
||||||
|
* @param whereJson /
|
||||||
|
* @return JSONObject
|
||||||
|
*/
|
||||||
|
JSONObject ovenInAndOut(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入冷却
|
||||||
|
* @param whereJson /
|
||||||
|
* @return JSONObject
|
||||||
|
*/
|
||||||
|
JSONObject inCoolIvt(JSONObject whereJson);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,463 @@
|
|||||||
|
package org.nl.wms.pda.mps.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
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.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||||
|
import org.nl.wms.pda.mps.service.BakingService;
|
||||||
|
import org.nl.wms.sch.tasks.InCoolIvtTask;
|
||||||
|
import org.nl.wms.sch.tasks.InHotTask;
|
||||||
|
import org.nl.wms.sch.tasks.OutHotTask;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class BakingServiceImpl implements BakingService {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 业务流程:
|
||||||
|
* 入烤箱:
|
||||||
|
* 1.首先需要找到无任务的暂存位 并创建两条任务
|
||||||
|
* 2。下发冷却区 --> 烘烤区的任务 等待反馈完成
|
||||||
|
* 3.插入烤箱区出入主表和明细表
|
||||||
|
* 出烤箱:
|
||||||
|
* 1.烤箱时间到后 查找无任务的暂存位 并创建2条任务
|
||||||
|
* 2.1下发烤箱区 --> 暂存位 的任务
|
||||||
|
* 2.2插入烤箱区出入明细表
|
||||||
|
* 3.查找对应冷却区空位
|
||||||
|
* 4.在下发暂存位 --> 冷却区的任务
|
||||||
|
* 问题:
|
||||||
|
* 1.第二条任务出现异常后 如何再次触发
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public JSONObject ovenInAndOut(JSONObject whereJson) {
|
||||||
|
|
||||||
|
String option = whereJson.getString("option"); // 1-入箱 2-出箱
|
||||||
|
|
||||||
|
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位表
|
||||||
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||||
|
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区点位库存表
|
||||||
|
WQLObject hosIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烤箱区点位库存表
|
||||||
|
WQLObject hosReMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烤箱区出入主表
|
||||||
|
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||||
|
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||||
|
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
|
||||||
|
|
||||||
|
|
||||||
|
if (StrUtil.equals(option, "1")) {
|
||||||
|
// 入箱
|
||||||
|
String container_name = whereJson.getString("container_name"); // 母卷号
|
||||||
|
String temperature = whereJson.getString("temperature"); // 温度
|
||||||
|
String hours = whereJson.getString("hours"); // 时间
|
||||||
|
String point_code1 = whereJson.getString("point_code"); // 点位
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(container_name)) throw new BadRequestException("母卷号不能为空");
|
||||||
|
if (ObjectUtil.isEmpty(temperature)) throw new BadRequestException("温度不能为空");
|
||||||
|
if (ObjectUtil.isEmpty(hours)) throw new BadRequestException("时间不能为空");
|
||||||
|
if (ObjectUtil.isEmpty(point_code1)) throw new BadRequestException("点位不能为空");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 根据点位判断是 冷却区入烘箱还是暂存区入烘箱
|
||||||
|
*/
|
||||||
|
JSONObject jsonPointZc = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonPointZc)) {
|
||||||
|
/*
|
||||||
|
* 暂存区入烘箱
|
||||||
|
*/
|
||||||
|
// 1.查询烘箱对应的空位
|
||||||
|
JSONObject jsonMap = new JSONObject();
|
||||||
|
jsonMap.put("flag", "1");
|
||||||
|
jsonMap.put("product_area",jsonPointZc.getString("product_area"));
|
||||||
|
jsonMap.put("temperature",temperature);
|
||||||
|
jsonMap.put("point_location",jsonPointZc.getString("point_location"));
|
||||||
|
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位");
|
||||||
|
// 2.创建暂存位 --> 烘烤区任务
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("type", "2"); // 1- 冷却区入烘箱 2- 暂存位入烘箱
|
||||||
|
param.put("point_code1", point_code1);
|
||||||
|
param.put("point_code2", jsonHotIvt.getString("point_code"));
|
||||||
|
|
||||||
|
InHotTask inHotTask = new InHotTask();
|
||||||
|
String task_id = inHotTask.createTask(param);
|
||||||
|
|
||||||
|
// 3.插入主表
|
||||||
|
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
JSONObject hotParam = new JSONObject();
|
||||||
|
hotParam.put("container_name", container_name);
|
||||||
|
hotParam.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||||
|
hotParam.put("material_id", jsonMater.getString("material_id"));
|
||||||
|
hotParam.put("qty", jsonRaw.get("productin_qty"));
|
||||||
|
hotParam.put("qty_unit_id", jsonMater.getString("base_unit_id"));
|
||||||
|
hotParam.put("task_id", task_id);
|
||||||
|
hotParam.put("start_point_code", point_code1);
|
||||||
|
hotParam.put("next_point_code", jsonHotIvt.getString("point_code"));
|
||||||
|
hotParam.put("temperature", temperature);
|
||||||
|
hotParam.put("oven_time", hours);
|
||||||
|
this.createHotIoMst(hotParam);
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* 冷却区入烘箱
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 1.根据冷却区此母卷的点位找到对应的暂存区、找到空位
|
||||||
|
// JSONObject jsonCoolIvt = coolIvtTab.query("container_name ='" + container_name + "' and is_used = '1' and full_point_status = '02' and cool_ivt_status = '01'").uniqueResult(0);
|
||||||
|
JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + point_code1 + "'and container_name = '" + container_name + "' and is_used = '1' and full_point_status = '02' and cool_ivt_status = '01'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("点位不存在或母卷不存在");
|
||||||
|
|
||||||
|
String product_area = jsonCoolIvt.getString("product_area"); // 生产区域
|
||||||
|
String point_location = jsonCoolIvt.getString("point_location"); // 位置
|
||||||
|
String reging_id = "";
|
||||||
|
|
||||||
|
switch (product_area) {
|
||||||
|
case "A1":
|
||||||
|
reging_id = RegionTypeEnum.A_HKZC.getId();
|
||||||
|
break;
|
||||||
|
case "A2":
|
||||||
|
reging_id = RegionTypeEnum.B_HKZC.getId();
|
||||||
|
break;
|
||||||
|
case "A3":
|
||||||
|
reging_id = RegionTypeEnum.C_HKZC.getId();
|
||||||
|
break;
|
||||||
|
case "A4":
|
||||||
|
reging_id = RegionTypeEnum.D_HKZC.getId();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("flag", "1");
|
||||||
|
map.put("reging_id", reging_id);
|
||||||
|
map.put("point_location", point_location);
|
||||||
|
|
||||||
|
JSONArray pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
if (ObjectUtil.isEmpty(pointArr)) {
|
||||||
|
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
|
||||||
|
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||||
|
pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有空暂存位");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2.判断暂存位是否有任务:找到无任务的暂存位 、查询烘箱对应的空位
|
||||||
|
String point_code2 = "";
|
||||||
|
for (int i = 0; i < pointArr.size(); i++) {
|
||||||
|
JSONObject jsonPoint = pointArr.getJSONObject(i);
|
||||||
|
String point_code = jsonPoint.getString("point_code");
|
||||||
|
|
||||||
|
JSONObject json_point_code1 = taskTab.query("point_code1 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject json_point_code2 = taskTab.query("point_code2 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject json_point_code3 = taskTab.query("point_code3 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject json_point_code4 = taskTab.query("point_code4 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(json_point_code1) && ObjectUtil.isEmpty(json_point_code2) && ObjectUtil.isEmpty(json_point_code3) && ObjectUtil.isEmpty(json_point_code4)) {
|
||||||
|
point_code2 = point_code;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有空暂存位");
|
||||||
|
|
||||||
|
// 查询烘箱对应的空位
|
||||||
|
|
||||||
|
JSONObject jsonMap = new JSONObject();
|
||||||
|
jsonMap.put("flag", "1");
|
||||||
|
jsonMap.put("product_area",product_area);
|
||||||
|
jsonMap.put("temperature",temperature);
|
||||||
|
jsonMap.put("point_location",map.getString("point_location"));
|
||||||
|
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位");
|
||||||
|
|
||||||
|
// 3.创建冷却区 --> 烘烤区任务
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("type", "1"); // 1- 冷却区入烘箱 2- 暂存位入烘箱
|
||||||
|
param.put("point_code1", point_code1);
|
||||||
|
param.put("point_code2", point_code2);
|
||||||
|
param.put("point_code3", jsonHotIvt.getString("point_code"));
|
||||||
|
|
||||||
|
// 创建冷却区 --> 暂存位的任务
|
||||||
|
InHotTask inHotTask = new InHotTask();
|
||||||
|
String task_id = inHotTask.createTask(param);
|
||||||
|
|
||||||
|
// 4.插入烘箱区出入主表
|
||||||
|
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料不存在");
|
||||||
|
|
||||||
|
JSONObject hotParam = new JSONObject();
|
||||||
|
hotParam.put("container_name", container_name);
|
||||||
|
hotParam.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||||
|
hotParam.put("material_id", jsonMater.getString("material_id"));
|
||||||
|
hotParam.put("qty", jsonRaw.get("productin_qty"));
|
||||||
|
hotParam.put("qty_unit_id", jsonMater.getString("base_unit_id"));
|
||||||
|
hotParam.put("task_id", task_id);
|
||||||
|
hotParam.put("start_point_code", point_code1);
|
||||||
|
hotParam.put("next_point_code", jsonHotIvt.getString("point_code"));
|
||||||
|
hotParam.put("temperature", temperature);
|
||||||
|
hotParam.put("oven_time", hours);
|
||||||
|
this.createHotIoMst(hotParam);
|
||||||
|
|
||||||
|
|
||||||
|
// 生成冷却区出入表
|
||||||
|
Long currentUserId = 2L;
|
||||||
|
String currentUsername = "mes用户";
|
||||||
|
|
||||||
|
JSONObject jsonCool = new JSONObject();
|
||||||
|
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
|
||||||
|
jsonCool.put("io_type", "1");
|
||||||
|
jsonCool.put("material_id", jsonMater.getString("material_id"));
|
||||||
|
jsonCool.put("pcsn", container_name);
|
||||||
|
jsonCool.put("bill_status", "10");
|
||||||
|
jsonCool.put("task_id", task_id);
|
||||||
|
jsonCool.put("qty_unit_id", jsonMater.getString("base_unit_id"));
|
||||||
|
jsonCool.put("start_point_code", point_code1);
|
||||||
|
jsonCool.put("end_point_code", jsonHotIvt.getString("point_code"));
|
||||||
|
jsonCool.put("create_mode", "03");
|
||||||
|
jsonCool.put("create_id", currentUserId);
|
||||||
|
jsonCool.put("create_name", currentUsername);
|
||||||
|
jsonCool.put("create_time", DateUtil.now());
|
||||||
|
jsonCool.put("update_optid", currentUserId);
|
||||||
|
jsonCool.put("update_optname", currentUsername);
|
||||||
|
jsonCool.put("update_time", DateUtil.now());
|
||||||
|
jsonCool.put("confirm_optid", currentUserId);
|
||||||
|
jsonCool.put("confirm_optname", currentUsername);
|
||||||
|
jsonCool.put("confirm_time", DateUtil.now());
|
||||||
|
coolTab.insert(jsonCool);
|
||||||
|
}
|
||||||
|
} else if (StrUtil.equals(option, "2")) {
|
||||||
|
// 出箱
|
||||||
|
String point_code1 = whereJson.getString("point_code");
|
||||||
|
if (ObjectUtil.isEmpty(point_code1)) throw new BadRequestException("出箱点位不能为空");
|
||||||
|
JSONObject jsonHotIvt = hosIvtTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("点位不存在");
|
||||||
|
|
||||||
|
// 1.查询暂存位有没有空位
|
||||||
|
String product_area = jsonHotIvt.getString("product_area");
|
||||||
|
String reging_id = "";
|
||||||
|
switch (product_area) {
|
||||||
|
case "A1":
|
||||||
|
reging_id = RegionTypeEnum.A_HKZC.getId();
|
||||||
|
break;
|
||||||
|
case "A2":
|
||||||
|
reging_id = RegionTypeEnum.B_HKZC.getId();
|
||||||
|
break;
|
||||||
|
case "A3":
|
||||||
|
reging_id = RegionTypeEnum.C_HKZC.getId();
|
||||||
|
break;
|
||||||
|
case "A4":
|
||||||
|
reging_id = RegionTypeEnum.D_HKZC.getId();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("flag", "1");
|
||||||
|
map.put("reging_id", reging_id);
|
||||||
|
map.put("point_location", jsonHotIvt.getString("point_location"));
|
||||||
|
|
||||||
|
JSONArray pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有空暂存位");
|
||||||
|
|
||||||
|
// 2.判断暂存位是否有任务:找到无任务的暂存位
|
||||||
|
String point_code2 = "";
|
||||||
|
for (int i = 0; i < pointArr.size(); i++) {
|
||||||
|
JSONObject jsonPoint = pointArr.getJSONObject(i);
|
||||||
|
String point_code = jsonPoint.getString("point_code");
|
||||||
|
|
||||||
|
JSONObject json_point_code1 = taskTab.query("point_code1 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject json_point_code2 = taskTab.query("point_code2 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject json_point_code3 = taskTab.query("point_code3 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject json_point_code4 = taskTab.query("point_code4 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(json_point_code1) && ObjectUtil.isEmpty(json_point_code2) && ObjectUtil.isEmpty(json_point_code3) && ObjectUtil.isEmpty(json_point_code4)) {
|
||||||
|
point_code2 = point_code;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有空暂存位");
|
||||||
|
// 3.创建任务
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("point_code1", point_code1);
|
||||||
|
param.put("point_code2", point_code2);
|
||||||
|
param.put("material_code", jsonHotIvt.getString("container_name"));
|
||||||
|
OutHotTask outHotTask = new OutHotTask();
|
||||||
|
String task_id = outHotTask.createTask(param);
|
||||||
|
|
||||||
|
// 4.插入烘箱区出入明细表
|
||||||
|
JSONObject jsonHotReMst = hosReMstTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and bill_status <> '50' and is_delete = '0'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonHotReMst)) throw new BadRequestException("烘箱区出入主表不存在");
|
||||||
|
|
||||||
|
// 创建明细
|
||||||
|
JSONObject hotParam = new JSONObject();
|
||||||
|
hotParam.put("task_id", task_id);
|
||||||
|
hotParam.put("iostorinv_id", jsonHotReMst.getString("iostorinv_id"));
|
||||||
|
hotParam.put("start_point_code", point_code1);
|
||||||
|
hotParam.put("next_point_code", point_code2);
|
||||||
|
hotParam.put("temperature", jsonHotIvt.getString("temperature"));
|
||||||
|
this.createHotDtl(hotParam);
|
||||||
|
}
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("message", "操作成功!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public JSONObject inCoolIvt(JSONObject whereJson) {
|
||||||
|
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位点
|
||||||
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||||
|
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱出入主表
|
||||||
|
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||||
|
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||||
|
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
|
||||||
|
|
||||||
|
|
||||||
|
String point_code1 = whereJson.getString("point_code"); // 暂存位:起点
|
||||||
|
String container_name = whereJson.getString("container_name"); // 母卷号
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(point_code1)) throw new BadRequestException("点位不能为空");
|
||||||
|
if (ObjectUtil.isEmpty(container_name)) throw new BadRequestException("母卷号不能为空");
|
||||||
|
|
||||||
|
// 1.获取此暂存位的生产区域和上下位置
|
||||||
|
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("点位不存在");
|
||||||
|
|
||||||
|
// 2.找冷却区空货位
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("flag", "2");
|
||||||
|
map.put("product_area", jsonPoint.getString("product_area"));
|
||||||
|
map.put("point_location", jsonPoint.getString("point_location"));
|
||||||
|
|
||||||
|
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||||
|
// 如果为空
|
||||||
|
if (ObjectUtil.isEmpty(jsonCooIvt)) {
|
||||||
|
if (StrUtil.equals(jsonPoint.getString("point_location"), "0")) map.put("point_location", "1");
|
||||||
|
if (StrUtil.equals(jsonPoint.getString("point_location"), "1")) map.put("point_location", "0");
|
||||||
|
jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(jsonCooIvt)) throw new BadRequestException("冷却区空位不足");
|
||||||
|
|
||||||
|
// 3.创建任务
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("point_code1", point_code1);
|
||||||
|
param.put("point_code2", jsonCooIvt.getString("full_point_code"));
|
||||||
|
param.put("container_name", container_name);
|
||||||
|
|
||||||
|
|
||||||
|
InCoolIvtTask inCoolIvtTask = new InCoolIvtTask();
|
||||||
|
String task_id = inCoolIvtTask.createTask(param);
|
||||||
|
|
||||||
|
// 4.插入明细
|
||||||
|
JSONObject jsonHotMst = hotMstTab.query("container_name = '" + container_name + "' and is_delete = '0' and bill_status <> '50'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonHotMst)) throw new BadRequestException("烘烤区出入主表不存在");
|
||||||
|
JSONObject hotParam = new JSONObject();
|
||||||
|
hotParam.put("task_id", task_id);
|
||||||
|
hotParam.put("iostorinv_id", jsonHotMst.getString("iostorinv_id"));
|
||||||
|
hotParam.put("start_point_code", point_code1);
|
||||||
|
hotParam.put("next_point_code", jsonCooIvt.getString("full_point_code"));
|
||||||
|
this.createHotDtl(hotParam);
|
||||||
|
|
||||||
|
// 生成冷却区出入表
|
||||||
|
Long currentUserId = 2L;
|
||||||
|
String currentUsername = "mes用户";
|
||||||
|
|
||||||
|
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料不存在");
|
||||||
|
|
||||||
|
JSONObject jsonCool = new JSONObject();
|
||||||
|
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
|
||||||
|
jsonCool.put("io_type", "0");
|
||||||
|
jsonCool.put("material_id", jsonMater.getString("material_id"));
|
||||||
|
jsonCool.put("pcsn", container_name);
|
||||||
|
jsonCool.put("bill_status", "10");
|
||||||
|
jsonCool.put("qty_unit_id", jsonMater.get("base_unit_id"));
|
||||||
|
jsonCool.put("task_id", task_id);
|
||||||
|
jsonCool.put("start_point_code", point_code1);
|
||||||
|
jsonCool.put("end_point_code", jsonCooIvt.getString("full_point_code"));
|
||||||
|
jsonCool.put("create_mode", "03");
|
||||||
|
jsonCool.put("create_id", currentUserId);
|
||||||
|
jsonCool.put("create_name", currentUsername);
|
||||||
|
jsonCool.put("create_time", DateUtil.now());
|
||||||
|
jsonCool.put("update_optid", currentUserId);
|
||||||
|
jsonCool.put("update_optname", currentUsername);
|
||||||
|
jsonCool.put("update_time", DateUtil.now());
|
||||||
|
jsonCool.put("confirm_optid", currentUserId);
|
||||||
|
jsonCool.put("confirm_optname", currentUsername);
|
||||||
|
jsonCool.put("confirm_time", DateUtil.now());
|
||||||
|
coolTab.insert(jsonCool);
|
||||||
|
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("message", "操作成功!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public String createHotIoMst(JSONObject param) {
|
||||||
|
/*
|
||||||
|
* 创建烘箱区出入主表
|
||||||
|
*/
|
||||||
|
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱区出入主表
|
||||||
|
|
||||||
|
JSONObject jsonHotMst = new JSONObject();
|
||||||
|
jsonHotMst.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jsonHotMst.put("bill_code", CodeUtil.getNewCode("HOT_BILL_CODE"));
|
||||||
|
jsonHotMst.put("container_name", param.getString("container_name"));
|
||||||
|
jsonHotMst.put("workorder_id", param.getString("workorder_id"));
|
||||||
|
jsonHotMst.put("material_id", param.get("material_id"));
|
||||||
|
jsonHotMst.put("qty", param.getString("qty"));
|
||||||
|
jsonHotMst.put("bill_status", "50");
|
||||||
|
jsonHotMst.put("qty_unit_id", param.getString("qty_unit_id"));
|
||||||
|
jsonHotMst.put("start_point_code", param.getString("start_point_code"));
|
||||||
|
jsonHotMst.put("end_point_code", param.getString("end_point_code"));
|
||||||
|
jsonHotMst.put("create_mode", "03");
|
||||||
|
jsonHotMst.put("task_id", param.getString("task_id"));
|
||||||
|
jsonHotMst.put("task_type", param.getString("task_type"));
|
||||||
|
jsonHotMst.put("temperature", param.getString("temperature"));
|
||||||
|
jsonHotMst.put("oven_time", param.getString("oven_time"));
|
||||||
|
jsonHotMst.put("create_id", 2);
|
||||||
|
jsonHotMst.put("create_name", "mes用户");
|
||||||
|
jsonHotMst.put("create_time", DateUtil.now());
|
||||||
|
jsonHotMst.put("confirm_optid", 2);
|
||||||
|
jsonHotMst.put("confirm_optname", "mes用户");
|
||||||
|
jsonHotMst.put("confirm_time", DateUtil.now());
|
||||||
|
hotMstTab.insert(jsonHotMst);
|
||||||
|
|
||||||
|
return jsonHotMst.getString("iostorinv_id");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void createHotDtl(JSONObject param) {
|
||||||
|
/*
|
||||||
|
* 创建烘箱区出入明细表
|
||||||
|
*/
|
||||||
|
WQLObject hotDtlTab = WQLObject.getWQLObject("ST_IVT_HotRegionIODtl"); // 烘箱区出入明细表
|
||||||
|
|
||||||
|
JSONObject jsonHotDtl = new JSONObject();
|
||||||
|
jsonHotDtl.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jsonHotDtl.put("bill_code", "");
|
||||||
|
jsonHotDtl.put("start_point_code", param.getString("start_point_code"));
|
||||||
|
jsonHotDtl.put("next_point_code", param.getString("next_point_code"));
|
||||||
|
jsonHotDtl.put("temperature", param.getString("temperature"));
|
||||||
|
jsonHotDtl.put("oven_time", param.getString("oven_time"));
|
||||||
|
jsonHotDtl.put("task_type", "1");
|
||||||
|
jsonHotDtl.put("task_id", param.getString("task_id"));
|
||||||
|
jsonHotDtl.put("create_id", 2);
|
||||||
|
jsonHotDtl.put("create_name", "mes用户");
|
||||||
|
jsonHotDtl.put("create_time", DateUtil.now());
|
||||||
|
jsonHotDtl.put("dtl_status", "10");
|
||||||
|
hotDtlTab.insert(jsonHotDtl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -448,7 +448,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
|||||||
HashMap<String, String> map = rows.get(0);
|
HashMap<String, String> map = rows.get(0);
|
||||||
|
|
||||||
//判断该载具是否已经分配货位或者起点
|
//判断该载具是否已经分配货位或者起点
|
||||||
JSONArray now_dis_rows = WQLObject.getWQLObject("st_ivt_iostorinvdis").query("box_no = '" + map.get("box_no") + "' AND work_status < '99' AND (struct_id <> '' AND struct_id is not null)").getResultJSONArray(0);
|
JSONArray now_dis_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag","17").addParam("box_no",map.get("box_no")).process().getResultJSONArray(0);
|
||||||
if (now_dis_rows.size() > 0) {
|
if (now_dis_rows.size() > 0) {
|
||||||
throw new BadRequestException("该木箱已经分配过货位,无法继续分配!");
|
throw new BadRequestException("该木箱已经分配过货位,无法继续分配!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
输入.stor_id TYPEAS s_string
|
输入.stor_id TYPEAS s_string
|
||||||
输入.bill_status TYPEAS s_string
|
输入.bill_status TYPEAS s_string
|
||||||
输入.bill_type TYPEAS s_string
|
输入.bill_type TYPEAS s_string
|
||||||
|
输入.box_no TYPEAS s_string
|
||||||
输入.container_name TYPEAS s_string
|
输入.container_name TYPEAS s_string
|
||||||
输入.package_box_sn TYPEAS s_string
|
输入.package_box_sn TYPEAS s_string
|
||||||
输入.iostorinv_id TYPEAS s_string
|
输入.iostorinv_id TYPEAS s_string
|
||||||
@@ -633,6 +634,23 @@
|
|||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "17"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
st_ivt_iostorinvdis dis
|
||||||
|
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||||
|
WHERE
|
||||||
|
dis.box_no = 输入.box_no
|
||||||
|
AND work_status < '99'
|
||||||
|
AND ( struct_id <> '' AND struct_id IS NOT NULL )
|
||||||
|
AND mst.is_delete = '0'
|
||||||
|
AND mst.bill_status < '99'
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
|||||||
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
||||||
map.put("material_code", "%" + map.get("material_code") + "%");
|
map.put("material_code", "%" + map.get("material_code") + "%");
|
||||||
}
|
}
|
||||||
|
if (StrUtil.isNotEmpty(map.get("vbeln"))) {
|
||||||
|
map.put("vbeln", "%" + map.get("vbeln") + "%");
|
||||||
|
}
|
||||||
|
|
||||||
//获取人员对应的仓库
|
//获取人员对应的仓库
|
||||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
输入.username TYPEAS s_string
|
输入.username TYPEAS s_string
|
||||||
输入.create_mode TYPEAS s_string
|
输入.create_mode TYPEAS s_string
|
||||||
输入.bill_type TYPEAS s_string
|
输入.bill_type TYPEAS s_string
|
||||||
|
输入.vbeln TYPEAS s_string
|
||||||
输入.stor_id TYPEAS s_string
|
输入.stor_id TYPEAS s_string
|
||||||
输入.iostorinv_id TYPEAS s_string
|
输入.iostorinv_id TYPEAS s_string
|
||||||
输入.buss_type TYPEAS s_string
|
输入.buss_type TYPEAS s_string
|
||||||
@@ -71,14 +72,16 @@
|
|||||||
|
|
||||||
IF 输入.flag = "1"
|
IF 输入.flag = "1"
|
||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT
|
SELECT DISTINCT
|
||||||
ios.*,
|
ios.*,
|
||||||
cu.shd_dtl_num,
|
cu.shd_dtl_num,
|
||||||
cu.cust_name,
|
cu.cust_name,
|
||||||
|
dtl.vbeln,
|
||||||
cu.cust_simple_name
|
cu.cust_simple_name
|
||||||
FROM
|
FROM
|
||||||
ST_IVT_IOStorInv ios
|
ST_IVT_IOStorInv ios
|
||||||
LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code
|
LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code
|
||||||
|
LEFT JOIN st_ivt_iostorinvdtl dtl ON ios.iostorinv_id = dtl.iostorinv_id
|
||||||
WHERE
|
WHERE
|
||||||
ios.io_type = '1'
|
ios.io_type = '1'
|
||||||
and ios.is_delete='0'
|
and ios.is_delete='0'
|
||||||
@@ -92,6 +95,10 @@
|
|||||||
ios.io_type = 输入.io_type
|
ios.io_type = 输入.io_type
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.vbeln <> ""
|
||||||
|
dtl.vbeln like 输入.vbeln
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.bill_type <> ""
|
OPTION 输入.bill_type <> ""
|
||||||
ios.bill_type = 输入.bill_type
|
ios.bill_type = 输入.bill_type
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
@@ -580,7 +587,7 @@
|
|||||||
st_ivt_iostorinvdis dis
|
st_ivt_iostorinvdis dis
|
||||||
LEFT JOIN md_me_materialbase mater ON dis.material_id = mater.material_id
|
LEFT JOIN md_me_materialbase mater ON dis.material_id = mater.material_id
|
||||||
LEFT JOIN sch_base_point point ON dis.point_id = point.point_id
|
LEFT JOIN sch_base_point point ON dis.point_id = point.point_id
|
||||||
INNER JOIN sch_base_task task ON dis.task_id = task.task_id
|
LEFT JOIN sch_base_task task ON dis.task_id = task.task_id
|
||||||
WHERE
|
WHERE
|
||||||
1=1
|
1=1
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.common.utils.SecurityUtils;
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.utils.dto.CurrentUser;
|
import org.nl.modules.common.utils.dto.CurrentUser;
|
||||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||||
@@ -19,9 +20,13 @@ import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
|||||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||||
import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
|
import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
|
||||||
import org.nl.wms.st.returns.service.InAndOutReturnService;
|
import org.nl.wms.st.returns.service.InAndOutReturnService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.TransactionStatus;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
|
||||||
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -34,6 +39,7 @@ import java.util.Map;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||||
|
private final TransactionTemplate transactionTemplate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
|
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
|
||||||
@@ -50,6 +56,8 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
||||||
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
||||||
map.put("pcsn", MapUtil.getStr(whereJson, "pcsn"));
|
map.put("pcsn", MapUtil.getStr(whereJson, "pcsn"));
|
||||||
|
map.put("is_writeoff", MapUtil.getStr(whereJson, "is_writeoff"));
|
||||||
|
map.put("vbeln", MapUtil.getStr(whereJson, "vbeln"));
|
||||||
if (!ObjectUtil.isEmpty(bill_code)) map.put("bill_code", "%" + bill_code + "%");
|
if (!ObjectUtil.isEmpty(bill_code)) map.put("bill_code", "%" + bill_code + "%");
|
||||||
if (!ObjectUtil.isEmpty(material_search)) map.put("material_search", "%" + material_search + "%");
|
if (!ObjectUtil.isEmpty(material_search)) map.put("material_search", "%" + material_search + "%");
|
||||||
if (!ObjectUtil.isEmpty(box_no)) map.put("box_no", "%" + box_no + "%");
|
if (!ObjectUtil.isEmpty(box_no)) map.put("box_no", "%" + box_no + "%");
|
||||||
@@ -92,7 +100,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
String stor_id = jo_mst.getString("stor_id");
|
String stor_id = jo_mst.getString("stor_id");
|
||||||
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("stor_id = '" + stor_id + "'").uniqueResult(0);
|
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("stor_id = '" + stor_id + "'").uniqueResult(0);
|
||||||
String lgort = stor_jo.getString("ext_id");
|
String lgort = stor_jo.getString("ext_id");
|
||||||
String is_virtualstore = stor_jo.getString("is_virtualstore");
|
|
||||||
String is_productstore = stor_jo.getString("is_productstore");
|
String is_productstore = stor_jo.getString("is_productstore");
|
||||||
//生产入库
|
//生产入库
|
||||||
if (StrUtil.equals(bill_type, "0001")) {
|
if (StrUtil.equals(bill_type, "0001")) {
|
||||||
@@ -107,6 +114,11 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
paramMesMst.put("PackageBoxSN", box_row.getString("box_no"));
|
paramMesMst.put("PackageBoxSN", box_row.getString("box_no"));
|
||||||
paramMesMst.put("User", box_row.getString("confirm_optname"));
|
paramMesMst.put("User", box_row.getString("confirm_optname"));
|
||||||
new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);
|
new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);
|
||||||
|
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
jo_mst.put("upload_mes", "1");
|
||||||
|
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||||
|
jo_mst.put("upload_time", DateUtil.now());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,6 +151,12 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
|
|
||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
||||||
|
|
||||||
|
jo_mst.put("upload_mes", "1");
|
||||||
|
if (jo_mst.getString("upload_sap").equals("1")) {
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
}
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调拨出库
|
// 调拨出库
|
||||||
@@ -170,6 +188,10 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
|
|
||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
||||||
|
|
||||||
|
jo_mst.put("upload_mes", "1");
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 改切出库
|
// 改切出库
|
||||||
@@ -186,6 +208,11 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
mes_jo.put("package_box_sn", source_dtl.getString("box_no"));
|
mes_jo.put("package_box_sn", source_dtl.getString("box_no"));
|
||||||
mes_jo.put("warehouse", "3");
|
mes_jo.put("warehouse", "3");
|
||||||
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mes_jo);
|
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mes_jo);
|
||||||
|
|
||||||
|
jo_mst.put("upload_mes", "1");
|
||||||
|
if (jo_mst.getString("upload_sap").equals("1")) {
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -215,7 +242,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
String stor_id = jo_mst.getString("stor_id");
|
String stor_id = jo_mst.getString("stor_id");
|
||||||
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("stor_id = '" + stor_id + "'").uniqueResult(0);
|
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("stor_id = '" + stor_id + "'").uniqueResult(0);
|
||||||
String lgort = stor_jo.getString("ext_id");
|
String lgort = stor_jo.getString("ext_id");
|
||||||
String is_virtualstore = stor_jo.getString("is_virtualstore");
|
|
||||||
String is_productstore = stor_jo.getString("is_productstore");
|
String is_productstore = stor_jo.getString("is_productstore");
|
||||||
//退货入库
|
//退货入库
|
||||||
if (StrUtil.equals(bill_type, "0002")) {
|
if (StrUtil.equals(bill_type, "0002")) {
|
||||||
@@ -276,6 +302,10 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
|
|
||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToSapServiceImpl().returnDelivery(param);
|
new LmsToSapServiceImpl().returnDelivery(param);
|
||||||
|
|
||||||
|
jo_mst.put("upload_sap", "1");
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 销售出库
|
// 销售出库
|
||||||
@@ -339,6 +369,11 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
|
|
||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToSapServiceImpl().returnDelivery(param);
|
new LmsToSapServiceImpl().returnDelivery(param);
|
||||||
|
|
||||||
|
jo_mst.put("upload_sap", "1");
|
||||||
|
if (jo_mst.getString("upload_mes").equals("1") || is_productstore.equals("0")) {
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 改切出库
|
// 改切出库
|
||||||
@@ -394,26 +429,18 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
System.out.println(paramMst.toString());
|
System.out.println(paramMst.toString());
|
||||||
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
||||||
|
|
||||||
|
jo_mst.put("upload_sap", "1");
|
||||||
|
if (jo_mst.getString("upload_mes").equals("1")) {
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Override
|
@Override
|
||||||
public void disupload(JSONObject whereJson) {
|
public void disupload(JSONObject whereJson) {
|
||||||
//出库分配表
|
|
||||||
WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
|
||||||
//出库明细表
|
|
||||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
|
||||||
//出库主表
|
|
||||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
|
||||||
// 物料表
|
|
||||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
|
||||||
// 库区表
|
|
||||||
WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr");
|
|
||||||
// 子卷包装关系表
|
|
||||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
|
||||||
|
|
||||||
JSONArray rows = whereJson.getJSONArray("rows");
|
JSONArray rows = whereJson.getJSONArray("rows");
|
||||||
|
|
||||||
@@ -423,6 +450,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
jo_mst.put("upload_time", DateUtil.now());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +479,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
String stor_id = jo_mst.getString("stor_id");
|
String stor_id = jo_mst.getString("stor_id");
|
||||||
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("stor_id = '" + stor_id + "'").uniqueResult(0);
|
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("stor_id = '" + stor_id + "'").uniqueResult(0);
|
||||||
String lgort = stor_jo.getString("ext_id");
|
String lgort = stor_jo.getString("ext_id");
|
||||||
String is_virtualstore = stor_jo.getString("is_virtualstore");
|
|
||||||
String is_productstore = stor_jo.getString("is_productstore");
|
String is_productstore = stor_jo.getString("is_productstore");
|
||||||
//生产入库
|
//生产入库
|
||||||
if (StrUtil.equals(bill_type, "0001")) {
|
if (StrUtil.equals(bill_type, "0001")) {
|
||||||
@@ -465,7 +492,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
JSONObject paramMesMst = new JSONObject();
|
JSONObject paramMesMst = new JSONObject();
|
||||||
paramMesMst.put("PackageBoxSN", box_row.getString("box_no"));
|
paramMesMst.put("PackageBoxSN", box_row.getString("box_no"));
|
||||||
paramMesMst.put("User", box_row.getString("confirm_optname"));
|
paramMesMst.put("User", box_row.getString("confirm_optname"));
|
||||||
|
|
||||||
new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);
|
new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);
|
||||||
|
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
jo_mst.put("upload_mes", "1");
|
||||||
|
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||||
|
jo_mst.put("upload_time", DateUtil.now());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -528,6 +561,12 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
|
|
||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToSapServiceImpl().returnDelivery(param);
|
new LmsToSapServiceImpl().returnDelivery(param);
|
||||||
|
|
||||||
|
jo_mst.put("upload_sap", "1");
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||||
|
jo_mst.put("upload_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
}
|
}
|
||||||
// 销售出库
|
// 销售出库
|
||||||
if (StrUtil.equals(bill_type, "1001")) {
|
if (StrUtil.equals(bill_type, "1001")) {
|
||||||
@@ -591,8 +630,12 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToSapServiceImpl().returnDelivery(param);
|
new LmsToSapServiceImpl().returnDelivery(param);
|
||||||
|
|
||||||
|
jo_mst.put("upload_sap", "1");
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
|
|
||||||
|
|
||||||
// 2.回传mes
|
// 2.回传mes
|
||||||
if (is_productstore.equals("1")){
|
if (is_productstore.equals("1")) {
|
||||||
JSONObject paramMesMst = new JSONObject();
|
JSONObject paramMesMst = new JSONObject();
|
||||||
String userName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
String userName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
String passWord = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
String passWord = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||||
@@ -619,6 +662,10 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
|
|
||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
||||||
|
|
||||||
|
jo_mst.put("upload_mes", "1");
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,6 +703,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
||||||
|
|
||||||
|
jo_mst.put("upload_sap", "1");
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
|
|
||||||
//调用母卷配送到位接口
|
//调用母卷配送到位接口
|
||||||
JSONObject mes_jo = new JSONObject();
|
JSONObject mes_jo = new JSONObject();
|
||||||
|
|
||||||
@@ -665,6 +715,10 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
mes_jo.put("package_box_sn", disArr.getJSONObject(0).getString("box_no"));
|
mes_jo.put("package_box_sn", disArr.getJSONObject(0).getString("box_no"));
|
||||||
mes_jo.put("warehouse", "3");
|
mes_jo.put("warehouse", "3");
|
||||||
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mes_jo);
|
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mes_jo);
|
||||||
|
|
||||||
|
jo_mst.put("upload_mes", "1");
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调拨出库
|
// 调拨出库
|
||||||
@@ -696,12 +750,12 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
|
|
||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
||||||
|
|
||||||
|
jo_mst.put("upload_mes", "1");
|
||||||
|
jo_mst.put("is_upload", "1");
|
||||||
|
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
}
|
}
|
||||||
|
|
||||||
jo_mst.put("is_upload", "1");
|
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
输入.is_upload TYPEAS s_string
|
输入.is_upload TYPEAS s_string
|
||||||
输入.begin_time TYPEAS s_string
|
输入.begin_time TYPEAS s_string
|
||||||
输入.end_time TYPEAS s_string
|
输入.end_time TYPEAS s_string
|
||||||
|
输入.vbeln TYPEAS s_string
|
||||||
输入.bill_status TYPEAS s_string
|
输入.bill_status TYPEAS s_string
|
||||||
输入.iostorinv_id TYPEAS s_string
|
输入.iostorinv_id TYPEAS s_string
|
||||||
输入.bill_code TYPEAS s_string
|
输入.bill_code TYPEAS s_string
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
输入.io_type TYPEAS s_string
|
输入.io_type TYPEAS s_string
|
||||||
输入.material_type_id TYPEAS f_string
|
输入.material_type_id TYPEAS f_string
|
||||||
输入.iostorinv_id TYPEAS s_string
|
输入.iostorinv_id TYPEAS s_string
|
||||||
|
输入.is_writeoff TYPEAS s_string
|
||||||
输入.ids TYPEAS f_string
|
输入.ids TYPEAS f_string
|
||||||
输入.box_no TYPEAS s_string
|
输入.box_no TYPEAS s_string
|
||||||
输入.in_stor_id TYPEAS f_string
|
输入.in_stor_id TYPEAS f_string
|
||||||
@@ -61,6 +63,7 @@
|
|||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
mst.*,
|
mst.*,
|
||||||
dtl.source_bill_type,
|
dtl.source_bill_type,
|
||||||
|
dtl.vbeln,
|
||||||
user.nick_name AS upload_name
|
user.nick_name AS upload_name
|
||||||
FROM
|
FROM
|
||||||
st_ivt_iostorinv mst
|
st_ivt_iostorinv mst
|
||||||
@@ -80,6 +83,10 @@
|
|||||||
dtl.pcsn = 输入.pcsn
|
dtl.pcsn = 输入.pcsn
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.is_writeoff <> ""
|
||||||
|
mst.is_writeoff = 输入.is_writeoff
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
OPTION 输入.bill_status <> ""
|
OPTION 输入.bill_status <> ""
|
||||||
mst.bill_status = 输入.bill_status
|
mst.bill_status = 输入.bill_status
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
@@ -114,6 +121,9 @@
|
|||||||
OPTION 输入.end_time <> ""
|
OPTION 输入.end_time <> ""
|
||||||
mst.input_time <= 输入.end_time
|
mst.input_time <= 输入.end_time
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
OPTION 输入.vbeln <> ""
|
||||||
|
dtl.vbeln = 输入.vbeln
|
||||||
|
ENDOPTION
|
||||||
OPTION 输入.material_search <> ""
|
OPTION 输入.material_search <> ""
|
||||||
(
|
(
|
||||||
mb.material_code like 输入.material_search
|
mb.material_code like 输入.material_search
|
||||||
|
|||||||
@@ -204,6 +204,8 @@
|
|||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="is_upload" label="是否回传" :formatter="formatIsUpload" />
|
<el-table-column show-overflow-tooltip prop="is_upload" label="是否回传" :formatter="formatIsUpload" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="upload_mes" label="回传MES" :formatter="formatUploadMes" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="upload_sap" label="回传SAP" :formatter="formatUploadSap" />
|
||||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||||
@@ -374,11 +376,10 @@ export default {
|
|||||||
const data = {}
|
const data = {}
|
||||||
data.rows = res
|
data.rows = res
|
||||||
inandoutreturn.disupload(data).then(res => {
|
inandoutreturn.disupload(data).then(res => {
|
||||||
this.fullscreenLoading = false
|
|
||||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
this.crud.toQuery()
|
}).finally(() => {
|
||||||
}).catch(() => {
|
|
||||||
this.fullscreenLoading = false
|
this.fullscreenLoading = false
|
||||||
|
this.crud.toQuery()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
uploadSAP() {
|
uploadSAP() {
|
||||||
@@ -391,11 +392,10 @@ export default {
|
|||||||
const data = {}
|
const data = {}
|
||||||
data.rows = res
|
data.rows = res
|
||||||
inandoutreturn.uploadSAP(data).then(res => {
|
inandoutreturn.uploadSAP(data).then(res => {
|
||||||
this.fullscreenLoading = false
|
|
||||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
this.crud.toQuery()
|
}).finally(() => {
|
||||||
}).catch(() => {
|
|
||||||
this.fullscreenLoading = false
|
this.fullscreenLoading = false
|
||||||
|
this.crud.toQuery()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
uploadMES() {
|
uploadMES() {
|
||||||
@@ -421,6 +421,20 @@ export default {
|
|||||||
} else if (row.is_upload === '1') {
|
} else if (row.is_upload === '1') {
|
||||||
return '是'
|
return '是'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
formatUploadMes(row) {
|
||||||
|
if (row.upload_mes === '0') {
|
||||||
|
return '否'
|
||||||
|
} else if (row.upload_mes === '1') {
|
||||||
|
return '是'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formatUploadSap(row) {
|
||||||
|
if (row.upload_sap === '0') {
|
||||||
|
return '否'
|
||||||
|
} else if (row.upload_sap === '1') {
|
||||||
|
return '是'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,6 +154,7 @@
|
|||||||
</el-button>-->
|
</el-button>-->
|
||||||
<el-button
|
<el-button
|
||||||
slot="left"
|
slot="left"
|
||||||
|
:loading="divBtn"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@@ -267,6 +268,7 @@ export default {
|
|||||||
bucketProp: {},
|
bucketProp: {},
|
||||||
structShow: false,
|
structShow: false,
|
||||||
bucketObj: null,
|
bucketObj: null,
|
||||||
|
divBtn: false,
|
||||||
bucketShow: false,
|
bucketShow: false,
|
||||||
sects: [],
|
sects: [],
|
||||||
sect_val: null,
|
sect_val: null,
|
||||||
@@ -508,6 +510,7 @@ export default {
|
|||||||
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.divBtn = true
|
||||||
this.form.sect_id = this.sect_id
|
this.form.sect_id = this.sect_id
|
||||||
this.form.stor_id = this.stor_id
|
this.form.stor_id = this.stor_id
|
||||||
this.form.is_pc = '1'
|
this.form.is_pc = '1'
|
||||||
@@ -517,8 +520,11 @@ export default {
|
|||||||
})
|
})
|
||||||
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
|
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
|
||||||
this.form.tableMater = res
|
this.form.tableMater = res
|
||||||
|
this.divBtn = false
|
||||||
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
})
|
})
|
||||||
|
}).finally(() => {
|
||||||
|
this.divBtn = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.structShow = true
|
this.structShow = true
|
||||||
|
|||||||
@@ -103,6 +103,15 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="交货单号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.vbeln"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
placeholder="交货单号"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<rrOperation />
|
<rrOperation />
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -201,6 +210,7 @@
|
|||||||
<el-table-column label="总重量" align="center" prop="total_qty" width="100" />
|
<el-table-column label="总重量" align="center" prop="total_qty" width="100" />
|
||||||
<el-table-column show-overflow-tooltip label="客户" align="center" prop="cust_simple_name" width="100" />
|
<el-table-column show-overflow-tooltip label="客户" align="center" prop="cust_simple_name" width="100" />
|
||||||
<el-table-column show-overflow-tooltip label="客户编码" align="center" prop="cust_code" width="100" />
|
<el-table-column show-overflow-tooltip label="客户编码" align="center" prop="cust_code" width="100" />
|
||||||
|
<el-table-column show-overflow-tooltip label="交货单号" align="center" prop="vbeln" width="100" />
|
||||||
<el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="100" />
|
<el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="100" />
|
||||||
<el-table-column show-overflow-tooltip label="制单人" align="center" prop="input_optname" />
|
<el-table-column show-overflow-tooltip label="制单人" align="center" prop="input_optname" />
|
||||||
<el-table-column show-overflow-tooltip label="制单时间" align="center" prop="input_time" width="140" />
|
<el-table-column show-overflow-tooltip label="制单时间" align="center" prop="input_time" width="140" />
|
||||||
|
|||||||
@@ -126,9 +126,18 @@
|
|||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="品质类型">
|
<el-form-item label="交货单号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.vbeln"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
placeholder="批次模糊查询"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否冲销">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="query.quality_scode"
|
v-model="query.is_writeoff"
|
||||||
clearable
|
clearable
|
||||||
size="mini"
|
size="mini"
|
||||||
placeholder="全部"
|
placeholder="全部"
|
||||||
@@ -136,7 +145,7 @@
|
|||||||
@change="crud.toQuery"
|
@change="crud.toQuery"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dict.ST_QUALITY_SCODE"
|
v-for="item in dict.IS_OR_NOT"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -213,12 +222,15 @@
|
|||||||
{{ fun(scope.row.total_qty) }}
|
{{ fun(scope.row.total_qty) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="交货单号" align="center" prop="vbeln" />
|
||||||
<el-table-column label="制单人" align="center" prop="input_optname" />
|
<el-table-column label="制单人" align="center" prop="input_optname" />
|
||||||
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
|
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
|
||||||
<el-table-column label="修改人" align="center" prop="update_optname" />
|
<el-table-column label="修改人" align="center" prop="update_optname" />
|
||||||
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
|
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
|
||||||
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150" />
|
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150" />
|
||||||
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
|
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
|
||||||
|
<el-table-column label="是否冲销" align="center" :formatter="writeoffFormat" prop="is_writeoff" width="150" />
|
||||||
|
<el-table-column label="是否回传" align="center" :formatter="uploadFormat" prop="is_upload" width="150" />
|
||||||
<el-table-column label="回传人" align="center" prop="upload_name" width="150" />
|
<el-table-column label="回传人" align="center" prop="upload_name" width="150" />
|
||||||
<el-table-column label="回传时间" align="center" prop="upload_time" width="150" />
|
<el-table-column label="回传时间" align="center" prop="upload_time" width="150" />
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -262,7 +274,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mixins: [presenter(), header(), crud()],
|
mixins: [presenter(), header(), crud()],
|
||||||
// 数据字典
|
// 数据字典
|
||||||
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'io_type', 'is_upload', 'ST_INV_IN_TYPE', 'ST_INV_OUT_TYPE'],
|
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'io_type', 'is_upload', 'ST_INV_IN_TYPE', 'ST_INV_OUT_TYPE', 'IS_OR_NOT'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||||
@@ -347,6 +359,12 @@ export default {
|
|||||||
create_modeFormat(row) {
|
create_modeFormat(row) {
|
||||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||||
},
|
},
|
||||||
|
writeoffFormat(row) {
|
||||||
|
return this.dict.label.IS_OR_NOT[row.create_mode]
|
||||||
|
},
|
||||||
|
uploadFormat(row) {
|
||||||
|
return this.dict.label.IS_OR_NOT[row.create_mode]
|
||||||
|
},
|
||||||
handleCurrentChange(current) {
|
handleCurrentChange(current) {
|
||||||
if (current === null) {
|
if (current === null) {
|
||||||
this.dis_flag = true
|
this.dis_flag = true
|
||||||
|
|||||||
Reference in New Issue
Block a user