rev:修改:1、新增退货库区;2、根据当前报表需求新增两个出入库报表页面;3、出库分配页面已经下发的任务无法取消;4、出入库报表、转单页面新增子卷号查询字段;5、冷却区页面新增回传MES入冷却按钮;6、手持其他入库也增加库区选择;7、新增改切入库类型,按照MES传的包装关系生成改切入库单;8、临期库区页面修改;
This commit is contained in:
@@ -1009,6 +1009,10 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String demand_limit = detail.getString("Attribute4");//客户需求抗拉下限
|
||||
String standard_limit = detail.getString("Attribute5");//内控标准抗拉下限
|
||||
String actual_value = detail.getString("Attribute6");//生产实际抗拉值
|
||||
String Attribute7 = detail.getString("7");//生产实际抗拉值
|
||||
if (ObjectUtil.isNotEmpty(Attribute7) && Attribute7.equals("1")){
|
||||
sub_type = "2";
|
||||
}
|
||||
|
||||
//查询库内是否存在相同的子卷号
|
||||
JSONObject container_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("container_name = '" + ContainerName + "'").uniqueResult(0);
|
||||
|
||||
@@ -149,6 +149,17 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
mst_jo.put("bill_type", "0006");
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < box_rows.size(); i++) {
|
||||
HashMap box_row = box_rows.get(i);
|
||||
sub_type = box_row.get("sub_type");
|
||||
if (ObjectUtil.isNotEmpty(sub_type)){
|
||||
if (sub_type.equals("2")){
|
||||
//如果为改切的包装关系则变为改切入库
|
||||
mst_jo.put("bill_type", "0007");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//查询成品库仓库
|
||||
JSONObject stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1'").uniqueResult(0);
|
||||
mst_jo.put("stor_id", stor.getString("stor_id"));
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package org.nl.wms.pdm.ivt.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -72,4 +73,13 @@ public class CoolPointIvtController {
|
||||
public ResponseEntity<Object> coolRegionIOQueryAll(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(coolpointivtService.coolRegionIOQueryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/uploadMes")
|
||||
@Log("手动回传MES")
|
||||
@ApiOperation("手动回传MES")
|
||||
public ResponseEntity<Object> uploadMes(@RequestBody JSONObject form){
|
||||
coolpointivtService.uploadMes(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package org.nl.wms.pdm.ivt.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pdm.ivt.service.dto.CoolPointIvtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -69,4 +70,6 @@ public interface CoolPointIvtService {
|
||||
* @return
|
||||
*/
|
||||
Map<String,Object> coolRegionIOQueryAll(Map whereJson, Pageable page);
|
||||
|
||||
void uploadMes(JSONObject form);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ 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 cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -15,8 +16,11 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.pdm.ivt.service.CoolPointIvtService;
|
||||
import org.nl.wms.pdm.ivt.service.dto.CoolPointIvtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -175,4 +179,27 @@ public class CoolPointIvtServiceImpl implements CoolPointIvtService {
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadMes(JSONObject form) {
|
||||
//调用回传MES的半成品入库接口
|
||||
// 将入冷却信息发送给mes
|
||||
JSONObject param = new JSONObject();
|
||||
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
String container_name = form.getString("container_name");
|
||||
if (StrUtil.isEmpty(container_name)){
|
||||
throw new BadRequestException("母卷号不能为空!");
|
||||
}
|
||||
param.put("iContainerName", container_name);
|
||||
param.put("iArrivalTime", DateUtil.now());
|
||||
param.put("iWarehouse", 2);
|
||||
param.put("UserName", userName);
|
||||
param.put("PassWord", passWord);
|
||||
|
||||
//判断该接口是否需要回传
|
||||
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'momRollSemiFGInboundComplete'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")){
|
||||
new LmsToMesServiceImpl().momRollSemiFGInboundComplete(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -119,9 +119,9 @@ public class OutTask extends AbstractAcsTask {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonTask)) {
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 任务为下发之后就不允许取消
|
||||
if (jsonTask.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.START_AND_POINT.getCode())) {
|
||||
throw new BadRequestException("任务:" + jsonTask.getString("task_code") + "已下发,不可取消");
|
||||
// 任务为执行之后就不允许取消
|
||||
if (jsonTask.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.ISSUE.getCode())) {
|
||||
throw new BadRequestException("任务:" + jsonTask.getString("task_code") + "已执行,不可取消");
|
||||
}
|
||||
|
||||
// 更新删除字段
|
||||
|
||||
@@ -105,14 +105,17 @@ public class InbillServiceImpl {
|
||||
dis_table.update(dis_row);
|
||||
|
||||
String pcsn = dis_row.getString("pcsn");
|
||||
JSONObject sub_jo = sub_table.query("container_name = '"+pcsn+"'").uniqueResult(0);
|
||||
JSONObject sub_jo = sub_table.query("container_name = '"+pcsn+"' AND package_box_sn = '"+dis_row.getString("box_no")+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)){
|
||||
throw new BadRequestException("未查询到子卷号为:"+pcsn+"对应的包装关系!");
|
||||
}
|
||||
JSONObject mst_jo = mst_table.query("iostorinv_id = '" + dis_row.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
sub_jo.put("io_code",mst_jo.getString("bill_code"));
|
||||
sub_jo.put("bill_code",mst_jo.getString("bill_code"));
|
||||
sub_jo.put("bill_id",mst_jo.getString("iostorinv_id"));
|
||||
sub_jo.put("bill_type",mst_jo.getString("bill_type"));
|
||||
sub_jo.put("io_type","0");
|
||||
sub_jo.put("insert_time",DateUtil.now());
|
||||
sub_jo.put("record_id",IdUtil.getSnowflake(1, 1));
|
||||
sub_jo.put("record_id",IdUtil.getSnowflake(1, 1).nextId());
|
||||
sub_record.insert(sub_jo);
|
||||
|
||||
//回写明细表实际数量
|
||||
|
||||
@@ -53,6 +53,9 @@ public class ChangeServiceImpl implements ChangeService {
|
||||
if (StrUtil.isNotEmpty(map.get("buss_type"))) {
|
||||
map.put("buss_type", whereJson.get("buss_type") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
map.put("pcsn", (String) whereJson.get("pcsn"));
|
||||
}
|
||||
|
||||
//获取人员对应的仓库
|
||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||
|
||||
@@ -64,18 +64,22 @@
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
SELECT DISTINCT
|
||||
cg.changeinv_id AS id,
|
||||
cg.*
|
||||
FROM
|
||||
st_ivt_structivtchange cg
|
||||
st_ivt_structivtchange cg
|
||||
LEFT JOIN st_ivt_structivtchangedtl dtl ON cg.changeinv_id = dtl.changeinv_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND cg.is_delete = '0'
|
||||
and cg.stor_id in 输入.in_stor_id
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
cg.bill_code like 输入.bill_code
|
||||
cg.bill_code like 输入.bill_code
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
dtl.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
OPTION 输入.buss_type <> ""
|
||||
cg.buss_type like 输入.buss_type
|
||||
|
||||
@@ -1436,7 +1436,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
.getResultJSONArray(0);
|
||||
//若存在记录,则不可取消该出库明细对应的任何分配记录
|
||||
if (dtl.size() != 0) {
|
||||
throw new BadRequestException("存在出库明细对应任务执行中或完成!");
|
||||
throw new BadRequestException("存在出库明细对应任务下发、执行中或完成!");
|
||||
}
|
||||
double plan_qty = dis.getDoubleValue("plan_qty");
|
||||
//更新库存
|
||||
@@ -1565,7 +1565,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
.getResultJSONArray(0);
|
||||
//若存在记录,则不可取消该出库明细对应的任何分配记录
|
||||
if (dtl.size() != 0) {
|
||||
throw new BadRequestException("存在出库明细对应任务执行中或完成!");
|
||||
throw new BadRequestException("存在出库明细对应任务下发、执行中或完成!");
|
||||
}
|
||||
double plan_qty = dis.getDoubleValue("plan_qty");
|
||||
//更新库存
|
||||
@@ -4143,6 +4143,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||
// 子卷包装关系表
|
||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||
//包装关系出入库记录表
|
||||
WQLObject sub_record = WQLObject.getWQLObject("pdm_bi_subpackagerelationrecord");
|
||||
|
||||
String iostorinv_id = form.getString("iostorinv_id");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
@@ -4239,6 +4241,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
subTab.update(jsonSub);
|
||||
|
||||
//插入包装关系出入库记录表
|
||||
jsonSub.put("bill_code",jo_mst.getString("bill_code"));
|
||||
jsonSub.put("bill_id",jo_mst.getString("iostorinv_id"));
|
||||
jsonSub.put("bill_type",jo_mst.getString("bill_type"));
|
||||
jsonSub.put("io_type","1");
|
||||
jsonSub.put("insert_time",DateUtil.now());
|
||||
jsonSub.put("record_id",IdUtil.getSnowflake(1, 1).nextId());
|
||||
sub_record.insert(jsonSub);
|
||||
|
||||
// 更新分配明细执行状态为 - 99
|
||||
JSONObject jsonDis = wo_dis.query("iostorinvdis_id = '" + dis.getString("iostorinvdis_id") + "'").uniqueResult(0);
|
||||
jsonDis.put("work_status", "99");
|
||||
|
||||
@@ -434,7 +434,7 @@
|
||||
WHERE
|
||||
1 = 1
|
||||
AND dis.work_status = '01'
|
||||
AND task.task_status IN ('02', '03', '99')
|
||||
AND task.task_status IN ('02', '03','05','06','99')
|
||||
OPTION 输入.iostorinvdtl_id <> ""
|
||||
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
||||
ENDOPTION
|
||||
|
||||
@@ -41,6 +41,13 @@ public class InBillQueryController {
|
||||
return new ResponseEntity<>(inBillQueryService.queryAll(whereJson, page, product_area), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/query2")
|
||||
@Log("查询")
|
||||
@ApiOperation("查询")
|
||||
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page, String[] product_area) {
|
||||
return new ResponseEntity<>(inBillQueryService.queryAll2(whereJson, page, product_area), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增")
|
||||
@ApiOperation("新增")
|
||||
@@ -71,4 +78,11 @@ public class InBillQueryController {
|
||||
public void download(@RequestParam Map map, HttpServletResponse response, String[] product_area) throws IOException {
|
||||
inBillQueryService.download(map, response, product_area);
|
||||
}
|
||||
|
||||
@Log("导出数据2")
|
||||
@ApiOperation("导出数据2")
|
||||
@GetMapping(value = "/download2")
|
||||
public void download2(@RequestParam Map map, HttpServletResponse response, String[] product_area) throws IOException {
|
||||
inBillQueryService.download2(map, response, product_area);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,13 @@ public class OutBillQueryController {
|
||||
return new ResponseEntity<>(outBillQueryService.queryAll(whereJson, page, bill_types), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/query2")
|
||||
@Log("新查询")
|
||||
@ApiOperation("新查询")
|
||||
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page, String[] bill_types) {
|
||||
return new ResponseEntity<>(outBillQueryService.queryAll2(whereJson, page, bill_types), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增")
|
||||
@ApiOperation("新增")
|
||||
@@ -67,7 +74,14 @@ public class OutBillQueryController {
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(@RequestParam Map map, HttpServletResponse response) throws IOException {
|
||||
outBillQueryService.download(map, response);
|
||||
public void download(@RequestParam Map map, HttpServletResponse response, String[] bill_types) throws IOException {
|
||||
outBillQueryService.download(map, response,bill_types);
|
||||
}
|
||||
|
||||
@Log("导出数据2")
|
||||
@ApiOperation("导出数据2")
|
||||
@GetMapping(value = "/download2")
|
||||
public void download2(@RequestParam Map map, HttpServletResponse response, String[] bill_types) throws IOException {
|
||||
outBillQueryService.download2(map, response,bill_types);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ public interface InBillQueryService {
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page, String[] product_area);
|
||||
|
||||
Map<String, Object> queryAll2(Map whereJson, Pageable page, String[] product_area);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
@@ -56,4 +58,6 @@ public interface InBillQueryService {
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
void download(Map map, HttpServletResponse response, String[] product_area) throws IOException;
|
||||
|
||||
void download2(Map map, HttpServletResponse response, String[] product_area) throws IOException;
|
||||
}
|
||||
@@ -26,6 +26,8 @@ public interface OutBillQueryService {
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page, String[] bill_types);
|
||||
|
||||
Map<String, Object> queryAll2(Map whereJson, Pageable page, String[] bill_types);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
@@ -55,5 +57,7 @@ public interface OutBillQueryService {
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
void download(Map map, HttpServletResponse response) throws IOException;
|
||||
void download(Map map, HttpServletResponse response, String[] bill_types) throws IOException;
|
||||
|
||||
void download2(Map map, HttpServletResponse response, String[] bill_types) throws IOException;
|
||||
}
|
||||
@@ -51,6 +51,7 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
String is_virtual = MapUtil.getStr(whereJson, "is_virtual");
|
||||
String classes = MapUtil.getStr(whereJson, "classes");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String is_all = MapUtil.getStr(whereJson, "is_all");
|
||||
String thickness_request = MapUtil.getStr(whereJson, "thickness_request");
|
||||
|
||||
@@ -65,6 +66,69 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
map.put("with", with);
|
||||
map.put("is_virtual", is_virtual);
|
||||
map.put("classes", classes);
|
||||
map.put("pcsn", pcsn);
|
||||
map.put("thickness_request", thickness_request);
|
||||
|
||||
// 处理时间
|
||||
if (ObjectUtil.isNotEmpty(begin_time) && ObjectUtil.isNotEmpty(end_time)) {
|
||||
String begin_time_today = begin_time.substring(0, 10);
|
||||
String end_time_today = end_time.substring(0, 10);
|
||||
|
||||
|
||||
// 开始时间
|
||||
String today_begin_time = begin_time_today + " 08:00:00";
|
||||
|
||||
// 结束时间:19:59:59
|
||||
DateTime parse = DateUtil.parse(end_time_today);
|
||||
String substring = DateUtil.offsetDay(parse, 1).toString().substring(0, 10);
|
||||
|
||||
String today_end_time = substring + " 07:59:59";
|
||||
|
||||
map.put("begin_time", today_begin_time);
|
||||
map.put("end_time", today_end_time);
|
||||
}
|
||||
|
||||
|
||||
if (ObjectUtil.isNotEmpty(product_area)) {
|
||||
String areas = "(";
|
||||
for (int i = 0; i < product_area.length; i++) {
|
||||
if (i != product_area.length - 1) {
|
||||
areas += "'" + product_area[i] + "',";
|
||||
} else {
|
||||
areas += "'" + product_area[i] + "')";
|
||||
}
|
||||
}
|
||||
map.put("areas", areas);
|
||||
}
|
||||
JSONObject json = WQL.getWO("ST_IVT_INBILLQUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.confirm_time DESC,dis.box_no");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll2(Map whereJson, Pageable page, String[] product_area) {
|
||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||
String bill_type = MapUtil.getStr(whereJson, "bill_type");
|
||||
String with = MapUtil.getStr(whereJson, "with"); // 厚度*幅宽
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
String is_virtual = MapUtil.getStr(whereJson, "is_virtual");
|
||||
String classes = MapUtil.getStr(whereJson, "classes");
|
||||
String is_all = MapUtil.getStr(whereJson, "is_all");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String thickness_request = MapUtil.getStr(whereJson, "thickness_request");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
if ("0".equals(is_all)) {
|
||||
map.put("flag", "5");
|
||||
} else {
|
||||
map.put("flag", "6");
|
||||
}
|
||||
map.put("stor_id", stor_id);
|
||||
map.put("bill_type", bill_type);
|
||||
map.put("with", with);
|
||||
map.put("pcsn", pcsn);
|
||||
map.put("is_virtual", is_virtual);
|
||||
map.put("classes", classes);
|
||||
map.put("thickness_request", thickness_request);
|
||||
|
||||
// 处理时间
|
||||
@@ -148,6 +212,7 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
String end_time = MapUtil.getStr(map, "end_time");
|
||||
String is_virtual = MapUtil.getStr(map, "is_virtual");
|
||||
String classes = MapUtil.getStr(map, "classes");
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
String is_all = MapUtil.getStr(map, "is_all");
|
||||
String thickness_request = MapUtil.getStr(map, "thickness_request");
|
||||
|
||||
@@ -160,6 +225,7 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
mapParam.put("stor_id", stor_id);
|
||||
mapParam.put("bill_type", bill_type);
|
||||
mapParam.put("with", with);
|
||||
mapParam.put("pcsn", pcsn);
|
||||
mapParam.put("is_virtual", is_virtual);
|
||||
mapParam.put("classes", classes);
|
||||
mapParam.put("thickness_request", thickness_request);
|
||||
@@ -260,4 +326,129 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download2(Map map, HttpServletResponse response, String[] product_area) throws IOException {
|
||||
String stor_id = MapUtil.getStr(map, "stor_id");
|
||||
String bill_type = MapUtil.getStr(map, "bill_type");
|
||||
String with = MapUtil.getStr(map, "with"); // 厚度*幅宽
|
||||
String begin_time = MapUtil.getStr(map, "begin_time");
|
||||
String end_time = MapUtil.getStr(map, "end_time");
|
||||
String is_virtual = MapUtil.getStr(map, "is_virtual");
|
||||
String classes = MapUtil.getStr(map, "classes");
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
String is_all = MapUtil.getStr(map, "is_all");
|
||||
String thickness_request = MapUtil.getStr(map, "thickness_request");
|
||||
|
||||
JSONObject mapParam = new JSONObject();
|
||||
if ("0".equals(is_all)) {
|
||||
mapParam.put("flag", "5");
|
||||
} else {
|
||||
mapParam.put("flag", "6");
|
||||
}
|
||||
mapParam.put("stor_id", stor_id);
|
||||
mapParam.put("bill_type", bill_type);
|
||||
mapParam.put("with", with);
|
||||
mapParam.put("pcsn", pcsn);
|
||||
mapParam.put("is_virtual", is_virtual);
|
||||
mapParam.put("classes", classes);
|
||||
mapParam.put("thickness_request", thickness_request);
|
||||
|
||||
// 处理时间
|
||||
if (ObjectUtil.isNotEmpty(begin_time) && ObjectUtil.isNotEmpty(end_time)) {
|
||||
String begin_time_today = begin_time.substring(0, 10);
|
||||
String end_time_today = end_time.substring(0, 10);
|
||||
|
||||
|
||||
// 开始时间
|
||||
String today_begin_time = begin_time_today + " 08:00:00";
|
||||
|
||||
// 结束时间:19:59:59
|
||||
DateTime parse = DateUtil.parse(end_time_today);
|
||||
String substring = DateUtil.offsetDay(parse, 1).toString().substring(0, 10);
|
||||
|
||||
String today_end_time = substring + " 07:59:59";
|
||||
|
||||
mapParam.put("begin_time", today_begin_time);
|
||||
mapParam.put("end_time", today_end_time);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(product_area)) {
|
||||
String areas = "(";
|
||||
for (int i = 0; i < product_area.length; i++) {
|
||||
if (i != product_area.length - 1) {
|
||||
areas += "'" + product_area[i] + "',";
|
||||
} else {
|
||||
areas += "'" + product_area[i] + "')";
|
||||
}
|
||||
}
|
||||
mapParam.put("areas", areas);
|
||||
}
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("ST_IVT_INBILLQUERY").addParamMap(mapParam).process().getResultJSONArray(0);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
if ("0".equals(is_all)){
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject json = resultJSONArray.getJSONObject(i);
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
mp.put("日期", (json.getString("confirm_time_class").substring(0,10)).replace("-","/"));
|
||||
mp.put("班次", json.getString("classes"));
|
||||
mp.put("销售订单", json.getString("sale_order_name"));
|
||||
mp.put("客户编码", json.getString("customer_name"));
|
||||
mp.put("规格", json.getString("thickness_request"));
|
||||
mp.put("尺寸(mm)(客户要求幅宽)", json.getString("width_standard"));
|
||||
mp.put("实际尺寸(mm)(实际幅宽)", json.getString("width"));
|
||||
String box_name = json.getString("box_name");
|
||||
if (StrUtil.isNotEmpty(box_name)){
|
||||
String[] s = box_name.split("木箱");
|
||||
String s1 = s[1];
|
||||
String[] split = s1.split("\\|");
|
||||
mp.put("木箱规格/尺寸", split[1]+"*"+split[2]);
|
||||
}else {
|
||||
mp.put("木箱规格/尺寸", "");
|
||||
}
|
||||
mp.put("毛重合计", NumberUtil.round(StrUtil.isEmpty(json.getString("box_weight")) ? "0" : json.getString("box_weight"), 1));
|
||||
mp.put("净重(KG)", NumberUtil.round(StrUtil.isEmpty(json.getString("net_weight")) ? "0" : json.getString("net_weight"), 1));
|
||||
mp.put("卷数", json.getString("quanlity_in_box"));
|
||||
mp.put("品级", "A");
|
||||
mp.put("小卷号", json.getString("pcsn"));
|
||||
mp.put("箱号", json.getString("box_no"));
|
||||
mp.put("母卷号", json.getString("parent_container_name"));
|
||||
mp.put("基重(g/m³)(面密度)", NumberUtil.round(StrUtil.isEmpty(json.getString("mass_per_unit_area")) ? "0" : json.getString("mass_per_unit_area"), 1));
|
||||
mp.put("居中度(mm)", "±1");
|
||||
mp.put("塌边(mm)", "≤10");
|
||||
mp.put("米数(长度)", NumberUtil.round(StrUtil.isEmpty(json.getString("length")) ? "0" : json.getString("length"), 1));
|
||||
mp.put("管件类型", json.getString("paper_type"));
|
||||
mp.put("管件编码", json.getString("paper_code"));
|
||||
mp.put("管件描述", json.getString("paper_name"));
|
||||
mp.put("生产实际抗拉值", json.getString("actual_value"));
|
||||
mp.put("内控标准抗拉下限", json.getString("standard_limit"));
|
||||
mp.put("客户需求抗拉下限", json.getString("demand_limit"));
|
||||
mp.put("生产日期", json.getString("date_of_production").replace("-","/"));
|
||||
mp.put("入库日期", json.getString("confirm_time").substring(0,10).replace("-","/"));
|
||||
list.add(mp);
|
||||
}
|
||||
}else {
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject json = resultJSONArray.getJSONObject(i);
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
mp.put("序号", String.valueOf(i+1));
|
||||
mp.put("日期", (json.getString("confirm_time_class").substring(0,10)).replace("-","/"));
|
||||
mp.put("班次", json.getString("classes"));
|
||||
mp.put("库区", json.getString("sect_name"));
|
||||
mp.put("客户编码", json.getString("customer_name"));
|
||||
mp.put("销售订单及行号", json.getString("sale_order_name"));
|
||||
mp.put("生产日期", json.getString("date_of_production").replace("-","/"));
|
||||
mp.put("箱号", json.getString("box_no"));
|
||||
mp.put("生产批号", (json.getString("confirm_time").substring(0,10)).replace("-","").trim());
|
||||
mp.put("规格", json.getString("specification"));
|
||||
mp.put("净重", NumberUtil.round(json.getString("net_weight"), 1));
|
||||
mp.put("等级", "A");
|
||||
mp.put("备注", "");
|
||||
list.add(mp);
|
||||
}
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
String with = MapUtil.getStr(whereJson, "with"); // 厚度*幅宽
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String customer_name = MapUtil.getStr(whereJson, "customer_name");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
@@ -56,6 +57,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
}
|
||||
map.put("with",with);
|
||||
map.put("begin_time",begin_time);
|
||||
map.put("pcsn",pcsn);
|
||||
map.put("end_time",end_time);
|
||||
if (ObjectUtil.isNotEmpty(customer_name)) map.put("customer_name","%"+customer_name+"%");
|
||||
|
||||
@@ -63,6 +65,36 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll2(Map whereJson, Pageable page, String[] bill_types) {
|
||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||
|
||||
String with = MapUtil.getStr(whereJson, "with"); // 厚度*幅宽
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String customer_name = MapUtil.getStr(whereJson, "customer_name");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("stor_id",stor_id);
|
||||
if (ObjectUtil.isNotEmpty(bill_types)){
|
||||
StringJoiner joiner = new StringJoiner(",","(",")");
|
||||
for (String type : bill_types){
|
||||
joiner.add("'"+type+"'");
|
||||
}
|
||||
map.put("bill_type",joiner.toString());
|
||||
}
|
||||
map.put("with",with);
|
||||
map.put("begin_time",begin_time);
|
||||
map.put("end_time",end_time);
|
||||
map.put("pcsn",pcsn);
|
||||
if (ObjectUtil.isNotEmpty(customer_name)) map.put("customer_name","%"+customer_name+"%");
|
||||
|
||||
JSONObject json = WQL.getWO("ST_IVT_OUTBILLQUERY").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC,dis.box_no");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PointDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_point");
|
||||
@@ -101,20 +133,91 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(Map map, HttpServletResponse response) throws IOException {
|
||||
public void download(Map map, HttpServletResponse response, String[] bill_types) throws IOException {
|
||||
String stor_id = MapUtil.getStr(map, "stor_id");
|
||||
String bill_type = MapUtil.getStr(map, "bill_type");
|
||||
String with = MapUtil.getStr(map, "with"); // 厚度*幅宽
|
||||
String begin_time = MapUtil.getStr(map, "begin_time");
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
String end_time = MapUtil.getStr(map, "end_time");
|
||||
String customer_name = MapUtil.getStr(map, "customer_name");
|
||||
|
||||
JSONObject mapParam = new JSONObject();
|
||||
mapParam.put("flag", "1");
|
||||
mapParam.put("stor_id",stor_id);
|
||||
mapParam.put("bill_type",bill_type);
|
||||
if (ObjectUtil.isNotEmpty(bill_types)){
|
||||
StringJoiner joiner = new StringJoiner(",","(",")");
|
||||
for (String type : bill_types){
|
||||
joiner.add("'"+type+"'");
|
||||
}
|
||||
mapParam.put("bill_type",joiner.toString());
|
||||
}
|
||||
mapParam.put("with",with);
|
||||
mapParam.put("begin_time",begin_time);
|
||||
mapParam.put("pcsn",pcsn);
|
||||
mapParam.put("end_time",end_time);
|
||||
if (ObjectUtil.isNotEmpty(customer_name)) mapParam.put("customer_name","%"+customer_name+"%");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("ST_IVT_OUTBILLQUERY").addParamMap(mapParam).process().getResultJSONArray(0);
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject json = resultJSONArray.getJSONObject(i);
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
|
||||
mp.put("仓库", json.getString("stor_name"));
|
||||
if (ObjectUtil.isNotEmpty(bill_type) && bill_type.equals("1004")){
|
||||
mp.put("移入仓库", json.getString("in_stor_name"));
|
||||
}
|
||||
mp.put("库区", json.getString("sect_name"));
|
||||
mp.put("交货单号", json.getString("vbeln"));
|
||||
mp.put("物流公司", json.getString("cust_name"));
|
||||
mp.put("运费", json.getString("estimated_freight"));
|
||||
mp.put("木箱号", json.getString("box_no"));
|
||||
mp.put("物料编码", json.getString("material_code"));
|
||||
mp.put("物料名称", json.getString("material_name"));
|
||||
mp.put("子卷号", json.getString("pcsn"));
|
||||
mp.put("sap批次", json.getString("sap_pcsn"));
|
||||
mp.put("净重", json.getString("net_weight"));
|
||||
mp.put("单位", json.getString("qty_unit_name"));
|
||||
mp.put("客户编码", json.getString("customer_name"));
|
||||
mp.put("发货客户名称", json.getString("customer_description"));
|
||||
mp.put("销售订单", json.getString("sale_order_name"));
|
||||
mp.put("出库日期", json.getString("input_time"));
|
||||
mp.put("产品规格", json.getString("width"));
|
||||
mp.put("产品厚度", json.getString("thickness"));
|
||||
mp.put("单位面积", json.getString("mass_per_unit_area"));
|
||||
mp.put("制单人", json.getString("input_optname"));
|
||||
mp.put("备注", json.getString("remark"));
|
||||
list.add(mp);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download2(Map map, HttpServletResponse response, String[] bill_types) throws IOException {
|
||||
String stor_id = MapUtil.getStr(map, "stor_id");
|
||||
String bill_type = MapUtil.getStr(map, "bill_type");
|
||||
String with = MapUtil.getStr(map, "with"); // 厚度*幅宽
|
||||
String begin_time = MapUtil.getStr(map, "begin_time");
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
String end_time = MapUtil.getStr(map, "end_time");
|
||||
String customer_name = MapUtil.getStr(map, "customer_name");
|
||||
|
||||
JSONObject mapParam = new JSONObject();
|
||||
mapParam.put("flag", "2");
|
||||
mapParam.put("stor_id",stor_id);
|
||||
if (ObjectUtil.isNotEmpty(bill_types)){
|
||||
StringJoiner joiner = new StringJoiner(",","(",")");
|
||||
for (String type : bill_types){
|
||||
joiner.add("'"+type+"'");
|
||||
}
|
||||
mapParam.put("bill_type",joiner.toString());
|
||||
}
|
||||
mapParam.put("with",with);
|
||||
mapParam.put("pcsn",pcsn);
|
||||
mapParam.put("begin_time",begin_time);
|
||||
mapParam.put("end_time",end_time);
|
||||
if (ObjectUtil.isNotEmpty(customer_name)) mapParam.put("customer_name","%"+customer_name+"%");
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
输入.with TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.is_virtual TYPEAS s_string
|
||||
输入.classes TYPEAS s_string
|
||||
输入.thickness_request TYPEAS s_string
|
||||
@@ -110,7 +111,12 @@
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
AND b.bill_type = 输入.bill_type
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
@@ -236,7 +242,12 @@
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
AND b.bill_type = 输入.bill_type
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
@@ -365,7 +376,12 @@
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
AND b.bill_type = 输入.bill_type
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
@@ -493,7 +509,12 @@
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
AND b.bill_type = 输入.bill_type
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
@@ -559,4 +580,298 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "5"
|
||||
PAGEQUERY
|
||||
SELECT DISTINCT
|
||||
mst.stor_name,
|
||||
dis.sect_name,
|
||||
dis.struct_code,
|
||||
dis.struct_name,
|
||||
mst.bill_type,
|
||||
dis.box_no,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mb.material_name AS box_name,
|
||||
dis.pcsn,
|
||||
sub.sap_pcsn,
|
||||
sub.net_weight,
|
||||
dis.qty_unit_name,
|
||||
sub.customer_name,
|
||||
sub.quanlity_in_box,
|
||||
sub.customer_description,
|
||||
sub.sale_order_name,
|
||||
mst.input_time,
|
||||
mst.confirm_time,
|
||||
sub.date_of_production,
|
||||
mst.input_optname,
|
||||
sub.width,
|
||||
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS paper_type,
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then plan.FRP_material end AS paper_code,
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then plan.FRP_description end AS paper_name,
|
||||
sub.thickness,
|
||||
sub.box_weight,
|
||||
sub.length,
|
||||
sub.thickness_request,
|
||||
sub.width_standard,
|
||||
sub.mass_per_unit_area,
|
||||
sub.demand_limit,
|
||||
sub.standard_limit,
|
||||
sub.actual_value,
|
||||
(case when plan.parent_container_name <> '' then plan.parent_container_name else plan.restruct_container_name end) AS parent_container_name,
|
||||
mst.remark,
|
||||
(case when DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='08:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '19:59:59' then '白班'
|
||||
when ((
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='20:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '23:59:59'
|
||||
OR
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='00:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '07:59:59'
|
||||
)) then '晚班' end) AS classes,
|
||||
CONCAT( sub.box_length,'*',sub.box_width,'*',sub.box_high) AS box_size,
|
||||
CASE
|
||||
|
||||
WHEN DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >= '08:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '23:59:59'
|
||||
THEN mst.confirm_time
|
||||
WHEN DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >= '00:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '07:59:59'
|
||||
THEN DATE_SUB(mst.confirm_time,INTERVAL 1 day)
|
||||
END AS confirm_time_class
|
||||
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
MIN( a.iostorinvdis_id ) AS iostorinvdis_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
MIN( a.iostorinvdis_id ) AS iostorinvdis_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
OPTION 输入.bill_type = "0001"
|
||||
b.bill_type = '0007'
|
||||
ENDOPTION
|
||||
OPTION 输入.bill_type = "0001"
|
||||
(b.bill_type = '0001' OR b.bill_type = '0007')
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
) AS c
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = c.iostorinvdis_id
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
LEFT JOIN st_ivt_sectattr sect ON sect.sect_id = dis.sect_id
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
INNER JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id = dis.iostorinv_id
|
||||
LEFT JOIN (SELECT
|
||||
container_name,
|
||||
MAX(paper_tube_or_FRP) AS paper_tube_or_FRP,
|
||||
MAX(paper_tube_material) AS paper_tube_material,
|
||||
MAX(paper_tube_description) AS paper_tube_description,
|
||||
MAX(paper_tube_model) AS paper_tube_model,
|
||||
MAX(FRP_material) AS FRP_material,
|
||||
MAX(parent_container_name) AS parent_container_name,
|
||||
MAX(restruct_container_name) AS restruct_container_name,
|
||||
MAX(FRP_description) AS FRP_description,
|
||||
MAX(FRP_model) AS FRP_model
|
||||
FROM
|
||||
pdm_bi_slittingproductionplan plan1
|
||||
WHERE
|
||||
plan1.is_delete = '0'
|
||||
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_code = sub.box_type
|
||||
WHERE
|
||||
mst.io_type = '0'
|
||||
AND mst.is_delete = '0'
|
||||
AND mst.bill_status = '99'
|
||||
|
||||
OPTION 输入.stor_id <> ""
|
||||
mst.stor_id = 输入.stor_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.is_virtual = "0"
|
||||
sect.sect_type_attr <> '09'
|
||||
ENDOPTION
|
||||
OPTION 输入.is_virtual = "1"
|
||||
sect.sect_type_attr = '09'
|
||||
ENDOPTION
|
||||
OPTION 输入.areas <> ""
|
||||
LEFT(sub.container_name,2) IN 输入.areas
|
||||
ENDOPTION
|
||||
OPTION 输入.thickness_request <> ""
|
||||
sub.thickness_request = 输入.thickness_request
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_type = "0001"
|
||||
IFNULL(sub.sub_type,'') = ''
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_type = "0007"
|
||||
sub.sub_type = '2'
|
||||
ENDOPTION
|
||||
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
mst.confirm_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
mst.confirm_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.with <> ""
|
||||
CONCAT( sub.thickness_request,'*',sub.width) = 输入.with
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classes = "1"
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='08:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '19:59:59'
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classes = "2"
|
||||
(
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='20:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '23:59:59'
|
||||
OR
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='00:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '07:59:59'
|
||||
)
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "6"
|
||||
PAGEQUERY
|
||||
SELECT DISTINCT
|
||||
MAX(mst.stor_name) AS stor_name,
|
||||
MAX(dis.sect_name) AS sect_name,
|
||||
MAX(dis.struct_code) AS struct_code,
|
||||
MAX(dis.struct_name) AS struct_name,
|
||||
MAX(mst.bill_type) AS bill_type,
|
||||
MAX(mater.material_code) AS material_code,
|
||||
MAX(mater.material_name) AS material_name,
|
||||
MAX(dis.qty_unit_name) AS qty_unit_name,
|
||||
MAX(sub.customer_description) AS customer_description,
|
||||
MAX(mst.input_optname) AS input_optname,
|
||||
MAX(mst.remark) AS remark,
|
||||
mst.iostorinv_id,
|
||||
dis.box_no,
|
||||
MAX(sub.customer_name) AS customer_name,
|
||||
MAX(sub.sale_order_name) AS sale_order_name,
|
||||
MAX(sub.date_of_production) AS date_of_production,
|
||||
SUM(sub.net_weight) AS net_weight,
|
||||
MAX(mst.input_time) AS input_time,
|
||||
MAX(mst.confirm_time) AS confirm_time,
|
||||
CONCAT_WS('',MAX(sub.thickness_request),'*',MAX(sub.width)) AS specification,
|
||||
CONCAT( MAX(sub.box_length),'*',MAX(sub.box_width),'*',MAX(sub.box_high)) AS box_size,
|
||||
(case when DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='08:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '19:59:59' then '白班'
|
||||
when ((
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='20:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '23:59:59'
|
||||
OR
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='00:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '07:59:59'
|
||||
)) then '晚班' end) AS classes,
|
||||
CASE
|
||||
WHEN DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >= '08:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '23:59:59'
|
||||
THEN mst.confirm_time
|
||||
WHEN DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >= '00:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '07:59:59'
|
||||
THEN DATE_SUB(mst.confirm_time,INTERVAL 1 day)
|
||||
END AS confirm_time_class
|
||||
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
MIN( a.iostorinvdis_id ) AS iostorinvdis_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
) AS c
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = c.iostorinvdis_id
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
LEFT JOIN st_ivt_sectattr sect ON sect.sect_id = dis.sect_id
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
INNER JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id = dis.iostorinv_id
|
||||
WHERE
|
||||
mst.io_type = '0'
|
||||
AND mst.is_delete = '0'
|
||||
AND mst.bill_status = '99'
|
||||
|
||||
OPTION 输入.stor_id <> ""
|
||||
mst.stor_id = 输入.stor_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.is_virtual = "0"
|
||||
sect.sect_type_attr <> '09'
|
||||
ENDOPTION
|
||||
OPTION 输入.is_virtual = "1"
|
||||
sect.sect_type_attr = '09'
|
||||
ENDOPTION
|
||||
OPTION 输入.areas <> ""
|
||||
LEFT(sub.container_name,2) IN 输入.areas
|
||||
ENDOPTION
|
||||
OPTION 输入.thickness_request <> ""
|
||||
sub.thickness_request = 输入.thickness_request
|
||||
ENDOPTION
|
||||
OPTION 输入.bill_type <> ""
|
||||
mst.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
mst.confirm_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
mst.confirm_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.with <> ""
|
||||
CONCAT( sub.thickness_request,'*',sub.width) = 输入.with
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classes = "1"
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='08:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '19:59:59'
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classes = "2"
|
||||
(
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='20:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '23:59:59'
|
||||
OR
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) >='00:00:00' AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <= '07:59:59'
|
||||
)
|
||||
ENDOPTION
|
||||
GROUP BY
|
||||
mst.iostorinv_id,
|
||||
dis.box_no
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
输入.stor_id TYPEAS s_string
|
||||
输入.bill_type TYPEAS f_string
|
||||
输入.with TYPEAS s_string
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.customer_name TYPEAS s_string
|
||||
@@ -74,7 +75,22 @@
|
||||
mst.remark,
|
||||
stor.stor_name AS in_stor_name
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
(
|
||||
SELECT
|
||||
MAX( a.iostorinvdis_id ) AS iostorinvdis_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '1'
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
) AS c
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = c.iostorinvdis_id
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
LEFT JOIN st_ivt_iostorinvdtl dtl ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
|
||||
LEFT JOIN md_cs_transportationbase base ON base.cust_code = mst.trans_code
|
||||
@@ -127,4 +143,107 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
mst.stor_name,
|
||||
dis.sect_name,
|
||||
mst.bill_type,
|
||||
dtl.vbeln,
|
||||
base.cust_name,
|
||||
mst.estimated_freight,
|
||||
dis.box_no,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
dis.pcsn,
|
||||
sub.sap_pcsn,
|
||||
sub.net_weight,
|
||||
dis.qty_unit_name,
|
||||
sub.customer_name,
|
||||
sub.customer_description,
|
||||
sub.sale_order_name,
|
||||
mst.input_time,
|
||||
sub.width,
|
||||
sub.thickness,
|
||||
sub.mass_per_unit_area,
|
||||
mst.input_optname,
|
||||
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS paper_type,
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then plan.FRP_material end AS paper_code,
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then plan.FRP_description end AS paper_name,
|
||||
mst.remark,
|
||||
stor.stor_name AS in_stor_name
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
MAX( a.iostorinvdis_id ) AS iostorinvdis_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '1'
|
||||
OPTION 输入.bill_type <> ""
|
||||
b.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
a.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
) AS c
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = c.iostorinvdis_id
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
LEFT JOIN st_ivt_iostorinvdtl dtl ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
|
||||
LEFT JOIN md_cs_transportationbase base ON base.cust_code = mst.trans_code
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
LEFT JOIN st_ivt_bsrealstorattr stor ON stor.stor_id = mst.out_stor_id
|
||||
INNER JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id = mst.iostorinv_id
|
||||
LEFT JOIN (SELECT
|
||||
container_name,
|
||||
MAX(paper_tube_or_FRP) AS paper_tube_or_FRP,
|
||||
MAX(paper_tube_material) AS paper_tube_material,
|
||||
MAX(paper_tube_description) AS paper_tube_description,
|
||||
MAX(paper_tube_model) AS paper_tube_model,
|
||||
MAX(FRP_material) AS FRP_material,
|
||||
MAX(FRP_description) AS FRP_description,
|
||||
MAX(FRP_model) AS FRP_model
|
||||
FROM
|
||||
pdm_bi_slittingproductionplan plan1
|
||||
WHERE
|
||||
plan1.is_delete = '0'
|
||||
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||
WHERE
|
||||
mst.io_type = '1'
|
||||
AND mst.is_delete = '0'
|
||||
AND mst.bill_status = '99'
|
||||
|
||||
OPTION 输入.stor_id <> ""
|
||||
mst.stor_id = 输入.stor_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_type <> ""
|
||||
mst.bill_type IN 输入.bill_type
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
mst.input_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
mst.input_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.with <> ""
|
||||
CONCAT(sub.width,'*',sub.thickness) = 输入.with
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.customer_name <> ""
|
||||
(sub.customer_name LIKE 输入.customer_name OR
|
||||
sub.customer_description LIKE 输入.customer_name)
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
Reference in New Issue
Block a user