rev:修改半成品出库分配,设置,强制确认逻辑。
This commit is contained in:
@@ -65,7 +65,7 @@ public enum StatusEnum {
|
||||
POINT_STATUS_EMPTY_VEHICLE("3", "空载具", ""),
|
||||
|
||||
// 出入库分配明细状态
|
||||
IOS_NOCREATE("00","为生成",""),
|
||||
IOS_NOCREATE("00","未生成",""),
|
||||
IOS_CREATE("01","生成",""),
|
||||
IOS_RUNNING("02","执行中",""),
|
||||
IOS_FINISH("99","完成",""),
|
||||
|
||||
@@ -118,8 +118,8 @@ public class ProductInTask extends AbstractAcsTask {
|
||||
// 修改主表状态为分配中:30
|
||||
JSONObject mstMap = new JSONObject();
|
||||
mstMap.put("bill_status", "20");
|
||||
mstMap.put("update_optid", currentUserId);
|
||||
mstMap.put("update_optname", nickName);
|
||||
mstMap.put("update_id", currentUserId);
|
||||
mstMap.put("update_name", nickName);
|
||||
mstMap.put("update_time", now);
|
||||
mstTab.update(mstMap,"iostorinv_id = '"+iostorinv_id+"'");
|
||||
|
||||
@@ -138,8 +138,8 @@ public class ProductInTask extends AbstractAcsTask {
|
||||
disMap.put("struct_name", "");
|
||||
disTab.update(disMap,"task_id = '"+taskObj.getString("task_id")+"'");
|
||||
}
|
||||
map.put("update_optid", currentUserId);
|
||||
map.put("update_optname", nickName);
|
||||
map.put("update_id", currentUserId);
|
||||
map.put("update_name", nickName);
|
||||
map.put("update_time", now);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(map, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ public class ProductOutTask extends AbstractAcsTask {
|
||||
|
||||
// 更改任务状态为完成
|
||||
jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
jsonTask.put("update_optid", currentUserId);
|
||||
jsonTask.put("update_optname", currentUsername);
|
||||
jsonTask.put("update_id", currentUserId);
|
||||
jsonTask.put("update_name", currentUsername);
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
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 org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.st.in.service.impl.ProductInServiceImpl;
|
||||
import org.nl.wms.st.in.service.impl.StorPublicServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Created by Lxy on 2023/03/30.
|
||||
*/
|
||||
public class SemiProductInTask extends AbstractAcsTask{
|
||||
private final String THIS_CLASS = SemiProductInTask.class.getName();
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配表
|
||||
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库主表
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl"); // 出入库明细表
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
|
||||
WQLObject pointTab = WQLObject.getWQLObject("st_ivt_structattr"); // 点位表
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task"); // 任务表表
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + taskObj.getString("task_id") + "'").uniqueResult(0);
|
||||
//1:执行中,2:完成 ,3:acs取消
|
||||
if(StrUtil.equals(status, "1")) {
|
||||
map.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
//更新入库单分配任务状态
|
||||
HashMap<String,String> dis_map = new HashMap<>();
|
||||
dis_map.put("work_status", StatusEnum.IOS_RUNNING.getCode());
|
||||
dis_map.put("is_issued", "1");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
if(StrUtil.equals(status, "2")) {
|
||||
map.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
//调用入库分配确认方法
|
||||
ProductInServiceImpl productInService = SpringContextHolder.getBean(ProductInServiceImpl.class);
|
||||
JSONObject dis_form = new JSONObject();
|
||||
dis_form.put("task_id", taskObj.getString("task_id"));
|
||||
productInService.confirmDis(dis_form);
|
||||
}
|
||||
if(StrUtil.equals(status, "3")) {
|
||||
if(taskObj.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.ISSUE.getCode())) {
|
||||
throw new BadRequestException("任务已执行不能取消");
|
||||
}
|
||||
// 更新任务表删除字段
|
||||
map.put("is_delete", "1");
|
||||
JSONObject jsonDis = disTab.query("task_id ='" + taskObj.getString("task_id") + "'").uniqueResult(0);
|
||||
if(ObjectUtil.isEmpty(jsonDis)) {
|
||||
throw new BadRequestException("分配明细不存在");
|
||||
}
|
||||
String iostorinv_id = jsonDis.getString("iostorinv_id");
|
||||
// 解锁货位
|
||||
JSONObject jsonPoint1 = pointTab.query("struct_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
jsonPoint1.put("lock_type", StatusEnum.LOCK_OFF.getCode());
|
||||
pointTab.update(jsonPoint1);
|
||||
// 判断物料是否超长: 超长解锁对应点位
|
||||
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
|
||||
String length_up = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MATERIAL_LENGTH_UP").getValue();
|
||||
double material_length = jsonMater.getDoubleValue("length");
|
||||
double material_length_up = Double.valueOf(length_up);
|
||||
if(material_length > material_length_up) {
|
||||
JSONObject jsonPoint2 = pointTab.query("struct_code = '" + jsonPoint1.getString("control_point") + "'").uniqueResult(0);
|
||||
jsonPoint2.put("lock_type", StatusEnum.LOCK_OFF.getCode());
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
//减去原货位的待入数
|
||||
JSONArray dis_rows = disTab.query("struct_code = '" + jsonTask.get("point_code2") + "' AND work_status < '99'").getResultJSONArray(0);
|
||||
if(dis_rows.size() <= 0) {
|
||||
throw new BadRequestException("数据参数有误!");
|
||||
}
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + dis_rows.getJSONObject(0).getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
for(int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject i_form = new JSONObject();
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
i_form.put("struct_id", jsonPoint1.getString("point_id"));
|
||||
i_form.put("material_id", dis_row.getString("material_id"));
|
||||
i_form.put("quality_scode", "01");
|
||||
i_form.put("pcsn", dis_row.getString("pcsn"));
|
||||
i_form.put("change_qty", dis_row.getString("plan_qty"));
|
||||
i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
|
||||
i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
|
||||
i_form.put("bill_code", mst_jo.getString("bill_code"));
|
||||
i_form.put("bill_table", "ST_IVT_IOStorInv");
|
||||
i_form.put("qty_unit_id", dis_row.getString("qty_unit_id"));
|
||||
i_form.put("qty_unit_name", dis_row.getString("qty_unit_name"));
|
||||
new StorPublicServiceImpl().IOStor(i_form, "32");
|
||||
}
|
||||
// 修改主表状态为分配中:30
|
||||
JSONObject mstMap = new JSONObject();
|
||||
mstMap.put("bill_status", "20");
|
||||
mstMap.put("update_id", currentUserId);
|
||||
mstMap.put("update_name", nickName);
|
||||
mstMap.put("update_time", now);
|
||||
mstTab.update(mstMap, "iostorinv_id = '" + iostorinv_id + "'");
|
||||
// 修改明细状态为生成:10
|
||||
JSONObject dtlMap = new JSONObject();
|
||||
dtlMap.put("bill_status", "10");
|
||||
dtlTab.update(dtlMap, "iostorinv_id = '" + iostorinv_id + "'");
|
||||
// 更新分配明细为:未生成:00,清空对应字段
|
||||
JSONObject disMap = new JSONObject();
|
||||
disMap.put("work_status", StatusEnum.IOS_NOCREATE.getCode());
|
||||
disMap.put("point_id", "");
|
||||
disMap.put("task_id", "");
|
||||
disMap.put("struct_id", "");
|
||||
disMap.put("struct_code", "");
|
||||
disMap.put("struct_name", "");
|
||||
disTab.update(disMap, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
map.put("update_id", currentUserId);
|
||||
map.put("update_name", nickName);
|
||||
map.put("update_time", now);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(map, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
String task_type = form.getString("task_type");
|
||||
if(StrUtil.isBlank(task_type)) {
|
||||
throw new BadRequestException("业务类型不能为空");
|
||||
}
|
||||
String start_device_code = form.getString("start_device_code");
|
||||
if(StrUtil.isBlank(start_device_code)) {
|
||||
throw new BadRequestException("起点不能为空");
|
||||
}
|
||||
String next_device_code = form.getString("next_device_code");
|
||||
if(StrUtil.isBlank(next_device_code)) {
|
||||
throw new BadRequestException("终点不能为空");
|
||||
}
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
if(StrUtil.isBlank(vehicle_code)) {
|
||||
throw new BadRequestException("载具号不能为空");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("task_name", form.getString("task_name"));
|
||||
json.put("is_send", "1");
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("material_id", form.getString("material_id"));
|
||||
json.put("material_qty", form.getString("plan_qty"));
|
||||
json.put("point_code1", start_device_code);
|
||||
json.put("point_code2", next_device_code);
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("handle_class", THIS_CLASS);
|
||||
json.put("create_id", currentUserId);
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("update_id", currentUserId);
|
||||
json.put("update_name", currentUsername);
|
||||
json.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pointConfirm(JSONObject param) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
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.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.st.out.service.impl.ProductOutServiceImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* Created by Lxy on 2021/12/22.
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SemiProductOutTask extends AbstractAcsTask{
|
||||
private final String THIS_CLASS = SemiProductOutTask.class.getName();
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配表
|
||||
WQLObject pointTab = WQLObject.getWQLObject("st_ivt_structattr"); // 点位表
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "' and task_status < '7'").uniqueResult(0);
|
||||
if(ObjectUtil.isNotEmpty(jsonTask)) {
|
||||
if(StrUtil.equals(status, "3")) {
|
||||
// 任务为下发之后就不允许取消
|
||||
if(jsonTask.getIntValue("task_status") > Integer.parseInt(TaskStatusEnum.START_AND_POINT.getCode())) {
|
||||
throw new BadRequestException("任务:" + jsonTask.getString("task_code") + "已下发,不可取消");
|
||||
}
|
||||
// 更新删除字段
|
||||
jsonTask.put("is_delete", StatusEnum.STATUS_TRUE.getCode());
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
// 更新分配明细为:未生成
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("work_status", StatusEnum.IOS_NOCREATE.getCode());
|
||||
map.put("point_id", "");
|
||||
disTab.update(map, "task_id = '" + task_id + "'");
|
||||
// 解锁终点点位
|
||||
JSONObject jsonPoint = pointTab.query("struct_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
jsonPoint.put("lock_type", StatusEnum.LOCK_OFF.getCode());
|
||||
pointTab.update(jsonPoint);
|
||||
}
|
||||
if(TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
}
|
||||
if(StrUtil.equals(status, "2")) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
// 调用标识完成
|
||||
ProductOutServiceImpl productOutService = SpringContextHolder.getBean(ProductOutServiceImpl.class);
|
||||
productOutService.finishTask(jsonTask);
|
||||
// 更改任务状态为完成
|
||||
jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
jsonTask.put("update_id", currentUserId);
|
||||
jsonTask.put("update_name", currentUsername);
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
json.put("task_name", form.getString("task_name"));
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("is_send", "1");
|
||||
json.put("material_id", form.getString("material_id"));
|
||||
json.put("material_qty", form.getString("plan_qty"));
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("handle_class", THIS_CLASS);
|
||||
json.put("create_id", currentUserId);
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("update_id", currentUserId);
|
||||
json.put("update_name", currentUsername);
|
||||
json.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pointConfirm(JSONObject param) {
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import org.nl.wms.basedata.st.service.StructattrService;
|
||||
import org.nl.wms.basedata.st.service.dto.StructattrDto;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.sch.tasks.ProductInTask;
|
||||
import org.nl.wms.sch.tasks.SemiProductInTask;
|
||||
import org.nl.wms.st.in.service.SemiProductInService;
|
||||
import org.nl.wms.st.in.service.StorPublicService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -132,7 +132,7 @@ public class SemiProductInServiceImpl implements SemiProductInService{
|
||||
//4.设置起点
|
||||
JSONObject mst = WQLObject.getWQLObject("st_ivt_iostorinv").query("iostorinv_id = '" + whereJson.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
//如果终点已确定,创建任务
|
||||
ProductInTask task = new ProductInTask();
|
||||
SemiProductInTask task = new SemiProductInTask();
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("material_id", whereJson.get("material_id"));
|
||||
task_form.put("material_qty", whereJson.get("plan_qty"));
|
||||
@@ -763,7 +763,7 @@ public class SemiProductInServiceImpl implements SemiProductInService{
|
||||
JSONObject ios_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + map.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
if(StrUtil.isNotEmpty(ios_dis.getString("struct_code"))) {
|
||||
//3.如果终点已确定,创建任务
|
||||
ProductInTask task = new ProductInTask();
|
||||
SemiProductInTask task = new SemiProductInTask();
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("material_id", map.getString("material_id"));
|
||||
task_form.put("material_qty", map.getString("plan_qty"));
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ProductOutServiceImpl implements ProductOutService {
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("bill_type","1001");
|
||||
map.put("bill_type","0001");
|
||||
map.put("product_code",MapUtil.getStr(whereJson,"product_code"));
|
||||
map.put("bill_status",MapUtil.getStr(whereJson,"bill_status"));
|
||||
map.put("begin_time",MapUtil.getStr(whereJson, "begin_time"));
|
||||
@@ -67,7 +67,7 @@ public class ProductOutServiceImpl implements ProductOutService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAddDtl(Map whereJson, Pageable page) {
|
||||
public Map<String, Object> queryAddDtl(Map whereJson, Pageable page) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
map.put("flag", "4");
|
||||
map.put("product_area", MapUtil.getStr(whereJson, "stor_id"));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -277,13 +277,13 @@
|
||||
task.task_code,
|
||||
task.task_status,
|
||||
task.task_type,
|
||||
point_code
|
||||
point.struct_code point_code
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
||||
LEFT JOIN ST_IVT_IOStorInv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dis.task_id AND task.is_delete = '0'
|
||||
LEFT JOIN sch_base_point point ON point.point_id = dis.point_id
|
||||
LEFT JOIN st_ivt_structattr point ON point.struct_id = dis.point_id
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
|
||||
@@ -294,3 +294,44 @@
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "8"
|
||||
QUERY
|
||||
SELECT
|
||||
ivt.*,
|
||||
region.sect_code region_code,
|
||||
region.sect_name region_name,
|
||||
point.storagevehicle_code vehicle_code,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.material_model
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = ivt.material_id
|
||||
LEFT JOIN st_ivt_structattr point ON point.struct_id = ivt.struct_id
|
||||
LEFT JOIN st_ivt_sectattr region ON region.sect_code = point.sect_code
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.material_id <> ""
|
||||
ivt.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.region_code <> ""
|
||||
point.sect_code = 输入.region_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.product_area <> ""
|
||||
region.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
|
||||
order by ivt.instorage_time DESC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
输入.product_area TYPEAS s_string
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.material_spec TYPEAS s_string
|
||||
输入.material_name TYPEAS s_string
|
||||
输入.material_code TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
@@ -189,3 +190,52 @@
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "5"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
ivt.struct_id,
|
||||
ivt.struct_code,
|
||||
ivt.struct_name,
|
||||
ivt.material_id,
|
||||
ivt.quality_scode,
|
||||
ivt.pcsn,
|
||||
ivt.canuse_qty AS plan_qty,
|
||||
ivt.qty_unit_id,
|
||||
ivt.instorage_time,
|
||||
sec.product_area,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
unit.unit_name AS qty_unit_name
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr point ON point.struct_id = ivt.struct_id
|
||||
LEFT JOIN st_ivt_sectattr sec ON sec.sect_id = point.sect_id
|
||||
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id
|
||||
WHERE
|
||||
ivt.canuse_qty > 0
|
||||
AND point.lock_type = '0'
|
||||
AND IFNULL( point.storagevehicle_code, '' ) <> ''
|
||||
|
||||
OPTION 输入.product_area <> ""
|
||||
sec.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.material_spec <> ""
|
||||
mater.material_spec LIKE 输入.material_spec
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.material_code <> ""
|
||||
(mater.material_code LIKE 输入.material_code or
|
||||
mater.material_code LIKE 输入.material_name)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -75,4 +75,38 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
ivt.*
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr point ON point.struct_id = ivt.struct_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.struct_id <> ""
|
||||
ivt.struct_id = 输入.struct_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.material_id <> ""
|
||||
ivt.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.quality_scode <> ""
|
||||
ivt.quality_scode = 输入.quality_scode
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.storagevehicle_code <> ""
|
||||
point.storagevehicle_code = 输入.storagevehicle_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -50,13 +50,13 @@
|
||||
SELECT
|
||||
struct.*
|
||||
FROM
|
||||
sch_base_point struct
|
||||
st_ivt_structattr struct
|
||||
WHERE
|
||||
struct.is_delete = '0'
|
||||
AND struct.is_used = '1'
|
||||
|
||||
OPTION 输入.id <> ""
|
||||
struct.point_id = 输入.id
|
||||
struct.struct_id = 输入.id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
@@ -84,18 +84,18 @@
|
||||
SELECT
|
||||
struct.struct_id,
|
||||
struct.struct_code,
|
||||
point.point_code,
|
||||
point.point_id,
|
||||
point.struct_code point_code,
|
||||
point.struct_id point_id,
|
||||
struct.storagevehicle_code
|
||||
FROM
|
||||
SCH_BASE_Point point
|
||||
st_ivt_structattr point
|
||||
left join ST_IVT_StructAttr struct on point.source_id=struct.struct_id
|
||||
WHERE 1=1
|
||||
OPTION 输入.id <> ""
|
||||
struct.struct_id = 输入.id
|
||||
ENDOPTION
|
||||
OPTION 输入.point_code <> ""
|
||||
point.point_code = 输入.point_code
|
||||
point.struct_code = 输入.point_code
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
|
||||
Reference in New Issue
Block a user