Merge remote-tracking branch 'origin/master_merge' into master_merge
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package org.nl.b_lms.pda.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pda.service.PrintTableTwoService;
|
||||
import org.nl.b_lms.pdm_manage.enums.SUBEnum;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2024-08-13
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/api/twoPrintTable")
|
||||
@Slf4j
|
||||
public class PrintTableTwoController {
|
||||
|
||||
@Autowired
|
||||
private PrintTableTwoService printTableTwoService;
|
||||
|
||||
@PostMapping("/printTable")
|
||||
@Log("打印")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirmPass(@RequestBody JSONObject whereJson) {
|
||||
if (whereJson.getString("type").equals(SUBEnum.TABLE_TYPE.code("内标"))) {
|
||||
return new ResponseEntity<>(printTableTwoService.withinTable(whereJson), HttpStatus.OK);
|
||||
} else {
|
||||
return new ResponseEntity<>(printTableTwoService.pipeTable(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/getPrint")
|
||||
@Log("获取打印机")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getPrint() {
|
||||
return new ResponseEntity<>(printTableTwoService.getPrint(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.nl.b_lms.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务接口
|
||||
* @date 2024-08-13
|
||||
**/
|
||||
public interface PrintTableTwoService {
|
||||
|
||||
/**
|
||||
* 内标打印
|
||||
*
|
||||
* @param whereJson: {
|
||||
* pcsn: 子卷号
|
||||
* print_code: 打印机
|
||||
* }
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject withinTable(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 管标打印
|
||||
*
|
||||
* @param whereJson {
|
||||
* pcsn: 子卷号
|
||||
* print_code: 打印机
|
||||
* }
|
||||
* @return
|
||||
*/
|
||||
JSONObject pipeTable(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取打印机
|
||||
*
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject getPrint();
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package org.nl.b_lms.pda.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.b_lms.pda.service.PrintTableTwoService;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
||||
import org.nl.b_lms.pdm_manage.enums.SUBEnum;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
@Service
|
||||
public class PrintTableTwoServiceImpl implements PrintTableTwoService {
|
||||
|
||||
/*
|
||||
* 子卷下线服务
|
||||
*/
|
||||
@Autowired
|
||||
private IPdmBiContainerinfoService iPdmBiContainerinfoService;
|
||||
|
||||
/*
|
||||
* 订单bom服务
|
||||
*/
|
||||
@Autowired
|
||||
private IPdmBiOrderbominfoService iPdmBiOrderbominfoService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject withinTable(JSONObject whereJson) {
|
||||
// 返回参数
|
||||
JSONObject result = new JSONObject();
|
||||
// 基础校验
|
||||
String pcsn = whereJson.getString("pcsn");
|
||||
if (ObjectUtil.isEmpty(pcsn)) {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
}
|
||||
|
||||
JSONObject jsonPrint = WQLObject.getWQLObject("pdm_bi_printinfo")
|
||||
.query("print_id = '" + whereJson.getString("print_code") + "' and print_region = '2'")
|
||||
.uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonPrint)) {
|
||||
throw new BadRequestException("打印机不能为空!");
|
||||
}
|
||||
|
||||
// 根据子卷号查询子卷下线表
|
||||
PdmBiContainerinfo subDao = iPdmBiContainerinfoService.getOne(
|
||||
new QueryWrapper<PdmBiContainerinfo>().lambda()
|
||||
.eq(PdmBiContainerinfo::getContainer_name, pcsn)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(subDao)) {
|
||||
throw new BadRequestException("未查询到子卷号:" + pcsn + "的子卷下线记录!");
|
||||
}
|
||||
// 找对应的分切计划
|
||||
JSONObject jsonPlan = WQLObject.getWQLObject("pdm_bi_slittingproductionplan")
|
||||
.query("container_name = '" + pcsn + "' and is_delete = '0'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPlan)) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "未查询到分切工单!");
|
||||
}
|
||||
// 校验信息
|
||||
if (ObjectUtil.isEmpty(jsonPlan.getString("description"))) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "物料描述不能为空!(分切计划工单)");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(subDao.getThickness_request()) || ObjectUtil.isEmpty(subDao.getWidth_standard())) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "规格不能为空!(子卷下线记录)");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(subDao.getMass_per_unit_area())) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "单位面积质量不能为空!(子卷下线记录)");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(subDao.getNet_weight())) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "净重不能为空!(子卷下线记录)");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(subDao.getLength())) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "长度不能为空!(子卷下线记录)");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonPlan.getString("material_type"))) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "物料类型不能为空!(分切计划工单)");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonPlan.getString("joint_type"))) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "接头数不能为空!(分切计划工单)");
|
||||
}
|
||||
|
||||
/*
|
||||
* 组织标签字段
|
||||
*/
|
||||
// 模版名称
|
||||
String LocationOfBTW = "\"" + SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("TWO_PRINT_WITHIN").getValue() + "\"";
|
||||
// 抬头
|
||||
String BTW = "%BTW% /AF=" + LocationOfBTW + "/R=3 /PRN=" + "\"" + jsonPrint.getString("print_floder") + "\"" + " /D /P /C=1";
|
||||
// 标签类型: 查询客户信息中配置的打印模版,根据模版找到字典配置的参数
|
||||
JSONObject jsonCust = WQLObject.getWQLObject("md_cs_customerbase")
|
||||
.query("cust_code = '" + subDao.getCustomer_name() + "' AND is_delete = '0' AND is_used = '1'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCust)) {
|
||||
throw new BadRequestException("客户【"+subDao.getCustomer_description()+"】不存在或未启用!");
|
||||
}
|
||||
JSONObject jsonDict = WQLObject.getWQLObject("sys_dict")
|
||||
.query("code = 'two_print_temple' AND value = '" + jsonCust.getString("bz_print_within") + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonDict)) {
|
||||
throw new BadRequestException("客户【"+subDao.getCustomer_description()+"】未找到对应的打印模版,请检查是否在客户信息中配置!");
|
||||
}
|
||||
String LabelType = jsonDict.getString("para1");
|
||||
|
||||
/*
|
||||
* 生成txt文件
|
||||
*/
|
||||
// 远程路径
|
||||
String filePath = jsonPrint.getString("print_route") + pcsn + "内标.txt";
|
||||
FileWriter fw = null;
|
||||
|
||||
try {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
file.createNewFile();
|
||||
}
|
||||
fw = new FileWriter(filePath);
|
||||
OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
|
||||
BufferedWriter bw = new BufferedWriter(write);
|
||||
|
||||
// 抬头
|
||||
bw.write(BTW + "\n");
|
||||
bw.write("%END%\n");
|
||||
// 须打印的key字段
|
||||
bw.write("LabelType,ContainerName,SerialNumber2,ProductName,Thickness,ArealWeight,Qty,Length,InspectUser,MfgDate,ProductFamilyName,JointNumbers\n");
|
||||
// 须打印的value值
|
||||
bw.write(
|
||||
LabelType + ","
|
||||
+ subDao.getContainer_name() + ","
|
||||
+ subDao.getSap_pcsn() + ","
|
||||
+ jsonPlan.getString("description") + ","
|
||||
+ subDao.getThickness_request() + "x" + subDao.getWidth_standard() + ","
|
||||
+ NumberUtil.round(subDao.getMass_per_unit_area(), 2).toString() + ","
|
||||
+ NumberUtil.round(subDao.getNet_weight(), 2).toString() + ","
|
||||
+ NumberUtil.round(subDao.getLength(), 2).toString() + ","
|
||||
+ "GSHL-JY100" + ","
|
||||
+ subDao.getDate_of_production() + ","
|
||||
+ jsonPlan.getString("material_type") + ","
|
||||
+ jsonPlan.getString("joint_type")
|
||||
);
|
||||
// 关闭流
|
||||
bw.close();
|
||||
result.put("message", "打印成功!");
|
||||
} catch (Exception e) {
|
||||
result.put("message", "打印失败!" + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
fw.close();
|
||||
} catch (Exception e) {
|
||||
result.put("message", "打印失败!" + e.getMessage());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject pipeTable(JSONObject whereJson) {
|
||||
// 返回参数
|
||||
JSONObject result = new JSONObject();
|
||||
// 基础校验
|
||||
String pcsn = whereJson.getString("pcsn");
|
||||
if (ObjectUtil.isEmpty(pcsn)) {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
}
|
||||
|
||||
JSONObject jsonPrint = WQLObject.getWQLObject("pdm_bi_printinfo")
|
||||
.query("print_id = '" + whereJson.getString("print_code") + "' and print_region = '2'")
|
||||
.uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonPrint)) {
|
||||
throw new BadRequestException("打印机不能为空!");
|
||||
}
|
||||
|
||||
// 根据子卷号查询子卷下线表
|
||||
PdmBiContainerinfo subDao = iPdmBiContainerinfoService.getOne(
|
||||
new QueryWrapper<PdmBiContainerinfo>().lambda()
|
||||
.eq(PdmBiContainerinfo::getContainer_name, pcsn)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(subDao)) {
|
||||
throw new BadRequestException("未查询到子卷号:" + pcsn + "的子卷下线记录!");
|
||||
}
|
||||
// 找对应的分切计划
|
||||
JSONObject jsonPlan = WQLObject.getWQLObject("pdm_bi_slittingproductionplan")
|
||||
.query("container_name = '" + pcsn + "' and is_delete = '0'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPlan)) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "未查询到分切工单!");
|
||||
}
|
||||
// 找对应的订单bom
|
||||
PdmBiOrderbominfo orderDao = iPdmBiOrderbominfoService.list(
|
||||
new QueryWrapper<PdmBiOrderbominfo>().lambda()
|
||||
.eq(PdmBiOrderbominfo::getMfgOrder, jsonPlan.getString("mfg_order_name"))
|
||||
).stream().findFirst().orElse(null);
|
||||
|
||||
if (ObjectUtil.isEmpty(orderDao)) {
|
||||
throw new BadRequestException("没有此订单的bom记录:" + jsonPlan.getString("mfg_order_name"));
|
||||
}
|
||||
|
||||
// 校验信息
|
||||
if (ObjectUtil.isEmpty(jsonPlan.getString("paper_weight"))) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "子管重量不能为空!(分切计划工单)");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(subDao.getThickness_request()) || ObjectUtil.isEmpty(subDao.getWidth_standard())) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "规格不能为空!(子卷下线记录)");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(orderDao.getRollingType())) {
|
||||
throw new BadRequestException("子卷号:" + pcsn + "毛面/光面不能为空!(订单BOM记录)");
|
||||
}
|
||||
|
||||
/*
|
||||
* 组织标签字段
|
||||
*/
|
||||
// 模版名称
|
||||
String LocationOfBTW = "\"" + SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("TWO_PRINT_PIPE").getValue() + "\"";
|
||||
// 抬头
|
||||
String BTW = "%BTW% /AF=" + LocationOfBTW + "/R=3 /PRN=" + "\"" + jsonPrint.getString("print_floder") + "\"" + " /D /P /C=1";
|
||||
// 标签类型
|
||||
String LabelType = SUBEnum.TABLE_TEMPLE_TYPE.code("管标");
|
||||
|
||||
/*
|
||||
* 生成txt文件
|
||||
*/
|
||||
// 远程路径
|
||||
String filePath = jsonPrint.getString("print_route") + pcsn + "管标.txt";
|
||||
FileWriter fw = null;
|
||||
|
||||
try {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
file.createNewFile();
|
||||
}
|
||||
fw = new FileWriter(filePath);
|
||||
OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
|
||||
BufferedWriter bw = new BufferedWriter(write);
|
||||
|
||||
// 抬头
|
||||
bw.write(BTW + "\n");
|
||||
bw.write("%END%\n");
|
||||
// 须打印的key字段
|
||||
bw.write("LabelType,ContainerName,Qty,Thickness,WindingMode\n");
|
||||
// 须打印的value值
|
||||
bw.write(
|
||||
LabelType + ","
|
||||
+ subDao.getContainer_name() + ","
|
||||
+ NumberUtil.round(jsonPlan.getString("paper_weight"), 1).toString() + ","
|
||||
+ subDao.getThickness_request() + "x" + subDao.getWidth_standard() + ","
|
||||
+ orderDao.getRollingType()
|
||||
);
|
||||
// 关闭流
|
||||
bw.close();
|
||||
result.put("message", "打印成功!");
|
||||
} catch (Exception e) {
|
||||
result.put("message", "打印失败!" + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
fw.close();
|
||||
} catch (Exception e) {
|
||||
result.put("message", "打印失败!" + e.getMessage());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getPrint() {
|
||||
JSONArray data = WQLObject.getWQLObject("pdm_bi_printinfo")
|
||||
.query("print_region = '2'")
|
||||
.getResultJSONArray(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "查询成功!");
|
||||
result.put("data", data);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,12 @@ public enum SUBEnum {
|
||||
|
||||
// 子卷包装类型
|
||||
SUB_TYPE(MapOf.of("返检入库", "1", "改切入库", "2")),
|
||||
|
||||
// 标签类型
|
||||
TABLE_TYPE(MapOf.of("内标", "1", "管标", "2")),
|
||||
|
||||
// 标签模版类型
|
||||
TABLE_TEMPLE_TYPE(MapOf.of( "管标", "4")),
|
||||
;
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
@@ -14,6 +14,7 @@ import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pda.service.PrintTableTwoService;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
@@ -26,6 +27,9 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.redisson.api.RLock;
|
||||
@@ -69,6 +73,9 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
|
||||
@Resource
|
||||
private IPdmBiContainerinfoService iPdmBiContainerinfoService;
|
||||
|
||||
@Resource
|
||||
private PrintTableTwoService printTableTwoService;
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
@@ -801,6 +808,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
* 手持子卷质检
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject update(JSONObject whereJson) {
|
||||
JSONObject result = new JSONObject();
|
||||
if (StringUtils.isBlank(whereJson.getString("ivt_status"))) {
|
||||
@@ -841,6 +849,32 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
iPdmBiContainerinfoService.createSubInfoByContainer(whereJson.getString("container_name"));
|
||||
jo.put("container_name",whereJson.getString("container_name"));
|
||||
lmsToMesService.getInspectionResult(jo);
|
||||
|
||||
/*
|
||||
* 调用打印服务进行打印内标管表
|
||||
*/
|
||||
// 判断是否自动打标
|
||||
String auto_table = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("AUTO_PRINT_TABLE").getValue();
|
||||
if (auto_table.equals(IOSEnum.IS_NOTANDYES.code("是"))) {
|
||||
// 内标默认打印机
|
||||
String within_table = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("WITHIN_PEINT_TWO").getValue();
|
||||
JSONObject within_print = WQLObject.getWQLObject("pdm_bi_printinfo")
|
||||
.query("print_name = '" + within_table + "'")
|
||||
.uniqueResult(0);
|
||||
// 管标默认打印机
|
||||
String pipe_table = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("PIPE_PEINT_TWO").getValue();
|
||||
JSONObject pipe_print = WQLObject.getWQLObject("pdm_bi_printinfo")
|
||||
.query("print_name = '" + pipe_table + "'")
|
||||
.uniqueResult(0);
|
||||
// 组织数据
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("pcsn", whereJson.getString("container_name"));
|
||||
param.put("print_code", pipe_print.getString("print_id"));
|
||||
printTableTwoService.pipeTable(param);
|
||||
|
||||
param.put("print_code", within_print.getString("print_id"));
|
||||
printTableTwoService.withinTable(param);
|
||||
}
|
||||
}
|
||||
updateWrapper.set("container_name", dtoList.get(0).getContainer_name());
|
||||
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));
|
||||
|
||||
@@ -51,6 +51,7 @@ public class TwoExceptionInTask extends AbstractAcsTask {
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.interaction_json(json.getJSONObject("request_param"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
|
||||
@@ -50,6 +50,7 @@ public class TwoInBoxTask extends AbstractAcsTask {
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.route_plan_code(getRoutePlanCode(json.getString("point_code2")))
|
||||
.class_type(json.getString("task_type"))
|
||||
|
||||
@@ -67,6 +67,7 @@ public class TwoInTask extends AbstractAcsTask {
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.interaction_json(json.getJSONObject("request_param"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
@@ -111,9 +112,9 @@ public class TwoInTask extends AbstractAcsTask {
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
|
||||
if (taskObj.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.ISSUE.getCode())) {
|
||||
/* if (taskObj.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.ISSUE.getCode())) {
|
||||
throw new BadRequestException("任务已执行不能取消");
|
||||
}
|
||||
}*/
|
||||
|
||||
// 更新任务表删除字段
|
||||
map.put("is_delete", IOSEnum.IS_NOTANDYES.code("是"));
|
||||
|
||||
@@ -50,6 +50,7 @@ public class TwoMoveBoxTask extends AbstractAcsTask {
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.route_plan_code(getRoutePlanCode(json.getString("point_code2")))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
|
||||
@@ -59,7 +59,7 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
JSONArray arr = taskTab.query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0' order by create_time").getResultJSONArray(0);
|
||||
|
||||
// 判断当前有多少个正在执行中的任务
|
||||
int num = taskTab.query("handle_class = '" + THIS_CLASS + "' and task_status < '" + TaskStatusEnum.FINISHED.getCode() + "' and is_delete ='0'")
|
||||
int num = taskTab.query("handle_class = '" + THIS_CLASS + "' and task_status IN ('05','06') and is_delete ='0'")
|
||||
.getResultJSONArray(0).size();
|
||||
|
||||
// 查询装箱对接位是否有木箱
|
||||
@@ -89,6 +89,7 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.interaction_json(json.getJSONObject("request_param"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
|
||||
@@ -51,6 +51,7 @@ public class TwoOutExceptionalTask extends AbstractAcsTask {
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.route_plan_code(getRoutePlanCode(json.getString("point_code1")))
|
||||
|
||||
@@ -55,6 +55,7 @@ public class TwoOutHeapTask extends AbstractAcsTask {
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.interaction_json(json.getJSONObject("request_param"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(IOSEnum.ACS_TYPE.code("RGV输送任务"))
|
||||
|
||||
@@ -102,6 +102,7 @@ public class TwoOutTask extends AbstractAcsTask {
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.interaction_json(json.getJSONObject("request_param"))
|
||||
.route_plan_code(getRoutePlanCode(json.getString("point_code1")))
|
||||
.priority(json.getString("priority"))
|
||||
|
||||
@@ -47,6 +47,7 @@ import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -615,6 +616,17 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
throw new BadRequestException("当前没有可设置的分配明细!");
|
||||
}
|
||||
|
||||
//判断是否有正在执行中的任务
|
||||
List<JSONObject> arr2 = taskService.query("handle_class = '" + TwoOutTask.class.getName() + "' and task_status < '" + TaskStatusEnum.FINISHED.getCode() + "' and is_delete ='0'")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
Map<String, List<JSONObject>> taskGroup = arr2.stream()
|
||||
.collect(Collectors.groupingBy(row -> row.getString("task_group_id")));
|
||||
|
||||
if (taskGroup.size() >= 3) {
|
||||
throw new BadRequestException("当前有三种不同规格的木箱正在出库,请稍后在试!");
|
||||
}
|
||||
|
||||
/*
|
||||
* 下发任务
|
||||
* 1.根据木箱 长、宽、高、订单号、物料分组
|
||||
|
||||
@@ -204,4 +204,9 @@ public class CustomerbaseDto implements Serializable {
|
||||
* 是否自动贴标
|
||||
*/
|
||||
private String is_auto_table;
|
||||
|
||||
/**
|
||||
* 内标打印模版
|
||||
*/
|
||||
private String bz_print_within;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -90,7 +90,7 @@
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '3'
|
||||
END
|
||||
END AS sub_type,
|
||||
DATEDIFF( NOW(), sub.date_of_production ) AS stock_age,
|
||||
DATEDIFF( NOW(), dis.confirm_time ) AS stock_age,
|
||||
sub.joint_type,
|
||||
dis.confirm_time
|
||||
|
||||
@@ -118,14 +118,19 @@
|
||||
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN( mst.confirm_time ) AS confirm_time,
|
||||
(
|
||||
CASE
|
||||
WHEN MAX(mst.bill_type) = '0001' THEN MIN( mst.confirm_time )
|
||||
ELSE MAX( mst.confirm_time )
|
||||
END
|
||||
) AS confirm_time,
|
||||
dis.pcsn
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
WHERE
|
||||
mst.io_type = '0'
|
||||
AND mst.bill_type = '0001'
|
||||
AND mst.bill_type IN ('0001','0006','0007')
|
||||
AND mst.is_delete = '0'
|
||||
GROUP BY
|
||||
dis.pcsn
|
||||
@@ -268,7 +273,7 @@
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '3'
|
||||
END
|
||||
END AS sub_type,
|
||||
DATEDIFF( NOW(), ivt.instorage_time ) AS stock_age,
|
||||
DATEDIFF( NOW(), dis.confirm_time ) AS stock_age,
|
||||
sub.joint_type,
|
||||
dis.confirm_time
|
||||
FROM
|
||||
@@ -296,16 +301,21 @@
|
||||
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN( mst.confirm_time ) AS confirm_time,
|
||||
(
|
||||
CASE
|
||||
WHEN MAX(mst.bill_type) = '0001' THEN MIN( mst.confirm_time )
|
||||
ELSE MAX( mst.confirm_time )
|
||||
END
|
||||
) AS confirm_time,
|
||||
dis.pcsn
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
WHERE
|
||||
mst.io_type = '0'
|
||||
AND mst.bill_type = '0001'
|
||||
AND mst.bill_type IN ( '0001', '0006', '0007' )
|
||||
AND mst.is_delete = '0'
|
||||
GROUP BY
|
||||
GROUP BY
|
||||
dis.pcsn
|
||||
) dis ON dis.pcsn = ivt.pcsn
|
||||
WHERE
|
||||
|
||||
@@ -1592,16 +1592,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
log.info("shipDeviceUpdate请求参数:---------------------------------------------" + whereJson.toString() + ",ACS上报无货且此时LMS该点位没有任何任务!");
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功,ACS上报无货且此时LMS该点位没有任何任务!");
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}else {
|
||||
String vehicleCode2 = left_jo.getString("vehicle_code2");
|
||||
if (!deliver_jo.getString("vehicle_code").equals(vehicleCode2)) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功,ACS上报无货但当前点位载具和任务载具号不一致!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//如果为分切输送线上料位,判断该点位是否存在未完成的任务类型为分切输送出的或载具横移任务
|
||||
@@ -1612,14 +1604,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}else {
|
||||
String vehicleCode2 = right_jo.getString("vehicle_code2");
|
||||
if (!deliver_jo.getString("vehicle_code").equals(vehicleCode2)) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功,ACS上报无货但当前点位载具和任务载具号不一致!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
deliver_jo.put("point_status", "01");
|
||||
|
||||
@@ -204,6 +204,8 @@
|
||||
print_name AS text
|
||||
FROM
|
||||
pdm_bi_printinfo
|
||||
WHERE
|
||||
print_region = '1'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
Binary file not shown.
@@ -43,6 +43,10 @@ public class AcsTaskDto {
|
||||
* 载具号
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 载具号2
|
||||
*/
|
||||
private String vehicle_code2;
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user