dev:代码规范

This commit is contained in:
2023-12-13 10:10:16 +08:00
parent 52a0ba88ea
commit 10b0e6c2eb
3 changed files with 42 additions and 115 deletions

View File

@@ -187,13 +187,6 @@ public class FaultDeviceServiceImpl implements FaultDeviceService {
}
}
// 组织分页查询并返回
// Map<String, Object> json = PageUtil.toPage(
// PageUtil.toPage(page.getPageNumber(), page.getPageSize(), objects),
// objects.size()
// );
JSONObject json = new JSONObject();
json.put("content", objects);
return json;

View File

@@ -6,28 +6,22 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.system.service.ParamService;
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.modules.wql.util.WqlUtil;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.pda.st.service.CoolInService;
import org.nl.wms.pda.st.service.ProductInstorService;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.tasks.CutConveyorTask;
import org.nl.wms.sch.tasks.InTask;
import org.nl.wms.st.inbill.service.RawAssistIStorService;
import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.inbill.service.impl.InbillServiceImpl;

View File

@@ -69,7 +69,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
private final RedissonClient redissonClient;
@Override
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
HashMap<String, String> map = new HashMap<>();
@@ -192,8 +191,8 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
row.put("iostorinv_id", iostorinv_id);
row.put("seq_no", (i + 1) + "");
JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + row.get("product_name") + "'").uniqueResult(0);
if(ObjectUtil.isEmpty(material)){
throw new BadRequestException("LMS系统不存在物料"+row.get("product_name")+"】,请确认物料是否正确或SAP系统是否推送到LMS系统");
if (ObjectUtil.isEmpty(material)) {
throw new BadRequestException("LMS系统不存在物料" + row.get("product_name") + "】,请确认物料是否正确或SAP系统是否推送到LMS系统");
}
row.put("material_id", material.getString("material_id"));
row.put("pcsn", row.get("container_name"));
@@ -220,18 +219,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
throw new BadRequestException("木箱:" + row.get("package_box_sn") + "已存在库内,请对数据进行核实!");
}
/*//如果是退货入库,查询对应的包装关系维护交货单号和交货单行号
if (whereJson.get("bill_type").equals("0002")) {
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("container_name = '" + row.get("container_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)) {
throw new BadRequestException("未查询到对应的子卷包装关系!");
}
row.put("vbeln", sub_jo.getString("vbeln"));
row.put("posnr", sub_jo.getString("posnr"));
}*/
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(row);
JSONObject dis = new JSONObject();
@@ -253,7 +240,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
//将包装关系中对应的记录状态改为包装
HashMap<String, String> map = new HashMap<>();
map.put("status", "1");
if (whereJson.get("bill_type").equals("0003")) {
if ("0003".equals(whereJson.get("bill_type"))) {
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + dis.getString("box_no") + "' AND status = '3'");
} else {
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + dis.getString("box_no") + "' AND status = '0'");
@@ -325,7 +312,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
@Override
public void update(Map whereJson) {
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
if (!mst_jo.getString("bill_status").equals("10")) {
if (!"10".equals(mst_jo.getString("bill_status"))) {
throw new BadRequestException("主表状态必须为生成!");
}
String currentUserId = SecurityUtils.getCurrentUserId();
@@ -349,7 +336,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String box_no = dis_row.getString("box_no");
//将状态为包装的改为生成
HashMap<String, String> map = new HashMap<>();
if (whereJson.get("bill_type").equals("0003")) {
if ("0003".equals(whereJson.get("bill_type"))) {
map.put("status", "3");
} else {
map.put("status", "0");
@@ -365,8 +352,8 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
row.put("iostorinv_id", iostorinv_id);
row.put("seq_no", (i + 1) + "");
JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + row.get("product_name") + "'").uniqueResult(0);
if(ObjectUtil.isEmpty(material)){
throw new BadRequestException("LMS系统不存在物料"+row.get("product_name")+"】,请确认物料是否正确或SAP系统是否推送到LMS系统");
if (ObjectUtil.isEmpty(material)) {
throw new BadRequestException("LMS系统不存在物料" + row.get("product_name") + "】,请确认物料是否正确或SAP系统是否推送到LMS系统");
}
row.put("material_id", material.getString("material_id"));
row.put("pcsn", row.get("container_name"));
@@ -380,16 +367,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String net_weight = row.get("net_weight");
row.put("box_no", row.get("package_box_sn"));
/*//如果是退货入库,查询对应的包装关系维护交货单号和交货单行号
if (whereJson.get("bill_type").equals("0002")) {
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("container_name = '" + row.get("container_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)) {
throw new BadRequestException("未查询到对应的子卷包装关系!");
}
row.put("vbeln", sub_jo.getString("vbeln"));
row.put("posnr", sub_jo.getString("posnr"));
}*/
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(row);
JSONObject dis = new JSONObject();
@@ -410,7 +387,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
//将包装关系中对应的记录状态改为包装
HashMap<String, String> map = new HashMap<>();
map.put("status", "1");
if (whereJson.get("bill_type").equals("0003")) {
if ("0003".equals(whereJson.get("bill_type"))) {
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + dis.getString("box_no") + "' AND status = '3'");
} else {
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + dis.getString("box_no") + "' AND status = '0'");
@@ -422,7 +399,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
public void commit(Map whereJson) {
String iostorinv_id = (String) whereJson.get("iostorinv_id");
JSONObject mst = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
if (!mst.getString("bill_status").equals("10")) {
if (!"10".equals(mst.getString("bill_status"))) {
throw new BadRequestException("请选择单据状态为生成的进行提交!");
}
HashMap<String, String> map = new HashMap<>();
@@ -515,7 +492,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String need_sect = (String) whereJson.get("sect_id");
JSONObject need_sect_jo = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id = '" + need_sect + "'").uniqueResult(0);
//判断是否为主存区,主存区调用自动分配,虚拟区调用普通查询
if (StrUtil.isNotEmpty(need_sect) && !need_sect_jo.getString("sect_type_attr").equals("00")) {
if (StrUtil.isNotEmpty(need_sect) && !"00".equals(need_sect_jo.getString("sect_type_attr"))) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("sect_id = '" + need_sect + "' AND lock_type = '1' AND is_delete = '0' AND IFNULL( storagevehicle_code, '' ) = ''").uniqueResult(0);
} else {
jo_form.put("sect_id", whereJson.get("sect_id"));
@@ -549,7 +526,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
// 入库木箱上线
String in_up_box_high = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("in_up_box_high").getValue();
if (Double.parseDouble(in_download_box_high) < box_high && box_high <= Double.parseDouble(in_up_box_high)) {
if (Double.parseDouble(in_download_box_high) < box_high && box_high <= Double.parseDouble(in_up_box_high)) {
if (StrUtil.equals(jsonAttr.getString("layer_num"), "3")) {
if (box_high > jsonAttr.getDoubleValue("height")) {
throw new BadRequestException("木箱高度不符,请检查!");
@@ -595,7 +572,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
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 ("09".equals(sect_jo.getString("sect_type_attr"))) {
is_virtual = true;
String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
dis_map.put("task_id", task_id);
@@ -697,12 +674,12 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String iostorinv_id = form.getString("iostorinv_id");
String sect_id = form.getString("sect_id");
JSONObject sect_jo = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id = '"+sect_id+"'").uniqueResult(0);
if (!sect_jo.getString("sect_type_attr").equals("09")){
JSONObject sect_jo = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id = '" + sect_id + "'").uniqueResult(0);
if (!"09".equals(sect_jo.getString("sect_type_attr"))) {
throw new BadRequestException("只能对虚拟区的库区进行全部分配!");
}
//查询当前入库单状态为生成的入库单明细
JSONArray dis_rows =WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' AND work_status = '00'").getResultJSONArray(0);
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' AND work_status = '00'").getResultJSONArray(0);
HashSet<String> vehicle_set = new HashSet<>();
for (int j = 0; j < dis_rows.size(); j++) {
JSONObject dtl_row = dis_rows.getJSONObject(j);
@@ -723,18 +700,18 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
List<Map> list = new ArrayList<>();
for (int i = 0; i < dtl_rows.size(); i++) {
JSONObject jo = dtl_rows.getJSONObject(i);
list.add(JSON.parseObject(jo.toString(),Map.class));
list.add(JSON.parseObject(jo.toString(), Map.class));
}
Map<String,Object> dis_map = new HashMap<>();
dis_map.put("tableMater",list);
dis_map.put("sect_id",sect_id);
dis_map.put("checked",true);
Map<String, Object> dis_map = new HashMap<>();
dis_map.put("tableMater", list);
dis_map.put("sect_id", sect_id);
dis_map.put("checked", true);
this.divStruct(dis_map);
}
}else {
} else {
throw new BadRequestException("其他入库单当前正在分配货位,请等待几秒再进行操作!");
}
}finally {
} finally {
if (tryLock) {
lock.unlock();
}
@@ -951,7 +928,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
// 木箱高度大于入库上限 报错
if (box_high > Double.parseDouble(in_up_box_high)) {
throw new BadRequestException("木箱:"+sub_jo.getString("package_box_sn")+"高度不符合要求,请检查!");
throw new BadRequestException("木箱:" + sub_jo.getString("package_box_sn") + "高度不符合要求,请检查!");
}
row_map.put("in_layer_num", in_layer_num);
@@ -968,7 +945,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
// 判断此排是否有除:入库锁、移入锁以外的锁
JSONArray isLock = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('1','2','7') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(isLock)) {
if (placement_type.equals("02")) {
if ("02".equals(placement_type)) {
// 左通
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);
@@ -980,7 +957,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
}
}
break;
} else if (placement_type.equals("03")) {
} else if ("03".equals(placement_type)) {
// 右通
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);
@@ -1075,7 +1052,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String row_num2 = empty_row.getString("row_num");
String placement_type2 = empty_row.getString("placement_type");
if (placement_type.equals("02")) {
if ("02".equals(placement_type)) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
// 判断是否是第三层 且高度是否超过仓位高度
@@ -1213,7 +1190,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String row_num = empty_row.getString("row_num");
String placement_type = empty_row.getString("placement_type");
if (placement_type.equals("02")) {
if ("02".equals(placement_type)) {
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 {
@@ -1354,7 +1331,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
// 判断此排是否有除:入库锁、移入锁以外的锁
JSONArray isLock = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('1','2','7') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(isLock)) {
if (placement_type.equals("02")) {
if ("02".equals(placement_type)) {
// 左通
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);
@@ -1366,7 +1343,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
}
}
break;
} else if (placement_type.equals("03")) {
} else if ("03".equals(placement_type)) {
// 右通
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);
@@ -1461,7 +1438,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String row_num2 = empty_row.getString("row_num");
String placement_type2 = empty_row.getString("placement_type");
if (placement_type.equals("02")) {
if ("02".equals(placement_type)) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
// 判断是否是第三层 且高度是否超过仓位高度
@@ -1599,7 +1576,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String row_num = empty_row.getString("row_num");
String placement_type = empty_row.getString("placement_type");
if (placement_type.equals("02")) {
if ("02".equals(placement_type)) {
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 DESC").uniqueResult(0);
@@ -1721,7 +1698,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String row_num2 = empty_row.getString("row_num");
String placement_type2 = empty_row.getString("placement_type");
if (placement_type.equals("02")) {
if ("02".equals(placement_type)) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "' 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_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq DESC").uniqueResult(0);
@@ -1738,10 +1715,10 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
//判断该排是左边为空,还是右边为空
JSONObject right_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq").uniqueResult(0);
JSONObject left_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq desc").uniqueResult(0);
if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !right_str.getString("lock_type").equals("1")) {
if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !"1".equals(right_str.getString("lock_type"))) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
}
if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !left_str.getString("lock_type").equals("1")) {
if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !"1".equals(left_str.getString("lock_type"))) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
}
}
@@ -1758,18 +1735,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
WQLObject point_table = WQLObject.getWQLObject("SCH_BASE_Point");
WQLObject struct_table = WQLObject.getWQLObject("ST_IVT_StructAttr");
//判断指令状态,只能修改生成状态的任务
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("01")) {
throw new BadRequestException("只能修改任务状态为生成的任务");
}*/
//判断入库点是否修改
// 判断入库点是否修改
if (!whereJson.get("point_code").equals(whereJson.get("new_point_code"))) {
HashMap<String, String> dis_map = new HashMap<>();
HashMap<String, String> task_map = new HashMap<>();
@@ -1802,7 +1768,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
str_map.put("struct_name", structattrDto.getStruct_name());
dis_wql.update(str_map, "task_id = '" + whereJson.get("task_id") + "'");
//原货位解锁,新货位加锁
// 原货位解锁,新货位加锁
HashMap unlock_map = new HashMap();
unlock_map.put("lock_type", "1");
point_table.update(unlock_map, "point_code = '" + whereJson.get("struct_code") + "'");
@@ -1852,17 +1818,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
WQLObject point_table = WQLObject.getWQLObject("SCH_BASE_Point");
WQLObject struct_table = WQLObject.getWQLObject("ST_IVT_StructAttr");
//判断指令状态,只能修改生成状态的任务
/* String task_id = (String) whereJson.get("task_id");
TaskDto taskDto = taskService.findByDtlId(task_id);
if (ObjectUtil.isEmpty(taskDto)) {
throw new BadRequestException("请输入正确的任务号");
}
if (!taskDto.getTask_status().equals("01")) {
throw new BadRequestException("只能修改任务状态为生成的任务");
}*/
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
@@ -1874,7 +1829,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 = '" + whereJson.get("task_id") + "'");
task_wql.update(task_map, "task_id = '" + whereJson.get("task_id") + "'");
//解锁原货位点位
HashMap unlock_map = new HashMap();
@@ -1948,7 +1903,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
if (ObjectUtil.isEmpty(task_jo)) {
throw new BadRequestException("请输入正确的任务号!");
}
if (!task_jo.getString("task_status").equals("04")) {
if (!"04".equals(task_jo.getString("task_status"))) {
throw new BadRequestException("只能修改任务状态为未下发的任务!");
}
AbstractAcsTask task = new InTask();
@@ -1977,9 +1932,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
if (ObjectUtil.isEmpty(task_jo)) {
throw new BadRequestException("请输入正确的任务号!");
}
/*if (!task_jo.getString("task_status").equals("03")) {
throw new BadRequestException("只能修改任务状态为执行中的任务");
}*/
AbstractAcsTask task = new InTask();
task.updateTaskStatus(task_jo, TaskStatusEnum.FINISHED.getCode());
@@ -1991,20 +1943,8 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
WQLObject task_wql = WQLObject.getWQLObject("SCH_BASE_Task");
WQLObject dtl_wql = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
//判断指令状态,只能取消完成状态的任务
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("99")) {
throw new BadRequestException("只能取消任务状态为完成中的任务");
}*/
//判断主表是否为99如果为99不允许取消
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
if (mst_jo.getString("bill_status").equals("99")) {
if ("99".equals(mst_jo.getString("bill_status"))) {
throw new BadRequestException("单据已完成,无法进行取消任务操作!");
}
@@ -2038,7 +1978,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
//校验主表状态为分配中、分配完
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")) {
if (!"30".equals(mst_jo.getString("bill_status")) && !"40".equals(mst_jo.getString("bill_status"))) {
throw new BadRequestException("主表状态必须为分配中、分配完!");
}
@@ -2065,7 +2005,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
//校验主表状态为生成
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
if (!mst_jo.getString("bill_status").equals("10")) {
if (!"10".equals(mst_jo.getString("bill_status"))) {
throw new BadRequestException("主表状态必须为生成!");
}