opt:捆扎逻辑修改
This commit is contained in:
@@ -39,6 +39,8 @@ import org.nl.modules.common.exception.BadRequestException;
|
|||||||
import org.nl.modules.common.utils.RedisUtils;
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.system.service.dict.dao.Dict;
|
||||||
|
import org.nl.system.service.dict.dao.mapper.SysDictMapper;
|
||||||
import org.nl.system.service.param.ISysParamService;
|
import org.nl.system.service.param.ISysParamService;
|
||||||
import org.nl.system.service.param.dao.Param;
|
import org.nl.system.service.param.dao.Param;
|
||||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
@@ -82,6 +84,9 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
|
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysDictMapper sysDictMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private LmsToMesService lmsToMesService;
|
private LmsToMesService lmsToMesService;
|
||||||
|
|
||||||
@@ -317,10 +322,15 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
|
|
||||||
whereJson.put("material_barcode", material_barcode);
|
whereJson.put("material_barcode", material_barcode);
|
||||||
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("盘点入库"));
|
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("盘点入库"));
|
||||||
if (whereJson.getString("vehicle_code").startsWith("YNY")) {
|
|
||||||
|
|
||||||
//whereJson.put("move_block_num", "4");
|
List<Dict> dict = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>()
|
||||||
} else{
|
.eq( Dict::getCode, "inventory_block_point")
|
||||||
|
.eq(Dict::getValue, point_code));
|
||||||
|
|
||||||
|
if (whereJson.getString("vehicle_code").startsWith("YNY")) {
|
||||||
|
whereJson.put("move_block_num", "4");
|
||||||
|
} else if(!CollectionUtils.isEmpty(dict)){
|
||||||
|
whereJson.put("move_block_num", dict.get(0).getLabel());
|
||||||
// whereJson.put("move_block_num", "2");
|
// whereJson.put("move_block_num", "2");
|
||||||
}
|
}
|
||||||
if (!whereJson.containsKey("point_code")) {
|
if (!whereJson.containsKey("point_code")) {
|
||||||
|
|||||||
@@ -129,6 +129,11 @@ public class TwoLashTask extends AbstractAcsTask {
|
|||||||
isBinding = IOSEnum.IS_NOTANDYES.code("否");
|
isBinding = IOSEnum.IS_NOTANDYES.code("否");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(IOSEnum.IS_NOTANDYES.code("是").equals(isBinding) && IOSEnum.IS_NOTANDYES.code("否").equals(json.getString("is_auto_issue"))){
|
||||||
|
isBinding = IOSEnum.IS_NOTANDYES.code("否");
|
||||||
|
}
|
||||||
|
|
||||||
interaction_json.put("isBinding", isBinding);
|
interaction_json.put("isBinding", isBinding);
|
||||||
|
|
||||||
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
||||||
|
|||||||
@@ -112,8 +112,9 @@
|
|||||||
FROM
|
FROM
|
||||||
ST_IVT_IOStorInvDis dis
|
ST_IVT_IOStorInvDis dis
|
||||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn
|
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn
|
||||||
|
LEFT JOIN st_ivt_iostorinv inv on dis.iostorinv_id = inv.iostorinv_id
|
||||||
WHERE
|
WHERE
|
||||||
dis.work_status = '00'
|
dis.work_status = '00' and inv.io_type = '1'
|
||||||
<if test="iostorinvdtl_id != null and iostorinvdtl_id != ''">
|
<if test="iostorinvdtl_id != null and iostorinvdtl_id != ''">
|
||||||
AND dis.iostorinvdtl_id= #{iostorinvdtl_id}
|
AND dis.iostorinvdtl_id= #{iostorinvdtl_id}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.sun.xml.bind.v2.TODO;
|
import com.sun.xml.bind.v2.TODO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.b_lms.sch.point.dao.SchBasePoint;
|
import org.nl.b_lms.sch.point.dao.SchBasePoint;
|
||||||
import org.nl.b_lms.sch.point.dao.mapper.SchBasePointMapper;
|
import org.nl.b_lms.sch.point.dao.mapper.SchBasePointMapper;
|
||||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||||
@@ -38,9 +39,11 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
|||||||
import org.nl.system.service.param.ISysParamService;
|
import org.nl.system.service.param.ISysParamService;
|
||||||
import org.nl.system.service.param.dao.Param;
|
import org.nl.system.service.param.dao.Param;
|
||||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
|
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.pda.st.service.impl.PrintServiceImpl;
|
import org.nl.wms.pda.st.service.impl.PrintServiceImpl;
|
||||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -108,6 +111,9 @@ public class LashManageServiceImpl implements LashManageService {
|
|||||||
private final ISysParamService iSysParamService;
|
private final ISysParamService iSysParamService;
|
||||||
private final SchBaseTaskMapper schBaseTaskMapper;
|
private final SchBaseTaskMapper schBaseTaskMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WmsToAcsService wmsToAcsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void createLashTask(JSONObject whereJson) {
|
public void createLashTask(JSONObject whereJson) {
|
||||||
@@ -197,6 +203,12 @@ public class LashManageServiceImpl implements LashManageService {
|
|||||||
if (jsonPoint.getString("point_code").equals(IOSEnum.POINT_CODE.code("1124"))) {
|
if (jsonPoint.getString("point_code").equals(IOSEnum.POINT_CODE.code("1124"))) {
|
||||||
checkMove();
|
checkMove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (jsonPoint.getString("point_code").equals(IOSEnum.POINT_CODE.code("1125"))) {
|
||||||
|
checkMove2();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
end_point = jsonPoint.getString("point_code");
|
end_point = jsonPoint.getString("point_code");
|
||||||
schBasePointMapper.updateById(JSON.parseObject(jsonPoint.toString(), SchBasePoint.class));
|
schBasePointMapper.updateById(JSON.parseObject(jsonPoint.toString(), SchBasePoint.class));
|
||||||
@@ -237,6 +249,11 @@ public class LashManageServiceImpl implements LashManageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
end_point = jsonPoint.getString("point_code");
|
end_point = jsonPoint.getString("point_code");
|
||||||
|
|
||||||
|
if (jsonPoint.getString("point_code").equals(IOSEnum.POINT_CODE.code("1125")) && empPointList.size() == 2) {
|
||||||
|
checkMove3();
|
||||||
|
}
|
||||||
|
|
||||||
schBasePointMapper.updateById(JSON.parseObject(jsonPoint.toString(), SchBasePoint.class));
|
schBasePointMapper.updateById(JSON.parseObject(jsonPoint.toString(), SchBasePoint.class));
|
||||||
|
|
||||||
boolean remove_flag = iBstIvtBoxlashboundService.remove(new QueryWrapper<BstIvtBoxlashbound>().lambda()
|
boolean remove_flag = iBstIvtBoxlashboundService.remove(new QueryWrapper<BstIvtBoxlashbound>().lambda()
|
||||||
@@ -534,4 +551,152 @@ public class LashManageServiceImpl implements LashManageService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验1124捆扎位是否可以强制离开
|
||||||
|
*/
|
||||||
|
private void checkMove2() {
|
||||||
|
// 判断1125工位是否有有货
|
||||||
|
SchBasePoint pointDao = schBasePointMapper.selectOne(
|
||||||
|
new QueryWrapper<SchBasePoint>().lambda()
|
||||||
|
.eq(SchBasePoint::getPoint_code, IOSEnum.POINT_CODE.code("1125"))
|
||||||
|
);
|
||||||
|
|
||||||
|
SchBasePoint pointDao2 = schBasePointMapper.selectOne(
|
||||||
|
new QueryWrapper<SchBasePoint>().lambda()
|
||||||
|
.eq(SchBasePoint::getPoint_code, IOSEnum.POINT_CODE.code("1124"))
|
||||||
|
);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(pointDao.getVehicle_code()) && pointDao.getVehicle_qty().intValue() == 1
|
||||||
|
&& ObjectUtil.isNotEmpty(pointDao2.getVehicle_code()) && pointDao2.getVehicle_qty().intValue() == 1
|
||||||
|
) {
|
||||||
|
// 判断是否还有去1125工位的行架任务
|
||||||
|
List<SchBaseTask> taskList = ischBaseTaskService.list(
|
||||||
|
new QueryWrapper<SchBaseTask>().lambda()
|
||||||
|
.eq(SchBaseTask::getTask_type, TASKEnum.LASH_TYPE.code("捆扎桁架任务"))
|
||||||
|
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||||
|
.eq(SchBaseTask::getPoint_code2, IOSEnum.POINT_CODE.code("1125"))
|
||||||
|
.ne(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 判断是否还有去1124工位的行架任务
|
||||||
|
List<SchBaseTask> taskList2 = ischBaseTaskService.list(
|
||||||
|
new QueryWrapper<SchBaseTask>().lambda()
|
||||||
|
.eq(SchBaseTask::getTask_type, TASKEnum.LASH_TYPE.code("捆扎桁架任务"))
|
||||||
|
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||||
|
.eq(SchBaseTask::getPoint_code2, IOSEnum.POINT_CODE.code("1124"))
|
||||||
|
.ne(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//判断当前点位是否有托盘
|
||||||
|
JSONObject device_jo = new JSONObject();
|
||||||
|
device_jo.put("device_code", IOSEnum.POINT_CODE.code("1125"));
|
||||||
|
device_jo.put("product_area", IOSEnum.PRODUCT_AREA.code("BLK"));
|
||||||
|
|
||||||
|
JSONArray device_ja = new JSONArray();
|
||||||
|
device_ja.add(device_jo);
|
||||||
|
JSONObject device_data = wmsToAcsService.getPointStatus(device_ja);
|
||||||
|
JSONObject data = device_data.getJSONArray("data").getJSONObject(0);
|
||||||
|
|
||||||
|
// 如果是不为空的则下发强制离开
|
||||||
|
if (ObjectUtil.isNotEmpty(taskList) && ObjectUtil.isEmpty(taskList2) && data.getIntValue("move") == 0) {
|
||||||
|
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
|
JSONArray action_rows = new JSONArray();
|
||||||
|
JSONObject action_jo = new JSONObject();
|
||||||
|
action_jo.put("device_code", IOSEnum.POINT_CODE.code("1124"));
|
||||||
|
action_jo.put("code", "to_command");
|
||||||
|
action_jo.put("product_area", "BLK");
|
||||||
|
action_jo.put("value", "26");
|
||||||
|
action_rows.add(action_jo);
|
||||||
|
wmsToAcsService.action(action_rows);
|
||||||
|
|
||||||
|
JSONArray action_rows2 = new JSONArray();
|
||||||
|
JSONObject action_jo2 = new JSONObject();
|
||||||
|
action_jo2.put("device_code", "MXDDHJ");
|
||||||
|
action_jo2.put("product_area", "BLK");
|
||||||
|
action_jo2.put("code", "to_command");
|
||||||
|
action_jo2.put("value", "1124");
|
||||||
|
action_rows2.add(action_jo2);
|
||||||
|
wmsToAcsService.action(action_rows2);
|
||||||
|
|
||||||
|
// 更新点位数量
|
||||||
|
pointDao.setVehicle_qty(BigDecimal.valueOf(0));
|
||||||
|
pointDao.setVehicle_code("");
|
||||||
|
schBasePointMapper.updateById(pointDao);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验1125是否有托盘
|
||||||
|
*/
|
||||||
|
private void checkMove3() {
|
||||||
|
// 判断1124工位是否有有货
|
||||||
|
SchBasePoint pointDao = schBasePointMapper.selectOne(
|
||||||
|
new QueryWrapper<SchBasePoint>().lambda()
|
||||||
|
.eq(SchBasePoint::getPoint_code, IOSEnum.POINT_CODE.code("1124"))
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// 判断是否还有去1125工位的行架任务
|
||||||
|
List<SchBaseTask> taskList = ischBaseTaskService.list(
|
||||||
|
new QueryWrapper<SchBaseTask>().lambda()
|
||||||
|
.eq(SchBaseTask::getTask_type, TASKEnum.LASH_TYPE.code("捆扎桁架任务"))
|
||||||
|
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||||
|
.eq(SchBaseTask::getPoint_code2, IOSEnum.POINT_CODE.code("1125"))
|
||||||
|
.ne(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||||
|
);
|
||||||
|
|
||||||
|
List<SchBaseTask> taskList2 = ischBaseTaskService.list(
|
||||||
|
new QueryWrapper<SchBaseTask>().lambda()
|
||||||
|
.eq(SchBaseTask::getTask_type, TASKEnum.LASH_TYPE.code("捆扎桁架任务"))
|
||||||
|
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||||
|
.eq(SchBaseTask::getPoint_code2, IOSEnum.POINT_CODE.code("1124"))
|
||||||
|
.ne(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (StringUtils.isBlank(pointDao.getVehicle_code()) && pointDao.getVehicle_qty().intValue() == 0
|
||||||
|
) {
|
||||||
|
|
||||||
|
//判断当前点位是否有托盘
|
||||||
|
JSONObject device_jo = new JSONObject();
|
||||||
|
device_jo.put("device_code", IOSEnum.POINT_CODE.code("1125"));
|
||||||
|
device_jo.put("product_area", IOSEnum.PRODUCT_AREA.code("BLK"));
|
||||||
|
|
||||||
|
JSONArray device_ja = new JSONArray();
|
||||||
|
device_ja.add(device_jo);
|
||||||
|
JSONObject device_data = wmsToAcsService.getPointStatus(device_ja);
|
||||||
|
JSONObject data = device_data.getJSONArray("data").getJSONObject(0);
|
||||||
|
|
||||||
|
// 如果托盘为空
|
||||||
|
if (ObjectUtil.isEmpty(taskList) && ObjectUtil.isEmpty(taskList2) && data.getIntValue("move") == 0) {
|
||||||
|
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
|
JSONArray action_rows = new JSONArray();
|
||||||
|
JSONObject action_jo = new JSONObject();
|
||||||
|
action_jo.put("device_code", IOSEnum.POINT_CODE.code("1124"));
|
||||||
|
action_jo.put("code", "to_command");
|
||||||
|
action_jo.put("product_area", "BLK");
|
||||||
|
action_jo.put("value", "26");
|
||||||
|
action_rows.add(action_jo);
|
||||||
|
wmsToAcsService.action(action_rows);
|
||||||
|
|
||||||
|
JSONArray action_rows2 = new JSONArray();
|
||||||
|
JSONObject action_jo2 = new JSONObject();
|
||||||
|
action_jo2.put("device_code", "MXDDHJ");
|
||||||
|
action_jo2.put("product_area", "BLK");
|
||||||
|
action_jo2.put("code", "to_command");
|
||||||
|
action_jo2.put("value", "1124");
|
||||||
|
action_rows2.add(action_jo2);
|
||||||
|
wmsToAcsService.action(action_rows2);
|
||||||
|
|
||||||
|
// 更新点位数量
|
||||||
|
pointDao.setVehicle_qty(BigDecimal.valueOf(0));
|
||||||
|
pointDao.setVehicle_code("");
|
||||||
|
schBasePointMapper.updateById(pointDao);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
AND attr.block_num = #{param.block_num}
|
AND attr.block_num = #{param.block_num}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.row_num != '' || param.row_num != null ">
|
<if test="param.row_num != '' || param.row_num != null ">
|
||||||
AND attr.row_num != #{param.row_num}
|
AND attr.row_num = #{param.row_num}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -153,6 +153,11 @@ public class AcsToWmsController {
|
|||||||
|
|
||||||
@PostMapping("/deviceApplyTwo")
|
@PostMapping("/deviceApplyTwo")
|
||||||
@Log(value = "二期发货申请捆扎、贴标", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "二期发货申请捆扎、贴标", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
|
@ApiLog(
|
||||||
|
bizCode = "/api/wms/task/deviceApplyTwo",
|
||||||
|
bizDesc = "二期发货申请捆扎、贴标",
|
||||||
|
systemFlag = "acs"
|
||||||
|
)
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> deviceApplyTwo(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> deviceApplyTwo(@RequestBody JSONObject whereJson) {
|
||||||
return new ResponseEntity<>(acsToWmsService.deviceApplyTwo(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(acsToWmsService.deviceApplyTwo(whereJson), HttpStatus.OK);
|
||||||
|
|||||||
@@ -175,7 +175,6 @@ public abstract class AbstractAcsTask {
|
|||||||
List<SchBaseTask> outBigTaskList = workingTaskList.stream().filter(task->oneFloorReturnBigVehicleOutTaskStartPoint.contains(task.getPoint_code2())).collect(Collectors.toList());
|
List<SchBaseTask> outBigTaskList = workingTaskList.stream().filter(task->oneFloorReturnBigVehicleOutTaskStartPoint.contains(task.getPoint_code2())).collect(Collectors.toList());
|
||||||
List<SchBaseTask> outSmallTaskList = workingTaskList.stream().filter(task->oneFloorReturnSmallVehicleOutTaskStartPoint.contains(task.getPoint_code2())).collect(Collectors.toList());
|
List<SchBaseTask> outSmallTaskList = workingTaskList.stream().filter(task->oneFloorReturnSmallVehicleOutTaskStartPoint.contains(task.getPoint_code2())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
if(CollectionUtil.isEmpty(taskList)){
|
if(CollectionUtil.isEmpty(taskList)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -197,6 +196,7 @@ public abstract class AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||||
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(taskList));
|
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(taskList));
|
||||||
if (acsUtil == null) {
|
if (acsUtil == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user