Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
# Conflicts: # lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls
This commit is contained in:
Binary file not shown.
@@ -209,6 +209,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
jsonCool.put("pcsn", "");
|
||||
jsonCool.put("bill_status", "10");
|
||||
jsonCool.put("task_id", task_id);
|
||||
jsonCool.put("qty_unit_id", "1");
|
||||
jsonCool.put("start_point_code", point_code1);
|
||||
jsonCool.put("end_point_code", jsonHotIvt.getString("point_code"));
|
||||
jsonCool.put("create_mode", "03");
|
||||
@@ -354,6 +355,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
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);
|
||||
|
||||
@@ -378,6 +380,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
jsonCool.put("material_id", "");
|
||||
jsonCool.put("pcsn", "");
|
||||
jsonCool.put("bill_status", "10");
|
||||
jsonCool.put("qty_unit_id", "1");
|
||||
jsonCool.put("task_id", task_id);
|
||||
jsonCool.put("start_point_code", point_code1);
|
||||
jsonCool.put("end_point_code", jsonCooIvt.getString("full_point_code"));
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
package org.nl.wms.pda.st.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.st.service.ProductionOutService;
|
||||
import org.nl.wms.pda.st.service.VirtualOutService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "虚拟区发货")
|
||||
@RequestMapping("/api/pda/virtual")
|
||||
@Slf4j
|
||||
public class VirtualOutController {
|
||||
|
||||
private final VirtualOutService virtualOutService;
|
||||
|
||||
@PostMapping("/billQuery")
|
||||
@Log("出库初始化查询")
|
||||
@ApiOperation("出库初始化查询")
|
||||
public ResponseEntity<Object> ivtQuery(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(virtualOutService.ivtQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/billType")
|
||||
@Log("获取单据类型")
|
||||
@ApiOperation("获取单据类型")
|
||||
public ResponseEntity<Object> billType(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(virtualOutService.billType(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/ivtQuery")
|
||||
@Log("分配明细查询")
|
||||
@ApiOperation("分配明细查询")
|
||||
public ResponseEntity<Object> ivtDisQuery(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(virtualOutService.ivtDisQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/outConfirm")
|
||||
@Log("出库确认")
|
||||
@ApiOperation("出库确认")
|
||||
public ResponseEntity<Object> outConfirm(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(virtualOutService.outConfirm(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
package org.nl.wms.pda.st.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
public interface VirtualOutService {
|
||||
|
||||
/**
|
||||
* 出库初始化查询
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject ivtQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取单据类型
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject billType(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 分配明细查询
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject ivtDisQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 出库确认
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject outConfirm(JSONObject whereJson);
|
||||
}
|
||||
@@ -32,15 +32,9 @@ public class ProductionOutServiceImpl implements ProductionOutService {
|
||||
|
||||
@Override
|
||||
public JSONObject ivtQuery(JSONObject whereJson) {
|
||||
/* option
|
||||
* 0-生产区查询
|
||||
* 1-虚拟区查询
|
||||
*/
|
||||
String option = whereJson.getString("option");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
if (StrUtil.equals(option, "0")) map.put("flag", "1");
|
||||
if (StrUtil.equals(option, "1")) map.put("flag", "2");
|
||||
map.put("flag", "1");
|
||||
map.put("box_no", whereJson.getString("box_no"));
|
||||
map.put("point_code", whereJson.getString("point_code"));
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_PRODUVTIONOUT").addParamMap(map).process().getResultJSONArray(0);
|
||||
@@ -66,94 +60,26 @@ public class ProductionOutServiceImpl implements ProductionOutService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject outConfirm(JSONObject whereJson) {
|
||||
/* option
|
||||
* 0-生产区确认
|
||||
* 1-虚拟区确认
|
||||
*/
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt"); // 仓位库存表
|
||||
WQLObject subTab = WQLObject.getWQLObject("PDM_BI_SubPackageRelation"); // 子卷包装关系表
|
||||
WQLObject ioMstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库单主表
|
||||
WQLObject ioDtlTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl"); // 出入库单明细表
|
||||
WQLObject ioDidsTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); // 出入库单分配表
|
||||
|
||||
String option = whereJson.getString("option");
|
||||
JSONObject box_no = whereJson.getJSONObject("box_no");
|
||||
|
||||
Long deptId = SecurityUtils.getDeptId();
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject jsonSub = subTab.query("package_box_SN = '" + box_no + "'").uniqueResult(0);
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("vehicle_code = '" + box_no + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (StrUtil.equals(option, "0")) {
|
||||
/*
|
||||
* 0 - 生产区确认
|
||||
* a.解锁出库点位、清除木箱号
|
||||
*/
|
||||
jsonPoint.put("point_status", "00");
|
||||
jsonPoint.put("lock_type", "1");
|
||||
jsonPoint.put("vehicle_code", "");
|
||||
jsonPoint.put("vehicle_type", "");
|
||||
jsonPoint.put("vehicle_qty", 0);
|
||||
pointTab.update(jsonPoint);
|
||||
} else {
|
||||
/*
|
||||
* 1 - 虚拟区确认
|
||||
* a.生成出库单主表、明细表、分配表并确认
|
||||
* b.更新库存
|
||||
* c.更新点位
|
||||
*/
|
||||
/*
|
||||
* 生产区确认
|
||||
* a.解锁出库点位、清除木箱号
|
||||
*/
|
||||
jsonPoint.put("point_status", "00");
|
||||
jsonPoint.put("lock_type", "1");
|
||||
jsonPoint.put("vehicle_code", "");
|
||||
jsonPoint.put("vehicle_type", "");
|
||||
jsonPoint.put("vehicle_qty", 0);
|
||||
pointTab.update(jsonPoint);
|
||||
|
||||
JSONObject jsonIvt = ivtTab.query("pcsn = '" + jsonSub.getString("container_name") + "'").uniqueResult(0);
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "出库成功!");
|
||||
|
||||
// 生成出库单主表
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
jsonMst.put("iostorinv_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonMst.put("bill_code", CodeUtil.getNewCode("IO_CODE"));
|
||||
jsonMst.put("io_type", "1");
|
||||
jsonMst.put("buss_type", "");
|
||||
jsonMst.put("bill_type", "");
|
||||
jsonMst.put("biz_date", DateUtil.today());
|
||||
jsonMst.put("detail_count", 1);
|
||||
jsonMst.put("bill_status", "99");
|
||||
jsonMst.put("create_mode", "02");
|
||||
jsonMst.put("input_optid", currentUserId);
|
||||
jsonMst.put("input_optname", nickName);
|
||||
jsonMst.put("input_time", now);
|
||||
jsonMst.put("update_optid", currentUserId);
|
||||
jsonMst.put("update_optname", nickName);
|
||||
jsonMst.put("update_time", now);
|
||||
jsonMst.put("dis_optid", currentUserId);
|
||||
jsonMst.put("dis_optname", nickName);
|
||||
jsonMst.put("dis_time", now);
|
||||
jsonMst.put("confirm_optid", currentUserId);
|
||||
jsonMst.put("confirm_optname", nickName);
|
||||
jsonMst.put("confirm_time", now);
|
||||
jsonMst.put("sysdeptid", deptId);
|
||||
jsonMst.put("syscompanyid", deptId);
|
||||
ioMstTab.insert(jsonMst);
|
||||
|
||||
// 生成出库单明细表
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("iostorinvdtl_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonDtl.put("iostorinv_id", jsonMst.getString("iostorinv_id"));
|
||||
jsonDtl.put("seq_no", 1);
|
||||
// jsonDtl.put("material_id", "");
|
||||
jsonDtl.put("pcsn", jsonSub.getString("container_name"));
|
||||
jsonDtl.put("box_no", box_no);
|
||||
jsonDtl.put("bill_status", "99");
|
||||
jsonDtl.put("qty_unit_id", 1);
|
||||
jsonDtl.put("qty_unit_name", "KG");
|
||||
jsonDtl.put("plan_qty", jsonIvt.getDoubleValue("ivt_qty"));
|
||||
jsonDtl.put("real_qty", jsonIvt.getDoubleValue("ivt_qty"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
|
||||
package org.nl.wms.pda.st.service.impl;
|
||||
|
||||
|
||||
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.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pda.st.service.VirtualOutService;
|
||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||
import org.nl.wms.st.outbill.service.impl.CheckOutBillServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class VirtualOutServiceImpl implements VirtualOutService {
|
||||
|
||||
private final CheckOutBillService checkOutBillService;
|
||||
|
||||
@Override
|
||||
public JSONObject ivtQuery(JSONObject whereJson) {
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("box_no", whereJson.getString("box_no"));
|
||||
map.put("bill_code", whereJson.getString("bill_code"));
|
||||
map.put("bill_type", whereJson.getString("bill_type"));
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_VIRTUALOUT").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject billType(JSONObject whereJson) {
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_VIRTUALOUT").addParam("flag", "3").process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("rows", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject ivtDisQuery(JSONObject whereJson) {
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("box_no", whereJson.getString("box_no"));
|
||||
map.put("bill_code", whereJson.getString("bill_code"));
|
||||
map.put("material_code", whereJson.getString("material_code"));
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_VIRTUALOUT").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject jsonObject = resultJSONArray.getJSONObject(i);
|
||||
String isRePrintPackageBoxLabel = jsonObject.getString("isRePrintPackageBoxLabel");
|
||||
String isUnPackBox = jsonObject.getString("isUnPackBox");
|
||||
|
||||
if (StrUtil.equals(isRePrintPackageBoxLabel, "1") || StrUtil.equals(isUnPackBox, "1")) {
|
||||
jsonObject.put("colro_flag", "1");
|
||||
} else {
|
||||
jsonObject.put("colro_flag", "0");
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject outConfirm(JSONObject whereJson) {
|
||||
|
||||
WQLObject disTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); // 出入库分配明细表
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl"); // 出入库明细表
|
||||
|
||||
String box_no = whereJson.getString("box_no"); // 箱号
|
||||
|
||||
JSONArray disArr = disTab.query("box_no = '" + box_no + "' and work_status <> '99'").getResultJSONArray(0);
|
||||
for (int i = 0; i < disArr.size(); i++) {
|
||||
JSONObject jsonDis = disArr.getJSONObject(i);
|
||||
// 更新状态为完成
|
||||
jsonDis.put("work_status", "99");
|
||||
disTab.update(jsonDis);
|
||||
|
||||
// 判断分配明细是否全部完成
|
||||
JSONArray disNoArr = disTab.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "' and work_status <> '99'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(disNoArr)) {
|
||||
// 更新明细表状态为完成
|
||||
JSONObject jsonDtl = dtlTab.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
jsonDtl.put("bill_status", "99");
|
||||
dtlTab.update(jsonDtl);
|
||||
|
||||
// 判断此明细是否全部完成
|
||||
JSONArray dtlNoArr = dtlTab.query("iostorinv_id = '" + jsonDis.getString("iostorinv_id") + "' and bill_status <> '99'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(dtlNoArr)) {
|
||||
// 调用强制完成接口
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("iostorinv_id",jsonDis.getString("iostorinv_id"));
|
||||
checkOutBillService.confirm(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "出库成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
[交易说明]
|
||||
交易名: 成品出库
|
||||
交易名: 发货区出库
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
@@ -82,49 +82,4 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
sub.package_box_SN AS package_box_SN,
|
||||
sub.container_name AS container_name,
|
||||
sub.product_name AS product_name,
|
||||
sub.product_description AS product_description,
|
||||
sub.net_weight AS net_weight,
|
||||
(
|
||||
CASE
|
||||
sub.isRePrintPackageBoxLabel
|
||||
WHEN '1' THEN '是'
|
||||
WHEN '0' THEN '否'
|
||||
END
|
||||
) AS change_out,
|
||||
(
|
||||
CASE
|
||||
sub.isUnPackBox
|
||||
WHEN '1' THEN '是'
|
||||
WHEN '0' THEN '否'
|
||||
END
|
||||
) AS change_in,
|
||||
|
||||
sub.isRePrintPackageBoxLabel,
|
||||
sub.isUnPackBox,
|
||||
attr.struct_code AS point_code
|
||||
FROM
|
||||
PDM_BI_SubPackageRelation sub
|
||||
LEFT JOIN ST_IVT_StructIvt ivt ON sub.container_name = ivt.pcsn
|
||||
LEFT JOIN ST_IVT_StructAttr attr ON attr.struct_id = ivt.struct_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
attr.storagevehicle_code = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
attr.struct_code = 输入.point_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -0,0 +1,149 @@
|
||||
[交易说明]
|
||||
交易名: 虚拟区出库
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
输入.bill_type TYPEAS s_string
|
||||
输入.material_code TYPEAS s_string
|
||||
输入.box_no TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
mst.iostorinv_id,
|
||||
mst.bill_code,
|
||||
(
|
||||
CASE
|
||||
mst.bill_type
|
||||
WHEN '1001' THEN '发货出库'
|
||||
WHEN '1002' THEN '报废出库'
|
||||
WHEN '1003' THEN '改切出库'
|
||||
WHEN '1009' THEN '手工出库'
|
||||
END
|
||||
) AS bill_type_name,
|
||||
mst.source_id AS source_bill_code,
|
||||
mst.biz_date,
|
||||
mst.input_optname AS person_name
|
||||
FROM
|
||||
ST_IVT_IOStorInv mst
|
||||
LEFT JOIN ST_IVT_IOStorInvDis dis ON dis.iostorinv_id = mst.iostorinv_id
|
||||
WHERE
|
||||
dis.sect_id = '1586913215886004224'
|
||||
AND mst.is_delete = '0'
|
||||
AND mst.bill_status <> '99'
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
dis.box_no = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
mst.bill_code = 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_type <> ""
|
||||
mst.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
dis.box_no AS package_box_SN,
|
||||
dis.pcsn AS container_name,
|
||||
mater.material_code AS product_name,
|
||||
mater.material_name AS product_description,
|
||||
sub.net_weight,
|
||||
sub.isRePrintPackageBoxLabel,
|
||||
sub.isUnPackBox,
|
||||
(
|
||||
CASE
|
||||
sub.isRePrintPackageBoxLabel
|
||||
WHEN '0' THEN '否'
|
||||
WHEN '1' THEN '是'
|
||||
END
|
||||
) AS change_out,
|
||||
(
|
||||
CASE
|
||||
sub.isUnPackBox
|
||||
WHEN '0' THEN '否'
|
||||
WHEN '1' THEN '是'
|
||||
END
|
||||
) AS change_in,
|
||||
dis.iostorinvdis_id
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
LEFT JOIN ST_IVT_IOStorInv mst ON dis.iostorinv_id = mst.iostorinv_id
|
||||
LEFT JOIN md_me_materialbase mater ON dis.material_id = mater.material_id
|
||||
LEFT JOIN PDM_BI_SubPackageRelation sub ON dis.pcsn = sub.container_name
|
||||
WHERE
|
||||
dis.sect_id = '1586913215886004224'
|
||||
AND mst.is_delete = '0'
|
||||
AND dis.work_status <> '99'
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
dis.box_no = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
mst.bill_code = 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.material_code <> ""
|
||||
mater.material_code = 输入.material_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
label,
|
||||
value
|
||||
FROM
|
||||
sys_dict_detail
|
||||
WHERE
|
||||
name = 'ST_INV_OUT_TYPE'
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -64,4 +64,11 @@ public class HotPointIvtController {
|
||||
hotpointivtService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/taskDtlQuery")
|
||||
@Log("查询烘烤任务明细")
|
||||
@ApiOperation("查询烘烤任务明细")
|
||||
public ResponseEntity<Object> taskDtlQuery(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(hotpointivtService.taskDtlQuery(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,4 +61,13 @@ public interface HotPointIvtService {
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 任务明细分页查询
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> taskDtlQuery(Map whereJson, Pageable page);
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.pdm.ivt.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -137,4 +138,26 @@ public class HotPointIvtServiceImpl implements HotPointIvtService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> taskDtlQuery(Map whereJson, Pageable page) {
|
||||
|
||||
String task_code = MapUtil.getStr(whereJson, "task_code");
|
||||
String start_point_code = MapUtil.getStr(whereJson, "start_point_code");
|
||||
String next_point_code = MapUtil.getStr(whereJson, "next_point_code");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag","2");
|
||||
map.put("bill_code", MapUtil.getStr(whereJson,"bill_code"));
|
||||
map.put("dtl_status", MapUtil.getStr(whereJson,"dtl_status"));
|
||||
map.put("begin_time", whereJson.get("begin_time"));
|
||||
map.put("end_time", whereJson.get("end_time"));
|
||||
if (ObjectUtil.isNotEmpty(task_code)) map.put("task_code","%"+task_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(start_point_code)) map.put("start_point_code","%"+start_point_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(next_point_code)) map.put("next_point_code","%"+next_point_code+"%");
|
||||
|
||||
JSONObject json = WQL.getWO("ST_IVT_HOTPOINTIVT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "create_time DESC");
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
|
||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
||||
|
||||
JSONObject json = tab.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
|
||||
json.put("status", "2");
|
||||
json.put("status", "09");
|
||||
json.put("finish_type", "02");
|
||||
json.put("realend_time", DateUtil.now());
|
||||
json.put("update_optid", currentUserId);
|
||||
|
||||
@@ -17,9 +17,14 @@
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.point_status TYPEAS s_string
|
||||
输入.product_area TYPEAS s_string
|
||||
输入.is_used TYPEAS s_string
|
||||
输入.is_used TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
输入.dtl_status TYPEAS s_string
|
||||
输入.task_code TYPEAS s_string
|
||||
输入.start_point_code TYPEAS s_string
|
||||
输入.next_point_code TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -71,4 +76,72 @@
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
mst.bill_code,
|
||||
dtl.start_point_code,
|
||||
dtl.next_point_code,
|
||||
dtl.temperature,
|
||||
dtl.oven_time,
|
||||
dtl.create_name,
|
||||
dtl.create_time,
|
||||
dtl.confirm_optname,
|
||||
dtl.confirm_time,
|
||||
(
|
||||
CASE
|
||||
dtl.dtl_status
|
||||
WHEN '10' THEN '生成'
|
||||
WHEN '40' THEN '执行中'
|
||||
WHEN '50' THEN '确认'
|
||||
END
|
||||
) AS dtl_status,
|
||||
(
|
||||
CASE
|
||||
dtl.task_type
|
||||
WHEN '0' THEN 'AGV任务'
|
||||
WHEN '1' THEN '桁架任务'
|
||||
END
|
||||
) AS task_type,
|
||||
task.task_code
|
||||
FROM
|
||||
ST_IVT_HotRegionIODtl dtl
|
||||
LEFT JOIN ST_IVT_HotRegionIOMst mst ON mst.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dtl.task_id
|
||||
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
mst.bill_code = 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.dtl_status <> ""
|
||||
dtl.dtl_status = 输入.dtl_status
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.task_code <> ""
|
||||
task.task_code like 输入.task_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.start_point_code <> ""
|
||||
dtl.start_point_code like 输入.start_point_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.next_point_code <> ""
|
||||
dtl.next_point_code like 输入.next_point_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
dtl.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
dtl.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
Binary file not shown.
Binary file not shown.
@@ -324,12 +324,12 @@ public class PointServiceImpl implements PointService {
|
||||
structMap.put("point_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
structMap.put("point_code", json.getString("struct_code"));
|
||||
structMap.put("point_name", json.getString("struct_name"));
|
||||
structMap.put("region_id", "");
|
||||
structMap.put("region_code", "");
|
||||
structMap.put("region_name", "");
|
||||
structMap.put("point_type", "01");
|
||||
structMap.put("point_status", "00");
|
||||
structMap.put("lock_type", "1");
|
||||
structMap.put("region_id", json.get("sect_id"));
|
||||
structMap.put("region_code", json.getString("sect_code"));
|
||||
structMap.put("region_name", json.getString("sect_name"));
|
||||
structMap.put("point_type", "2");
|
||||
structMap.put("point_status", "1");
|
||||
structMap.put("lock_type", json.getString("lock_type"));
|
||||
structMap.put("block_num", json.getIntValue("block_num"));
|
||||
structMap.put("row_num", json.getIntValue("row_num"));
|
||||
structMap.put("col_num", json.getIntValue("col_num"));
|
||||
|
||||
@@ -72,8 +72,9 @@ public class TaskServiceImpl implements TaskService {
|
||||
map.put("vehicle_code", "%" + whereJson.getString("vehicle_code") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(whereJson.getString("task_type"))) {
|
||||
ClassstandardDto task_type = classstandardService.findById(whereJson.getString("task_type"));
|
||||
map.put("task_type", task_type.getClass_code());
|
||||
ClassstandardDto dto = classstandardService.findById(whereJson.getString("task_type"));
|
||||
String task_type = classstandardService.getChildIdStr(dto.getClass_id().toString());
|
||||
map.put("task_type", task_type);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(whereJson.getString("finishTypeList"))) {
|
||||
map.put("finishTypeList", whereJson.getString("finishTypeList"));
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
FROM
|
||||
ST_IVT_StructAttr struct
|
||||
left join
|
||||
SCH_BASE_Region region on struct.region_id = region.region_id
|
||||
SCH_BASE_Region region on struct.sect_id = region.region_id
|
||||
WHERE
|
||||
struct.is_delete = '0'
|
||||
ENDSELECT
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
输入.flag TYPEAS s_string
|
||||
输入.task_status TYPEAS s_string
|
||||
输入.finished_type TYPEAS s_string
|
||||
输入.task_type TYPEAS s_string
|
||||
输入.point_code1 TYPEAS s_string
|
||||
输入.point_code2 TYPEAS s_string
|
||||
输入.task_type TYPEAS f_string
|
||||
输入.point_code1 TYPEAS s_string
|
||||
输入.point_code2 TYPEAS s_string
|
||||
输入.task_code TYPEAS s_string
|
||||
输入.vehicle_code TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
@@ -60,7 +60,7 @@
|
||||
WHERE
|
||||
task.is_delete = '0'
|
||||
OPTION 输入.task_type <> ""
|
||||
task.task_type = 输入.task_type
|
||||
md.class_id in 输入.task_type
|
||||
ENDOPTION
|
||||
OPTION 输入.finished_type <> ""
|
||||
task.finished_type = 输入.finished_type
|
||||
@@ -83,7 +83,7 @@
|
||||
OPTION 输入.task_code <> ""
|
||||
(task.task_code like 输入.task_code)
|
||||
ENDOPTION
|
||||
OPTION 输入.point_code <> ""
|
||||
OPTION 输入.point_code1 <> ""
|
||||
(task.point_code1 like 输入.point_code1)
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
|
||||
@@ -393,13 +393,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
dtl.put("struct_code", ivt.getString("struct_code"));
|
||||
dtl.put("struct_name", ivt.getString("struct_name"));
|
||||
dtl.put("pcsn", ivt.getString("pcsn"));
|
||||
dtl.put("work_status", "00");
|
||||
dtl.put("box_no", ivt.getString("storagevehicle_code"));
|
||||
dtl.put("storagevehicle_id", ivt.getString("storagevehicle_id"));
|
||||
dtl.put("storagevehicle_code", ivt.getString("storagevehicle_code"));
|
||||
dtl.put("storagevehicle_type", ivt.getString("storagevehicle_type"));
|
||||
dtl.put("is_issued", "0");
|
||||
dtl.put("plan_qty", ivt.getDoubleValue("change_qty"));
|
||||
dtl.put("real_qty", ivt.getDoubleValue("change_qty"));
|
||||
// 如果所属仓位是虚拟区 则将分配明细状态变为生成
|
||||
if (StrUtil.equals(ivt.getString("sect_code"), "XN01")) {
|
||||
dtl.put("work_status", "01");
|
||||
} else {
|
||||
dtl.put("work_status", "00");
|
||||
}
|
||||
wo_dis.insert(dtl);
|
||||
//记录需锁定的仓位
|
||||
Struct_map.put(ivt.getString("struct_id"), ivt);
|
||||
@@ -423,7 +429,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
Collection<JSONObject> c = Struct_map.values();
|
||||
Iterator<JSONObject> it = c.iterator();
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("lock_type", "01");
|
||||
from_start.put("lock_type", "2");
|
||||
for (; it.hasNext(); ) {
|
||||
JSONObject Struct = it.next();
|
||||
from_start.put("struct_id", Struct.getString("struct_id"));
|
||||
@@ -528,13 +534,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
//解锁起点仓位点位
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("struct_id", dis.getString("struct_id"));
|
||||
from_start.put("lock_type", "00");
|
||||
from_start.put("lock_type", "1");
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
//解锁终点仓位点位
|
||||
if (StrUtil.isNotEmpty(dis.getString("point_code"))) {
|
||||
JSONObject from_end = new JSONObject();
|
||||
from_end.put("point_code", dis.getString("point_code"));
|
||||
from_end.put("lock_type", "00");
|
||||
from_end.put("lock_type", "1");
|
||||
storPublicService.updateStructAndPoint(from_end);
|
||||
}
|
||||
} else {//仓位载具扔有冻结数,需改任务类型为拣选出库
|
||||
@@ -572,11 +578,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
if (ObjectUtil.isEmpty(jo_mst)) {
|
||||
throw new BadRequestException("未查到相关出库单");
|
||||
}
|
||||
JSONObject point = wo_Point.query("lock_type='00' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0);
|
||||
JSONObject point = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0);
|
||||
//如果终点站点被锁定或者有载具号,则不允许设置点位
|
||||
/* if (ObjectUtil.isEmpty(point)) {
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!");
|
||||
}*/
|
||||
}
|
||||
//查询未生成和生成未下发的分配记录
|
||||
JSONArray diss = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||
.addParam("flag", "5")
|
||||
@@ -613,7 +619,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
//解锁原终点
|
||||
JSONObject from_end = new JSONObject();
|
||||
from_end.put("point_code", dis.getString("point_code"));
|
||||
from_end.put("lock_type", "00");
|
||||
from_end.put("lock_type", "1");
|
||||
storPublicService.updateStructAndPoint(from_end);
|
||||
} else {//生成任务
|
||||
task = new JSONObject();
|
||||
@@ -747,13 +753,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
dtl.put("struct_code", ivt.getString("struct_code"));
|
||||
dtl.put("struct_name", ivt.getString("struct_name"));
|
||||
dtl.put("pcsn", ivt.getString("pcsn"));
|
||||
dtl.put("work_status", "00");
|
||||
dtl.put("box_no", ivt.getString("storagevehicle_code"));
|
||||
dtl.put("storagevehicle_id", ivt.getString("storagevehicle_id"));
|
||||
dtl.put("storagevehicle_code", ivt.getString("storagevehicle_code"));
|
||||
dtl.put("storagevehicle_type", ivt.getString("storagevehicle_type"));
|
||||
dtl.put("is_issued", "0");
|
||||
dtl.put("plan_qty", ivt.getDoubleValue("change_qty"));
|
||||
dtl.put("real_qty", ivt.getDoubleValue("change_qty"));
|
||||
// 如果所属仓位是虚拟区 则将分配明细状态变为生成
|
||||
if (StrUtil.equals(ivt.getString("sect_code"), "XN01")) {
|
||||
dtl.put("work_status", "01");
|
||||
} else {
|
||||
dtl.put("work_status", "00");
|
||||
}
|
||||
wo_dis.insert(dtl);
|
||||
//记录需锁定的仓位
|
||||
Struct_map.put(ivt.getString("struct_id"), ivt);
|
||||
@@ -789,7 +801,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
//锁定起点仓位点位
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("struct_id", Struct.getString("struct_id"));
|
||||
from_start.put("lock_type", "01");
|
||||
from_start.put("lock_type", "2");
|
||||
from_start.put("inv_type", jo_mst.getString("bill_type"));
|
||||
from_start.put("inv_id", jo_mst.getString("iostorinv_id"));
|
||||
from_start.put("inv_code", jo_mst.getString("bill_code"));
|
||||
@@ -888,7 +900,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
//解锁起点
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("struct_id", dis.getString("struct_id"));
|
||||
from_start.put("lock_type", "00");
|
||||
from_start.put("lock_type", "1");
|
||||
from_start.put("storagevehicle_code", "");
|
||||
// from_start.put("vehicle_code", "");
|
||||
if ("02".equals(dis.getString("taskdtl_type"))) {
|
||||
from_start.put("is_free", "1");
|
||||
}
|
||||
@@ -996,9 +1010,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
wo_dis.update(map, "task_id='" + task_id + "'");
|
||||
|
||||
// 更新明细为完成
|
||||
/* JSONObject jsonDtl = wo_dtl.query("iostorinvdtl_id = '" + whereJson.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
JSONObject jsonDtl = wo_dtl.query("iostorinvdtl_id = '" + whereJson.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
jsonDtl.put("bill_status", "99");
|
||||
wo_dtl.update(jsonDtl);*/
|
||||
wo_dtl.update(jsonDtl);
|
||||
|
||||
//判断是否还有未完成的明细
|
||||
JSONArray ja = wo_dtl.query("bill_status<>'99' and iostorinv_id='" + whereJson.getString("iostorinv_id") + "'").getResultJSONArray(0);
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
LEFT JOIN SCH_BASE_Point point ON struct.struct_id = point.source_id
|
||||
WHERE
|
||||
1 = 1 and struct.lock_type='01'
|
||||
1 = 1 and struct.lock_type='1'
|
||||
and struct.struct_id in (
|
||||
SELECT
|
||||
dis.struct_id
|
||||
@@ -217,7 +217,7 @@
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt2.material_id
|
||||
LEFT JOIN SCH_BASE_Point point ON struct.struct_id = point.source_id
|
||||
WHERE
|
||||
1 = 1 and struct.lock_type='00'
|
||||
1 = 1 and struct.lock_type='1'
|
||||
OPTION 输入.material_id <> ""
|
||||
ivt2.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
|
||||
Reference in New Issue
Block a user