Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -12,6 +12,7 @@ import org.nl.system.service.quartz.dao.SysQuartzJob;
|
||||
import org.nl.system.service.quartz.dao.SysQuartzLog;
|
||||
import org.nl.system.service.quartz.dao.mapper.SysQuartzLogMapper;
|
||||
import org.nl.system.service.quartz.impl.SysQuartzJobServiceImpl;
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@@ -28,6 +29,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
@Async
|
||||
@SuppressWarnings({"unchecked", "all"})
|
||||
@Slf4j
|
||||
@DisallowConcurrentExecution
|
||||
public class ExecutionJob extends QuartzJobBean {
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
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;
|
||||
@@ -354,7 +355,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到相同销售订单的放货区点位或空的一排!");
|
||||
} else {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' order by out_order_seq desc").uniqueResult(0);
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' order by out_order_seq ASC").uniqueResult(0);
|
||||
point_code = jsonNewRow.getString("point_code");
|
||||
}
|
||||
} else {
|
||||
@@ -385,7 +386,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到相同销售订单的放货区点位或空的一排!");
|
||||
} else {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' order by out_order_seq desc").uniqueResult(0);
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' order by out_order_seq ASC").uniqueResult(0);
|
||||
point_code = jsonNewRow.getString("point_code");
|
||||
}
|
||||
}
|
||||
@@ -409,6 +410,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
public JSONObject deviceApply(JSONObject whereJson) {
|
||||
log.info("deviceApply请求参数:---------------------------------------------"+whereJson.toString());
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String weight = whereJson.getString("weight");
|
||||
String type = whereJson.getString("type");
|
||||
if (StrUtil.isEmpty(type)) {
|
||||
throw new BadRequestException("任务类型不能为空!");
|
||||
@@ -422,6 +424,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("木箱码不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(weight)) {
|
||||
throw new BadRequestException("重量不能为空!");
|
||||
}
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||
@@ -447,7 +452,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONObject print_jo = new JSONObject();
|
||||
print_jo.put("box_no", vehicle_code);
|
||||
print_jo.put("print_type", print_info.getString("print_id"));
|
||||
printService.customerPrint(print_jo);
|
||||
print_jo.put("box_weight", weight);
|
||||
new PrintServiceImpl().customerPrint2(print_jo);
|
||||
} else if (type.equals("2")) {
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("木箱码不能为空!");
|
||||
|
||||
@@ -272,14 +272,14 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
//如果为左边点位判断右边是否存在未完成的任务,如果有则提示不能下发
|
||||
//判断输送出来的任务起点是否靠近分切机,如果靠近分切机且远离分切机的点位上存在载具且不存在任务进行载具横移
|
||||
char dtl_type = point_jo.getString("point_code").charAt(point_jo.getString("point_code").length() - 1);
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
|
||||
/*if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
|
||||
JSONObject right_point = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_location = '" + point_jo.getString("point_location") + "' AND product_area = '" + point_jo.getString("product_area") + "' AND sort_seq = '" + point_jo.getString("sort_seq") + "' order by point_code desc").uniqueResult(0);
|
||||
//判断是否存在任务
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '" + right_point.getString("point_code") + "' OR point_code2 = '" + right_point.getString("point_code") + "') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
throw new BadRequestException(point_jo.getString("point_code") + "所在一截输送线存在未完成的任务,请稍等几分钟后进行下发!");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//下发输送线任务
|
||||
JSONObject form = new JSONObject();
|
||||
|
||||
@@ -24,6 +24,13 @@ public interface PrintService {
|
||||
*/
|
||||
JSONObject customerPrint(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取单据类型
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject customerPrint2(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取单据类型
|
||||
* @param whereJson /
|
||||
|
||||
@@ -171,6 +171,136 @@ public class PrintServiceImpl implements PrintService {
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject customerPrint2(JSONObject whereJson) {
|
||||
JSONObject jo = new JSONObject();
|
||||
WQLObject printTab = WQLObject.getWQLObject("pdm_bi_printinfo");
|
||||
WQLObject custTab = WQLObject.getWQLObject("md_cs_customerbase");
|
||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||
|
||||
String box_no = whereJson.getString("box_no");
|
||||
|
||||
JSONObject box_jo = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(box_jo)) {
|
||||
throw new BadRequestException("未查询到木箱相关信息!");
|
||||
}
|
||||
//组织木箱打印信息
|
||||
//箱号
|
||||
String package_box_sn = box_jo.getString("package_box_sn");
|
||||
|
||||
String package_box_sn1 = "";
|
||||
String package_box_sn2 = "";
|
||||
try {
|
||||
// 木箱1
|
||||
package_box_sn1 = package_box_sn.substring(0,package_box_sn.indexOf("@")+1);
|
||||
// 木箱2
|
||||
package_box_sn2 = package_box_sn.substring(package_box_sn.indexOf("@") + 1, package_box_sn.length());
|
||||
} catch (Exception e) {
|
||||
package_box_sn2 = package_box_sn;
|
||||
}
|
||||
//订单号
|
||||
String sale_order_name = box_jo.getString("sale_order_name");
|
||||
//品名
|
||||
String product_description = box_jo.getString("product_description");
|
||||
//物料号
|
||||
String product_name = box_jo.getString("product_name");
|
||||
//规格: 厚度*幅宽
|
||||
String width = box_jo.getString("thickness_request")+"*"+box_jo.getString("width_standard");
|
||||
|
||||
//入库日期:取此箱子中最晚的入库日期
|
||||
JSONObject jsonInbound= subTab.query("package_box_sn = '" + box_no + "' order by date_of_fg_inbound DESC").uniqueResult(0);
|
||||
String date_of_FG_inbound = jsonInbound.getString("date_of_fg_inbound");
|
||||
//毛重
|
||||
String box_weight = NumberUtil.round(whereJson.getString("box_weight"),2).toString();
|
||||
//生产日期:取此箱子中最晚的生产日期
|
||||
JSONObject jsonProduction = subTab.query("package_box_sn = '" + box_no + "' order by date_of_production DESC").uniqueResult(0);
|
||||
String date_of_production = jsonProduction.getString("date_of_production");
|
||||
//批号
|
||||
String pcsn = jsonProduction.getString("date_of_production");
|
||||
if (ObjectUtil.isNotEmpty(pcsn)) {
|
||||
pcsn = pcsn.replaceAll("[[\\s-:punct:]]", "");
|
||||
}
|
||||
//卷数
|
||||
String quanlity_in_box = box_jo.getString("quanlity_in_box");
|
||||
//保质期
|
||||
String quality_guaran_period = box_jo.getString("quality_guaran_period");
|
||||
//检验员
|
||||
String nspector = "1";
|
||||
//储存条件
|
||||
String storage_conditions = "";
|
||||
|
||||
// 根据客户条件选择对应模板
|
||||
JSONObject jsonCust = custTab.query("cust_code = '" + box_jo.getString("customer_name") + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonCust)) throw new BadRequestException("客户不存在或未启用");
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonCust.getString("bz_print_no"))) throw new BadRequestException("请先设置客户打印模板");
|
||||
String bz_print_no = jsonCust.getString("bz_print_no");
|
||||
|
||||
double weight = 0;
|
||||
JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().getResultJSONArray(0);
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
weight += row.getDoubleValue("net_weight");
|
||||
}
|
||||
|
||||
// 生成txt文件
|
||||
JSONObject jsonPrint = printTab.query("print_id = '" + whereJson.getString("print_type") + "'").uniqueResult(0);
|
||||
//10.1.3.21/LMSPrinter/
|
||||
String filePath = jsonPrint.getString("print_route")+ "外包标签.txt";
|
||||
FileWriter fw = null;
|
||||
try {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
file.createNewFile();
|
||||
}
|
||||
fw = new FileWriter(filePath);
|
||||
OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
|
||||
BufferedWriter bw = new BufferedWriter(write);
|
||||
bw.write("bz_print_no,package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight,customer_name,customer_description,thickness,mass_per_unit_area,length,box_type,sap_pcsn,box_length,box_width,box_high\n");
|
||||
|
||||
bw.write(bz_print_no + ","
|
||||
+package_box_sn1 + ","
|
||||
+ package_box_sn2 + ","
|
||||
+ sale_order_name + ","
|
||||
+ product_description + ","
|
||||
+ product_name + ","
|
||||
+ width + ","
|
||||
+ pcsn + ","
|
||||
+ date_of_FG_inbound + ","
|
||||
+ box_weight + "KG,"
|
||||
+ date_of_production + ","
|
||||
+ quanlity_in_box + ","
|
||||
+ quality_guaran_period + ","
|
||||
+ nspector + ","
|
||||
+ storage_conditions + ","
|
||||
+ NumberUtil.round(weight,2).toString() + "KG,"
|
||||
+ box_jo.getString("customer_name") + ","
|
||||
+ box_jo.getString("customer_description") + ","
|
||||
+ box_jo.getString("thickness") + ","
|
||||
+ box_jo.getString("mass_per_unit_area") + ","
|
||||
+ box_jo.getString("length") + ","
|
||||
+ box_jo.getString("box_type") + ","
|
||||
+ box_jo.getString("sap_pcsn") + ","
|
||||
+ box_jo.getString("box_length") + ","
|
||||
+ box_jo.getString("box_width") + ","
|
||||
+ box_jo.getString("box_high") + "\n"
|
||||
);
|
||||
|
||||
bw.close();
|
||||
jo.put("message", "打印成功!");
|
||||
} catch (Exception e) {
|
||||
jo.put("message", "打印失败!"+e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
fw.close();
|
||||
} catch (Exception e) {
|
||||
jo.put("message", "打印失败!"+e.getMessage());
|
||||
}
|
||||
}
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject printType(JSONObject whereJson){
|
||||
JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag","6").process().getResultJSONArray(0);
|
||||
|
||||
@@ -19,13 +19,14 @@ public class AutoQueryDeviceStatus{
|
||||
//通过ACS接口获取温度
|
||||
JSONArray device_rows = WQL.getWO("PDA_02").addParam("flag","15").process().getResultJSONArray(0);
|
||||
JSONObject jo = wmsToAcsService.getPointStatus(device_rows);
|
||||
WQLObject ivtTab=WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
JSONArray de_rows = jo.getJSONArray("data");
|
||||
for (int i = 0; i < de_rows.size(); i++) {
|
||||
JSONObject row = de_rows.getJSONObject(i);
|
||||
String device_code = row.getString("device_code");
|
||||
JSONObject point_jo = WQLObject.getWQLObject("st_ivt_hotpointivt").query("point_code = '"+device_code+"'").uniqueResult(0);
|
||||
JSONObject point_jo = ivtTab.query("point_code = '"+device_code+"'").uniqueResult(0);
|
||||
point_jo.put("temperature",row.getString("temperature"));
|
||||
WQLObject.getWQLObject("st_ivt_hotpointivt").update(point_jo);
|
||||
ivtTab.update(point_jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,19 @@ public class EmptyVehicleTask extends AbstractAcsTask {
|
||||
// 更新删除字段
|
||||
map.put("is_delete","1");
|
||||
map.put("update_time", DateUtil.now());
|
||||
|
||||
HashMap<String, String> point_map = new HashMap<>();
|
||||
point_map.put("lock_type","1");
|
||||
if (task_jo.getString("task_type").equals("010502")) {
|
||||
point_table.update(point_map, "point_code = '" + task_jo.getString("point_code2") + "'");
|
||||
struct_table.update(point_map, "struct_code = '" + task_jo.getString("point_code2") + "'");
|
||||
}
|
||||
|
||||
if (task_jo.getString("task_type").equals("010504")) {
|
||||
point_table.update(point_map, "point_code = '" + task_jo.getString("point_code1") + "'");
|
||||
struct_table.update(point_map, "struct_code = '" + task_jo.getString("point_code1") + "'");
|
||||
}
|
||||
|
||||
}
|
||||
if (status.equals(TaskStatusEnum.EXECUTING.getCode())) {
|
||||
map.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
|
||||
@@ -11,12 +11,16 @@ import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.basedata.st.service.StructattrService;
|
||||
import org.nl.wms.basedata.st.service.dto.StructattrDto;
|
||||
import org.nl.wms.basedata.st.service.impl.StructattrServiceImpl;
|
||||
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.nl.wms.st.inbill.service.impl.InbillServiceImpl;
|
||||
import org.nl.wms.st.inbill.service.impl.RawAssistIStorServiceImpl;
|
||||
import org.nl.wms.st.inbill.service.impl.StorPublicServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,6 +32,7 @@ import java.util.Map;
|
||||
* Created by ZZ on 2021/12/22.
|
||||
*/
|
||||
public class InTask extends AbstractAcsTask {
|
||||
|
||||
private final String THIS_CLASS = InTask.class.getName();
|
||||
|
||||
@Override
|
||||
@@ -72,6 +77,8 @@ public class InTask extends AbstractAcsTask {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配表
|
||||
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库主表
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl"); // 出入库明细表
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
@@ -95,15 +102,83 @@ public class InTask extends AbstractAcsTask {
|
||||
inbillService.confirmDis(dis_form);
|
||||
}
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 更新删除字段
|
||||
WQLObject point_table = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject struct_table = WQLObject.getWQLObject("ST_IVT_StructAttr");
|
||||
|
||||
if (taskObj.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.ISSUE.getCode())) {
|
||||
throw new BadRequestException("任务已执行不能取消");
|
||||
}
|
||||
|
||||
// 更新任务表删除字段
|
||||
map.put("is_delete","1");
|
||||
|
||||
// 更新分配明细为:未生成
|
||||
JSONObject mapParam = new JSONObject();
|
||||
mapParam.put("work_status", "00");
|
||||
mapParam.put("point_id", "");
|
||||
JSONObject jsonDis = disTab.query("task_id ='" + taskObj.getString("task_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonDis)) throw new BadRequestException("分配明细不存在");
|
||||
String iostorinv_id = jsonDis.getString("iostorinv_id");
|
||||
|
||||
disTab.update(map,"task_id = '"+taskObj.getString("task_id")+"'");
|
||||
// 解锁货位
|
||||
HashMap unlock_map = new HashMap();
|
||||
unlock_map.put("lock_type", "1");
|
||||
unlock_map.put("taskdtl_type", "");
|
||||
unlock_map.put("taskdtl_id", "");
|
||||
unlock_map.put("task_code", "");
|
||||
unlock_map.put("inv_type", "");
|
||||
unlock_map.put("inv_id", "");
|
||||
unlock_map.put("inv_code", "");
|
||||
point_table.update(unlock_map, "point_code = '" + taskObj.get("point_code2") + "'");
|
||||
struct_table.update(unlock_map, "struct_code = '" + taskObj.get("point_code2") + "'");
|
||||
|
||||
//减去原货位的待入数
|
||||
JSONArray dis_rows = disTab.query("struct_code = '" + taskObj.get("point_code2") + "' AND work_status < '99'").getResultJSONArray(0);
|
||||
if (dis_rows.size() <= 0) {
|
||||
throw new BadRequestException("数据参数有误!");
|
||||
}
|
||||
|
||||
StructattrDto old_struct = new StructattrServiceImpl().findByCode(taskObj.getString("point_code2"));
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + dis_rows.getJSONObject(0).getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject i_form = new JSONObject();
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
i_form.put("struct_id", old_struct.getStruct_id());
|
||||
i_form.put("material_id", dis_row.getString("material_id"));
|
||||
i_form.put("quality_scode", dis_row.getString("quality_scode"));
|
||||
i_form.put("pcsn", dis_row.getString("pcsn"));
|
||||
i_form.put("ivt_level", dis_row.getString("ivt_level"));
|
||||
i_form.put("change_qty", dis_row.getString("plan_qty"));
|
||||
i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
|
||||
i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
|
||||
i_form.put("bill_code", mst_jo.getString("bill_code"));
|
||||
i_form.put("bill_table", "ST_IVT_IOStorInv");
|
||||
i_form.put("qty_unit_id", dis_row.getString("qty_unit_id"));
|
||||
i_form.put("qty_unit_name", dis_row.getString("qty_unit_name"));
|
||||
new StorPublicServiceImpl().IOStor(i_form,"32");
|
||||
}
|
||||
|
||||
// 修改主表状态为分配中:30
|
||||
JSONObject mstMap = new JSONObject();
|
||||
mstMap.put("bill_status", "30");
|
||||
mstMap.put("update_optid", currentUserId);
|
||||
mstMap.put("update_optname", nickName);
|
||||
mstMap.put("update_time", now);
|
||||
mstTab.update(mstMap,"iostorinv_id = '"+iostorinv_id+"'");
|
||||
|
||||
// 修改明细状态为生成:10
|
||||
JSONObject dtlMap = new JSONObject();
|
||||
dtlMap.put("bill_status", "10");
|
||||
dtlTab.update(dtlMap,"iostorinv_id = '"+iostorinv_id+"'");
|
||||
|
||||
// 更新分配明细为:未生成:00,清空对应字段
|
||||
JSONObject disMap = new JSONObject();
|
||||
disMap.put("work_status", "00");
|
||||
disMap.put("point_id", "");
|
||||
disMap.put("task_id", "");
|
||||
disMap.put("sect_id", "");
|
||||
disMap.put("sect_code", "");
|
||||
disMap.put("sect_name", "");
|
||||
disMap.put("struct_id", "");
|
||||
disMap.put("struct_code", "");
|
||||
disMap.put("struct_name", "");
|
||||
disTab.update(disMap,"task_id = '"+taskObj.getString("task_id")+"'");
|
||||
}
|
||||
map.put("update_optid", currentUserId);
|
||||
map.put("update_optname", nickName);
|
||||
|
||||
@@ -156,7 +156,7 @@ public class OutTask extends AbstractAcsTask {
|
||||
String sort_seq_last = NumberUtil.sub(jsonTask.getString("sort_seq"), "1").toString();
|
||||
|
||||
JSONObject jsonTaskLast = taskTab.query("task_group_id = '" + task_group_id + "' and sort_seq = '" + sort_seq_last + "' and task_status <> '07'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonTaskLast)) throw new BadRequestException("请先完成"+jsonTaskLast.getString("task_code")+"的任务!");
|
||||
// if (ObjectUtil.isNotEmpty(jsonTaskLast)) throw new BadRequestException("请先完成"+jsonTaskLast.getString("task_code")+"的任务!");
|
||||
}
|
||||
|
||||
// 调用标识完成
|
||||
|
||||
@@ -840,14 +840,36 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
String placement_type = row_jo.getString("placement_type");
|
||||
|
||||
if (placement_type.equals("02")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
|
||||
// 左通
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else if(placement_type.equals("03")) {
|
||||
// 右通
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
|
||||
} else {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
|
||||
// 双通
|
||||
// 先倒序找到第一个木箱、判断上一个是否有货位
|
||||
JSONObject jsonDescBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
|
||||
String out_order_seq = jsonDescBox.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
String out_order_seq_desc = String.valueOf(NumberUtil.add(out_order_seq, "1"));
|
||||
JSONObject jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_desc+"'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
||||
struct_jo = jsonDescStruct;
|
||||
} else {
|
||||
// 没有就正序找到第一个物料、判断上一个是否有货位
|
||||
JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
|
||||
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
String out_order_seq_asc = String.valueOf(NumberUtil.sub(out_order_seq2, "1"));
|
||||
JSONObject jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_asc+"'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAscStruct)) struct_jo = jsonAscStruct;
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
//如果不存在相同订单物料的巷道
|
||||
|
||||
|
||||
/*//查询是否存在未完成的相同订单物流的入库单,如果存在则查询该排是否存在可用的仓位
|
||||
HashMap<String,String> io_map = new HashMap<>();
|
||||
io_map.put("flag","12");
|
||||
@@ -877,11 +899,12 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
String placement_type = empty_row.getString("placement_type");
|
||||
|
||||
if (placement_type.equals("02")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '" + placement_type + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq desc").uniqueResult(0);
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '" + placement_type + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '" + placement_type + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq").uniqueResult(0);
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '" + placement_type + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq DESC").uniqueResult(0);
|
||||
}
|
||||
} else {
|
||||
|
||||
//如果查询不到空的一排,则查询有空位双通的一排
|
||||
JSONObject have_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().uniqueResult(0);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
ORDER BY po.out_order_seq desc
|
||||
ORDER BY po.out_order_seq ASC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
@@ -143,7 +143,7 @@
|
||||
LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num
|
||||
WHERE
|
||||
IFNULL( point2.vehicle_code, '' ) <> ''
|
||||
AND point1.out_order_seq > point2.out_order_seq
|
||||
AND point1.out_order_seq < point2.out_order_seq
|
||||
AND point2.point_type = '9'
|
||||
|
||||
OPTION 输入.point_code <> ""
|
||||
|
||||
@@ -3931,7 +3931,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
JSONObject jsonSub = subTab.query("container_name = '" + dis.getString("pcsn") + "' and package_box_sn = '" + dis.getString("box_no") + "' and status = '2'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSub)) throw new BadRequestException("此子卷不存在或不为入库状态:" + dis.getString("pcsn"));
|
||||
// 如果是拆分入库则将包装关系改为生成状态
|
||||
if (jo_mst.getString("bill_type").equals("1005") || (jo_mst.getString("bill_type").equals("1009") && StrUtil.isEmpty(dtl_jo.getString("source_bill_code")))) {
|
||||
if (jo_mst.getString("bill_type").equals("1005") || (jo_mst.getString("bill_type").equals("1009"))) {
|
||||
jsonSub.put("status", "0");
|
||||
} else {
|
||||
jsonSub.put("status", "3");
|
||||
@@ -4339,8 +4339,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
String sort_seq_last = NumberUtil.sub(task.getString("sort_seq"), "1").toString();
|
||||
|
||||
JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' and sort_seq = '" + sort_seq_last + "' and task_status <> '07'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonTaskLast))
|
||||
throw new BadRequestException("请先完成" + jsonTaskLast.getString("task_code") + "的任务!");
|
||||
// if (ObjectUtil.isNotEmpty(jsonTaskLast)) throw new BadRequestException("请先完成" + jsonTaskLast.getString("task_code") + "的任务!");
|
||||
}
|
||||
|
||||
JSONObject dtljo = wo_dis.query("task_id='" + task_id + "'").uniqueResult(0);
|
||||
|
||||
Reference in New Issue
Block a user