This commit is contained in:
lyd
2022-10-26 19:32:17 +08:00
4 changed files with 17 additions and 78 deletions

View File

@@ -52,7 +52,7 @@ public class InTask extends AbstractAcsTask {
map.put("update_optid",currentUserId);
map.put("update_optname",nickName);
map.put("update_time",now);
WQLObject.getWQLObject("SCH_BASE_Task").update(map,"taskdtl_id = '"+taskObj.getString("taskdtl_id")+"'");
WQLObject.getWQLObject("SCH_BASE_Task").update(map,"task_id = '"+taskObj.getString("task_id")+"'");
}
@Override

View File

@@ -87,8 +87,6 @@ public class InbillServiceImpl {
case "2":
//解锁终点,绑定载具
String vehicle_code = form.getString("vehicle_code");
String storagevehicle_id = form.getString("storagevehicle_id");
String storagevehicle_type = form.getString("storagevehicle_type");
map.put("lock_type", "00");
map.put("point_status", "02");
map.put("vehicle_code", vehicle_code);
@@ -100,10 +98,8 @@ public class InbillServiceImpl {
map.put("inv_code", "");
point_table.update(map, "point_code = '" + end_point + "'");
HashMap<String, String> struct_map = new HashMap<>();
struct_map.put("storagevehicle_id", storagevehicle_id);
struct_map.put("lock_type", "00");
struct_map.put("storagevehicle_code", vehicle_code);
struct_map.put("storagevehicle_type", storagevehicle_type);
struct_map.put("taskdtl_type", "");
struct_map.put("taskdtl_id", "");
struct_map.put("task_code", "");
@@ -119,7 +115,6 @@ public class InbillServiceImpl {
public void confirmDis(JSONObject form) {
WQLObject dis_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
WQLObject dtl_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
WQLObject pcs_if_purchaseorderproc = WQLObject.getWQLObject("pcs_if_purchaseorderproc");
String task_id = form.getString("task_id");
if (StrUtil.isEmpty(task_id)) {
@@ -146,18 +141,6 @@ public class InbillServiceImpl {
dtl_row.put("real_qty", real_qty);
dtl_table.update(dtl_row);
//判断是否为软废采购入库,修改采购入库单
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + dis_row.getString("iostorinv_id") + "'").uniqueResult(0);
if (mst_jo.getString("bill_type").equals("000202")) {
String bill_id = dtl_row.getString("base_billdtl_id");
JSONArray bill_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("base_billdtl_id = '" + bill_id + "' AND bill_status < '99'").getResultJSONArray(0);
if (bill_rows.size() == 0) {
HashMap<String, String> bill_map = new HashMap<>();
bill_map.put("proc_status", "09");
pcs_if_purchaseorderproc.update(bill_map, "id = '" + bill_id + "'");
}
}
//判断主表是否改为完成
JSONArray dtl_rows = dtl_table.query("iostorinv_id = '" + dtl_row.getString("iostorinv_id") + "' AND bill_status < '99'").getResultJSONArray(0);
if (dtl_rows.size() == 0) {
@@ -171,11 +154,6 @@ public class InbillServiceImpl {
public void confirmMst(JSONObject from) {
WQLObject dtl_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
WQLObject dis_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
WQLObject bucket_table = WQLObject.getWQLObject("md_pb_bucketrecord");
WQLObject reMstTab = WQLObject.getWQLObject("PCS_RC_ReceiveMst"); //到货通知单主表
WQLObject reDtlTab = WQLObject.getWQLObject("PCS_RC_ReceiveDtl"); //到货通知单明细表
WQLObject procTab = WQLObject.getWQLObject("PCS_IF_PurchaseOrderProc"); //采购订单接口处理表
WQLObject dtlTab = WQLObject.getWQLObject("QL_TEST_InspectionSheetDtl"); //质检单明细表
String iostorinv_id = from.getString("iostorinv_id");
Long currentUserId = SecurityUtils.getCurrentUserId();
@@ -184,7 +162,6 @@ public class InbillServiceImpl {
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
String bill_type = mst_jo.getString("bill_type");
//查询
JSONArray dtl_rows = dtl_table.query("iostorinv_id = '" + iostorinv_id + "' AND bill_status < '99'").getResultJSONArray(0);
@@ -222,13 +199,6 @@ public class InbillServiceImpl {
i_form.put("qty_unit_name", dis_row.getString("qty_unit_name"));
storPublicService.IOStor(i_form, "33");
//更新桶记录表
HashMap bucket_map = new HashMap();
bucket_map.put("status", "03");
bucket_map.put("instor_optid", currentUserId);
bucket_map.put("instor_optname", nickName);
bucket_map.put("instor_time", now);
bucket_table.update(bucket_map, "storagevehicle_code = '" + dis_row.getString("storagevehicle_code") + "' AND status = '02'");
//如果单据为原辅料入库,且为寄样合格,回写到货通知单
@@ -237,26 +207,6 @@ public class InbillServiceImpl {
mst_jo.put("confirm_optid", currentUserId);
mst_jo.put("confirm_optname", nickName);
mst_jo.put("confirm_time", now);
if("000101".equals(bill_type)){
//查询
dtl_rows = dtl_table.query("iostorinv_id = '" + iostorinv_id + "' AND bill_status = '99'").getResultJSONArray(0);
for(int i=0; i<dtl_rows.size();i++){
boolean flag = false;
JSONObject jo = dtl_rows.getJSONObject(i);
String quality_scode = jo.getString("quality_scode");
if("01".equals(quality_scode)){//合格
flag = true;
}else if("00".equals(quality_scode)){//待检品
String material_id = jo.getString("material_id");
String pcsn = jo.getString("pcsn");
JSONObject dtl = dtlTab.query("bill_status='99' and material_id='"+material_id+"' and pcsn='"+pcsn+"' and result='01'").uniqueResult(0);
if(dtl!=null){
flag = true;
}
}
}
}
//更新主表状态为99
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);

View File

@@ -18,7 +18,6 @@ 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.master.service.dto.MaterialbaseDto;
import org.nl.wms.basedata.master.service.dto.StoragevehicleinfoDto;
import org.nl.wms.basedata.st.service.StorattrService;
import org.nl.wms.basedata.st.service.StructattrService;
import org.nl.wms.basedata.st.service.dto.StorattrDto;
@@ -30,7 +29,7 @@ import org.nl.wms.sch.service.dto.PointDto;
import org.nl.wms.sch.service.dto.TaskDto;
import org.nl.wms.st.inbill.service.RawAssistIStorService;
import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.task.InTask;
import org.nl.wms.sch.tasks.InTask;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -713,9 +712,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
task_form.put("taskdtl_type", "01");
task_form.put("start_device_code", point_code);
task_form.put("next_device_code", ios_dis.getString("struct_code"));
task_form.put("storagevehicle_id", map.get("storagevehicle_id"));
task_form.put("vehicle_code", map.get("storagevehicle_code"));
task_form.put("storagevehicle_type", map.get("storagevehicle_type"));
task_form.put("vehicle_code", map.get("box_no"));
//查询主表信息
JSONObject mst = WQLObject.getWQLObject("st_ivt_iostorinv").query("iostorinv_id = '" + map.get("iostorinv_id") + "'").uniqueResult(0);
task_form.put("inv_type", mst.get("bill_type"));
@@ -730,7 +727,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
if (StrUtil.isNotEmpty(ios_dis.getString("struct_code"))) {
//修改库存
//直接取出入库分配表的库存
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + map.get("iostorinv_id") + "' AND storagevehicle_code = '" + map.get("storagevehicle_code") + "'").getResultJSONArray(0);
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'").getResultJSONArray(0);
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + map.get("iostorinv_id") + "'").uniqueResult(0);
for (int i = 0; i < dis_rows.size(); i++) {
JSONObject dis_jo = dis_rows.getJSONObject(i);
@@ -738,7 +735,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "'").uniqueResult(0);
if (dtl_jo.getDoubleValue("unassign_qty") == 0) {
//判断该明细下是否还存在未分配货位的分配明细
JSONArray disdiv_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "' AND (struct_id = '' OR struct_id is null) AND (point_code = '' OR point_code is null)").getResultJSONArray(0);
JSONArray disdiv_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "' AND (struct_id = '' OR struct_id is null) AND (point_id = '' OR point_id is null)").getResultJSONArray(0);
if (disdiv_rows.size() == 0) {
dtl_jo.put("bill_status", "40");
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
@@ -1005,28 +1002,19 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
@Override
@Transactional(rollbackFor = Exception.class)
public void confirmTask(Map whereJson) {
WQLObject dis_wql = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
WQLObject dtl_wql = WQLObject.getWQLObject("st_ivt_iostorinvdtl");
//校验主表状态为分配中、分配完
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
if (!mst_jo.getString("bill_status").equals("30") && !mst_jo.getString("bill_status").equals("40")) {
throw new BadRequestException("主表状态必须为分配中、分配完!");
//判断指令状态,只能下发生成、执行中状态的任务
String task_code = (String) whereJson.get("task_code");
TaskDto taskDto = taskService.findByCode(task_code);
if (ObjectUtil.isEmpty(taskDto)) {
throw new BadRequestException("请输入正确的任务号!");
}
/*if (!taskDto.getTask_status().equals("03")) {
throw new BadRequestException("只能修改任务状态为执行中的任务!");
}*/
//分配中任务状态必须全部为完成
JSONArray dis_rows = dis_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "' AND work_status < '99'").getResultJSONArray(0);
if (dis_rows.size() > 0) {
throw new BadRequestException("存在未完成的作业,或存在组盘记录!");
}
//将明细全部变为99
HashMap map = new HashMap();
map.put("bill_status", "99");
dtl_wql.update(map, "iostorinv_id = '" + whereJson.get("iostorinv_id") + "' AND bill_status < '99'").getResultJSONArray(0);
//完成单据
inbillService.confirmMst(JSONObject.parseObject(JSON.toJSONString(whereJson)));
JSONObject task_jo = JSONObject.parseObject(JSON.toJSONString(taskDto));
AbstractAcsTask task = new InTask();
task.updateTaskStatus(task_jo, "2");
}
@Override

View File

@@ -418,6 +418,7 @@ public class StorPublicServiceImpl implements StorPublicService {
}
jo_in.put("stor_code", jo.getString("stor_code"));
jo_in.put("stor_id", jo.getString("stor_id"));
jo_in.put("stor_name", jo.getString("stor_name"));
this.createStructIvtFlow(jo_in);
}
}