|
|
@ -37,7 +37,6 @@ import org.nl.wms.sch_manage.service.ISchBaseTaskService; |
|
|
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint; |
|
|
|
import org.nl.wms.sch_manage.service.dao.SchBaseTask; |
|
|
|
import org.nl.wms.sch_manage.service.util.AbstractTask; |
|
|
|
import org.nl.wms.sch_manage.service.util.tasks.StOutTask; |
|
|
|
import org.nl.wms.warehouse_management.enums.IOSConstant; |
|
|
|
import org.nl.wms.warehouse_management.enums.IOSEnum; |
|
|
|
import org.nl.wms.warehouse_management.service.dao.GroupPlate; |
|
|
@ -195,7 +194,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PdaResponse getVehicleMaterial(JSONObject whereJson) { |
|
|
|
List<JSONObject> list = new ArrayList<JSONObject>(); |
|
|
|
List<JSONObject> list = new ArrayList<>(); |
|
|
|
whereJson.put("status", GROUP_PLATE_STATUS.code("入库")); |
|
|
|
whereJson.put("vehicleCode", whereJson.getString("search")); |
|
|
|
whereJson.put("qty", 0); |
|
|
@ -301,7 +300,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
taskForm.put("point_code1", json.getString("struct_code")); |
|
|
|
taskForm.put("point_code2", whereJson.getString("siteCode")); |
|
|
|
taskForm.put("vehicle_code", json.getString("storagevehicle_code")); |
|
|
|
taskForm.put("is_auto_confirm",(BaseDataEnum.IS_YES_NOT.code("是"))); |
|
|
|
taskForm.put("handle_status", (BaseDataEnum.IS_YES_NOT.code("否"))); |
|
|
|
taskForm.put("is_auto_confirm", (BaseDataEnum.IS_YES_NOT.code("是"))); |
|
|
|
String taskCode = applyTaskMap.get(IOSConstant.PDA_POINT_TASK).create(taskForm); |
|
|
|
GroupPlate plateDao = mdPbGroupplateMapper.selectOne( |
|
|
|
new LambdaQueryWrapper<GroupPlate>() |
|
|
@ -501,13 +501,10 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public PdaResponse bindOrUnbind(JSONObject whereJson) { |
|
|
|
String siteCode = whereJson.getString("siteCode"); |
|
|
|
String shelfCode = whereJson.getString("shelfCode"); |
|
|
|
String mode = whereJson.getString("mode"); |
|
|
|
SchBasePoint sitePoint; |
|
|
|
if (IOSEnum.BIND_OR_UNBIND.code("绑定").equals(mode)) { |
|
|
|
public PdaResponse bindOrUnbind(String siteCode, String shelfCode, String mode) { |
|
|
|
SchBasePoint sitePoint = new SchBasePoint(); |
|
|
|
// 校验站点是否存在、是否可用
|
|
|
|
if (StringUtils.isNotBlank(siteCode)) { |
|
|
|
sitePoint = iSchBasePointService.getOne( |
|
|
|
new LambdaQueryWrapper<SchBasePoint>() |
|
|
|
.eq(SchBasePoint::getPoint_code, siteCode) |
|
|
@ -516,6 +513,9 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
if (sitePoint == null) { |
|
|
|
throw new BadRequestException("输入的站点编号有误或被禁用,请检查!"); |
|
|
|
} |
|
|
|
} |
|
|
|
//绑定
|
|
|
|
if (IOSEnum.BIND_OR_UNBIND.code("绑定").equals(mode)) { |
|
|
|
Set<String> pointIds = new HashSet<>(); |
|
|
|
pointIds.add(siteCode); |
|
|
|
//校验是否有任务
|
|
|
@ -526,6 +526,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
",载具号为:" + activeTasks.get(0).getVehicle_code() + ",请稍后操作,或在WMS任务列表中检查。"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//解绑
|
|
|
|
if (StringUtils.isNotBlank(shelfCode)) { |
|
|
|
// 校验站点是否存在、是否可用
|
|
|
|
sitePoint = iSchBasePointService.getOne( |
|
|
@ -538,34 +539,22 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
return PdaResponse.requestOk(); |
|
|
|
} |
|
|
|
siteCode = sitePoint.getPoint_code(); |
|
|
|
} else { |
|
|
|
// 校验站点是否存在、是否可用
|
|
|
|
sitePoint = iSchBasePointService.getOne( |
|
|
|
new LambdaQueryWrapper<SchBasePoint>() |
|
|
|
.eq(SchBasePoint::getPoint_code, siteCode) |
|
|
|
.eq(SchBasePoint::getIs_used, true) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<>(); |
|
|
|
if (IOSEnum.BIND_OR_UNBIND.code("绑定").equals(mode)) { |
|
|
|
checkGroupPlateStatus(shelfCode, sitePoint.getRegion_code()); |
|
|
|
doBind(siteCode, shelfCode, wrapper); |
|
|
|
doBind(siteCode, shelfCode); |
|
|
|
} else { |
|
|
|
doUnbind(sitePoint, siteCode, wrapper); |
|
|
|
doUnbind(siteCode, sitePoint.getParent_point_code()); |
|
|
|
} |
|
|
|
wrapper.set(SchBasePoint::getUpdate_time, DateUtil.now()) |
|
|
|
.set(SchBasePoint::getIs_has_workder, BaseDataEnum.IS_YES_NOT.code("否")) |
|
|
|
.set(SchBasePoint::getIng_task_code, null) |
|
|
|
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName()); |
|
|
|
iSchBasePointService.update(wrapper); |
|
|
|
return PdaResponse.requestOk(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 绑定 |
|
|
|
*/ |
|
|
|
private void doBind(String siteCode, String shelfCode, LambdaUpdateWrapper<SchBasePoint> wrapper) { |
|
|
|
private void doBind(String siteCode, String shelfCode) { |
|
|
|
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<>(); |
|
|
|
SchBasePoint boundPoint = iSchBasePointService.getOne( |
|
|
|
new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, shelfCode) |
|
|
|
); |
|
|
@ -580,7 +569,12 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
} |
|
|
|
wrapper.eq(SchBasePoint::getPoint_code, siteCode) |
|
|
|
.set(SchBasePoint::getVehicle_code, shelfCode) |
|
|
|
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有货")); |
|
|
|
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有货")) |
|
|
|
.set(SchBasePoint::getUpdate_time, DateUtil.now()) |
|
|
|
.set(SchBasePoint::getIs_has_workder, BaseDataEnum.IS_YES_NOT.code("否")) |
|
|
|
.set(SchBasePoint::getIng_task_code, null) |
|
|
|
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName()); |
|
|
|
iSchBasePointService.update(wrapper); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -590,7 +584,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
List<GroupPlate> plates = mdPbGroupplateMapper.selectList( |
|
|
|
new LambdaQueryWrapper<GroupPlate>() |
|
|
|
.eq(GroupPlate::getStoragevehicle_code, shelfCode) |
|
|
|
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")) |
|
|
|
.lt(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库")) |
|
|
|
); |
|
|
|
if (CollectionUtils.isNotEmpty(plates)) { |
|
|
|
LambdaUpdateWrapper<GroupPlate> update = new LambdaUpdateWrapper<>(); |
|
|
@ -598,7 +592,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
if (!regionCode.equals(StatusEnum.REGION_INFO.code("商用线5号线"))) { |
|
|
|
update.set(GroupPlate::getFrozen_qty, BigDecimal.ZERO); |
|
|
|
} |
|
|
|
update.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库")) |
|
|
|
update.set(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库")) |
|
|
|
.in(GroupPlate::getGroup_id, plateCodes); |
|
|
|
mdPbGroupplateMapper.update(null, update); |
|
|
|
} |
|
|
@ -607,23 +601,33 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 解绑 |
|
|
|
* siteCode:地面站点 |
|
|
|
* parentPointCode:父级点位编码 |
|
|
|
*/ |
|
|
|
private void doUnbind(SchBasePoint sitePoint, String siteCode, LambdaUpdateWrapper<SchBasePoint> wrapper) { |
|
|
|
if (!"0".equals(sitePoint.getParent_point_code())) { |
|
|
|
private void doUnbind(String siteCode, String parentPointCode) { |
|
|
|
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(parentPointCode) && !"0".equals(parentPointCode)) { |
|
|
|
// 有同列的子站点,批量解绑
|
|
|
|
List<SchBasePoint> sameColumnPoints = iSchBasePointService.list( |
|
|
|
new LambdaQueryWrapper<SchBasePoint>() |
|
|
|
.eq(SchBasePoint::getParent_point_code, sitePoint.getParent_point_code()) |
|
|
|
.eq(SchBasePoint::getParent_point_code, parentPointCode) |
|
|
|
.eq(SchBasePoint::getIs_used, true) |
|
|
|
); |
|
|
|
if (CollectionUtils.isNotEmpty(sameColumnPoints)) { |
|
|
|
wrapper.in(SchBasePoint::getPoint_code, sameColumnPoints.stream() |
|
|
|
.map(SchBasePoint::getPoint_code) |
|
|
|
.collect(Collectors.toList())); |
|
|
|
} |
|
|
|
} else { |
|
|
|
wrapper.eq(SchBasePoint::getPoint_code, siteCode); |
|
|
|
} |
|
|
|
wrapper.set(SchBasePoint::getVehicle_code, null) |
|
|
|
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("无货")); |
|
|
|
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("无货")) |
|
|
|
.set(SchBasePoint::getUpdate_time, DateUtil.now()) |
|
|
|
.set(SchBasePoint::getIs_has_workder, BaseDataEnum.IS_YES_NOT.code("否")) |
|
|
|
.set(SchBasePoint::getIng_task_code, null) |
|
|
|
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName()); |
|
|
|
iSchBasePointService.update(wrapper); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|