opt:代码优化

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-02-14 13:49:05 +08:00
parent 6741aa3fac
commit 065c809a58
21 changed files with 821 additions and 318 deletions

View File

@@ -104,13 +104,13 @@ public class InBoxManageServiceImpl implements InBoxManageService {
.eq("task_type", "010702") .eq("task_type", "010702")
.eq("is_delete", "0") .eq("is_delete", "0")
.lt("task_status", TaskStatusEnum.FINISHED.getCode())); .lt("task_status", TaskStatusEnum.FINISHED.getCode()));
if (count>0){ if (count > 0) {
throw new BadRequestException("当前木箱入库任务已存在"+ boxNo); throw new BadRequestException("当前木箱入库任务已存在" + boxNo);
} }
//查询仓库是否存在相同木箱 //查询仓库是否存在相同木箱
JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + boxNo + "'").getResultJSONArray(0); JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + boxNo + "'").getResultJSONArray(0);
if (stIvtStructattr!=null && stIvtStructattr.size()>0){ if (stIvtStructattr != null && stIvtStructattr.size() > 0) {
throw new BadRequestException("当前木箱已经存在库中"+stIvtStructattr.getJSONObject(0).getString("struct_code")); throw new BadRequestException("当前木箱已经存在库中" + stIvtStructattr.getJSONObject(0).getString("struct_code"));
} }
// 查询木箱信息 // 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne( BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
@@ -201,10 +201,10 @@ public class InBoxManageServiceImpl implements InBoxManageService {
throw new BadRequestException("扫描的木箱个数和选择的木箱层数不一致!"); throw new BadRequestException("扫描的木箱个数和选择的木箱层数不一致!");
} }
Set<String> collect = Arrays.stream(split).collect(Collectors.toSet()); Set<String> collect = Arrays.stream(split).collect(Collectors.toSet());
if (collect.size()!=split.length){ if (collect.size() != split.length) {
throw new BadRequestException("扫描的木箱条码不能相同"); throw new BadRequestException("扫描的木箱条码不能相同");
} }
if (split.length>3){ if (split.length > 3) {
throw new BadRequestException("堆叠木箱最大不能超过3层"); throw new BadRequestException("堆叠木箱最大不能超过3层");
} }
// 校验是否有相同木箱号 // 校验是否有相同木箱号
@@ -218,8 +218,8 @@ public class InBoxManageServiceImpl implements InBoxManageService {
//查询仓库是否存在相同木箱 //查询仓库是否存在相同木箱
for (String boxSn : split) { for (String boxSn : split) {
JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + boxSn + "'").getResultJSONArray(0); JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + boxSn + "'").getResultJSONArray(0);
if (stIvtStructattr!=null && stIvtStructattr.size()>0){ if (stIvtStructattr != null && stIvtStructattr.size() > 0) {
throw new BadRequestException("当前木箱已经存在库中"+stIvtStructattr.getJSONObject(0).getString("struct_code")); throw new BadRequestException("当前木箱已经存在库中" + stIvtStructattr.getJSONObject(0).getString("struct_code"));
} }
} }
@@ -349,13 +349,13 @@ public class InBoxManageServiceImpl implements InBoxManageService {
// 手工入库 // 手工入库
if (whereJson.getString("bill_type").equals(IOSEnum.IN_TYPE.code("手工入库"))) { if (whereJson.getString("bill_type").equals(IOSEnum.IN_TYPE.code("手工入库"))) {
if (!ifFirst) { if (!ifFirst) {
throw new BadRequestException("此木箱【"+whereJson.getString("box_no")+"】未入过库,请选择【生产入库】!"); throw new BadRequestException("此木箱【" + whereJson.getString("box_no") + "】未入过库,请选择【生产入库】!");
} }
} }
if (whereJson.getString("bill_type").equals(IOSEnum.IN_TYPE.code("生产入库"))) { if (whereJson.getString("bill_type").equals(IOSEnum.IN_TYPE.code("生产入库"))) {
if (ifFirst) { if (ifFirst) {
throw new BadRequestException("此木箱【"+whereJson.getString("box_no")+"】已入过库,请选择【手工入库】!"); throw new BadRequestException("此木箱【" + whereJson.getString("box_no") + "】已入过库,请选择【手工入库】!");
} }
} }
} }
@@ -368,15 +368,15 @@ public class InBoxManageServiceImpl implements InBoxManageService {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("pcsn", ""); param.put("pcsn", "");
WQLObject.getWQLObject("md_pb_storagevehicleext") WQLObject.getWQLObject("md_pb_storagevehicleext")
.update(param,"pcsn = '"+whereJson.getString("box_no")+"'"); .update(param, "pcsn = '" + whereJson.getString("box_no") + "'");
} }
// 更新子卷包装关系创建人 // 更新子卷包装关系创建人
JSONObject param2 = new JSONObject(); JSONObject param2 = new JSONObject();
param2.put("create_id",SecurityUtils.getCurrentUserId()); param2.put("create_id", SecurityUtils.getCurrentUserId());
param2.put("create_name",SecurityUtils.getCurrentNickName()); param2.put("create_name", SecurityUtils.getCurrentNickName());
WQLObject.getWQLObject("pdm_bi_subpackagerelation") WQLObject.getWQLObject("pdm_bi_subpackagerelation")
.update(param2,"package_box_sn = '"+whereJson.getString("box_no")+"'"); .update(param2, "package_box_sn = '" + whereJson.getString("box_no") + "'");
/* /*
* 查询mes木箱信息插入木箱信息表 * 查询mes木箱信息插入木箱信息表
@@ -423,6 +423,12 @@ public class InBoxManageServiceImpl implements InBoxManageService {
param.put("height", boxDao.getBox_high()); param.put("height", boxDao.getBox_high());
param.put("containerType", boxDao.getVehicle_type()); param.put("containerType", boxDao.getVehicle_type());
String type = whereJson.getString("bill_type"); String type = whereJson.getString("bill_type");
if (StrUtil.isEmpty(type)) {
throw new BadRequestException("入库类型不能为空!");
}
if (type.length() < 4) {
throw new BadRequestException("入库类型字段长度不能少于4!");
}
param.put("barcode", whereJson.getString("box_no") + "-" + type.substring(3, 4)); param.put("barcode", whereJson.getString("box_no") + "-" + type.substring(3, 4));
//根据木箱高度,判断入库仓位的高度 //根据木箱高度,判断入库仓位的高度

View File

@@ -16,6 +16,7 @@ package org.nl.modules.common.utils;/*
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.poi.excel.BigExcelWriter; import cn.hutool.poi.excel.BigExcelWriter;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import org.apache.poi.util.IOUtils; import org.apache.poi.util.IOUtils;
@@ -203,12 +204,15 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
* 导出excel * 导出excel
*/ */
public static void downloadExcel(List<Map<String, Object>> list, HttpServletResponse response) throws IOException { public static void downloadExcel(List<Map<String, Object>> list, HttpServletResponse response) throws IOException {
ServletOutputStream out = null;
BigExcelWriter writer;
try {
String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx"; String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx";
File file = new File(tempPath); File file = new File(tempPath);
BigExcelWriter writer = ExcelUtil.getBigWriter(file); writer = ExcelUtil.getBigWriter(file);
// 一次性写出内容,使用默认样式,强制输出标题 // 一次性写出内容,使用默认样式,强制输出标题
writer.write(list, true); writer.write(list, true);
SXSSFSheet sheet = (SXSSFSheet)writer.getSheet(); SXSSFSheet sheet = (SXSSFSheet) writer.getSheet();
//上面需要强转SXSSFSheet 不然没有trackAllColumnsForAutoSizing方法 //上面需要强转SXSSFSheet 不然没有trackAllColumnsForAutoSizing方法
sheet.trackAllColumnsForAutoSizing(); sheet.trackAllColumnsForAutoSizing();
//列宽自适应 //列宽自适应
@@ -217,13 +221,18 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
//test.xls是弹出下载对话框的文件名不能为中文中文请自行编码 //test.xls是弹出下载对话框的文件名不能为中文中文请自行编码
response.setHeader("Content-Disposition", "attachment;filename=file.xlsx"); response.setHeader("Content-Disposition", "attachment;filename=file.xlsx");
ServletOutputStream out = response.getOutputStream(); out = response.getOutputStream();
// 终止后删除临时文件 // 终止后删除临时文件
file.deleteOnExit(); file.deleteOnExit();
writer.flush(out, true); writer.flush(out, true);
} finally {
//此处记得关闭输出Servlet流 //此处记得关闭输出Servlet流
if (ObjectUtil.isNotEmpty(out)) {
IoUtil.close(out); IoUtil.close(out);
} }
}
}
public static String getFileType(String type) { public static String getFileType(String type) {
String documents = "txt doc pdf ppt pps xlsx xls docx"; String documents = "txt doc pdf ppt pps xlsx xls docx";

View File

@@ -67,6 +67,9 @@ public class FaultDeviceServiceImpl implements FaultDeviceService {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
if (ObjectUtil.isNotEmpty(device_code)) { if (ObjectUtil.isNotEmpty(device_code)) {
JSONObject device_jo = WQLObject.getWQLObject("EM_BI_MonitorDevice").query("device_code = '" + device_code + "'").uniqueResult(0); JSONObject device_jo = WQLObject.getWQLObject("EM_BI_MonitorDevice").query("device_code = '" + device_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(device_jo)){
throw new BadRequestException("未查询到设备号为["+device_code+"]的设备信息!");
}
param.put("device_code", device_code); param.put("device_code", device_code);
param.put("product_area", device_jo.getString("product_area")); param.put("product_area", device_jo.getString("product_area"));
} else { } else {

View File

@@ -186,8 +186,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (tryLock) { if (tryLock) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task") JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task")
.query("task_id = '" + task_id + "'").uniqueResult(0); .query("task_id = '" + task_id + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(taskObj)){
throw new BadRequestException("未找到任务标识为:" + task_id + "的任务!");
}
// 任务处理类 // 任务处理类
String processing_class = taskObj.getString("handle_class"); String processing_class = taskObj.getString("handle_class");
if (StrUtil.isEmpty(processing_class)) {
throw new BadRequestException("当前任务的处理类未找到!");
}
//1:执行中,2:完成 ,3:acs取消 //1:执行中,2:完成 ,3:acs取消
String acs_task_status = row.getString("task_status"); String acs_task_status = row.getString("task_status");
String car_no = row.getString("car_no"); String car_no = row.getString("car_no");
@@ -2109,7 +2115,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext"); WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
// 6-退货入库 // 6-退货入库
String materialBarcode = whereJson.getString("material_barcode"); String materialBarcode = whereJson.getString("material_barcode");
if(StrUtil.isEmpty(materialBarcode)){
throw new BadRequestException("当前木箱号不能为空!");
}
String[] box_arr = materialBarcode.split("-"); String[] box_arr = materialBarcode.split("-");
if (box_arr.length < 2) {
// 处理分割结果不足的情况
throw new BadRequestException("当前木箱号数据异常!"+box_arr.toString());
}
//获取当前的入库类型 //获取当前的入库类型
whereJson.put("bill_type", "000" + box_arr[1]); whereJson.put("bill_type", "000" + box_arr[1]);
whereJson.put("box_no", box_arr[0]); whereJson.put("box_no", box_arr[0]);

View File

@@ -5,12 +5,10 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; 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.b_lms.sch.point.service.IschBasePointService;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.RedisUtils; import org.nl.modules.common.utils.RedisUtils;
@@ -18,7 +16,6 @@ import org.nl.common.utils.CodeUtil;
import org.nl.modules.wql.WQL; import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl; import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl; import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.pda.mps.eum.RegionTypeEnum; import org.nl.wms.pda.mps.eum.RegionTypeEnum;
@@ -256,7 +253,7 @@ public class BakingServiceImpl implements BakingService {
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("flag", "1"); map.put("flag", "1");
if (product_area.equals("B2")) { if (product_area.equals("B2")) {
map.put("flag", "3"); map.put("flag", "302");
} }
map.put("reging_id", reging_id); map.put("reging_id", reging_id);
map.put("point_location", point_location); map.put("point_location", point_location);
@@ -521,7 +518,11 @@ public class BakingServiceImpl implements BakingService {
hotParam.put("task_id", task_id); hotParam.put("task_id", task_id);
hotParam.put("start_point_code", point_code1); hotParam.put("start_point_code", point_code1);
hotParam.put("end_point_code", point_code2); hotParam.put("end_point_code", point_code2);
String point_temperature = (String) redisUtils.hget(point_code1, "temperature"); Object pt = redisUtils.hget(point_code1, "temperature");
if (ObjectUtil.isEmpty(pt)) {
throw new BadRequestException("当前操作点位设备:"+point_code1+",无法获取温度,请稍后再试!");
}
String point_temperature = String.valueOf(pt);
hotParam.put("temperature", point_temperature); hotParam.put("temperature", point_temperature);
if (ObjectUtil.isEmpty(last_hot_mst)) { if (ObjectUtil.isEmpty(last_hot_mst)) {
hotParam.put("oven_time", "480"); hotParam.put("oven_time", "480");
@@ -757,7 +758,7 @@ public class BakingServiceImpl implements BakingService {
rows.add(jo); rows.add(jo);
new WmsToAcsServiceImpl().action(rows); new WmsToAcsServiceImpl().action(rows);
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("message", "操作成功"); result.put("message", "烘箱三色灯报警已关闭,请联系烘箱设备维护人员处理烘箱报警问题!");
return result; return result;
} }

View File

@@ -97,6 +97,9 @@ public class VirtualOutServiceImpl implements VirtualOutService {
if (ObjectUtil.isNotEmpty(whereJson.getString("box_no"))) { if (ObjectUtil.isNotEmpty(whereJson.getString("box_no"))) {
JSONObject jsonSub = WQL.getWO("PDA_VIRTUALOUT").addParam("flag", "4").addParam("box_no", whereJson.getString("box_no")).process().uniqueResult(0); JSONObject jsonSub = WQL.getWO("PDA_VIRTUALOUT").addParam("flag", "4").addParam("box_no", whereJson.getString("box_no")).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)){
throw new BadRequestException("未查询到设木箱号为["+whereJson.getString("box_no")+"]的子卷包装关系信息!");
}
jo.put("net_weight_num", ObjectUtil.isNotEmpty(jsonSub) ? NumberUtil.round(jsonSub.getString("net_weight_num"), 3) : "0"); jo.put("net_weight_num", ObjectUtil.isNotEmpty(jsonSub) ? NumberUtil.round(jsonSub.getString("net_weight_num"), 3) : "0");
} else { } else {

View File

@@ -29,7 +29,7 @@ public interface RegionService {
* @param whereJson 条件参数 * @param whereJson 条件参数
* @return List<RegionDto> * @return List<RegionDto>
*/ */
List<RegionDto> queryAll(Map whereJson); List<RegionDto> queryAll(String whereJson);
/** /**
* 根据ID查询 * 根据ID查询

View File

@@ -50,9 +50,9 @@ public class RegionServiceImpl implements RegionService {
} }
@Override @Override
public List<RegionDto> queryAll(Map whereJson) { public List<RegionDto> queryAll(String whereJson) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region"); WQLObject wo = WQLObject.getWQLObject("sch_base_region");
JSONArray arr = wo.query().getResultJSONArray(0); JSONArray arr = wo.query(whereJson).getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(arr)) { if (ObjectUtil.isNotEmpty(arr)) {
return arr.toJavaList(RegionDto.class); return arr.toJavaList(RegionDto.class);
} }

View File

@@ -123,12 +123,11 @@ public class CallEmpReelTask extends AbstractAcsTask {
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) { if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
// 更改任务状态为完成 // 更改任务状态为完成
HashMap<Object, Object> hashMap = new HashMap<>(); jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
hashMap.put("task_status", TaskStatusEnum.FINISHED.getCode()); jsonTask.put("update_optid", SecurityUtils.getCurrentUserId());
hashMap.put("update_optid", SecurityUtils.getCurrentUserId()); jsonTask.put("update_optname", SecurityUtils.getCurrentUsername());
hashMap.put("update_optname", SecurityUtils.getCurrentUsername()); jsonTask.put("update_time", DateUtil.now());
hashMap.put("update_time", DateUtil.now()); taskTab.update(jsonTask);
taskTab.update(hashMap,"task_id = '" + task_id + "'");
String point_code1 = jsonTask.getString("point_code1"); String point_code1 = jsonTask.getString("point_code1");
String point_code2 = jsonTask.getString("point_code2"); String point_code2 = jsonTask.getString("point_code2");
@@ -136,7 +135,9 @@ public class CallEmpReelTask extends AbstractAcsTask {
String point_code4 = jsonTask.getString("point_code4"); String point_code4 = jsonTask.getString("point_code4");
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0); JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonRaw)) {
throw new BadRequestException("未找到满足条件的生箔工单:" + jsonTask.getString("material_code"));
}
// 判断是两个点位的任务还是四个点位的任务 // 判断是两个点位的任务还是四个点位的任务
if (ObjectUtil.isEmpty(point_code3)) { if (ObjectUtil.isEmpty(point_code3)) {
// 判断是取满 or 取空 :取满起点是生箔区域、取空起点是冷却区域 // 判断是取满 or 取空 :取满起点是生箔区域、取空起点是冷却区域
@@ -231,8 +232,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
jsonIvt2.put("point_status", "2"); jsonIvt2.put("point_status", "2");
jsonIvt2.put("material_code", jsonTask.getString("material_code")); jsonIvt2.put("material_code", jsonTask.getString("material_code"));
point_tab.update(jsonIvt2); point_tab.update(jsonIvt2);
} } else if (jsonTask.getString("task_type").equals("010106")) {
else if (jsonTask.getString("task_type").equals("010106")) {
BakingServiceImpl bean = SpringContextHolder.getBean(BakingServiceImpl.class); BakingServiceImpl bean = SpringContextHolder.getBean(BakingServiceImpl.class);
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表 WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
JSONObject requestParam = jsonTask.getJSONObject("request_param"); JSONObject requestParam = jsonTask.getJSONObject("request_param");
@@ -299,8 +299,8 @@ public class CallEmpReelTask extends AbstractAcsTask {
} else { } else {
// 校验终点是否存在 // 校验终点是否存在
JSONObject jsonIvt2 = ivtTab.query("full_point_code ='" + point_code4 + "'").uniqueResult(0); JSONObject jsonIvt2 = ivtTab.query("full_point_code ='" + point_code4 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) { if (ObjectUtil.isEmpty(jsonIvt2)) {
throw new BadRequestException("终点未找到可用点位:" + point_code2); throw new BadRequestException("终点未找到可用点位:" + jsonIvt2);
} }
// 更新工单状态为完成 // 更新工单状态为完成
@@ -324,6 +324,37 @@ public class CallEmpReelTask extends AbstractAcsTask {
cache_param.put("cool_ivt_status", "01"); cache_param.put("cool_ivt_status", "01");
ivtTab.update(cache_param, "full_point_code ='" + point_code4 + "'"); ivtTab.update(cache_param, "full_point_code ='" + point_code4 + "'");
/*// 插入入库单
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) {
throw new BadRequestException("产品不存在");
}
JSONObject jsonRegion = new JSONObject();
jsonRegion.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonRegion.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
jsonRegion.put("io_type", "0");
jsonRegion.put("material_id", jsonMater.getString("material_id"));
jsonRegion.put("pcsn", jsonRaw.getString("container_name"));
jsonRegion.put("vehicle_code", "");
jsonRegion.put("qty", jsonRaw.getString("productin_qty"));
jsonRegion.put("qty_unit_id", jsonMater.get("base_unit_id"));
jsonRegion.put("bill_status", "50");
jsonRegion.put("start_point_code", point_code2);
jsonRegion.put("end_point_code", point_code4);
jsonRegion.put("cust_id", "");
jsonRegion.put("create_mode", "03");
jsonRegion.put("task_id", task_id);
jsonRegion.put("create_id", currentUserId);
jsonRegion.put("create_name", currentUsername);
jsonRegion.put("create_time", DateUtil.now());
jsonRegion.put("update_optid", currentUserId);
jsonRegion.put("update_optname", currentUsername);
jsonRegion.put("update_time", DateUtil.now());
jsonRegion.put("confirm_optid", currentUserId);
jsonRegion.put("confirm_optname", currentUsername);
jsonRegion.put("confirm_time", DateUtil.now());
coolTab.insert(jsonRegion);*/
} }
} }
@@ -341,6 +372,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public String createTask(JSONObject form) { public String createTask(JSONObject form) {
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task"); WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
String currentUserId = SecurityUtils.getCurrentUserId(); String currentUserId = SecurityUtils.getCurrentUserId();

View File

@@ -59,6 +59,7 @@ public class InchargeServiceImpl implements InchargeService {
} }
if (ObjectUtil.isNotEmpty(sap_pcsn)) { if (ObjectUtil.isNotEmpty(sap_pcsn)) {
map.put("sap_pcsn", "%" + sap_pcsn + "%"); map.put("sap_pcsn", "%" + sap_pcsn + "%");
map.put("flag", "11");
} }
if (ObjectUtil.isNotEmpty(pcsn)) { if (ObjectUtil.isNotEmpty(pcsn)) {
map.put("pcsn", "%" + pcsn + "%"); map.put("pcsn", "%" + pcsn + "%");

View File

@@ -96,6 +96,10 @@ public class OutChargeServiceImpl implements OutChargeService {
map.put("end_time", end_time); map.put("end_time", end_time);
} }
if (ObjectUtil.isNotEmpty(map.get("sap_pcsn"))) {
map.put("flag", "151");
}
JSONObject json = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ios.iostorinv_id DESC"); JSONObject json = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ios.iostorinv_id DESC");
return json; return json;
} }

View File

@@ -75,7 +75,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
@Override @Override
public Map<String, Object> pageQuery(Map whereJson, Pageable page) { public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("flag", "1"); map.put("flag", "30");
map.put("buss_type", (String) whereJson.get("buss_type")); map.put("buss_type", (String) whereJson.get("buss_type"));
map.put("stor_id", (String) whereJson.get("stor_id")); map.put("stor_id", (String) whereJson.get("stor_id"));
map.put("bill_type", (String) whereJson.get("bill_type")); map.put("bill_type", (String) whereJson.get("bill_type"));
@@ -172,6 +172,10 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
map.put("in_stor_id", in_stor_id); map.put("in_stor_id", in_stor_id);
} }
if (ObjectUtil.isNotEmpty(map.get("sap_pcsn_in"))) {
map.put("flag", "29");
}
JSONObject jo = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "iostorinv_id desc"); JSONObject jo = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "iostorinv_id desc");
return jo; return jo;
} }
@@ -1873,7 +1877,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void download(Map whereJson, HttpServletResponse response) throws IOException { public void download(Map whereJson, HttpServletResponse response) throws IOException {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("flag", "1"); map.put("flag", "199");
map.put("buss_type", (String) whereJson.get("buss_type")); map.put("buss_type", (String) whereJson.get("buss_type"));
map.put("stor_id", (String) whereJson.get("stor_id")); map.put("stor_id", (String) whereJson.get("stor_id"));
map.put("bill_type", (String) whereJson.get("bill_type")); map.put("bill_type", (String) whereJson.get("bill_type"));
@@ -1969,7 +1973,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
if (ObjectUtil.isNotEmpty(in_stor_id)) { if (ObjectUtil.isNotEmpty(in_stor_id)) {
map.put("in_stor_id", in_stor_id); map.put("in_stor_id", in_stor_id);
} }
JSONArray resultJSONArray = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).process().getResultJSONArray(0); JSONArray resultJSONArray = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).process().getResultJSONArray(0);
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
for (int i = 0; i < resultJSONArray.size(); i++) { for (int i = 0; i < resultJSONArray.size(); i++) {

View File

@@ -49,12 +49,77 @@
IF 输入.flag = "1" IF 输入.flag = "1"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
ios.* ios.*
FROM FROM
ST_IVT_IOStorInv ios ST_IVT_IOStorInv ios
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinv_id = ios.iostorinv_id INNER JOIN (
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn SELECT
dis.iostorinv_id
FROM
st_ivt_iostorinvdis dis
WHERE
1 = 1
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
GROUP BY
dis.iostorinv_id
) b ON b.iostorinv_id = ios.iostorinv_id
WHERE
ios.is_delete = '0'
AND ios.io_type = '0'
AND ios.bill_status = '99'
AND ios.is_writeoff = '0'
AND ios.bill_type = '0002'
and ios.stor_id in 输入.in_stor_id
OPTION 输入.bill_code <> ""
ios.bill_code like 输入.bill_code
ENDOPTION
OPTION 输入.stor_id <> ""
ios.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.bill_type <> ""
ios.bill_type = 输入.bill_type
ENDOPTION
OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode
ENDOPTION
OPTION 输入.begin_time <> ""
ios.input_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "11"
PAGEQUERY
SELECT
ios.*
FROM
ST_IVT_IOStorInv ios
INNER JOIN (
SELECT
dis.iostorinv_id
FROM
st_ivt_iostorinvdis dis
LEFT JOIN pdm_bi_subpackagerelation sub ON ( sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn )
WHERE
1 = 1
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
GROUP BY
dis.iostorinv_id
) b ON b.iostorinv_id = ios.iostorinv_id
WHERE WHERE
ios.is_delete = '0' ios.is_delete = '0'
AND ios.io_type = '0' AND ios.io_type = '0'
@@ -62,35 +127,21 @@
AND ios.is_writeoff = '0' AND ios.is_writeoff = '0'
AND ios.bill_type = '0002' AND ios.bill_type = '0002'
and ios.stor_id in 输入.in_stor_id and ios.stor_id in 输入.in_stor_id
OPTION 输入.bill_code <> "" OPTION 输入.bill_code <> ""
ios.bill_code like 输入.bill_code ios.bill_code like 输入.bill_code
ENDOPTION ENDOPTION
OPTION 输入.stor_id <> "" OPTION 输入.stor_id <> ""
ios.stor_id = 输入.stor_id ios.stor_id = 输入.stor_id
ENDOPTION ENDOPTION
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.bill_type <> "" OPTION 输入.bill_type <> ""
ios.bill_type = 输入.bill_type ios.bill_type = 输入.bill_type
ENDOPTION ENDOPTION
OPTION 输入.create_mode <> "" OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode ios.create_mode = 输入.create_mode
ENDOPTION ENDOPTION
OPTION 输入.begin_time <> "" OPTION 输入.begin_time <> ""
ios.input_time >= 输入.begin_time ios.input_time >= 输入.begin_time
ENDOPTION ENDOPTION
OPTION 输入.end_time <> "" OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time ios.input_time <= 输入.end_time
ENDOPTION ENDOPTION

View File

@@ -37,6 +37,7 @@
输入.row_num TYPEAS s_string 输入.row_num TYPEAS s_string
输入.block_num TYPEAS s_string 输入.block_num TYPEAS s_string
输入.placement_type TYPEAS s_string 输入.placement_type TYPEAS s_string
输入.limits TYPEAS s_string
输入.sql_str TYPEAS f_string 输入.sql_str TYPEAS f_string
输入.in_stor_id TYPEAS f_string 输入.in_stor_id TYPEAS f_string
输入.in_layer_num TYPEAS f_string 输入.in_layer_num TYPEAS f_string
@@ -72,7 +73,7 @@
IF 输入.flag = "1" IF 输入.flag = "1"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
ios.*, ios.*,
IFNULL(dtl.vbeln,'') as vbeln IFNULL(dtl.vbeln,'') as vbeln
FROM FROM
@@ -145,6 +146,282 @@
OPTION 输入.end_time <> "" OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time ios.input_time <= 输入.end_time
ENDOPTION ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "199"
QUERY
SELECT
ios.*,
IFNULL(dtl.vbeln,'') as vbeln
FROM
ST_IVT_IOStorInv ios
LEFT JOIN st_ivt_iostorinvdtl dtl ON ios.iostorinv_id = dtl.iostorinv_id
LEFT JOIN st_ivt_iostorinvdis dis ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn AND ios.bill_code = sub.bill_code
WHERE
ios.is_delete = '0'
AND
ios.io_type = '0'
AND ios.stor_id in 输入.in_stor_id
OPTION 输入.box_no <> ""
dis.box_no like 输入.box_no
ENDOPTION
OPTION 输入.box_no_in <> ""
dis.box_no IN 输入.box_no_in
ENDOPTION
OPTION 输入.vbeln <> ""
dtl.vbeln like 输入.vbeln
ENDOPTION
OPTION 输入.vbeln_in <> ""
dtl.vbeln IN 输入.vbeln_in
ENDOPTION
OPTION 输入.bill_code <> ""
ios.bill_code like 输入.bill_code
ENDOPTION
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
OPTION 输入.sap_pcsn_in <> ""
sub.sap_pcsn IN 输入.sap_pcsn_in
ENDOPTION
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.pcsn_in <> ""
dis.pcsn IN 输入.pcsn_in
ENDOPTION
OPTION 输入.stor_id <> ""
ios.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.bill_type <> ""
ios.bill_type = 输入.bill_type
ENDOPTION
OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode
ENDOPTION
OPTION 输入.bill_status <> ""
ios.bill_status = 输入.bill_status
ENDOPTION
OPTION 输入.begin_time <> ""
ios.input_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time
ENDOPTION
limit 0,10000
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "29"
PAGEQUERY
SELECT
ios2.*,
IFNULL(dtl2.vbeln,'') as vbeln
FROM
(
SELECT
ios.*
FROM
ST_IVT_IOStorInv ios
WHERE
ios.is_delete = '0'
AND ios.io_type = '0'
AND ios.stor_id in 输入.in_stor_id
OPTION 输入.stor_id <> ""
ios.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.bill_type <> ""
ios.bill_type = 输入.bill_type
ENDOPTION
OPTION 输入.bill_code <> ""
ios.bill_code like 输入.bill_code
ENDOPTION
OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode
ENDOPTION
OPTION 输入.bill_status <> ""
ios.bill_status = 输入.bill_status
ENDOPTION
OPTION 输入.begin_time <> ""
ios.input_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time
ENDOPTION
) ios2
INNER JOIN (
SELECT
dis.iostorinv_id
FROM
st_ivt_iostorinvdis dis
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn
WHERE
1 = 1
OPTION 输入.box_no <> ""
dis.box_no like 输入.box_no
ENDOPTION
OPTION 输入.box_no_in <> ""
dis.box_no IN 输入.box_no_in
ENDOPTION
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.pcsn_in <> ""
dis.pcsn IN 输入.pcsn_in
ENDOPTION
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
OPTION 输入.sap_pcsn_in <> ""
sub.sap_pcsn IN 输入.sap_pcsn_in
ENDOPTION
GROUP BY dis.iostorinv_id
) dis2 ON dis2.iostorinv_id = ios2.iostorinv_id
INNER JOIN (
SELECT
dtl.iostorinv_id,
MAX( vbeln ) AS vbeln
FROM
st_ivt_iostorinvdtl dtl
WHERE
1 = 1
OPTION 输入.vbeln <> ""
dtl.vbeln like 输入.vbeln
ENDOPTION
OPTION 输入.vbeln_in <> ""
dtl.vbeln IN 输入.vbeln_in
ENDOPTION
GROUP BY
dtl.iostorinv_id
) dtl2 ON ios2.iostorinv_id = dtl2.iostorinv_id
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "30"
PAGEQUERY
SELECT
ios2.*,
IFNULL(dtl2.vbeln,'') as vbeln
FROM
(
SELECT
ios.*
FROM
ST_IVT_IOStorInv ios
WHERE
ios.is_delete = '0'
AND ios.io_type = '0'
AND ios.stor_id in 输入.in_stor_id
OPTION 输入.stor_id <> ""
ios.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.bill_type <> ""
ios.bill_type = 输入.bill_type
ENDOPTION
OPTION 输入.bill_code <> ""
ios.bill_code like 输入.bill_code
ENDOPTION
OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode
ENDOPTION
OPTION 输入.bill_status <> ""
ios.bill_status = 输入.bill_status
ENDOPTION
OPTION 输入.begin_time <> ""
ios.input_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time
ENDOPTION
) ios2
INNER JOIN (
SELECT
dis.iostorinv_id
FROM
st_ivt_iostorinvdis dis
WHERE
1 = 1
OPTION 输入.box_no <> ""
dis.box_no like 输入.box_no
ENDOPTION
OPTION 输入.box_no_in <> ""
dis.box_no IN 输入.box_no_in
ENDOPTION
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.pcsn_in <> ""
dis.pcsn IN 输入.pcsn_in
ENDOPTION
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
OPTION 输入.sap_pcsn_in <> ""
sub.sap_pcsn IN 输入.sap_pcsn_in
ENDOPTION
GROUP BY dis.iostorinv_id
) dis2 ON dis2.iostorinv_id = ios2.iostorinv_id
INNER JOIN (
SELECT
dtl.iostorinv_id,
MAX( vbeln ) AS vbeln
FROM
st_ivt_iostorinvdtl dtl
WHERE
1 = 1
OPTION 输入.vbeln <> ""
dtl.vbeln like 输入.vbeln
ENDOPTION
OPTION 输入.vbeln_in <> ""
dtl.vbeln IN 输入.vbeln_in
ENDOPTION
GROUP BY
dtl.iostorinv_id
) dtl2 ON ios2.iostorinv_id = dtl2.iostorinv_id
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY
@@ -715,12 +992,14 @@
IF 输入.flag = "15" IF 输入.flag = "15"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
ios2.*
FROM
(
SELECT
ios.* ios.*
FROM FROM
ST_IVT_IOStorInv ios ST_IVT_IOStorInv ios
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinv_id = ios.iostorinv_id
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn
WHERE WHERE
ios.is_delete = '0' ios.is_delete = '0'
AND AND
@@ -733,19 +1012,12 @@
ios.bill_type in ('1001','1009') ios.bill_type in ('1001','1009')
AND AND
ios.stor_id in 输入.in_stor_id ios.stor_id in 输入.in_stor_id
OPTION 输入.bill_code <> "" OPTION 输入.bill_code <> ""
ios.bill_code like 输入.bill_code ios.bill_code like 输入.bill_code
ENDOPTION ENDOPTION
OPTION 输入.stor_id <> "" OPTION 输入.stor_id <> ""
ios.stor_id = 输入.stor_id ios.stor_id = 输入.stor_id
ENDOPTION ENDOPTION
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
OPTION 输入.bill_type <> "" OPTION 输入.bill_type <> ""
ios.bill_type = 输入.bill_type ios.bill_type = 输入.bill_type
ENDOPTION ENDOPTION
@@ -761,6 +1033,87 @@
OPTION 输入.end_time <> "" OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time ios.input_time <= 输入.end_time
ENDOPTION ENDOPTION
) ios2
INNER JOIN (
SELECT
dis.iostorinv_id
FROM
st_ivt_iostorinvdis dis
WHERE
1 = 1
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
GROUP BY dis.iostorinv_id
) dis2 ON dis2.iostorinv_id = ios2.iostorinv_id
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "151"
PAGEQUERY
SELECT
ios2.*
FROM
(
SELECT
ios.*
FROM
ST_IVT_IOStorInv ios
WHERE
ios.is_delete = '0'
AND
ios.io_type = '1'
AND
ios.is_writeoff = '0'
AND
ios.bill_status = '99'
AND
ios.bill_type in ('1001','1009')
AND
ios.stor_id in 输入.in_stor_id
OPTION 输入.bill_code <> ""
ios.bill_code like 输入.bill_code
ENDOPTION
OPTION 输入.stor_id <> ""
ios.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.bill_type <> ""
ios.bill_type = 输入.bill_type
ENDOPTION
OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode
ENDOPTION
OPTION 输入.bill_status <> ""
ios.bill_status = 输入.bill_status
ENDOPTION
OPTION 输入.begin_time <> ""
ios.input_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
ios.input_time <= 输入.end_time
ENDOPTION
) ios2
INNER JOIN (
SELECT
dis.iostorinv_id
FROM
st_ivt_iostorinvdis dis
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn
WHERE
1 = 1
OPTION 输入.pcsn <> ""
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.sap_pcsn <> ""
sub.sap_pcsn like 输入.sap_pcsn
ENDOPTION
GROUP BY dis.iostorinv_id
) dis2 ON dis2.iostorinv_id = ios2.iostorinv_id
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY

View File

@@ -64,23 +64,31 @@
IF 输入.flag = "1" IF 输入.flag = "1"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
cg.changeinv_id AS id, cg.changeinv_id AS id,
cg.* cg.*
FROM FROM
st_ivt_structivtchange cg st_ivt_structivtchange cg
LEFT JOIN st_ivt_structivtchangedtl dtl ON cg.changeinv_id = dtl.changeinv_id inner JOIN (
SELECT
dtl.changeinv_id
FROM
st_ivt_structivtchangedtl dtl
WHERE
1 = 1
OPTION 输入.pcsn <> ""
dtl.pcsn = 输入.pcsn
ENDOPTION
GROUP BY
dtl.changeinv_id
) b ON cg.changeinv_id = b.changeinv_id
WHERE WHERE
1 = 1 1 = 1
AND cg.is_delete = '0' AND cg.is_delete = '0'
and cg.stor_id in 输入.in_stor_id and cg.stor_id in 输入.in_stor_id
OPTION 输入.bill_code <> "" OPTION 输入.bill_code <> ""
cg.bill_code like 输入.bill_code cg.bill_code like 输入.bill_code
ENDOPTION ENDOPTION
OPTION 输入.pcsn <> ""
dtl.pcsn = 输入.pcsn
ENDOPTION
OPTION 输入.buss_type <> "" OPTION 输入.buss_type <> ""
cg.buss_type like 输入.buss_type cg.buss_type like 输入.buss_type
ENDOPTION ENDOPTION
@@ -109,30 +117,27 @@
IF 输入.flag = "2" IF 输入.flag = "2"
QUERY QUERY
SELECT DISTINCT SELECT * from
(
select
dtl.mfg_order_name AS new_sale_order_name, dtl.mfg_order_name AS new_sale_order_name,
dtl.customer_name AS new_customer_name, dtl.customer_name AS new_customer_name,
dtl.customer_description AS new_customer_description, dtl.customer_description AS new_customer_description,
dtl.package_box_sn AS storagevehicle_code, dtl.package_box_sn AS storagevehicle_code,
sa.sect_name AS turnout_sect_name,
sa.struct_code AS turnout_struct_code,
mb.material_code,
mb.material_name,
dtl.seq_no,
sub.sale_order_name,
sub.customer_name,
sub.customer_description,
sub.net_weight AS qty,
dtl.demand_date, dtl.demand_date,
dtl.UpdatedDateOfProduction AS date_of_FG_inbound, dtl.UpdatedDateOfProduction AS date_of_FG_inbound,
dtl.isRePrintPackageBoxLabel, dtl.isRePrintPackageBoxLabel,
dtl.isUnPackBox, dtl.isUnPackBox,
dtl.pcsn dtl.pcsn,
dtl.seq_no,
sa.sect_name AS turnout_sect_name,
sa.struct_code AS turnout_struct_code,
mb.material_code,
mb.material_name
FROM FROM
st_ivt_structivtchangedtl dtl st_ivt_structivtchangedtl dtl
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
LEFT JOIN st_ivt_structattr sa ON sa.storagevehicle_code = dtl.package_box_sn LEFT JOIN st_ivt_structattr sa ON sa.storagevehicle_code = dtl.package_box_sn
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = dtl.package_box_sn AND sub.container_name = dtl.pcsn
WHERE WHERE
1 = 1 1 = 1
OPTION 输入.changeinv_id <> "" OPTION 输入.changeinv_id <> ""
@@ -145,6 +150,25 @@
dtl.work_status <= 输入.work_status dtl.work_status <= 输入.work_status
ENDOPTION ENDOPTION
order by dtl.seq_no order by dtl.seq_no
) dtl2
LEFT JOIN (
select
sub.sale_order_name,
sub.customer_name,
sub.customer_description,
sub.net_weight ,
sub.package_box_sn,
sub.container_name
from
pdm_bi_subpackagerelation sub
group by
sub.sale_order_name,
sub.customer_name,
sub.customer_description,
sub.net_weight,
sub.package_box_sn,
sub.container_name
) sub2 ON (sub2.package_box_sn = dtl2.storagevehicle_code AND sub2.container_name = dtl2.pcsn)
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF

View File

@@ -79,21 +79,22 @@
move.* move.*
FROM FROM
ST_IVT_MoveInv move ST_IVT_MoveInv move
WHERE inner join (
1 = 1 SELECT
AND move.is_delete = '0' movedtl.moveinv_id
AND move.moveinv_id IN (
SELECT DISTINCT
(movedtl.moveinv_id)
FROM FROM
st_ivt_moveinvdtl movedtl st_ivt_moveinvdtl movedtl
LEFT JOIN md_me_materialbase mb ON mb.material_id = movedtl.material_id INNER JOIN md_me_materialbase mb ON mb.material_id = movedtl.material_id
WHERE WHERE
1 = 1 1 = 1
OPTION 输入.material_code <> "" OPTION 输入.material_code <> ""
(mb.material_code LIKE 输入.material_code OR mb.material_name LIKE 输入.material_code) (mb.material_code LIKE 输入.material_code OR mb.material_name LIKE 输入.material_code)
ENDOPTION ENDOPTION
) GROUP BY movedtl.moveinv_id
) dtl2 on dtl2.moveinv_id = move.moveinv_id
WHERE
1 = 1
AND move.is_delete = '0'
AND move.stor_id in 输入.in_stor_id AND move.stor_id in 输入.in_stor_id
OPTION 输入.bill_code <> "" OPTION 输入.bill_code <> ""

View File

@@ -138,7 +138,7 @@
mst.input_time <= 输入.end_time mst.input_time <= 输入.end_time
ENDOPTION ENDOPTION
) ios ) ios
LEFT JOIN ( inner JOIN (
select select
dtl.iostorinv_id, dtl.iostorinv_id,
dtl.vbeln dtl.vbeln
@@ -158,7 +158,7 @@
dtl.iostorinv_id, dtl.iostorinv_id,
dtl.vbeln dtl.vbeln
) c ON ios.iostorinv_id = c.iostorinv_id ) c ON ios.iostorinv_id = c.iostorinv_id
LEFT JOIN ( inner JOIN (
SELECT SELECT
dis.iostorinv_id dis.iostorinv_id
FROM FROM
@@ -248,7 +248,7 @@
mst.input_time <= 输入.end_time mst.input_time <= 输入.end_time
ENDOPTION ENDOPTION
) ios ) ios
LEFT JOIN ( inner JOIN (
select select
dtl.iostorinv_id, dtl.iostorinv_id,
dtl.vbeln dtl.vbeln
@@ -268,7 +268,7 @@
dtl.iostorinv_id, dtl.iostorinv_id,
dtl.vbeln dtl.vbeln
) c ON ios.iostorinv_id = c.iostorinv_id ) c ON ios.iostorinv_id = c.iostorinv_id
LEFT JOIN ( inner JOIN (
SELECT SELECT
dis.iostorinv_id dis.iostorinv_id
FROM FROM
@@ -426,8 +426,7 @@
ENDOPTION ENDOPTION
GROUP BY sub.sale_order_name,spec,ios.iostorinv_id,dtl.iostorinvdtl_id GROUP BY sub.sale_order_name,spec,ios.iostorinv_id,dtl.iostorinvdtl_id
limit 0,10000
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
@@ -693,8 +692,7 @@
OPTION 输入.bill_status <> "" OPTION 输入.bill_status <> ""
dis.work_status <= 输入.bill_status dis.work_status <= 输入.bill_status
ENDOPTION ENDOPTION
order by dis.box_no,dis.pcsn limit 0,10000
order by dis.box_no,dis.pcsn
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF

View File

@@ -200,7 +200,8 @@
iostorinv_id iostorinv_id
FROM FROM
st_ivt_iostorinvdis dis st_ivt_iostorinvdis dis
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON (sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn AND dis.iostorinv_id = sub.bill_id) LEFT JOIN pdm_bi_subpackagerelationrecord sub ON (sub.container_name = dis.pcsn
AND dis.box_no = sub.package_box_sn AND dis.iostorinv_id = sub.bill_id)
WHERE WHERE
1=1 1=1
OPTION 输入.pcsn <> "" OPTION 输入.pcsn <> ""

View File

@@ -53,7 +53,7 @@
IF 输入.flag = "1" IF 输入.flag = "1"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
mst.stor_name, mst.stor_name,
dis.sect_name, dis.sect_name,
dis.struct_code, dis.struct_code,
@@ -212,7 +212,7 @@
IF 输入.flag = "2" IF 输入.flag = "2"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
MAX(mst.stor_name) AS stor_name, MAX(mst.stor_name) AS stor_name,
MAX(dis.sect_name) AS sect_name, MAX(dis.sect_name) AS sect_name,
MAX(dis.struct_code) AS struct_code, MAX(dis.struct_code) AS struct_code,
@@ -340,7 +340,7 @@
IF 输入.flag = "3" IF 输入.flag = "3"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
mst.stor_name, mst.stor_name,
dis.sect_name, dis.sect_name,
dis.struct_code, dis.struct_code,
@@ -501,7 +501,7 @@
IF 输入.flag = "4" IF 输入.flag = "4"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
MAX(mst.stor_name) AS stor_name, MAX(mst.stor_name) AS stor_name,
MAX(dis.sect_name) AS sect_name, MAX(dis.sect_name) AS sect_name,
MAX(dis.struct_code) AS struct_code, MAX(dis.struct_code) AS struct_code,
@@ -631,7 +631,7 @@
IF 输入.flag = "5" IF 输入.flag = "5"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
mst.stor_name, mst.stor_name,
dis.sect_name, dis.sect_name,
dis.struct_code, dis.struct_code,
@@ -832,7 +832,7 @@
IF 输入.flag = "6" IF 输入.flag = "6"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
MAX(mst.stor_name) AS stor_name, MAX(mst.stor_name) AS stor_name,
MAX(dis.sect_name) AS sect_name, MAX(dis.sect_name) AS sect_name,
MAX(dis.struct_code) AS struct_code, MAX(dis.struct_code) AS struct_code,

View File

@@ -150,7 +150,7 @@
IF 输入.flag = "2" IF 输入.flag = "2"
PAGEQUERY PAGEQUERY
SELECT DISTINCT SELECT
mst.stor_name, mst.stor_name,
dis.sect_name, dis.sect_name,
mst.bill_type, mst.bill_type,