add:新增回温区移库快速回温区功能
This commit is contained in:
@@ -51,13 +51,21 @@ public class ReportController {
|
||||
}
|
||||
|
||||
@GetMapping("/yl/movedetail")
|
||||
@Log("原料库工单库存明细")
|
||||
@ApiOperation("原料库工单库存明细")
|
||||
@Log("原料缓存区移库明细")
|
||||
@ApiOperation("原料缓存区移库明细")
|
||||
//@SaCheckPermission("@el.check('material:list')")
|
||||
public ResponseEntity<Object> queryMoveDetail(ReportQuery whereJson, PageQuery page){
|
||||
return new ResponseEntity<>(TableDataInfo.build(reportService.queryMoveDetail(whereJson,page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/yl/movedetail2")
|
||||
@Log("回温区移库库存明细")
|
||||
@ApiOperation("回温区移库库存明细")
|
||||
//@SaCheckPermission("@el.check('material:list')")
|
||||
public ResponseEntity<Object> queryMoveDetail2(ReportQuery whereJson, PageQuery page){
|
||||
return new ResponseEntity<>(TableDataInfo.build(reportService.queryMoveDetail2(whereJson,page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/yl/in")
|
||||
@Log("原材入库明细")
|
||||
@ApiOperation("原材入库明细")
|
||||
|
||||
@@ -85,6 +85,14 @@ public interface IReportService extends IService<ReportDto> {
|
||||
*/
|
||||
IPage<YCLKCDto> queryMoveDetail(ReportQuery whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 查询回温区库存-----
|
||||
* @param whereJson
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
IPage<YCLKCDto> queryMoveDetail2(ReportQuery whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 原材入库明细--------
|
||||
* @param whereJson
|
||||
|
||||
@@ -29,6 +29,8 @@ public interface ReportMapper extends BaseMapper<ReportDto> {
|
||||
|
||||
IPage<YCLKCDto> queryMoveDetail(IPage<YCLKCDto> pages, ReportQuery query);
|
||||
|
||||
IPage<YCLKCDto> queryMoveDetail2(IPage<YCLKCDto> pages, ReportQuery query);
|
||||
|
||||
IPage<YlDto> queryYlIn(IPage<YlDto> pages, ReportQuery query);
|
||||
|
||||
IPage<YlDto> queryYlOut(IPage<YlDto> pages, ReportQuery query);
|
||||
|
||||
@@ -210,6 +210,36 @@
|
||||
ORDER BY a.pointCode ASC
|
||||
</select>
|
||||
|
||||
<select id="queryMoveDetail2" resultType="org.nl.wms.sch.report.service.dto.YCLKCDto">
|
||||
SELECT
|
||||
a.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
p.point_code AS pointCode,
|
||||
p.region_name AS regionName,
|
||||
p.vehicle_code2 AS subTray,
|
||||
p.vehicle_code AS motherTray,
|
||||
( CASE WHEN ( p.ing_task_code = '' OR p.ing_task_code IS NULL ) THEN 0 ELSE 1 END ) AS STATUS,
|
||||
p.update_time AS updateTime
|
||||
FROM
|
||||
sch_base_point p
|
||||
WHERE
|
||||
p.vehicle_code2 != ''
|
||||
AND p.vehicle_code2 IS NOT NULL
|
||||
AND p.is_used = '1'
|
||||
AND (p.ing_task_code IS NULL or p.ing_task_code = '')
|
||||
AND p.region_code IN ( 'HW' )) a
|
||||
WHERE 1=1
|
||||
<if test="query.point_code != null">
|
||||
and a.pointCode = #{query.point_code}
|
||||
</if>
|
||||
<if test="query.status != null">
|
||||
and a.status = #{query.status}
|
||||
</if>
|
||||
ORDER BY a.pointCode ASC
|
||||
</select>
|
||||
|
||||
<select id="queryYlIn" resultType="org.nl.wms.sch.report.service.dto.YlDto">
|
||||
SELECT
|
||||
m.lotSN,
|
||||
|
||||
@@ -72,6 +72,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<YCLKCDto> queryMoveDetail2(ReportQuery query, PageQuery pageQuery){
|
||||
IPage<YCLKCDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
pages = reportMapper.queryMoveDetail2(pages, query);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<YlDto> queryYlIn(ReportQuery query, PageQuery pageQuery){
|
||||
IPage<YlDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
|
||||
@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.pdm.service.dao.PointDetailAdd;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -98,4 +99,14 @@ public class SchBaseTaskController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/move2")
|
||||
@Log("管理端一键移库")
|
||||
@ApiOperation("管理端一键移库")
|
||||
@SaIgnore
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public ResponseEntity<Object> move2(@RequestBody PointDetailAdd pointDetailAdd) {
|
||||
schBaseTaskService.move2(pointDetailAdd);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.pdm.service.dao.PointDetailAdd;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
||||
|
||||
@@ -111,4 +112,11 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
||||
* @return
|
||||
*/
|
||||
void move();
|
||||
|
||||
/**
|
||||
* 管理端一键移库
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
void move2(PointDetailAdd pointDetailAdd);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.ext.service.AcsToWmsService;
|
||||
import org.nl.wms.ext.service.dto.to.BaseResponse;
|
||||
import org.nl.wms.pdm.service.dao.PointDetailAdd;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
@@ -344,4 +345,74 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理端一键移库:回温区---》快速回温区
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void move2(PointDetailAdd pointDetailAdd) {
|
||||
log.info("管理端发起一键移库!");
|
||||
String time = pointDetailAdd.getTime();
|
||||
List<SchBasePoint> schBasePointList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getRegion_code, "HW")
|
||||
.isNotNull(SchBasePoint::getVehicle_code2)
|
||||
.ne(SchBasePoint::getVehicle_code2, "")
|
||||
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
|
||||
.or()
|
||||
.eq(SchBasePoint::getIng_task_code, "")
|
||||
));
|
||||
List<SchBasePoint> nextList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, "HWK")
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getVehicle_qty, 0)
|
||||
.and(slam -> slam.isNull(SchBasePoint::getVehicle_code2)
|
||||
.or()
|
||||
.eq(SchBasePoint::getVehicle_code2, ""))
|
||||
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
|
||||
.or()
|
||||
.eq(SchBasePoint::getIng_task_code, "")));
|
||||
for (SchBasePoint schBasePoint : schBasePointList) {
|
||||
if(nextList.size()==0){
|
||||
log.info("快速回温区无可用点位,取消后续循环");
|
||||
return;
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
SchBasePoint nexSchBasePoint = nextList.get(0);
|
||||
param.put("start_point", schBasePoint.getPoint_code());
|
||||
param.put("next_point", nexSchBasePoint.getPoint_code());
|
||||
param.put("create_mode","1");
|
||||
param.put("request_medthod_code", "POINTTask");
|
||||
param.put("request_medthod_name", "点对点任务");
|
||||
param.put("vehicle_code",schBasePoint.getVehicle_code());
|
||||
param.put("vehicle_code2",schBasePoint.getVehicle_code2());
|
||||
param.put("device_code", schBasePoint.getPoint_code());
|
||||
param.put("time", time);
|
||||
|
||||
BaseResponse baseResponse= acsToWmsService.pdaApply(param);
|
||||
Integer resultCode = baseResponse.getCode();
|
||||
if(resultCode.equals(200)){
|
||||
Map<String, String> parameters = baseResponse.getParameters();
|
||||
//设置初始值
|
||||
schBasePoint.setIng_task_code("1");
|
||||
nexSchBasePoint.setIng_task_code("1");
|
||||
if(ObjectUtil.isNotNull(parameters)){
|
||||
String task_code = parameters.get("task_code");
|
||||
if(ObjectUtil.isNotEmpty(task_code)){
|
||||
schBasePoint.setIng_task_code(task_code);
|
||||
nexSchBasePoint.setIng_task_code(task_code);
|
||||
}
|
||||
}
|
||||
//发起任务时先把点位占用,防止发起重复任务
|
||||
pointService.update(schBasePoint);
|
||||
pointService.update(nexSchBasePoint);
|
||||
nextList.remove(0);
|
||||
}else{
|
||||
log.info(baseResponse.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,6 +233,11 @@ public class POINTTask extends AbstractTask {
|
||||
if(endPointObj.getRegion_code().contains("CB")){
|
||||
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
|
||||
}
|
||||
if(ObjectUtil.isEmpty(extGroupData.getString("time"))){
|
||||
one.setStanding_time(1);
|
||||
}else{
|
||||
one.setStanding_time(Integer.valueOf(extGroupData.getString("time")));
|
||||
}
|
||||
one.setUpdate_id(GeneralDefinition.ACS_ID);
|
||||
one.setUpdate_name(GeneralDefinition.ACS_NAME);
|
||||
one.setUpdate_time(DateUtil.now());
|
||||
@@ -305,6 +310,20 @@ public class POINTTask extends AbstractTask {
|
||||
|
||||
@Override
|
||||
protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
|
||||
//该场景无需重算等待点
|
||||
if(schBaseTask.getPoint_code2().startsWith("DKT")){
|
||||
//叠盘任务需要二次分配
|
||||
SchBasePoint nextSchBasePoint= pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getPoint_code, "DKT01"));
|
||||
Integer max_qty = nextSchBasePoint.getVehicle_max_qty();
|
||||
//如果是叠盘位,根据当前数量+1为目标地址
|
||||
int qty=nextSchBasePoint.getVehicle_qty()+1;
|
||||
if(qty <= max_qty){
|
||||
schBaseTask.setPoint_code2(schBaseTask.getPoint_code2().substring(0,schBaseTask.getPoint_code2().length()-1)+qty);
|
||||
}else{
|
||||
schBaseTask.setRemark("叠盘机空盘数量已达最大值:["+max_qty+"],暂时无法放置托盘!");
|
||||
taskService.update(schBaseTask);
|
||||
throw new BadRequestException("叠盘机空盘数量已达最大值:[\"+max_qty+\"],暂时无法放置托盘!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,4 +77,13 @@ public class WorkorderController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/batchCreate2")
|
||||
@Log("批量生成移库任务")
|
||||
@ApiOperation("批量生成移库任务")
|
||||
public ResponseEntity<Object> batchCreate2(@RequestBody PointDetailAdd pointDetailAdd){
|
||||
log.info("批量生成移库任务:"+pointDetailAdd.toString());
|
||||
workorderService.batchCreate2(pointDetailAdd);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,6 +59,12 @@ public interface IWorkorderService extends IService<Workorder> {
|
||||
*/
|
||||
void batchCreate( PointDetailAdd pointDetailAdd);
|
||||
|
||||
/**
|
||||
* 批量生成移库任务
|
||||
* @param pointDetailAdd
|
||||
*/
|
||||
void batchCreate2( PointDetailAdd pointDetailAdd);
|
||||
|
||||
/**
|
||||
* 批量生成工单出库任务
|
||||
*/
|
||||
|
||||
@@ -203,6 +203,84 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchCreate2( PointDetailAdd pointDetailAdd){
|
||||
log.info("管理端发起一键移库!");
|
||||
//点位集合
|
||||
List<String> pointCodes = pointDetailAdd.getPointCodes();
|
||||
//下发状态
|
||||
String status = pointDetailAdd.getStatus();
|
||||
String time = pointDetailAdd.getTime();
|
||||
//查询是否有目的空点位
|
||||
List<SchBasePoint> nextList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, "HWK")
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getVehicle_qty, 0)
|
||||
.and(slam -> slam.isNull(SchBasePoint::getVehicle_code2)
|
||||
.or()
|
||||
.eq(SchBasePoint::getVehicle_code2, ""))
|
||||
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
|
||||
.or()
|
||||
.eq(SchBasePoint::getIng_task_code, "")));
|
||||
if("1".equals(status)){
|
||||
for(String pointCode : pointCodes){
|
||||
if(nextList.size()==0){
|
||||
log.info("快速回温区无可用点位,取消后续循环");
|
||||
return;
|
||||
}
|
||||
//查询当前点位最新信息
|
||||
SchBasePoint schBasePoint =schBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.eq(SchBasePoint::getRegion_code, "HW")
|
||||
.eq(SchBasePoint::getPoint_code, pointCode)
|
||||
.isNotNull(SchBasePoint::getVehicle_code2)
|
||||
.ne(SchBasePoint::getVehicle_code2, "")
|
||||
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
|
||||
.or()
|
||||
.eq(SchBasePoint::getIng_task_code, "")
|
||||
));
|
||||
if(ObjectUtil.isNull(schBasePoint)){
|
||||
log.info("移库点位异常:"+pointCode);
|
||||
continue;
|
||||
}
|
||||
SchBasePoint nexSchBasePoint = nextList.get(0);
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("start_point", schBasePoint.getPoint_code());
|
||||
param.put("next_point", nexSchBasePoint.getPoint_code());
|
||||
param.put("create_mode","1");
|
||||
param.put("request_medthod_code", "POINTTask");
|
||||
param.put("request_medthod_name", "点对点任务");
|
||||
param.put("vehicle_code",schBasePoint.getVehicle_code());
|
||||
param.put("vehicle_code2",schBasePoint.getVehicle_code2());
|
||||
param.put("device_code", schBasePoint.getPoint_code());
|
||||
param.put("time", time);
|
||||
|
||||
BaseResponse baseResponse= acsToWmsService.pdaApply(param);
|
||||
Integer resultCode = baseResponse.getCode();
|
||||
if(resultCode.equals(200)){
|
||||
Map<String, String> parameters = baseResponse.getParameters();
|
||||
//设置初始值
|
||||
schBasePoint.setIng_task_code("1");
|
||||
nexSchBasePoint.setIng_task_code("1");
|
||||
if(ObjectUtil.isNotNull(parameters)){
|
||||
String task_code = parameters.get("task_code");
|
||||
if(ObjectUtil.isNotEmpty(task_code)){
|
||||
schBasePoint.setIng_task_code(task_code);
|
||||
nexSchBasePoint.setIng_task_code(task_code);
|
||||
}
|
||||
}
|
||||
//发起任务时先把点位占用,防止发起重复任务
|
||||
pointService.update(schBasePoint);
|
||||
pointService.update(nexSchBasePoint);
|
||||
nextList.remove(0);
|
||||
}else{
|
||||
log.info(baseResponse.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
//@Transactional(rollbackFor = Exception.class)
|
||||
public void batchCreateTask(){
|
||||
|
||||
Reference in New Issue
Block a user