rev:内包间改造代码提交
This commit is contained in:
Binary file not shown.
@@ -93,6 +93,34 @@ public class AcsToWmsController {
|
||||
return new ResponseEntity<>(acsToWmsService.sendDeviceStatus(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/sendCBZInfo")
|
||||
@ApiOperation("穿轴信号申请")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> sendCBZInfo(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(acsToWmsService.sendCBZInfo(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/sendGetGoalStruct")
|
||||
@ApiOperation("取放货申请")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> sendGetGoalStruct(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(acsToWmsService.sendGetGoalStruct(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/actionFinishRequest")
|
||||
@ApiOperation("取放货完成信号申请")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> actionFinishRequest(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(acsToWmsService.actionFinishRequest(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/*@PostMapping("/getQZZInfo")
|
||||
@ApiOperation("获取气涨轴信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getQZZInfo(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(acsToWmsService.getQZZInfo(jo), HttpStatus.OK);
|
||||
}*/
|
||||
|
||||
@PostMapping("/initialize")
|
||||
@Log(value = "仓位初始化", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("仓位初始化")
|
||||
|
||||
@@ -88,6 +88,14 @@ public interface AcsToWmsService {
|
||||
*/
|
||||
JSONObject sendDeviceStatus(JSONObject whereJson);
|
||||
|
||||
JSONObject sendCBZInfo(JSONObject whereJson);
|
||||
|
||||
JSONObject sendGetGoalStruct(JSONObject whereJson);
|
||||
|
||||
JSONObject actionFinishRequest(JSONObject whereJson);
|
||||
|
||||
// JSONObject getQZZInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 仓位初始化
|
||||
*/
|
||||
|
||||
@@ -17,14 +17,19 @@ import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.notice.ISysNoticeService;
|
||||
import org.nl.system.service.notice.NoticeTypeEnum;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
import org.nl.wms.pda.mps.service.CasingService;
|
||||
import org.nl.wms.pda.mps.service.ShippingService;
|
||||
import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
|
||||
import org.nl.wms.pda.st.service.PrintService;
|
||||
import org.nl.wms.pda.st.service.impl.PrintServiceImpl;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.EmptyVehicleTask;
|
||||
import org.nl.wms.sch.tasks.PaperTrussTask;
|
||||
import org.nl.wms.sch.tasks.SendOutTask;
|
||||
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
@@ -48,8 +53,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
private static Interner<String> Heap_Lock = Interners.newWeakInterner();
|
||||
|
||||
|
||||
private final PrintService printService;
|
||||
|
||||
private final RawAssistIStorService rawAssistIStorService;
|
||||
|
||||
private final StorPublicService storPublicService;
|
||||
@@ -58,6 +61,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
private final RedissonClient redissonClient;
|
||||
|
||||
private final PaperTrussTask paperTrussTask;
|
||||
|
||||
private final CasingService casingService;
|
||||
|
||||
private final ISysNoticeService noticeService;
|
||||
|
||||
/**
|
||||
* task_id:任务标识
|
||||
* task_code:任务编码
|
||||
@@ -99,8 +108,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
// 任务处理类
|
||||
try {
|
||||
// AbstractAcsTask bean = SpringContextHolder.getBean(processing_class);
|
||||
// bean.updateTaskStatus(row, status);
|
||||
Class<?> clz = Class.forName(processing_class);
|
||||
Object obj = clz.newInstance();
|
||||
// 调用每个任务类的forceFinishInst()强制结束方法
|
||||
@@ -156,7 +163,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
public Map<String, Object> orderFinish(String string) {
|
||||
JSONObject orderJson = JSONObject.parseObject(string);
|
||||
String ext_order_id = orderJson.getString("ext_order_id");
|
||||
// JSONArray array = JSONArray.parseArray(string);
|
||||
String now = DateUtil.now();
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_BD_WORKORDER");
|
||||
JSONObject map = new JSONObject();
|
||||
@@ -928,6 +934,315 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject sendCBZInfo(JSONObject whereJson) {
|
||||
//type:1、套轴申请;2、套轴完成反馈
|
||||
String type = whereJson.getString("type");
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject sendGetGoalStruct(JSONObject whereJson) {
|
||||
log.info("sendGetGoalStruct请求参数为--------------------------:" + whereJson.toString());
|
||||
//type:2、反馈尺寸;3、申请取货;4、申请放货;6、套轴申请;7、套轴完成
|
||||
String type = whereJson.getString("type");
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
//桁架任务
|
||||
String task_code1 = whereJson.getString("task_code1");
|
||||
//纸管任务
|
||||
String task_code2 = whereJson.getString("task_code2");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_code = '" + task_code1 + "'").uniqueResult(0);
|
||||
JSONObject task_jo2 = WQLObject.getWQLObject("sch_base_task").query("task_code = '" + task_code2 + "'").uniqueResult(0);
|
||||
String product_area = task_jo.getString("product_area");
|
||||
JSONObject cbz_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '0'").uniqueResult(0);
|
||||
String cbz_size = cbz_jo.getString("qzz_size");
|
||||
String cbz_generation = cbz_jo.getString("qzz_generation");
|
||||
if ("6".equals(type)) {
|
||||
//判断当前穿拔轴位置的气涨轴和纸管位的纸管是否匹配
|
||||
JSONObject zg_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '4'").uniqueResult(0);
|
||||
String zg_size = zg_jo.getString("qzz_size");
|
||||
String zg_generation = zg_jo.getString("qzz_generation");
|
||||
|
||||
if (StrUtil.isEmpty(zg_generation) || StrUtil.isEmpty(zg_size)){
|
||||
//如果纸管工位的代数和尺寸为空,则把气胀轴搬运到气胀轴缓存位
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010603");
|
||||
jo.put("point_code1", cbz_jo.getString("point_code"));
|
||||
JSONObject fhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '7' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
jo.put("point_code2", fhd_jo.getString("point_code"));
|
||||
jo.put("product_area", product_area);
|
||||
jo.put("vehicle_code", "qzz");
|
||||
jo.put("truss_type", "7");
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("have_size", cbz_size);
|
||||
request_param.put("have_generation", cbz_generation);
|
||||
jo.put("request_param", request_param.toString());
|
||||
paperTrussTask.createTask(jo);
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("is_bushing", "0");
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}else {
|
||||
if (cbz_size.equals(zg_size) && zg_generation.equals(cbz_generation)) {
|
||||
//todo:反馈ACS可以进行穿轴
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("is_bushing", "1");
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
} else {
|
||||
//todo:下发桁架任务空轴换货任务
|
||||
// String container_name = task_jo2.getString("vehicle_code");
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010604");
|
||||
jo.put("point_code1", cbz_jo.getString("point_code"));
|
||||
JSONObject fhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '7' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
jo.put("point_code2", fhd_jo.getString("point_code"));
|
||||
JSONObject qhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '6' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
jo.put("point_code3", qhd_jo.getString("point_code"));
|
||||
jo.put("point_code4", cbz_jo.getString("point_code"));
|
||||
jo.put("product_area", product_area);
|
||||
jo.put("vehicle_code", zg_jo.getString("container_name1"));
|
||||
jo.put("truss_type", "7");
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("need_size", zg_size);
|
||||
request_param.put("need_generation", zg_generation);
|
||||
request_param.put("have_size", cbz_size);
|
||||
request_param.put("have_generation", cbz_generation);
|
||||
jo.put("request_param", request_param.toString());
|
||||
paperTrussTask.createTask(jo);
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("is_bushing", "0");
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ("7".equals(type)) {
|
||||
JSONObject task_resq = task_jo2.getJSONObject("request_param");
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + task_resq.getString("container_name1") + "' AND is_delete = '0'").uniqueResult(0);
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + plan_jo.getString("resource_name") + "'").uniqueResult(0);
|
||||
String point_location = cut_jo.getString("point_location");
|
||||
//更新分切计划
|
||||
String container_name1 = task_resq.getString("container_name1");
|
||||
String container_name2 = task_resq.getString("container_name2");
|
||||
JSONArray rows = new JSONArray();
|
||||
String qzzno = "";
|
||||
if (StrUtil.isNotEmpty(container_name1)) {
|
||||
JSONObject container_jo1 = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + container_name1 + "'").uniqueResult(0);
|
||||
rows.add(container_jo1);
|
||||
qzzno = container_name1 + "-qzz";
|
||||
}
|
||||
if (StrUtil.isNotEmpty(container_name2)) {
|
||||
JSONObject container_jo2 = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + container_name2 + "'").uniqueResult(0);
|
||||
rows.add(container_jo2);
|
||||
}
|
||||
JSONObject conrimd_jo = new JSONObject();
|
||||
conrimd_jo.put("qzzno", qzzno);
|
||||
conrimd_jo.put("cut_rows", rows);
|
||||
casingService.confirm(conrimd_jo);
|
||||
|
||||
//查询当前输送线入口是否存在可用的载具
|
||||
JSONObject in_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + product_area + "' AND point_type = '6'").uniqueResult(0);
|
||||
String vehicle_code = in_jo.getString("vehicle_code");
|
||||
// JSONObject vehicle_jo = WQLObject.getWQLObject("md_pb_vehiclearea").query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
//todo:如果缓存位有可用库位,创建一个桁架任务从穿拔轴位到缓存位,否则不动
|
||||
JSONObject tz_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '2' AND have_qzz = '0' order by sort_seq").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(tz_jo)) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010607");
|
||||
JSONObject tggw_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '4'").uniqueResult(0);
|
||||
jo.put("point_code1", tggw_jo.getString("point_code"));
|
||||
jo.put("point_code2", tz_jo.getString("point_code"));
|
||||
jo.put("product_area", product_area);
|
||||
jo.put("vehicle_code", task_resq.getString("container_name1"));
|
||||
jo.put("truss_type", "1");
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("need_size", cbz_size);
|
||||
request_param.put("need_generation", cbz_generation);
|
||||
request_param.put("need_location", point_location);
|
||||
request_param.put("container_name1", task_resq.getString("container_name1"));
|
||||
request_param.put("container_name2", task_resq.getString("container_name2"));
|
||||
jo.put("request_param", request_param.toString());
|
||||
paperTrussTask.createTask(jo);
|
||||
} else {
|
||||
noticeService.createNotice("套轴气胀轴缓存架空位不足", "套轴气胀轴缓存架空位不足"
|
||||
, NoticeTypeEnum.WARN.getCode());
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
JSONObject request_param = task_jo.getJSONObject("request_param");
|
||||
String need_size = request_param.getString("need_size");
|
||||
String need_generation = request_param.getString("need_generation");
|
||||
String have_size = request_param.getString("have_size");
|
||||
String have_generation = request_param.getString("have_generation");
|
||||
|
||||
JSONObject struct_jo = new JSONObject();
|
||||
if ("4".equals(type)) {
|
||||
//查询可用的空气涨轴点位
|
||||
struct_jo = WQL.getWO("QAUTO_QUERY").addParam("flag", "6")
|
||||
.addParam("need_size", need_size)
|
||||
.addParam("need_generation", need_generation)
|
||||
.process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(struct_jo)) {
|
||||
noticeService.createNotice("任务:" + task_code1 + "气胀轴取货失败:" + need_size + "寸" + need_generation + "代气胀轴库存不足!", "气胀轴库存不足"
|
||||
, NoticeTypeEnum.EXCEPTION.getCode());
|
||||
throw new BadRequestException("未查询到可用的气胀轴库存!");
|
||||
}
|
||||
|
||||
//更新任务
|
||||
if ("010602".equals(task_jo.getString("task_type"))) {
|
||||
task_jo.put("point_code1", struct_jo.getString("point_code"));
|
||||
}
|
||||
if ("010604".equals(task_jo.getString("task_type"))) {
|
||||
task_jo.put("point_code3", struct_jo.getString("point_code"));
|
||||
}
|
||||
result.put("version", need_generation);
|
||||
result.put("size", need_size);
|
||||
}
|
||||
if ("3".equals(type)) {
|
||||
//查询可用的空点位
|
||||
struct_jo = WQL.getWO("QAUTO_QUERY").addParam("flag", "7")
|
||||
.addParam("need_size", have_size)
|
||||
.addParam("need_generation", have_generation)
|
||||
.process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(struct_jo)) {
|
||||
throw new BadRequestException("未查询到可用的点位!");
|
||||
}
|
||||
//更新任务
|
||||
if ("010603".equals(task_jo.getString("task_type")) || "010604".equals(task_jo.getString("task_type"))) {
|
||||
task_jo.put("point_code2", struct_jo.getString("point_code"));
|
||||
}
|
||||
|
||||
result.put("version", have_generation);
|
||||
result.put("size", have_size);
|
||||
}
|
||||
if ("2".equals(type)) {
|
||||
String size = whereJson.getString("size");
|
||||
JSONObject request_jo = task_jo.getJSONObject("request_param");
|
||||
request_jo.put("have_size", size);
|
||||
task_jo.put("request_param", request_jo);
|
||||
|
||||
}
|
||||
//拔轴任务完成更新穿拔轴机上的库存
|
||||
if ("8".equals(type)) {
|
||||
JSONObject cbz_device = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '0'").uniqueResult(0);
|
||||
JSONObject request_jo = task_jo.getJSONObject("request_param");
|
||||
cbz_device.put("have_qzz", "1");
|
||||
cbz_device.put("qzz_size", request_jo.getString("have_size"));
|
||||
cbz_device.put("qzz_generation", request_jo.getString("have_generation"));
|
||||
WQLObject.getWQLObject("st_ivt_shaftivt").update(cbz_device);
|
||||
//更新RGV上气胀轴数量
|
||||
JSONObject rgv_device = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '5'").uniqueResult(0);
|
||||
int have_qzz = rgv_device.getIntValue("have_qzz");
|
||||
rgv_device.put("have_qzz", have_qzz-1);
|
||||
WQLObject.getWQLObject("st_ivt_shaftivt").update(rgv_device);
|
||||
}
|
||||
WQLObject.getWQLObject("sch_base_task").update(task_jo);
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("device_code", struct_jo.getString("point_code"));
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject actionFinishRequest(JSONObject whereJson) {
|
||||
String type = whereJson.getString("action");
|
||||
String task_code = whereJson.getString("task_code1");
|
||||
WQLObject ivt_shaftivt = WQLObject.getWQLObject("st_ivt_shaftivt");
|
||||
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_code = '" + task_code + "'").uniqueResult(0);
|
||||
String point_type = task_jo.getString("task_type");
|
||||
//取货完成
|
||||
if ("1".equals(type)) {
|
||||
if ("010602".equals(point_type)) {
|
||||
JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0);
|
||||
point1_jo.put("have_qzz", "0");
|
||||
ivt_shaftivt.update(point1_jo);
|
||||
} else {
|
||||
JSONObject point3_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code3") + "'").uniqueResult(0);
|
||||
point3_jo.put("have_qzz", "0");
|
||||
ivt_shaftivt.update(point3_jo);
|
||||
}
|
||||
}
|
||||
|
||||
//放货完成
|
||||
if ("2".equals(type)) {
|
||||
JSONObject point2_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code2") + "'").uniqueResult(0);
|
||||
point2_jo.put("have_qzz", "1");
|
||||
ivt_shaftivt.update(point2_jo);
|
||||
|
||||
}
|
||||
|
||||
//横移完成
|
||||
if ("3".equals(type)) {
|
||||
if (task_jo.getString("task_type").equals("010401")) {
|
||||
String vehicle_code = task_jo.getString("vehicle_code2");
|
||||
JSONObject vehicle_jo = WQLObject.getWQLObject("md_pb_vehiclearea").query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
String point_location = vehicle_jo.getString("point_location");
|
||||
String product_area = task_jo.getString("product_area");
|
||||
JSONObject in_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + product_area + "' AND point_type = '6'").uniqueResult(0);
|
||||
//查询呼叫时间最早的分切计划
|
||||
JSONObject plan_jo = WQL.getWO("PDA_02").addParam("flag", "23").addParam("point_location", point_location)
|
||||
.addParam("product_area", product_area).process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(plan_jo)) {
|
||||
//将载具号维护到IN口
|
||||
in_jo.put("vehicle_code", vehicle_code);
|
||||
WQLObject.getWQLObject("sch_base_point").update(in_jo);
|
||||
String plan_type = plan_jo.getString("type");
|
||||
/**
|
||||
* plan_type:1;从缓存货架搬运,创建从缓存货架搬运到IN点的任务
|
||||
* plan_type:2;补齐从气胀轴缓存架子到IN点的任务
|
||||
*/
|
||||
if ("1".equals(plan_type)) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010606");
|
||||
jo.put("truss_type", "1");
|
||||
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
|
||||
jo.put("point_code1", plan_jo.getString("start_code"));
|
||||
jo.put("point_code2", in_jo.getString("point_code"));
|
||||
JSONObject hchj_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_code = '" + plan_jo.getString("start_code") + "'").uniqueResult(0);
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("container_name1", hchj_jo.getString("container_name1"));
|
||||
request_param.put("container_name2", hchj_jo.getString("container_name2"));
|
||||
jo.put("vehicle_code", hchj_jo.getString("container_name1"));
|
||||
jo.put("product_area", product_area);
|
||||
paperTrussTask.createTask(jo);
|
||||
}
|
||||
if ("2".equals(plan_type)) {
|
||||
JSONObject plan_task = WQLObject.getWQLObject("sch_base_task").query("task_code = '" + plan_jo.getString("start_code") + "'").uniqueResult(0);
|
||||
plan_task.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
paperTrussTask.immediateNotifyAcs(null);
|
||||
}
|
||||
} else {
|
||||
//未查询到需要搬运的气胀轴,创建空载具入库任务
|
||||
ShippingService shippingService = SpringContextHolder.getBean(ShippingService.class);
|
||||
JSONObject ship_jo = new JSONObject();
|
||||
ship_jo.put("vehicle_code", vehicle_code);
|
||||
ship_jo.put("point_code", in_jo.getString("point_code"));
|
||||
shippingService.returnVehicle(ship_jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject shipDeviceUpdate(JSONObject whereJson) {
|
||||
@@ -1006,100 +1321,98 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public void initialize(JSONObject param) {
|
||||
{
|
||||
int j_size = param.getInteger("j"); // 排
|
||||
int k_size = param.getInteger("k"); // 列
|
||||
String block = param.getString("layer"); // 块
|
||||
JSONObject max_jo = WQLObject.getWQLObject("ST_IVT_StructAttr").query("sect_code = 'ZC01' order by out_order_seq desc ").uniqueResult(0);
|
||||
int max_no = 0;
|
||||
if (ObjectUtil.isNotEmpty(max_jo)) {
|
||||
max_no = max_jo.getIntValue("out_order_seq");
|
||||
}
|
||||
max_no++;
|
||||
for (int i = 1; i < 4; i++) {
|
||||
for (int j = 1; j < j_size; j++) {
|
||||
for (int k = 1; k < k_size; k++) {
|
||||
//排
|
||||
String row = "";
|
||||
if (j < 10) {
|
||||
row = "0" + j;
|
||||
} else {
|
||||
row = j + "";
|
||||
}
|
||||
|
||||
//列
|
||||
String line = "";
|
||||
if (k < 10) {
|
||||
line = "0" + k;
|
||||
} else {
|
||||
line = k + "";
|
||||
}
|
||||
|
||||
//块
|
||||
String piece = i + block;
|
||||
|
||||
//层
|
||||
String layer = "0" + i;
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("struct_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jo.put("struct_code", piece + row + "-" + line + "-" + layer);
|
||||
jo.put("struct_name", piece + "区" + row + "排" + line + "列" + layer + "层");
|
||||
jo.put("simple_name", piece + "区" + row + "排" + line + "列" + layer + "层");
|
||||
jo.put("sect_id", "1582991348217286656");
|
||||
jo.put("sect_code", "ZC01");
|
||||
jo.put("sect_name", "主存区");
|
||||
jo.put("stor_id", "1582991156504039424");
|
||||
jo.put("stor_code", "CP01");
|
||||
jo.put("stor_name", "兰州仓库");
|
||||
jo.put("stor_type", "03");
|
||||
jo.put("is_tempstruct", "0");
|
||||
jo.put("row_num", row);
|
||||
jo.put("col_num", line);
|
||||
jo.put("layer_num", layer);
|
||||
jo.put("block_num", piece);
|
||||
jo.put("in_order_seq", 0);
|
||||
jo.put("out_order_seq", max_no);
|
||||
jo.put("in_empty_seq", 0);
|
||||
jo.put("out_empty_seq", 0);
|
||||
jo.put("placement_type", "01");
|
||||
jo.put("create_id", "1");
|
||||
jo.put("create_name", "管理员");
|
||||
jo.put("create_time", DateUtil.now());
|
||||
jo.put("update_optid", "1");
|
||||
jo.put("update_optname", "管理员");
|
||||
jo.put("update_time", DateUtil.now());
|
||||
jo.put("is_delete", "0");
|
||||
jo.put("is_used", "1");
|
||||
jo.put("lock_type", "1");
|
||||
jo.put("material_height_type", "1");
|
||||
WQLObject.getWQLObject("ST_IVT_StructAttr").insert(jo);
|
||||
max_no++;
|
||||
//插入点位
|
||||
JSONObject structMap = new JSONObject();
|
||||
structMap.put("point_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
structMap.put("point_code", jo.getString("struct_code"));
|
||||
structMap.put("point_name", jo.getString("struct_name"));
|
||||
structMap.put("region_id", "1582991348217286656");
|
||||
structMap.put("region_code", jo.getString("sect_code"));
|
||||
structMap.put("region_name", jo.getString("sect_name"));
|
||||
structMap.put("point_type", "2");
|
||||
structMap.put("point_status", "1");
|
||||
structMap.put("lock_type", jo.getString("lock_type"));
|
||||
structMap.put("block_num", jo.getIntValue("block_num"));
|
||||
structMap.put("row_num", jo.getIntValue("row_num"));
|
||||
structMap.put("col_num", jo.getIntValue("col_num"));
|
||||
structMap.put("layer_num", jo.getIntValue("layer_num"));
|
||||
structMap.put("source_id", jo.getString("struct_id"));
|
||||
structMap.put("create_id", "1");
|
||||
structMap.put("create_name", "管理员");
|
||||
structMap.put("create_time", DateUtil.now());
|
||||
structMap.put("update_optid", "1");
|
||||
structMap.put("update_optname", "管理员");
|
||||
structMap.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("sch_base_point").insert(structMap);
|
||||
int j_size = param.getInteger("j"); // 排
|
||||
int k_size = param.getInteger("k"); // 列
|
||||
String block = param.getString("layer"); // 块
|
||||
JSONObject max_jo = WQLObject.getWQLObject("ST_IVT_StructAttr").query("sect_code = 'ZC01' order by out_order_seq desc ").uniqueResult(0);
|
||||
int max_no = 0;
|
||||
if (ObjectUtil.isNotEmpty(max_jo)) {
|
||||
max_no = max_jo.getIntValue("out_order_seq");
|
||||
}
|
||||
max_no++;
|
||||
for (int i = 1; i < 4; i++) {
|
||||
for (int j = 1; j < j_size; j++) {
|
||||
for (int k = 1; k < k_size; k++) {
|
||||
//排
|
||||
String row = "";
|
||||
if (j < 10) {
|
||||
row = "0" + j;
|
||||
} else {
|
||||
row = j + "";
|
||||
}
|
||||
|
||||
//列
|
||||
String line = "";
|
||||
if (k < 10) {
|
||||
line = "0" + k;
|
||||
} else {
|
||||
line = k + "";
|
||||
}
|
||||
|
||||
//块
|
||||
String piece = i + block;
|
||||
|
||||
//层
|
||||
String layer = "0" + i;
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("struct_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jo.put("struct_code", piece + row + "-" + line + "-" + layer);
|
||||
jo.put("struct_name", piece + "区" + row + "排" + line + "列" + layer + "层");
|
||||
jo.put("simple_name", piece + "区" + row + "排" + line + "列" + layer + "层");
|
||||
jo.put("sect_id", "1582991348217286656");
|
||||
jo.put("sect_code", "ZC01");
|
||||
jo.put("sect_name", "主存区");
|
||||
jo.put("stor_id", "1582991156504039424");
|
||||
jo.put("stor_code", "CP01");
|
||||
jo.put("stor_name", "兰州仓库");
|
||||
jo.put("stor_type", "03");
|
||||
jo.put("is_tempstruct", "0");
|
||||
jo.put("row_num", row);
|
||||
jo.put("col_num", line);
|
||||
jo.put("layer_num", layer);
|
||||
jo.put("block_num", piece);
|
||||
jo.put("in_order_seq", 0);
|
||||
jo.put("out_order_seq", max_no);
|
||||
jo.put("in_empty_seq", 0);
|
||||
jo.put("out_empty_seq", 0);
|
||||
jo.put("placement_type", "01");
|
||||
jo.put("create_id", "1");
|
||||
jo.put("create_name", "管理员");
|
||||
jo.put("create_time", DateUtil.now());
|
||||
jo.put("update_optid", "1");
|
||||
jo.put("update_optname", "管理员");
|
||||
jo.put("update_time", DateUtil.now());
|
||||
jo.put("is_delete", "0");
|
||||
jo.put("is_used", "1");
|
||||
jo.put("lock_type", "1");
|
||||
jo.put("material_height_type", "1");
|
||||
WQLObject.getWQLObject("ST_IVT_StructAttr").insert(jo);
|
||||
max_no++;
|
||||
//插入点位
|
||||
JSONObject structMap = new JSONObject();
|
||||
structMap.put("point_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
structMap.put("point_code", jo.getString("struct_code"));
|
||||
structMap.put("point_name", jo.getString("struct_name"));
|
||||
structMap.put("region_id", "1582991348217286656");
|
||||
structMap.put("region_code", jo.getString("sect_code"));
|
||||
structMap.put("region_name", jo.getString("sect_name"));
|
||||
structMap.put("point_type", "2");
|
||||
structMap.put("point_status", "1");
|
||||
structMap.put("lock_type", jo.getString("lock_type"));
|
||||
structMap.put("block_num", jo.getIntValue("block_num"));
|
||||
structMap.put("row_num", jo.getIntValue("row_num"));
|
||||
structMap.put("col_num", jo.getIntValue("col_num"));
|
||||
structMap.put("layer_num", jo.getIntValue("layer_num"));
|
||||
structMap.put("source_id", jo.getString("struct_id"));
|
||||
structMap.put("create_id", "1");
|
||||
structMap.put("create_name", "管理员");
|
||||
structMap.put("create_time", DateUtil.now());
|
||||
structMap.put("update_optid", "1");
|
||||
structMap.put("update_optname", "管理员");
|
||||
structMap.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("sch_base_point").insert(structMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ public class CrmToLmsServiceImpl implements CrmToLmsService {
|
||||
customer_jo.put("cust_code", customer_name);
|
||||
customer_jo.put("cust_name", description);
|
||||
customer_jo.put("cust_simple_name", company);
|
||||
customer_jo.put("sales_owner", sales_owner);
|
||||
customer_jo.put("create_id", currentUserId);
|
||||
customer_jo.put("create_name", nickName);
|
||||
customer_jo.put("create_time", now);
|
||||
|
||||
@@ -817,6 +817,40 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "23"
|
||||
QUERY
|
||||
SELECT
|
||||
ivt.point_code AS start_code,
|
||||
'1' AS type,
|
||||
call_time
|
||||
FROM
|
||||
st_ivt_shaftivt ivt
|
||||
LEFT JOIN pdm_bi_slittingproductionplan plan ON plan.container_name = ivt.container_name1
|
||||
LEFT JOIN st_ivt_cutpointivt cut ON cut.ext_code = plan.resource_name
|
||||
WHERE
|
||||
ivt.product_area = 输入.product_area
|
||||
AND cut.point_location = 输入.point_location
|
||||
AND plan.is_delete = '0'
|
||||
AND have_qzz > 0 UNION
|
||||
SELECT
|
||||
task.task_code AS start_code,
|
||||
'2' AS type,
|
||||
call_time
|
||||
FROM
|
||||
sch_base_task task
|
||||
LEFT JOIN pdm_bi_slittingproductionplan plan ON plan.container_name = task.material_code
|
||||
LEFT JOIN st_ivt_cutpointivt cut ON cut.ext_code = plan.resource_name
|
||||
WHERE
|
||||
task.task_status = '02'
|
||||
AND task.task_type = '010606'
|
||||
AND plan.is_delete = '0'
|
||||
AND task.product_area = 输入.product_area
|
||||
AND cut.point_location = 输入.point_location
|
||||
ORDER BY
|
||||
call_time
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
package org.nl.wms.pdm.ivt.rest;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.pdm.ivt.service.PackagePointIvtService;
|
||||
import org.nl.wms.pdm.ivt.service.dto.DeliveryPointIvtDto;
|
||||
import org.nl.wms.pdm.ivt.service.dto.PackagePointIvtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Auther:Zhouz
|
||||
* @Date:2023/12/20
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "内包间管理")
|
||||
@RequestMapping("/api/packagepointivt")
|
||||
@Slf4j
|
||||
public class PackagePointIvtController {
|
||||
|
||||
private final PackagePointIvtService packagePointIvtService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询内包间点位")
|
||||
@ApiOperation("查询内包间点位")
|
||||
//@SaCheckPermission("@el.check('deliverypointivt:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(packagePointIvtService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增分切输送线")
|
||||
@ApiOperation("新增分切输送线")
|
||||
//@SaCheckPermission("@el.check('deliverypointivt:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody PackagePointIvtDto dto) {
|
||||
packagePointIvtService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改分切输送线")
|
||||
@ApiOperation("修改分切输送线")
|
||||
//@SaCheckPermission("@el.check('deliverypointivt:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody PackagePointIvtDto dto) {
|
||||
packagePointIvtService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除分切输送线")
|
||||
@ApiOperation("删除分切输送线")
|
||||
//@SaCheckPermission("@el.check('deliverypointivt:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
packagePointIvtService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
package org.nl.wms.pdm.ivt.service;
|
||||
|
||||
import org.nl.wms.pdm.ivt.service.dto.DeliveryPointIvtDto;
|
||||
import org.nl.wms.pdm.ivt.service.dto.PackagePointIvtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Auther:Zhouz
|
||||
* @Date:2023/12/20
|
||||
* @Description:内包间接口服务
|
||||
*/
|
||||
public interface PackagePointIvtService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
* @param whereJson 条件参数
|
||||
* @return List<DeliverypointivtDto>
|
||||
*/
|
||||
List<PackagePointIvtDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param ivt_id ID
|
||||
* @return Deliverypointivt
|
||||
*/
|
||||
PackagePointIvtDto findById(Long ivt_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
* @param code code
|
||||
* @return Deliverypointivt
|
||||
*/
|
||||
PackagePointIvtDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(PackagePointIvtDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(PackagePointIvtDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package org.nl.wms.pdm.ivt.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @description /
|
||||
* @date 2022-10-08
|
||||
**/
|
||||
@Data
|
||||
public class PackagePointIvtDto implements Serializable {
|
||||
|
||||
/** 库存记录标识 */
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long ivt_id;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
/**
|
||||
* 是否有轴
|
||||
**/
|
||||
private String have_qzz;
|
||||
|
||||
/**
|
||||
* 气胀轴尺寸
|
||||
**/
|
||||
private String qzz_size;
|
||||
|
||||
/**
|
||||
* 气胀轴代数
|
||||
**/
|
||||
private String qzz_generation;
|
||||
|
||||
/**
|
||||
* 纸管1编码
|
||||
*/
|
||||
private String tube_code1;
|
||||
|
||||
/**
|
||||
* 纸管1编码
|
||||
*/
|
||||
private String tube_name1;
|
||||
|
||||
/**
|
||||
* 顺序号
|
||||
*/
|
||||
private BigDecimal sort_seq;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
|
||||
package org.nl.wms.pdm.ivt.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
|
||||
import org.nl.wms.pdm.ivt.service.PackagePointIvtService;
|
||||
import org.nl.wms.pdm.ivt.service.dto.DeliveryPointIvtDto;
|
||||
import org.nl.wms.pdm.ivt.service.dto.PackagePointIvtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Auther:Zhouz
|
||||
* @Date:2023/12/20
|
||||
* @Description:内包间接口实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PackagePointIvtServiceImpl implements PackagePointIvtService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
//获取人员对应的区域
|
||||
UserAreaServiceImpl userAreaService = new UserAreaServiceImpl();
|
||||
String in_area_id = userAreaService.getInArea();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
if (!ObjectUtil.isNull(whereJson.get("point_code"))) {
|
||||
map.put("point_code", "%" + whereJson.get("point_code") + "%");
|
||||
}
|
||||
map.put("product_area", whereJson.get("product_area"));
|
||||
map.put("point_status", whereJson.get("point_status"));
|
||||
map.put("is_used", whereJson.get("is_used"));
|
||||
if (ObjectUtil.isNotEmpty(in_area_id)) {
|
||||
map.put("in_area_id", in_area_id);
|
||||
}
|
||||
JSONObject json = WQL.getWO("ST_IVT_PACKAGEPOINTIVT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "product_area,point_code");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PackagePointIvtDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_shaftivt");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) {
|
||||
return arr.toJavaList(PackagePointIvtDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackagePointIvtDto findById(Long ivt_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_shaftivt");
|
||||
JSONObject json = wo.query("ivt_id = '" + ivt_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(PackagePointIvtDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackagePointIvtDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_shaftivt");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(PackagePointIvtDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(PackagePointIvtDto dto) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setIvt_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_shaftivt");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(PackagePointIvtDto dto) {
|
||||
PackagePointIvtDto entity = this.findById(dto.getIvt_id());
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_shaftivt");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_shaftivt");
|
||||
for (Long ivt_id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("ivt_id", String.valueOf(ivt_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
[交易说明]
|
||||
交易名: 分切输送线点位库存
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.point_status TYPEAS s_string
|
||||
输入.product_area TYPEAS s_string
|
||||
输入.is_used TYPEAS s_string
|
||||
输入.in_area_id TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
ivt.*
|
||||
FROM
|
||||
st_ivt_shaftivt ivt
|
||||
WHERE
|
||||
ivt.product_area in 输入.in_area_id
|
||||
OPTION 输入.point_code <> ""
|
||||
point_code LIKE 输入.point_code
|
||||
ENDOPTION
|
||||
OPTION 输入.point_status <> ""
|
||||
point_status = 输入.point_status
|
||||
ENDOPTION
|
||||
OPTION 输入.product_area <> ""
|
||||
product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
OPTION 输入.is_used <> ""
|
||||
is_used = 输入.is_used
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
Binary file not shown.
@@ -98,4 +98,9 @@ public class AcsTaskDto {
|
||||
* 气涨轴版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 气涨轴尺寸
|
||||
*/
|
||||
private String size;
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
package org.nl.wms.sch.manage;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.PaperTubeTask;
|
||||
import org.nl.wms.sch.tasks.URLEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCallEmptyVehicle {
|
||||
|
||||
private final CutConveyorTask cutConveyorTask;
|
||||
|
||||
private final PaperTubeTask paperTubeTask;
|
||||
|
||||
private final WmsToAcsService wmsToAcsService;
|
||||
|
||||
public void run() {
|
||||
for (URLEnum url : URLEnum.values()) {
|
||||
String product_area = url.getProduct_area();
|
||||
JSONObject nbj_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '"+product_area+"' AND point_type = '9'").uniqueResult(0);
|
||||
if (nbj_jo.getString("is_used").equals("1")){
|
||||
//上半部分
|
||||
this.callEmptyVehicle(product_area, "0");
|
||||
//下半部分
|
||||
this.callEmptyVehicle(product_area, "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void callEmptyVehicle(String product_area, String point_location) {
|
||||
|
||||
//下半部分的分切组
|
||||
JSONArray down_rows = WQL.getWO("QAUTO_QUERY").addParam("flag", "1").addParam("point_location", point_location).addParam("product_area", product_area).process().getResultJSONArray(0);
|
||||
|
||||
//下半部分需要的总空载具
|
||||
int donw_num = 0;
|
||||
|
||||
for (int i = 0; i < down_rows.size(); i++) {
|
||||
JSONObject row = down_rows.getJSONObject(i);
|
||||
String parent_container_name = row.getString("parent_container_name");
|
||||
String split_group = row.getString("split_group");
|
||||
JSONArray plan_rows = WQLObject.getWQLObject("pdm_bi_slittingproductionplan")
|
||||
.query("(parent_container_name = '" + parent_container_name + "' OR restruct_container_name = '" + parent_container_name + "') " +
|
||||
"AND split_group = '" + split_group + "' AND is_delete = '0' AND is_call = '1' AND IFNULL(is_paper_ok,'0') = '0' order by container_name").getResultJSONArray(0);
|
||||
|
||||
//todo:下发ACS任务呼叫纸管
|
||||
this.callPaperTube(plan_rows, product_area);
|
||||
|
||||
if (plan_rows.size() >= 2) {
|
||||
donw_num += 2;
|
||||
} else {
|
||||
donw_num += 1;
|
||||
}
|
||||
}
|
||||
|
||||
//减去对应已经在出库的空载具任务
|
||||
JSONArray out_task = WQL.getWO("QAUTO_QUERY").addParam("flag", "2").addParam("point_location", point_location).addParam("product_area", product_area).process().getResultJSONArray(0);
|
||||
donw_num -= out_task.size();
|
||||
|
||||
//减去出口对应的载具
|
||||
JSONObject out_jo = WQL.getWO("QAUTO_QUERY").addParam("flag", "3").addParam("point_location", point_location).addParam("product_area", product_area).process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(out_jo)) {
|
||||
donw_num--;
|
||||
}
|
||||
|
||||
//减去入库口对应的载具
|
||||
JSONObject in_jo = WQL.getWO("QAUTO_QUERY").addParam("flag", "4").addParam("point_location", point_location).addParam("product_area", product_area).process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(in_jo)) {
|
||||
donw_num--;
|
||||
}
|
||||
|
||||
//减去入库任务数量
|
||||
JSONArray in_task = WQL.getWO("QAUTO_QUERY").addParam("flag", "5").addParam("point_location", point_location).addParam("product_area", product_area).process().getResultJSONArray(0);
|
||||
donw_num -= in_task.size();
|
||||
|
||||
//如果需要空载具数量大于0,进行呼叫载具
|
||||
if (donw_num > 0) {
|
||||
for (int i = 0; i < donw_num; i++) {
|
||||
JSONObject empty_vehicle = WQL.getWO("PDA_02")
|
||||
.addParam("sql_str", " ORDER BY point_code")
|
||||
.addParam("product_area", product_area)
|
||||
.addParam("point_location", point_location)
|
||||
.addParam("flag", "302").process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(empty_vehicle)) {
|
||||
break;
|
||||
}
|
||||
//如果查询到给ACS下发一个输送线任务
|
||||
JSONObject form = new JSONObject();
|
||||
form.put("point_code1", empty_vehicle.getString("point_code"));
|
||||
//查询该区域点位类型为出口的点位
|
||||
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + product_area + "' AND point_type = '7'").uniqueResult(0);
|
||||
form.put("point_code2", ss_jo.getString("point_code"));
|
||||
if (StrUtil.isEmpty(empty_vehicle.getString("vehicle_code"))) {
|
||||
throw new BadRequestException("点位:" + empty_vehicle.getString("point_code") + "载具号为空!");
|
||||
}
|
||||
form.put("vehicle_code2", empty_vehicle.getString("vehicle_code"));
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", "A1");
|
||||
cutConveyorTask.createTask(form);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void callPaperTube(JSONArray rows, String product_area) {
|
||||
JSONObject container_jo1;
|
||||
JSONObject container_jo2;
|
||||
JSONObject container_jo3;
|
||||
JSONObject container_jo4;
|
||||
JSONObject paper_jo = new JSONObject();
|
||||
String paper_code1;
|
||||
String paper_code2;
|
||||
JSONArray paper_rows = new JSONArray();
|
||||
switch (rows.size()) {
|
||||
case 1:
|
||||
container_jo1 = rows.getJSONObject(0);
|
||||
paper_code1 = getMaterial(container_jo1.getString("paper_tube_material"), container_jo1.getString("frp_material"));
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 1);
|
||||
paper_jo.put("pcsn", container_jo1.getString("container_name"));
|
||||
paper_rows.add(paper_jo);
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
break;
|
||||
case 2:
|
||||
container_jo1 = rows.getJSONObject(0);
|
||||
container_jo2 = rows.getJSONObject(1);
|
||||
paper_code1 = getMaterial(container_jo1.getString("paper_tube_material"), container_jo1.getString("FRP_material"));
|
||||
paper_code2 = getMaterial(container_jo2.getString("paper_tube_material"), container_jo2.getString("FRP_material"));
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 1);
|
||||
paper_jo.put("pcsn", container_jo1.getString("container_name"));
|
||||
paper_rows.add(paper_jo);
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
paper_jo.put("paper_code", paper_code2);
|
||||
paper_jo.put("pcsn", container_jo2.getString("container_name"));
|
||||
paper_jo.put("num", 1);
|
||||
paper_rows.add(paper_jo);
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
break;
|
||||
case 3:
|
||||
container_jo1 = rows.getJSONObject(0);
|
||||
container_jo2 = rows.getJSONObject(1);
|
||||
container_jo3 = rows.getJSONObject(2);
|
||||
paper_code1 = getMaterial(container_jo1.getString("paper_tube_material"), container_jo1.getString("FRP_material"));
|
||||
paper_code2 = getMaterial(container_jo2.getString("paper_tube_material"), container_jo2.getString("FRP_material"));
|
||||
if (paper_code2.equals(paper_code1)) {
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 2);
|
||||
paper_rows.add(paper_jo);
|
||||
paper_jo.put("pcsn", container_jo1.getString("container_name"));
|
||||
paper_jo.put("pcsn2", container_jo2.getString("container_name"));
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
} else {
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 1);
|
||||
paper_jo.put("pcsn", container_jo1.getString("container_name"));
|
||||
paper_rows.add(paper_jo);
|
||||
paper_jo.put("paper_code", paper_code2);
|
||||
paper_jo.put("pcsn", container_jo2.getString("container_name"));
|
||||
paper_rows.add(paper_jo);
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
}
|
||||
paper_code1 = getMaterial(container_jo3.getString("paper_tube_material"), container_jo3.getString("FRP_material"));
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 1);
|
||||
paper_jo.put("pcsn", container_jo3.getString("container_name"));
|
||||
paper_rows.add(paper_jo);
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
break;
|
||||
case 4:
|
||||
container_jo1 = rows.getJSONObject(0);
|
||||
container_jo2 = rows.getJSONObject(1);
|
||||
container_jo3 = rows.getJSONObject(2);
|
||||
container_jo4 = rows.getJSONObject(3);
|
||||
paper_code1 = getMaterial(container_jo1.getString("paper_tube_material"), container_jo1.getString("FRP_material"));
|
||||
paper_code2 = getMaterial(container_jo2.getString("paper_tube_material"), container_jo2.getString("FRP_material"));
|
||||
if (paper_code2.equals(paper_code1)) {
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 2);
|
||||
paper_rows.add(paper_jo);
|
||||
paper_jo.put("pcsn", container_jo1.getString("container_name"));
|
||||
paper_jo.put("pcsn2", container_jo2.getString("container_name"));
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
} else {
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 1);
|
||||
paper_rows.add(paper_jo);
|
||||
paper_jo.put("pcsn", container_jo1.getString("container_name"));
|
||||
paper_jo.put("paper_code", paper_code2);
|
||||
paper_rows.add(paper_jo);
|
||||
paper_jo.put("pcsn", container_jo2.getString("container_name"));
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
}
|
||||
paper_code1 = getMaterial(container_jo3.getString("paper_tube_material"), container_jo3.getString("FRP_material"));
|
||||
paper_code2 = getMaterial(container_jo4.getString("paper_tube_material"), container_jo4.getString("FRP_material"));
|
||||
if (paper_code2.equals(paper_code1)) {
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 2);
|
||||
paper_rows.add(paper_jo);
|
||||
paper_jo.put("pcsn", container_jo3.getString("container_name"));
|
||||
paper_jo.put("pcsn2", container_jo4.getString("container_name"));
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
} else {
|
||||
paper_jo.put("paper_code", paper_code1);
|
||||
paper_jo.put("num", 1);
|
||||
paper_jo.put("pcsn", container_jo3.getString("container_name"));
|
||||
paper_rows.add(paper_jo);
|
||||
paper_jo.put("paper_code", paper_code2);
|
||||
paper_jo.put("pcsn", container_jo4.getString("container_name"));
|
||||
paper_rows.add(paper_jo);
|
||||
this.getPaperStruct(paper_rows, product_area);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
row.put("is_paper_ok", "1");
|
||||
WQLObject.getWQLObject("pdm_bi_slittingproductionplan").update(row);
|
||||
}
|
||||
}
|
||||
|
||||
String getMaterial(String a, String b) {
|
||||
if (StrUtil.isEmpty(a)) {
|
||||
return b;
|
||||
} else {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
void getPaperStruct(JSONArray rows, String product_area) {
|
||||
//查询对应纸管库的库存
|
||||
JSONObject device_jo = new JSONObject();
|
||||
JSONObject zgk_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '8' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
//判断纸管库是否启用
|
||||
if ("1".equals(zgk_jo.getString("is_used"))) {
|
||||
device_jo.put("device_code", zgk_jo.getString("point_code"));
|
||||
device_jo.put("product_area", product_area);
|
||||
JSONArray device_ja = new JSONArray();
|
||||
device_ja.add(device_jo);
|
||||
JSONObject device_data = wmsToAcsService.getPointStatus(device_ja);
|
||||
JSONObject data = device_data.getJSONArray("data").getJSONObject(0);
|
||||
JSONArray task_rows = new JSONArray();
|
||||
boolean same_flag = false;
|
||||
boolean need_cz = false;
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
int num = row.getIntValue("num");
|
||||
if (num == 2) {
|
||||
same_flag = true;
|
||||
}
|
||||
String material_code = row.getString("paper_code");
|
||||
for (int j = 1; j < 13; j++) {
|
||||
String material_key = "material" + j;
|
||||
String qty_key = "qty" + j;
|
||||
String ivt_code = data.getString(material_key);
|
||||
int ivt_num = data.getIntValue(qty_key);
|
||||
if (StrUtil.isNotEmpty(ivt_code) && ivt_code.equals(material_code)) {
|
||||
JSONObject task_jo = new JSONObject();
|
||||
task_jo.put("device_code", j);
|
||||
task_jo.put("material_code", material_code);
|
||||
if (ivt_num >= num) {
|
||||
task_jo.put("qty", num);
|
||||
num = 0;
|
||||
} else {
|
||||
task_jo.put("qty", ivt_num);
|
||||
num -= ivt_num;
|
||||
}
|
||||
task_rows.add(task_jo);
|
||||
if (num == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (num > 0) {
|
||||
log.info("子卷号为:" + row.getString("pcsn") + "所需的纸管在纸管库中库存不足!不进行套管");
|
||||
} else {
|
||||
need_cz = true;
|
||||
}
|
||||
}
|
||||
if (need_cz) {
|
||||
//生成出纸管的任务
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010601");
|
||||
jo.put("point_code1", zgk_jo.getString("point_code"));
|
||||
JSONObject tggw_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '4' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
jo.put("point_code2", tggw_jo.getString("point_code"));
|
||||
JSONObject request_param = new JSONObject();
|
||||
if (same_flag) {
|
||||
request_param.put("container_name1", rows.getJSONObject(0).getString("pcsn"));
|
||||
request_param.put("container_name2", rows.getJSONObject(0).getString("pcsn2"));
|
||||
} else {
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
request_param.put("container_name" + (i + 1), rows.getJSONObject(i).getString("pcsn"));
|
||||
}
|
||||
}
|
||||
jo.put("vehicle_code", rows.getJSONObject(0).getString("pcsn"));
|
||||
jo.put("paper_array", task_rows);
|
||||
jo.put("request_param", request_param);
|
||||
jo.put("product_area", product_area);
|
||||
paperTubeTask.createTask(jo);
|
||||
} else {
|
||||
createTask(rows, product_area);
|
||||
}
|
||||
} else {
|
||||
//如果没有启用,不进行套轴配送空气胀轴到载具上
|
||||
createTask(rows, product_area);
|
||||
}
|
||||
}
|
||||
|
||||
private void createTask(JSONArray rows, String product_area) {
|
||||
boolean same_flag = false;
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
int num = row.getIntValue("num");
|
||||
if (num == 2) {
|
||||
same_flag = true;
|
||||
}
|
||||
}
|
||||
//todo 创建一个任务直接搬运空轴到IN口
|
||||
//查询对应的分切计划
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + rows.getJSONObject(0).getString("pcsn") + "'").uniqueResult(0);
|
||||
String paper_tube_or_FRP = plan_jo.getString("paper_tube_or_frp");
|
||||
String paper_name;
|
||||
if ("1".equals(paper_tube_or_FRP)) {
|
||||
paper_name = plan_jo.getString("paper_tube_description");
|
||||
} else {
|
||||
paper_name = plan_jo.getString("frp_description");
|
||||
}
|
||||
|
||||
if (StrUtil.isEmpty(paper_name)) {
|
||||
//todo:提醒分切计划存在问题无法进行套轴
|
||||
return;
|
||||
}
|
||||
|
||||
String need_size = String.valueOf(paper_name.split("\\|")[2].charAt(0));
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + plan_jo.getString("resource_name") + "'").uniqueResult(0);
|
||||
|
||||
//获取分切机维护的气涨轴代数
|
||||
String need_generation = cut_jo.getString("qzz_generation");
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010606");
|
||||
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
|
||||
JSONObject qhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '6' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
jo.put("point_code1", qhd_jo.getString("point_code"));
|
||||
JSONObject in_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + product_area + "' AND point_type = '6'").uniqueResult(0);
|
||||
jo.put("point_code2", in_jo.getString("point_code"));
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("need_size", need_size);
|
||||
request_param.put("need_generation", need_generation);
|
||||
if (same_flag) {
|
||||
request_param.put("container_name1", rows.getJSONObject(0).getString("pcsn"));
|
||||
request_param.put("container_name2", rows.getJSONObject(0).getString("pcsn2"));
|
||||
} else {
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
request_param.put("container_name" + (i + 1), rows.getJSONObject(i).getString("pcsn"));
|
||||
}
|
||||
}
|
||||
request_param.put("need_location", cut_jo.getString("point_location"));
|
||||
jo.put("vehicle_code", rows.getJSONObject(0).getString("pcsn"));
|
||||
jo.put("material_code", rows.getJSONObject(0).getString("pcsn"));
|
||||
jo.put("product_area", product_area);
|
||||
paperTubeTask.createTask(jo);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -13,6 +13,7 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
@@ -183,9 +184,46 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
}
|
||||
}
|
||||
|
||||
//判断载具上是否存在气涨轴
|
||||
String vehicle_code = jsonTask.getString("vehicle_code");
|
||||
|
||||
//判断内包间是否启用
|
||||
JSONObject package_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '9' AND product_area = '" + jsonTask.getString("product_area") + "'").uniqueResult(0);
|
||||
if (package_jo.getString("is_used").equals("1")){
|
||||
//判断载具上是否存在气涨轴
|
||||
String vehicle_code = jsonTask.getString("vehicle_code");
|
||||
if (StrUtil.isNotEmpty(vehicle_code)) {
|
||||
JSONObject out_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(out_jo)) {
|
||||
throw new BadRequestException("未查询到对应的点位!");
|
||||
}
|
||||
String point_location = out_jo.getString("point_location");
|
||||
JSONObject vehicle_jo = WQLObject.getWQLObject("md_pb_vehiclearea").query("point_location = '" + point_location + "' AND product_area = '" + jsonTask.getString("product_area") + "'").uniqueResult(0);
|
||||
String qzz_generation = vehicle_jo.getString("qzz_generation");
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010605");
|
||||
jo.put("point_code1", jsonTask.getString("point_code2"));
|
||||
JSONObject rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '5' AND product_area = '" + jsonTask.getString("product_area") + "'").uniqueResult(0);
|
||||
jo.put("point_code2", rgv_jo.getString("point_code"));
|
||||
jo.put("truss_type", "6");
|
||||
jo.put("vehicle_code", jsonTask.getString("vehicle_code"));
|
||||
jo.put("product_area", jsonTask.getString("product_area"));
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("have_generation", qzz_generation);
|
||||
jo.put("request_param", request_param.toString());
|
||||
PaperTrussTask paperTrussTask = SpringContextHolder.getBean(PaperTrussTask.class);
|
||||
paperTrussTask.createTask(jo);
|
||||
} else {
|
||||
//给输送线OUT点下发acition1,让载具进行横移
|
||||
String device_code = jsonTask.getString("point_code2");
|
||||
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
JSONArray action_rows = new JSONArray();
|
||||
JSONObject action_jo = new JSONObject();
|
||||
action_jo.put("device_code", device_code);
|
||||
action_jo.put("code", "to_command");
|
||||
action_jo.put("product_area", jsonTask.getString("product_area"));
|
||||
action_jo.put("value", "1");
|
||||
action_rows.add(action_jo);
|
||||
wmsToAcsService.action(action_rows);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//分切输送入任务
|
||||
|
||||
@@ -0,0 +1,278 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.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.wms.pda.mps.service.ShippingService;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.TaskService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ZZ on 2021/12/22.
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PaperTrussTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = PaperTrussTask.class.getName();
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.start_device_code2(json.getString("point_code3"))
|
||||
.next_device_code2(json.getString("point_code4"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.product_area(json.getString("product_area"))
|
||||
.priority(json.getString("priority"))
|
||||
.truss_type(json.getString("response_param"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
.remark(json.getString("remark"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.build();
|
||||
|
||||
if ("010605".equals(json.getString("task_type")) || "010603".equals(json.getString("task_type")) || "010604".equals(json.getString("task_type"))) {
|
||||
dto.setVersion(json.getJSONObject("request_param").getString("have_generation"));
|
||||
}
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject ivt_shaftivt = WQLObject.getWQLObject("st_ivt_shaftivt");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + taskObj.getString("task_id") + "'").uniqueResult(0);
|
||||
HashMap map = new HashMap();
|
||||
//1:执行中,2:完成 ,3:acs取消
|
||||
if ("0".equals(status)) {
|
||||
// 更新删除字段
|
||||
map.put("is_delete", "1");
|
||||
map.put("update_time", DateUtil.now());
|
||||
|
||||
}
|
||||
if (status.equals(TaskStatusEnum.EXECUTING.getCode())) {
|
||||
map.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
}
|
||||
if (status.equals(TaskStatusEnum.FINISHED.getCode())) {
|
||||
map.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
String task_type = task_jo.getString("task_type");
|
||||
//空轴取货任务
|
||||
if ("010602".equals(task_type)) {
|
||||
String point_code = task_jo.getString("point_code2");
|
||||
JSONObject goal_point = ivt_shaftivt.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
JSONObject request_param = task_jo.getJSONObject("request_param");
|
||||
String qzz_size = request_param.getString("need_size");
|
||||
String qzz_generation = request_param.getString("need_generation");
|
||||
goal_point.put("qzz_size", qzz_size);
|
||||
goal_point.put("qzz_generation", qzz_generation);
|
||||
goal_point.put("have_qzz", "1");
|
||||
ivt_shaftivt.update(goal_point);
|
||||
}
|
||||
//空轴放货任务
|
||||
if ("010603".equals(task_type)) {
|
||||
String point_code = task_jo.getString("point_code1");
|
||||
JSONObject goal_point = ivt_shaftivt.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
goal_point.put("qzz_size", "");
|
||||
goal_point.put("qzz_generation", "");
|
||||
goal_point.put("have_qzz", "0");
|
||||
ivt_shaftivt.update(goal_point);
|
||||
}
|
||||
//空轴换货任务
|
||||
if ("010604".equals(task_type)) {
|
||||
String point_code = task_jo.getString("point_code1");
|
||||
JSONObject goal_point = ivt_shaftivt.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
JSONObject request_param = task_jo.getJSONObject("request_param");
|
||||
String qzz_size = request_param.getString("need_size");
|
||||
String qzz_generation = request_param.getString("need_generation");
|
||||
goal_point.put("qzz_size", qzz_size);
|
||||
goal_point.put("qzz_generation", qzz_generation);
|
||||
goal_point.put("have_qzz", "1");
|
||||
ivt_shaftivt.update(goal_point);
|
||||
}
|
||||
//
|
||||
//成品下卷任务
|
||||
if ("010605".equals(task_type)) {
|
||||
//更新RGV上气胀轴的数量
|
||||
JSONObject rgv_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code2") + "'").uniqueResult(0);
|
||||
int have_qzz = rgv_jo.getIntValue("have_qzz");
|
||||
rgv_jo.put("have_qzz", have_qzz + 1);
|
||||
ivt_shaftivt.update(rgv_jo);
|
||||
}
|
||||
//套轴气胀轴放货任务
|
||||
if ("010606".equals(task_type)) {
|
||||
String point_code = task_jo.getString("point_code1");
|
||||
JSONObject goal_point = ivt_shaftivt.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if ("2".equals(goal_point.getString("point_type"))) {
|
||||
goal_point.put("qzz_size", "");
|
||||
goal_point.put("qzz_generation", "");
|
||||
goal_point.put("have_qzz", "0");
|
||||
ivt_shaftivt.update(goal_point);
|
||||
}
|
||||
//桁架任务完成后创建输送线配送任务
|
||||
JSONObject request_param_jo = task_jo.getJSONObject("request_param");
|
||||
String container_name1 = request_param_jo.getString("container_name1");
|
||||
JSONArray cut_rows = new JSONArray();
|
||||
JSONObject jo1 = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + container_name1 + "' AND is_delete = '0'").uniqueResult(0);
|
||||
cut_rows.add(jo1);
|
||||
String container_name2 = request_param_jo.getString("container_name2");
|
||||
if (StrUtil.isNotEmpty(container_name2)) {
|
||||
JSONObject jo2 = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + container_name2 + "' AND is_delete = '0'").uniqueResult(0);
|
||||
cut_rows.add(jo2);
|
||||
}
|
||||
JSONObject in_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + task_jo.getString("point_code2") + "'").uniqueResult(0);
|
||||
String vehicle_code = in_jo.getString("vehicle_code");
|
||||
JSONObject confirm_jo = new JSONObject();
|
||||
confirm_jo.put("vehicle_code", vehicle_code);
|
||||
confirm_jo.put("cut_rows", cut_rows);
|
||||
ShippingService shippingService = SpringContextHolder.getBean(ShippingService.class);
|
||||
shippingService.confirm(confirm_jo);
|
||||
in_jo.put("vehicle_code", "");
|
||||
WQLObject.getWQLObject("sch_base_point").update(in_jo);
|
||||
}
|
||||
//套轴气胀轴取货任务
|
||||
if ("010607".equals(task_type)) {
|
||||
String point_code = task_jo.getString("point_code1");
|
||||
JSONObject goal_point = ivt_shaftivt.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
goal_point.put("qzz_size", "");
|
||||
goal_point.put("qzz_generation", "");
|
||||
goal_point.put("have_qzz", "0");
|
||||
goal_point.put("container_name1", "");
|
||||
goal_point.put("container_name2", "");
|
||||
ivt_shaftivt.update(goal_point);
|
||||
String point_code2 = task_jo.getString("point_code2");
|
||||
JSONObject goal_point2 = ivt_shaftivt.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
JSONObject request_param = task_jo.getJSONObject("request_param");
|
||||
String qzz_size = request_param.getString("need_size");
|
||||
String qzz_generation = request_param.getString("need_generation");
|
||||
String point_location = request_param.getString("need_location");
|
||||
String container_name1 = request_param.getString("container_name1");
|
||||
String container_name2 = request_param.getString("container_name2");
|
||||
goal_point2.put("have_qzz", "1");
|
||||
goal_point2.put("qzz_size", qzz_size);
|
||||
goal_point2.put("qzz_generation", qzz_generation);
|
||||
goal_point2.put("point_location", point_location);
|
||||
goal_point2.put("container_name1", container_name1);
|
||||
goal_point2.put("container_name2", container_name2);
|
||||
ivt_shaftivt.update(goal_point2);
|
||||
}
|
||||
}
|
||||
map.put("update_optid", currentUserId);
|
||||
map.put("update_optname", nickName);
|
||||
map.put("update_time", now);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(map, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
|
||||
String task_type = form.getString("task_type");
|
||||
if (StrUtil.isBlank(task_type)) {
|
||||
throw new BadRequestException("业务类型不能为空");
|
||||
}
|
||||
String point_code1 = form.getString("point_code1");
|
||||
if (StrUtil.isBlank(point_code1)) {
|
||||
throw new BadRequestException("起点不能为空");
|
||||
}
|
||||
String point_code2 = form.getString("point_code2");
|
||||
if (StrUtil.isBlank(point_code2)) {
|
||||
throw new BadRequestException("下一点不能为空");
|
||||
}
|
||||
String point_code3 = form.getString("point_code3");
|
||||
|
||||
String point_code4 = form.getString("point_code4");
|
||||
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
if (StrUtil.isBlank(vehicle_code)) {
|
||||
throw new BadRequestException("载具号不能为空");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", point_code1);
|
||||
json.put("point_code2", point_code2);
|
||||
json.put("point_code3", point_code3);
|
||||
json.put("point_code4", point_code4);
|
||||
json.put("handle_class", this.getClass().getName());
|
||||
json.put("create_id", currentUserId);
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("priority", "1");
|
||||
json.put("acs_task_type", "9");
|
||||
json.put("response_param", form.getString("truss_type"));
|
||||
json.put("request_param", form.getString("request_param"));
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
||||
|
||||
//下发
|
||||
this.immediateNotifyAcs(json.getString("task_id"));
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void forceFinish(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.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.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ZZ on 2021/12/22.
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PaperTubeTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = PaperTubeTask.class.getName();
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.product_area(json.getString("product_area"))
|
||||
.paper_array(json.getString("response_param"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
.remark(json.getString("remark"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + taskObj.getString("task_id") + "'").uniqueResult(0);
|
||||
HashMap map = new HashMap();
|
||||
//1:执行中,2:完成 ,3:acs取消
|
||||
if ("0".equals(status)) {
|
||||
// 更新删除字段
|
||||
map.put("is_delete", "1");
|
||||
map.put("update_time", DateUtil.now());
|
||||
|
||||
}
|
||||
if (status.equals(TaskStatusEnum.EXECUTING.getCode())) {
|
||||
map.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
}
|
||||
if (status.equals(TaskStatusEnum.FINISHED.getCode())) {
|
||||
map.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
//更新套轴工位点位的子卷号
|
||||
String product_area = task_jo.getString("product_area");
|
||||
//查询对应的纸管出库口
|
||||
JSONObject out_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '4' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
|
||||
JSONObject req_param = task_jo.getJSONObject("request_param");
|
||||
out_jo.put("container_name1", req_param.getString("container_name1"));
|
||||
out_jo.put("container_name2", req_param.getString("container_name2"));
|
||||
|
||||
//查询对应的分切计划
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + req_param.getString("container_name1") + "'").uniqueResult(0);
|
||||
String paper_tube_or_FRP = plan_jo.getString("paper_tube_or_frp");
|
||||
String paper_name;
|
||||
if ("1".equals(paper_tube_or_FRP)) {
|
||||
paper_name = plan_jo.getString("paper_tube_description");
|
||||
} else {
|
||||
paper_name = plan_jo.getString("frp_description");
|
||||
}
|
||||
|
||||
if (StrUtil.isEmpty(paper_name)) {
|
||||
//todo:提醒分切计划存在问题无法进行套轴
|
||||
return;
|
||||
}
|
||||
|
||||
String need_size = String.valueOf(paper_name.split("\\|")[2].charAt(0));
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + plan_jo.getString("resource_name") + "'").uniqueResult(0);
|
||||
|
||||
//获取分切机维护的气涨轴代数
|
||||
String need_generation = cut_jo.getString("qzz_generation");
|
||||
|
||||
//判断当前穿拔轴机构上是否存在可用的气涨轴
|
||||
JSONObject cbz_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '0' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
String have_qzz = cbz_jo.getString("have_qzz");
|
||||
//判断当前RGV上是否存在未拔轴的成品卷
|
||||
JSONObject rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '5' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
if ( "0".equals(have_qzz) || "0".equals(rgv_jo.getString("have_qzz"))){
|
||||
PaperTrussTask paperTrussTask = SpringContextHolder.getBean(PaperTrussTask.class);
|
||||
//todo:创建桁架任务搬运一个符合的气涨轴
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010602");
|
||||
String public_area = "";
|
||||
if (product_area.equals("A1") || product_area.equals("A2")){
|
||||
public_area = "A1";
|
||||
}
|
||||
if (product_area.equals("A3") || product_area.equals("A4")){
|
||||
public_area = "A3";
|
||||
}
|
||||
JSONObject qhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '6' AND product_area = '" + public_area + "'").uniqueResult(0);
|
||||
jo.put("point_code1", qhd_jo.getString("point_code"));
|
||||
jo.put("point_code2", cbz_jo.getString("point_code"));
|
||||
jo.put("truss_type", "8");
|
||||
jo.put("vehicle_code", req_param.getString("container_name1") + "-qzz");
|
||||
jo.put("product_area", product_area);
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("need_size", need_size);
|
||||
request_param.put("need_generation", need_generation);
|
||||
jo.put("request_param", request_param.toString());
|
||||
paperTrussTask.createTask(jo);
|
||||
}
|
||||
|
||||
//更新出库口的库存信息
|
||||
out_jo.put("qzz_size", need_size);
|
||||
out_jo.put("qzz_generation", need_generation);
|
||||
WQLObject.getWQLObject("st_ivt_shaftivt").update(out_jo);
|
||||
|
||||
}
|
||||
map.put("update_optid", currentUserId);
|
||||
map.put("update_optname", nickName);
|
||||
map.put("update_time", now);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(map, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
|
||||
String task_type = form.getString("task_type");
|
||||
if (StrUtil.isBlank(task_type)) {
|
||||
throw new BadRequestException("业务类型不能为空");
|
||||
}
|
||||
String point_code1 = form.getString("point_code1");
|
||||
if (StrUtil.isBlank(point_code1)) {
|
||||
throw new BadRequestException("起点不能为空");
|
||||
}
|
||||
String point_code2 = form.getString("point_code2");
|
||||
if (StrUtil.isBlank(point_code2)) {
|
||||
throw new BadRequestException("下一点不能为空");
|
||||
}
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
if (StrUtil.isBlank(vehicle_code)) {
|
||||
throw new BadRequestException("载具号不能为空");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
String task_status = form.getString("task_status");
|
||||
if (StrUtil.isNotEmpty(task_status)){
|
||||
json.put("task_status", task_status);
|
||||
}else {
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
}
|
||||
|
||||
json.put("point_code1", point_code1);
|
||||
json.put("point_code2", point_code2);
|
||||
json.put("handle_class", this.getClass().getName());
|
||||
json.put("create_id", currentUserId);
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("priority", "1");
|
||||
json.put("acs_task_type", "10");
|
||||
json.put("response_param", form.getString("paper_array"));
|
||||
json.put("request_param", form.getString("request_param"));
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
||||
|
||||
//下发
|
||||
this.immediateNotifyAcs(json.getString("task_id"));
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void forceFinish(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
[交易说明]
|
||||
交易名: ACS请求WMS
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.need_size TYPEAS s_string
|
||||
输入.need_generation TYPEAS s_string
|
||||
输入.product_area TYPEAS s_string
|
||||
输入.point_location TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
parent_container_name,
|
||||
split_group,
|
||||
MIN( call_time ) AS call_time
|
||||
FROM
|
||||
pdm_bi_slittingproductionplan plan
|
||||
LEFT JOIN st_ivt_cutpointivt cut ON cut.ext_code = plan.resource_name
|
||||
WHERE
|
||||
`status` < '05'
|
||||
AND is_call = '1'
|
||||
AND order_type = '1'
|
||||
AND IFNULL( call_time, '' ) <> ''
|
||||
AND is_delete = '0'
|
||||
AND cut.product_area = 输入.product_area
|
||||
AND cut.point_location = 输入.point_location
|
||||
GROUP BY
|
||||
parent_container_name,
|
||||
split_group UNION
|
||||
SELECT
|
||||
restruct_container_name AS parent_container_name,
|
||||
split_group,
|
||||
MIN( call_time ) AS call_time
|
||||
FROM
|
||||
pdm_bi_slittingproductionplan plan
|
||||
LEFT JOIN st_ivt_cutpointivt cut ON cut.ext_code = plan.resource_name
|
||||
WHERE
|
||||
`status` < '05'
|
||||
AND is_call = '1'
|
||||
AND order_type = '2'
|
||||
AND IFNULL( call_time, '' ) <> ''
|
||||
AND is_delete = '0'
|
||||
AND cut.product_area = 输入.product_area
|
||||
AND cut.point_location = 输入.point_location
|
||||
GROUP BY
|
||||
restruct_container_name,
|
||||
split_group
|
||||
ORDER BY
|
||||
call_time
|
||||
LIMIT 3
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
st_ivt_deliverypointivt ivt
|
||||
INNER JOIN sch_base_task task ON task.point_code2 = ivt.point_code
|
||||
WHERE
|
||||
ivt.product_area = 输入.product_area
|
||||
AND ivt.point_location = 输入.point_location
|
||||
AND task.task_type = '010404'
|
||||
AND task.task_status < '07'
|
||||
AND task.is_delete = '0' UNION
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
st_ivt_deliverypointivt ivt
|
||||
INNER JOIN sch_base_task task ON task.point_code1 = ivt.point_code
|
||||
WHERE
|
||||
ivt.product_area = 输入.product_area
|
||||
AND ivt.point_location = 输入.point_location
|
||||
AND task.task_type IN ('010403','010401')
|
||||
AND task.task_status < '07'
|
||||
AND task.is_delete = '0'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_point po
|
||||
LEFT JOIN md_pb_vehiclearea area ON po.vehicle_code = area.vehicle_code
|
||||
WHERE
|
||||
po.point_type = '7'
|
||||
AND
|
||||
po.product_area = 输入.product_area
|
||||
AND
|
||||
area.point_location = 输入.point_location
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_point po
|
||||
LEFT JOIN md_pb_vehiclearea area ON po.vehicle_code = area.vehicle_code
|
||||
WHERE
|
||||
po.point_type = '6'
|
||||
AND
|
||||
po.product_area = 输入.product_area
|
||||
AND
|
||||
area.point_location = 输入.point_location
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
point_code1 = po.point_code
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "5"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
st_ivt_deliverypointivt ivt
|
||||
INNER JOIN sch_base_task task ON task.point_code2 = ivt.point_code
|
||||
WHERE
|
||||
ivt.product_area = 输入.product_area
|
||||
AND ivt.point_location = 输入.point_location
|
||||
AND task.task_type = '010402'
|
||||
AND task.task_status < '07'
|
||||
AND task.is_delete = '0' UNION
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
st_ivt_deliverypointivt ivt
|
||||
INNER JOIN sch_base_task task ON task.point_code1 = ivt.point_code
|
||||
WHERE
|
||||
ivt.product_area = 输入.product_area
|
||||
AND ivt.point_location = 输入.point_location
|
||||
AND task.task_type = '010405'
|
||||
AND task.task_status < '07'
|
||||
AND task.is_delete = '0'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "6"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
st_ivt_shaftivt ivt
|
||||
WHERE
|
||||
ivt.point_type = '1'
|
||||
AND
|
||||
ivt.have_qzz = '1'
|
||||
AND
|
||||
ivt.qzz_size = 输入.need_size
|
||||
AND
|
||||
ivt.qzz_generation = 输入.need_generation
|
||||
ORDER BY
|
||||
sort_seq
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "7"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
st_ivt_shaftivt ivt
|
||||
WHERE
|
||||
ivt.point_type = '1'
|
||||
AND ivt.have_qzz = '0'
|
||||
AND ivt.qzz_size = 输入.need_size
|
||||
AND ivt.qzz_generation = 输入.need_generation
|
||||
AND NOT EXISTS
|
||||
( SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
point_code2 = ivt.point_code
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
ORDER BY
|
||||
sort_seq desc
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
MAX(cu.cust_name) AS cust_name,
|
||||
MAX(dtl.vbeln) AS vbeln,
|
||||
sub.sale_order_name,
|
||||
CONCAT(sub.thickness,'*',sub.width) AS spec,
|
||||
CONCAT( sub.thickness_request, '*', sub.width_standard ) AS spec,
|
||||
MAX(tr.cust_name) AS wl_cust_name,
|
||||
MAX(ios.estimated_freight) AS estimated_freight
|
||||
FROM
|
||||
@@ -181,8 +181,8 @@
|
||||
LEFT JOIN ST_IVT_IOStorInv ios ON ios.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code
|
||||
LEFT JOIN md_cs_transportationbase tr ON ios.trans_code = tr.cust_code
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = dis.box_no AND dis.pcsn = sub.container_name
|
||||
WHERE
|
||||
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.package_box_sn = dis.box_no AND dis.pcsn = sub.container_name AND dis.iostorinv_id = sub.bill_id
|
||||
WHERE
|
||||
ios.io_type = '1'
|
||||
AND ios.is_delete = '0'
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
ios.input_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
GROUP BY sub.sale_order_name,spec
|
||||
GROUP BY sub.sale_order_name,spec,ios.iostorinv_id
|
||||
|
||||
|
||||
ENDSELECT
|
||||
|
||||
276
lms/nladmin-ui/src/views/wms/pdm/ivt/package/index.vue
Normal file
276
lms/nladmin-ui/src/views/wms/pdm/ivt/package/index.vue
Normal file
@@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="点位编码">
|
||||
<el-input
|
||||
v-model="query.point_code"
|
||||
clearable
|
||||
placeholder="输入点位编码"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产区域">
|
||||
<el-select
|
||||
v-model="query.product_area"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位类型">
|
||||
<el-select
|
||||
v-model="query.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.delivery_point_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch
|
||||
v-model="query.is_used"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
active-color="#C0CCDA"
|
||||
inactive-color="#409EFF"
|
||||
@change="hand"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="点位编码" prop="point_code">
|
||||
<el-input v-model="form.point_code" style="width: 370px;" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产区域">
|
||||
<el-select
|
||||
v-model="form.product_area"
|
||||
size="mini"
|
||||
placeholder="生产区域"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="轴数量">
|
||||
<el-input v-model="form.have_qzz" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="代数">
|
||||
<el-select
|
||||
v-model="form.qzz_generation"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in generation_list"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="尺寸">
|
||||
<el-select
|
||||
v-model="form.qzz_size"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in size_list"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="顺序号" prop="sort_seq">
|
||||
<el-input v-model="form.sort_seq" style="width: 370px;" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-switch v-model="form.is_used" active-value="1" inactive-value="0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="point_code" label="点位编码" width="100px" />
|
||||
<el-table-column prop="have_qzz" label="轴数量" />
|
||||
<el-table-column prop="qzz_generation" label="代数" />
|
||||
<el-table-column prop="qzz_size" label="尺寸" />
|
||||
<el-table-column prop="product_area" label="生产区域">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.product_area[scope.row.product_area] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.is_used[scope.row.is_used] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="update_time" label="修改时间" show-overflow-tooltip />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:is-visiable-del="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPackagepointivt from '@/views/wms/pdm/ivt/package/package'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
ivt_id: null,
|
||||
point_code: null,
|
||||
product_area: null,
|
||||
have_qzz: null,
|
||||
qzz_generation: null,
|
||||
qzz_size: null,
|
||||
point_location: null,
|
||||
sort_seq: null,
|
||||
is_used: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'DeliveryPointIvt',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
dicts: ['delivery_point_status', 'product_area', 'is_used', 'point_location'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '内包间',
|
||||
url: 'api/packagepointivt',
|
||||
idField: 'ivt_id',
|
||||
sort: 'ivt_id,desc',
|
||||
crudMethod: { ...crudPackagepointivt },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {
|
||||
point_code: [
|
||||
{ required: true, message: '点位编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
generation_list: [{
|
||||
'value': '4',
|
||||
'label': '4代'
|
||||
}, {
|
||||
'value': '5',
|
||||
'label': '5代'
|
||||
}, {
|
||||
'value': '6',
|
||||
'label': '6代'
|
||||
}],
|
||||
size_list: [{
|
||||
'value': '3',
|
||||
'label': '3寸'
|
||||
}, {
|
||||
'value': '6',
|
||||
'label': '6寸'
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
27
lms/nladmin-ui/src/views/wms/pdm/ivt/package/package.js
Normal file
27
lms/nladmin-ui/src/views/wms/pdm/ivt/package/package.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/packagepointivt',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/packagepointivt/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/packagepointivt',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -143,7 +143,7 @@
|
||||
<el-table-column key="1" type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column key="3" prop="material_code" label="产品编码" width="150" align="center" />
|
||||
<el-table-column key="4" prop="material_name" label="产品名称" align="center" min-width="200" />
|
||||
<el-table-column key="6" prop="sap_pcsn" label="改切批次号" align="center" min-width="150" />
|
||||
<el-table-column key="6" prop="pcsn" label="改切批次号" align="center" min-width="150" />
|
||||
<el-table-column
|
||||
key="10"
|
||||
prop="qty"
|
||||
@@ -314,6 +314,7 @@ export default {
|
||||
if (this.form.tableData.length !== 0) {
|
||||
this.flagnow = false
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
this.form.tableData[i].pcsn = this.form.tableData[i].sap_pcsn
|
||||
if (this.form.tableData[i].pcsn === item.pcsn) {
|
||||
this.flagnow = true
|
||||
break
|
||||
@@ -343,6 +344,7 @@ export default {
|
||||
}
|
||||
})
|
||||
for (const value of tablemap.values()) {
|
||||
value.pcsn = value.sap_pcsn
|
||||
this.form.tableData.push(value)
|
||||
}
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
|
||||
Reference in New Issue
Block a user