rev:1.成品出库分配站点设置明细显示 2.成品出库分配查询站点下拉框未锁定的 3.配粉发货区锁定4.新增页面:成品发货区

This commit is contained in:
2023-08-18 09:42:00 +08:00
parent 2300b7db66
commit 8da0178d04
7 changed files with 272 additions and 10 deletions

View File

@@ -139,5 +139,13 @@ public class SchBasePointController {
}
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/outUnLock")
@Log("发货区解锁")
//("发货区解锁")
public ResponseEntity<Object> outUnLock(@RequestBody JSONObject whereJson) {
basePointService.outUnLock(whereJson);
return new ResponseEntity<>( HttpStatus.OK);
}
}

View File

@@ -62,4 +62,10 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
* @param jo
*/
void taskOperate(JSONObject jo);
/**
* 发货区解锁
* @param whereJson
*/
void outUnLock(JSONObject whereJson);
}

View File

@@ -1,6 +1,7 @@
package org.nl.wms.scheduler_manage.service.point.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -17,6 +18,7 @@ import org.nl.common.enums.StatusEnum;
import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.DateUtil;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.scheduler_manage.service.point.ISchBasePointService;
import org.nl.wms.scheduler_manage.service.point.dao.SchBasePoint;
@@ -25,8 +27,10 @@ import org.nl.wms.scheduler_manage.service.region.ISchBaseRegionService;
import org.nl.wms.scheduler_manage.service.region.dao.SchBaseRegion;
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.storage_manage.IOSEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
@@ -220,4 +224,26 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.set("lock_type",StatusEnum.LOCK_OFF.getCode()).set("point_code",one.getPoint_code2()));
}
}
@Override
@Transactional
public void outUnLock(JSONObject whereJson) {
JSONArray data = whereJson.getJSONArray("data");
ArrayList<SchBasePoint> listDao = new ArrayList<>();
for (int i = 0; i < data.size(); i++) {
JSONObject json = data.getJSONObject(i);
json.put("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"));
json.put("vehicle_code","");
json.put("update_id",SecurityUtils.getCurrentUserId());
json.put("update_name",SecurityUtils.getCurrentNickName());
json.put("update_time", new Date());
listDao.add(JSONObject.toJavaObject(json, SchBasePoint.class));
}
this.updateBatchById(listDao);
}
}

View File

@@ -439,6 +439,7 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
new QueryWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getIs_delete, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getIs_used, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.eq(SchBasePoint::getRegion_code, PDAEnum.REGION_CODE.code("发货区域"))
.orderByAsc(SchBasePoint::getPoint_code)
@@ -460,9 +461,16 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
}
}
if (ObjectUtil.isEmpty(pointDao)) throw new BadRequestException("出库点位为空,请检查!");
if (ObjectUtil.isEmpty(pointDao)) throw new BadRequestException("出库点位为空,请检查是否有空位或未解锁");
}
// 锁定出库点位
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("出库锁"))
.eq(SchBasePoint::getPoint_code, pointDao.getPoint_code())
);
// 2.2 生成任务
PointEvent event = PointEvent.builder()
.type(AcsTaskEnum.TASK_STRUCT_CP_OUT)
@@ -480,6 +488,21 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
whereJson.put("task_id", disDao.getTask_id());
sendTask(whereJson);
// 2.4 更新明细表已设置站点 - remark_ext
List<StIvtIostorinvdisCp> disList = iostorinvdisCpService.list(
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
.eq(StIvtIostorinvdisCp::getIostorinv_id, disDao.getIostorinv_id())
.eq(StIvtIostorinvdisCp::getStoragevehicle_code, disDao.getStoragevehicle_code())
);
for (StIvtIostorinvdisCp row : disList) {
iostorinvdtlCpService.update(
new UpdateWrapper<StIvtIostorinvdtlCp>().lambda()
.set(StIvtIostorinvdtlCp::getRemark_ext, "已设置站点")
.eq(StIvtIostorinvdtlCp::getIostorinvdtl_id, row.getIostorinvdtl_id())
);
}
}
// 3.更新分配表
iostorinvdisCpService.update(
@@ -534,10 +557,14 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
.eq(SchBasePoint::getIs_delete, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getIs_used, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getRegion_code, PDAEnum.REGION_CODE.code("发货区域"))
.eq(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.orderByAsc(SchBasePoint::getPoint_code)
);
// 校验货位数量是否满足
if (disMapList.size() > pointList.size()) throw new BadRequestException("发货区点位不足!");
for (String struct_code : disMapList.keySet()) {
StIvtIostorinvdisCp disDao = disMapList.get(struct_code).get(0);
@@ -581,11 +608,30 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
.eq(StIvtIostorinvdisCp::getStoragevehicle_code, disDao.getStoragevehicle_code())
);
// 6.更新发货区点位
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("出库锁"))
.eq(SchBasePoint::getPoint_code, dao.getPoint_code())
);
break;
}
}
}
// 6.更新明细为已设置站点 - remark_ext
for (List<StIvtIostorinvdisCp> disList : disMapList.values()) {
disList.forEach(item -> {
iostorinvdtlCpService.update(
new UpdateWrapper<StIvtIostorinvdtlCp>().lambda()
.set(StIvtIostorinvdtlCp::getRemark_ext, "已设置站点")
.eq(StIvtIostorinvdtlCp::getIostorinvdtl_id, item.getIostorinvdtl_id())
);
});
}
}
@Override
@@ -663,6 +709,15 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
.eq(MdPbBucketrecord::getMaterial_id, dao.getMaterial_id())
.eq(MdPbBucketrecord::getStatus, MasterEnum.BOX_STATUS.code("出库"))
);*/
// 5) 更新发货区终点
if (ObjectUtil.isNotEmpty(dao.getPoint_code())) {
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getVehicle_code,dao.getStoragevehicle_code() )
.eq(SchBasePoint::getPoint_code, dao.getPoint_code())
);
}
}
// 5.更新箱记录表为出库
@@ -751,6 +806,8 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
String task_id = form.getString("task_id");
String status = form.getString("status");
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getOne(new QueryWrapper<StIvtIostorinvdisCp>().lambda()
.eq(StIvtIostorinvdisCp::getTask_id, task_id),false);
@@ -785,6 +842,13 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
iostorinvdisCpService.confirm(mst_jo);
}
// 更新发货点位
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getVehicle_code, taskDao.getVehicle_code())
.eq(SchBasePoint::getPoint_code, taskDao.getPoint_code3())
);
} else if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
// 更新任务为执行中
iSchBaseTaskService.update(
@@ -804,6 +868,13 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
JSONObject param = new JSONObject();
param.put("iostorinvdis_id",disDao.getIostorinvdis_id());
delTask(param);
// 更新发货点位
iSchBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.set(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.eq(SchBasePoint::getPoint_code, taskDao.getPoint_code3())
);
}
}