修改
This commit is contained in:
@@ -142,4 +142,7 @@ public class StructattrDto implements Serializable {
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 放置类型 */
|
||||
private String placement_type;
|
||||
}
|
||||
|
||||
@@ -168,17 +168,6 @@ public class StructattrServiceImpl implements StructattrService {
|
||||
dto.setStor_code(storattrDto.getStor_code());
|
||||
dto.setStor_name(storattrDto.getStor_name());
|
||||
|
||||
String storagevehicle_code = dto.getStoragevehicle_code();
|
||||
if (ObjectUtil.isNotEmpty(storagevehicle_code)) {
|
||||
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
|
||||
JSONObject obj = vehicleTab.query("storagevehicle_code = '" + storagevehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(obj)) throw new BadRequestException("未发现载具号为【" + storagevehicle_code + "】的载具信息");
|
||||
|
||||
dto.setStoragevehicle_id(obj.getLong
|
||||
("storagevehicle_id"));
|
||||
dto.setStoragevehicle_type(obj.getString("storagevehicle_type"));
|
||||
}
|
||||
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.ext.mes.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -372,6 +373,8 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
public JSONObject childRollFGInboundComplete(JSONObject param) {
|
||||
log.info("childRollFGInboundComplete接口输入参数为:-------------------"+param.toString());
|
||||
|
||||
String PackageBoxSN = param.getString("PackageBoxSN");
|
||||
String User = param.getString("User");
|
||||
JSONObject result = new JSONObject();
|
||||
String isConnect = "1";
|
||||
if (StrUtil.equals("0", isConnect)) {
|
||||
@@ -381,7 +384,12 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
return result;
|
||||
}
|
||||
|
||||
JSONArray list = new JSONArray();
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("iPackageBoxSN",PackageBoxSN);
|
||||
jo.put("iSpec","FGPRODUCT");
|
||||
jo.put("iWarehouse","3");
|
||||
jo.put("iArrivalDate", DateUtil.now());
|
||||
jo.put("iUser", User);
|
||||
|
||||
// String url = acsUrl + api;
|
||||
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||
@@ -418,6 +426,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
public JSONObject childRollFGOutboundComplete(JSONObject param) {
|
||||
log.info("childRollFGOutboundComplete接口输入参数为:-------------------"+param.toString());
|
||||
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
String isConnect = "1";
|
||||
if (StrUtil.equals("0", isConnect)) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.MesToLmsService;
|
||||
import org.nl.wms.log.LokiLog;
|
||||
import org.nl.wms.log.LokiLogType;
|
||||
import org.nl.wms.pda.mps.service.OutService;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.tasks.CoolCutTask;
|
||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||
@@ -23,6 +24,8 @@ import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import sun.security.krb5.internal.crypto.Des;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -30,6 +33,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
|
||||
private final CheckOutBillService checkOutBillService;
|
||||
|
||||
private final OutService outService;
|
||||
|
||||
/**
|
||||
* 生箔烘箱:
|
||||
* 母卷批次创建信息发送智能物流(MES生箔工序Move In)
|
||||
@@ -563,7 +568,12 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
dtl.put("plan_qty",sub_jo.getString("net_weight"));
|
||||
rows.add(dtl);
|
||||
mst_jo.put("tableData",rows);
|
||||
checkOutBillService.insertDtl(mst_jo);
|
||||
String iostorinv_id = checkOutBillService.insertDtl(mst_jo);
|
||||
|
||||
//调用自动分配
|
||||
JSONObject out_jo = new JSONObject();
|
||||
out_jo.put("iostorinv_id",iostorinv_id);
|
||||
checkOutBillService.allDiv(out_jo);
|
||||
|
||||
}
|
||||
|
||||
@@ -594,6 +604,52 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
public JSONObject childRollCutStartComp(JSONArray param) {
|
||||
log.info("childRollCutStartComp接口输入参数为:-------------------" + param.toString());
|
||||
|
||||
String Status = param.getJSONObject(0).getString("Status");
|
||||
|
||||
if (Status.equals("1")){
|
||||
//更新分切计划表状态
|
||||
for (int i = 0; i < param.size(); i++) {
|
||||
JSONObject row = param.getJSONObject(i);
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '"+row.getString("ContainerGroup")+"'").uniqueResult(0);
|
||||
plan_jo.put("status","05");
|
||||
WQLObject.getWQLObject("pdm_bi_slittingproductionplan").update(plan_jo);
|
||||
}
|
||||
}
|
||||
|
||||
if (Status.equals("2")){
|
||||
String ResourceName = param.getJSONObject(0).getString("ResourceName");
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("ext_code = '"+ResourceName+"'").uniqueResult(0);
|
||||
String up_point_code = cut_jo.getString("up_point_code");
|
||||
String down_point_code = cut_jo.getString("down_point_code");
|
||||
|
||||
JSONArray up_rows = new JSONArray();
|
||||
JSONArray down_rows = new JSONArray();
|
||||
for (int i = 0; i < param.size(); i++) {
|
||||
JSONObject row = param.getJSONObject(i);
|
||||
//查询对应的分切计划
|
||||
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '"+row.getString("ContainerGroup")+"'").uniqueResult(0);
|
||||
if (row.getString("ContainerPosition").equals("1")){
|
||||
up_rows.add(row);
|
||||
}
|
||||
if (row.getString("ContainerPosition").equals("2")){
|
||||
down_rows.add(row);
|
||||
}
|
||||
}
|
||||
|
||||
if (up_rows.size()>0){
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("point_code",up_point_code);
|
||||
jo.put("cut_rows",up_rows);
|
||||
outService.confirm(jo);
|
||||
}
|
||||
if (down_rows.size()>0){
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("point_code",down_point_code);
|
||||
jo.put("cut_rows",down_rows);
|
||||
outService.confirm(jo);
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
@@ -645,7 +701,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jo.put("package_box_SN", PackageBoxSN);
|
||||
jo.put("package_box_sn", PackageBoxSN);
|
||||
jo.put("quanlity_in_box", QuanlityInBox);
|
||||
jo.put("box_weight", BoxWeight);
|
||||
jo.put("quality_guaran_period", QualityGuaranPeriod);
|
||||
|
||||
@@ -20,7 +20,7 @@ public class SubpackagerelationDto implements Serializable {
|
||||
private Long workorder_id;
|
||||
|
||||
/** 木箱唯一码 */
|
||||
private String package_box_SN;
|
||||
private String package_box_sn;
|
||||
|
||||
/** 箱内子卷数量 */
|
||||
private BigDecimal quanlity_in_box;
|
||||
|
||||
@@ -7,26 +7,29 @@ import lombok.Data;
|
||||
@Builder
|
||||
public class AcsTaskDto {
|
||||
//任务标识
|
||||
private String task_id;
|
||||
private String ext_task_id;
|
||||
//任务编码
|
||||
private String task_code;
|
||||
//任务类型
|
||||
private String task_type;
|
||||
//起点
|
||||
//取货点1
|
||||
private String start_device_code;
|
||||
//下一点
|
||||
//放货点1
|
||||
private String next_device_code;
|
||||
//载具号
|
||||
private String vehicle_code;
|
||||
//载具类型
|
||||
private String vehicle_type;
|
||||
//取货点2
|
||||
private String start_device_code2;
|
||||
//放货点2
|
||||
private String next_device_code2;
|
||||
//烘箱放货点
|
||||
private String put_device_code;
|
||||
//优先级
|
||||
private String priority;
|
||||
//载具号
|
||||
private String vehicle_code;
|
||||
//任务类型
|
||||
private String task_type;
|
||||
//Agv系统类型
|
||||
private String agv_system_type;
|
||||
//备注
|
||||
private String remark;
|
||||
//扩展参数
|
||||
private String params;
|
||||
//路由类型
|
||||
private String route_plan_code;
|
||||
|
||||
}
|
||||
|
||||
@@ -44,13 +44,12 @@ public class CoolCutTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.task_id(json.getString("task_id"))
|
||||
.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"))
|
||||
.vehicle_type(json.getString("vehicle_type"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
|
||||
@@ -43,13 +43,12 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.task_id(json.getString("task_id"))
|
||||
.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"))
|
||||
.vehicle_type(json.getString("vehicle_type"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
|
||||
@@ -39,13 +39,12 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.task_id(json.getString("task_id"))
|
||||
.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"))
|
||||
.vehicle_type(json.getString("vehicle_type"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
|
||||
@@ -41,13 +41,12 @@ public class InTask extends AbstractAcsTask {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.task_id(json.getString("task_id"))
|
||||
.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"))
|
||||
.vehicle_type(json.getString("vehicle_type"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
|
||||
@@ -68,12 +68,12 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
if (StrUtil.equals(status,"0")) {
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 取消删除任务
|
||||
taskTab.delete("task_id = '"+task_id+"'");
|
||||
taskTab.delete("task_id = '" + task_id + "'");
|
||||
|
||||
// 删除出入烘箱任务明细
|
||||
hotDtlTab.delete("task_id = '"+task_id+"'");
|
||||
hotDtlTab.delete("task_id = '" + task_id + "'");
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -89,12 +89,12 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
|
||||
}
|
||||
|
||||
if(StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
// 更改任务状态为完成
|
||||
jsonTask.put("task_status",TaskStatusEnum.FINISHED.getCode());
|
||||
jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
jsonTask.put("update_optid", currentUserId);
|
||||
jsonTask.put("update_optname", currentUsername);
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
@@ -127,10 +127,10 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
|
||||
// 更新烘箱区库存状态
|
||||
jsonHotIvt.put("point_status", "01");
|
||||
jsonHotIvt.put("container_name","" );
|
||||
jsonHotIvt.put("workorder_id","" );
|
||||
jsonHotIvt.put("ivt_qty",0 );
|
||||
jsonHotIvt.put("instorage_time","");
|
||||
jsonHotIvt.put("container_name", "");
|
||||
jsonHotIvt.put("workorder_id", "");
|
||||
jsonHotIvt.put("ivt_qty", 0);
|
||||
jsonHotIvt.put("instorage_time", "");
|
||||
jsonHotIvt.put("update_optid", currentUserId);
|
||||
jsonHotIvt.put("update_optname", currentUsername);
|
||||
jsonHotIvt.put("update_time", DateUtil.now());
|
||||
@@ -140,7 +140,7 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("iContainerName", jsonHotMst.getString("container_name"));
|
||||
param.put("iResourceName", jsonHotIvt.getString("point_code"));
|
||||
param.put("iMoveOutDate", DateUtil. now());
|
||||
param.put("iMoveOutDate", DateUtil.now());
|
||||
param.put("iabxActualBakingTemperature", jsonHotDtl.getDoubleValue("temperature"));
|
||||
param.put("iabxActualBakingTimer", jsonHotDtl.getDoubleValue("oven_time"));
|
||||
param.put("UserName", "");
|
||||
@@ -171,15 +171,15 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
|
||||
String point_code1 = form.getString("point_code1");
|
||||
String point_code2 = form.getString("point_code2");
|
||||
if (cutConveyorTask.isSingleTask(point_code1)){
|
||||
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
|
||||
if (cutConveyorTask.isSingleTask(point_code1)) {
|
||||
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||
}
|
||||
if (cutConveyorTask.isSingleTask(point_code2)){
|
||||
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
|
||||
if (cutConveyorTask.isSingleTask(point_code2)) {
|
||||
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
json.put("task_type", "010202");
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
@@ -191,10 +191,10 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
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","1" );
|
||||
json.put("priority", "1");
|
||||
json.put("acs_task_type", "1");
|
||||
tab.insert(json);
|
||||
|
||||
immediateNotifyAcs();
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@@ -206,7 +206,6 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.st.inbill.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -213,4 +214,13 @@ public class RawAssistIStorController {
|
||||
rawAssistIStorService.backConfirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/autoDis")
|
||||
@Log("自动分配")
|
||||
@ApiOperation("自动分配")
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> autoDis(@RequestBody JSONObject whereJson) {
|
||||
rawAssistIStorService.autoDis(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface CheckOutBillService {
|
||||
* {bill_code=, stor_id=1473161852946092032, stor_code=01, stor_name=原材料库, bill_status=10, total_qty=2, detail_count=1, bill_type=010201, remark=, biz_date=2022-01-08, create_mode=, tableData=[{material_id=1309, material_code=090301010001, bill_status=10, material_name=碳化钨粉 02, pcsn=, quality_scode=02, ivt_level=01, is_active=1, plan_qty=2, qty_unit_name=千克\公斤, qty_unit_id=1, remark=, edit=true}]}
|
||||
* /
|
||||
*/
|
||||
void insertDtl (JSONObject whereJson);
|
||||
String insertDtl (JSONObject whereJson);
|
||||
/**
|
||||
* 新增出库单
|
||||
* @param whereJson
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.st.inbill.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -58,4 +59,6 @@ public interface RawAssistIStorService {
|
||||
|
||||
JSONArray bucketDtl(Map whereJson);
|
||||
|
||||
JSONObject autoDis(JSONObject whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.st.inbill.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.math.MathUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -515,9 +516,9 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
//判断起点是否不为空
|
||||
JSONObject ios_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'").uniqueResult(0);
|
||||
|
||||
JSONObject sect_jo = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id ='"+sect_id+"'").uniqueResult(0);
|
||||
JSONObject sect_jo = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id ='" + sect_id + "'").uniqueResult(0);
|
||||
boolean is_virtual = false;
|
||||
if (sect_jo.getString("sect_type_attr").equals("09")){
|
||||
if (sect_jo.getString("sect_type_attr").equals("09")) {
|
||||
is_virtual = true;
|
||||
dis_map.put("task_id", map.get("iostorinv_id"));
|
||||
dis_map.put("work_status", "01");
|
||||
@@ -620,7 +621,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
}
|
||||
}
|
||||
//如果是虚拟区,直接更新完成分配任务
|
||||
if (is_virtual){
|
||||
if (is_virtual) {
|
||||
JSONObject dis_form = new JSONObject();
|
||||
dis_form.put("task_id", map.get("iostorinv_id"));
|
||||
inbillService.confirmDis(dis_form);
|
||||
@@ -790,6 +791,98 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject autoDis(JSONObject whereJson) {
|
||||
/*
|
||||
* 分配逻辑:
|
||||
* 1、先查找该木箱内属于什么物料、订单,定位到具体的块、排,查看是否存在空位
|
||||
* a、存在的话,优先放在这一块这一排中
|
||||
* b、不存在则根据该订单物料大概数量、选择数量相近的一个空巷道
|
||||
* 1)存在空巷道
|
||||
* 2)不存在,则找一个双通有空位置、数量相近的巷道
|
||||
* */
|
||||
|
||||
JSONObject struct_jo = new JSONObject();
|
||||
|
||||
String box_no = whereJson.getString("box_no");
|
||||
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query(" = '" + box_no + "' AND status < 2").uniqueResult(0);
|
||||
|
||||
String material_code = sub_jo.getString("product_name");
|
||||
|
||||
String sale_order_name = sub_jo.getString("sale_order_name");
|
||||
|
||||
HashMap<String, String> row_map = new HashMap<>();
|
||||
row_map.put("material_code", material_code);
|
||||
row_map.put("sale_order_name", sale_order_name);
|
||||
row_map.put("flag", "11");
|
||||
//查询到当前可用的巷道
|
||||
JSONObject row_jo = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(row_jo)) {
|
||||
String block_num = row_jo.getString("block_num");
|
||||
String row_num = row_jo.getString("row_num");
|
||||
String placement_type = row_jo.getString("placement_type");
|
||||
|
||||
if (placement_type.equals("01") || placement_type.equals("03")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_empty_seq").uniqueResult(0);
|
||||
} else {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_empty_seq desc").uniqueResult(0);
|
||||
}
|
||||
} else {
|
||||
//如果不存在相同订单物料的巷道
|
||||
|
||||
|
||||
/*//查询是否存在未完成的相同订单物流的入库单,如果存在则查询该排是否存在可用的仓位
|
||||
HashMap<String,String> io_map = new HashMap<>();
|
||||
io_map.put("flag","12");
|
||||
io_map.put("material_code",material_code);
|
||||
io_map.put("sale_order_name",sale_order_name);
|
||||
JSONArray io_rows = WQL.getWO("").addParamMap(io_map).process().getResultJSONArray(0);*/
|
||||
|
||||
//根据分切计划查询该订单物料大概还有多少未入
|
||||
row_map.put("flag", "12");
|
||||
JSONObject plan_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().uniqueResult(0);
|
||||
int box_num = (int) Math.ceil(plan_rows.size() / 3);
|
||||
|
||||
//查询数量与订单物料箱子数量相近的一排
|
||||
JSONObject empty_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "13").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(empty_row)) {
|
||||
String block_num = empty_row.getString("block_num");
|
||||
String row_num = empty_row.getString("row_num");
|
||||
String placement_type = empty_row.getString("placement_type");
|
||||
|
||||
if (placement_type.equals("01") || placement_type.equals("03")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_empty_seq").uniqueResult(0);
|
||||
} else {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_empty_seq desc").uniqueResult(0);
|
||||
}
|
||||
} else {
|
||||
//如果查询不到空的一排,则查询有空位双通的一排
|
||||
JSONObject have_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num").process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(have_row)) {
|
||||
String block_num = have_row.getString("block_num");
|
||||
String row_num = have_row.getString("row_num");
|
||||
|
||||
//判断该排是左边为空,还是右边为空
|
||||
JSONObject right_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' order by out_empty_seq").uniqueResult(0);
|
||||
JSONObject left_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' order by out_empty_seq desc").uniqueResult(0);
|
||||
if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !right_str.getString("lock_type").equals("1")){
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_empty_seq").uniqueResult(0);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !left_str.getString("lock_type").equals("1")){
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_empty_seq desc").uniqueResult(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(struct_jo)){
|
||||
throw new BadRequestException("未查询到可用的仓位!");
|
||||
}
|
||||
return struct_jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTask(Map whereJson) {
|
||||
@@ -914,7 +1007,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
task_map.put("update_optname", nickName);
|
||||
task_map.put("update_time", now);
|
||||
//修改分配表起点,任务表起点
|
||||
/* task_wql.update(task_map, "task_id = '" + task_id + "'");*/
|
||||
/* task_wql.update(task_map, "task_id = '" + task_id + "'");*/
|
||||
|
||||
//解锁原货位点位
|
||||
HashMap unlock_map = new HashMap();
|
||||
@@ -1018,9 +1111,9 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void confirmTask(Map whereJson) {
|
||||
//判断指令状态,只能下发生成、执行中状态的任务
|
||||
//判断指令状态,只能下发生成、执行中状态的任务
|
||||
String task_code = (String) whereJson.get("task_code");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_code = '"+task_code+"'").uniqueResult(0);
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_code = '" + task_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("请输入正确的任务号!");
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
输入.package_box_sn TYPEAS s_string
|
||||
输入.iostorinv_id TYPEAS s_string
|
||||
输入.iostorinvdtl_id TYPEAS s_string
|
||||
输入.sale_order_name TYPEAS s_string
|
||||
输入.material_code TYPEAS s_string
|
||||
输入.sql_str TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -390,6 +393,103 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "11"
|
||||
QUERY
|
||||
SELECT
|
||||
count(sa2.struct_code) AS num,
|
||||
sa2.block_num,
|
||||
sa2.row_num,
|
||||
sa2.placement_type
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
INNER JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt.pcsn
|
||||
LEFT JOIN st_ivt_structattr sa ON sa.struct_code = ivt.struct_code
|
||||
LEFT JOIN st_ivt_structattr sa2 ON sa2.row_num = sa.row_num AND sa2.block_num = sa.block_num
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
WHERE
|
||||
IFNULL(sa2.storagevehicle_code,'') = ''
|
||||
AND
|
||||
sa2.lock_type = '1'
|
||||
OPTION 输入.material_code <> ""
|
||||
mb.material_code = 输入.material_code
|
||||
ENDOPTION
|
||||
OPTION 输入.material_code <> ""
|
||||
sub.sale_order_name = 输入.sale_order_name
|
||||
ENDOPTION
|
||||
GROUP BY
|
||||
sa2.block_num,sa2.row_num
|
||||
ORDER BY
|
||||
sa.placement_type desc,num
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "12"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
pdm_bi_slittingproductionplan plan
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = plan.container_name
|
||||
WHERE
|
||||
IFNULL( sub.container_name, '' ) = ''
|
||||
AND
|
||||
plan.is_delete = '0'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "13"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
sa.block_num,
|
||||
sa.row_num,
|
||||
sa.placement_type,
|
||||
COUNT( sa.struct_code ) AS struct_num
|
||||
FROM
|
||||
st_ivt_structattr sa
|
||||
WHERE
|
||||
sa.is_delete = '0'
|
||||
AND is_used = '1'
|
||||
AND sa.sect_id = '1582991348217286656'
|
||||
GROUP BY
|
||||
sa.block_num,
|
||||
sa.row_num,
|
||||
sa.placement_type
|
||||
) a
|
||||
WHERE
|
||||
NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
block_num,
|
||||
row_num,
|
||||
placement_type
|
||||
FROM
|
||||
st_ivt_structattr sa2
|
||||
WHERE
|
||||
sa2.lock_type <> '1'
|
||||
OR IFNULL( sa2.storagevehicle_code, '' ) <> ''
|
||||
GROUP BY
|
||||
sa2.block_num,
|
||||
sa2.row_num,
|
||||
sa2.placement_type
|
||||
) b
|
||||
WHERE
|
||||
b.block_num = a.block_num
|
||||
AND
|
||||
b.row_num = a.row_num
|
||||
AND
|
||||
b.placement_type = a.placement_type
|
||||
)
|
||||
输入.sql_str
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
public Map<String, Object> queryAddDtl(Map whereJson, Pageable page) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
map.put("flag", "7");
|
||||
map.put("begin_time", MapUtil.getStr(whereJson,"begin_time"));
|
||||
map.put("end_time", MapUtil.getStr(whereJson,"end_time"));
|
||||
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
||||
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
||||
map.put("material_code", "%" + map.get("material_code") + "%");
|
||||
@@ -94,17 +94,17 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
String begin_time = map.get("begin_time");
|
||||
if (StrUtil.isNotEmpty(begin_time)) {
|
||||
map.put("begin_time", begin_time.substring(0,10));
|
||||
map.put("begin_time", begin_time.substring(0, 10));
|
||||
}
|
||||
String end_time = map.get("end_time");
|
||||
if (StrUtil.isNotEmpty(end_time)) {
|
||||
map.put("end_time", end_time.substring(0,10));
|
||||
map.put("end_time", end_time.substring(0, 10));
|
||||
}
|
||||
String source_bill_code = map.get("source_bill_code");
|
||||
if (StrUtil.isNotEmpty(source_bill_code)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String[] strs = source_bill_code.split(",");
|
||||
for(int i=0;i<strs.length;i++){
|
||||
for (int i = 0; i < strs.length; i++) {
|
||||
sb.append(",'" + strs[i] + "'");
|
||||
}
|
||||
String str = sb.toString();
|
||||
@@ -178,7 +178,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertDtl(JSONObject map) {
|
||||
public String insertDtl(JSONObject map) {
|
||||
//明细另一种写法
|
||||
//JSONArray jsonArr = JSONArray.fromObject(whereJson.get("tableData"));
|
||||
JSONArray rows = map.getJSONArray("tableData");
|
||||
@@ -192,7 +192,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
JSONObject jsonStor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_id ='" + MapUtil.getStr(map, "stor_id") + "'").uniqueResult(0);
|
||||
map.put("iostorinv_id", iostorinv_id);
|
||||
map.put("bill_code", bill_code);
|
||||
map.put("biz_date", map.getString("biz_date").substring(0,10));
|
||||
map.put("biz_date", map.getString("biz_date").substring(0, 10));
|
||||
String bill_type = (String) map.get("bill_type");
|
||||
map.put("buss_type", bill_type.substring(0, 4));
|
||||
map.put("io_type", "1");
|
||||
@@ -232,6 +232,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(jsonDtl);
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").insert(map);
|
||||
|
||||
return iostorinv_id;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user