opt:现场问题的一些处理与优化
This commit is contained in:
@@ -71,7 +71,7 @@ public enum StatusEnum {
|
||||
/**
|
||||
* 点位锁类型
|
||||
*/
|
||||
LOCK(ForkMap.of("无锁", "00", null, "入库锁", "10", null, "入库盘点锁", "16", null, "出库锁", "20", null, "盘点出库锁", "26", null, "移库锁", "50", null, "异常锁定", "60", null, "空出锁", "70", null,"暂停锁", "98", null,"临时锁", "99", null)),
|
||||
LOCK(ForkMap.of("无锁", "00", null, "入库锁", "10", null, "入库盘点锁", "16", null, "出库锁", "20", null, "盘点出库锁", "26", null, "移库锁", "50", null, "异常锁定", "60", null, "空出锁", "70", null,"禁分配锁", "98", null,"技改锁", "99", null)),
|
||||
STRATEGY_TYPE(ForkMap.of("入库", "1", null, "出库", "2", null, "出入库", "3", null)),
|
||||
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class StIvtBsrealstorattrController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 库位初始化
|
||||
* 仓库库位数据初始化
|
||||
*/
|
||||
@PostMapping("/batchSaveAttr")
|
||||
@SaIgnore
|
||||
@@ -101,20 +101,20 @@ public class StIvtBsrealstorattrController {
|
||||
ArrayList<StIvtStructattr> list = new ArrayList<>();
|
||||
for (int x = 1; x <= 排; x++) {
|
||||
for (int y = 1; y <= 列; y++) {
|
||||
for (int z = 1; z <= 层; z++) {
|
||||
for (int z = 5; z <= 层; z++) {
|
||||
StIvtStructattr attr = new StIvtStructattr();
|
||||
attr.setId(IdUtil.getStringId());
|
||||
attr.setSect_code(sect_code);
|
||||
attr.setStor_code(stor_code);
|
||||
String nx = (x < 10) ? "0" + x : "" + x;
|
||||
String ny = (y < 10) ? "0" + y : "" + y;
|
||||
String nz = (z < 10) ? "0" + z : "" + z;
|
||||
String nx = "" + x;
|
||||
String ny = "" + y;
|
||||
String nz = "" + z;
|
||||
attr.setStruct_code(pre+nx+"-"+ny+"-"+nz);
|
||||
attr.setStruct_name(x+"排"+y+"列"+z+"层");
|
||||
attr.setCreate_id("1");
|
||||
attr.setRow_num(x);
|
||||
attr.setCol_num(y);
|
||||
attr.setBlock_num(2);
|
||||
attr.setBlock_num(5);
|
||||
attr.setLayer_num(z);
|
||||
attr.setCreate_time(now);
|
||||
attr.setCreate_name("Admin");
|
||||
|
||||
@@ -143,12 +143,14 @@ public class DepthPriorityHandler extends Decisioner<StIvtStructattr, JSONObject
|
||||
.lt(SchBaseTask::getStatus, StatusEnum.FORM_STATUS.code("完成"))
|
||||
.eq(SchBaseTask::getVehicle_code, param.getString("vehicle_code"))
|
||||
);
|
||||
taskList=taskList.stream()
|
||||
.filter(t -> t.getTask_type().equals(StatusEnum.IOBILL_TYPE_OUT.code("生产入库"))||t.getTask_type().equals(StatusEnum.IOBILL_TYPE_IN.code("拣选回库")))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(taskList)) {
|
||||
log.error("深位优先策略:获取深货位有货且浅货位无货仓位:载具号:" + param.getString("vehicle_code") + "获取仓位失败,该策略对应库位已不足30个!");
|
||||
return Collections.emptyList();
|
||||
taskList=taskList.stream()
|
||||
.filter(t -> t.getTask_type().equals(StatusEnum.IOBILL_TYPE_IN.code("生产入库"))||t.getTask_type().equals(StatusEnum.IOBILL_TYPE_IN.code("拣选回库")))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(taskList)) {
|
||||
log.error("深位优先策略:获取深货位有货且浅货位无货仓位:载具号:" + param.getString("vehicle_code") + "获取仓位失败,该策略对应库位已不足30个!");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("深位优先策略:载具号:" + param.getString("vehicle_code") + "分配结果: 深货位有货且浅货位无货仓位,无需移库,分配仓位:" + combinedResult.get(0).getStruct_code());
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
@@ -41,8 +42,7 @@ public class InventoryRuleHandler extends Decisioner<StIvtStructattr, JSONObject
|
||||
/**
|
||||
* 出入库明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtStructattrService iStIvtStructattrService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -16,16 +17,15 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class TaskDispatchService {
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
@Scheduled(cron = "0/30 * * * * ?")
|
||||
public void taskPublish(){
|
||||
List<SchBaseTask> tasks = iSchBaseTaskService.list(new QueryWrapper<SchBaseTask>()
|
||||
.eq("is_send", true)
|
||||
.eq("is_delete",false)
|
||||
.lt("status", StatusEnum.FORM_STATUS.code("生成")));
|
||||
//...调度逻辑
|
||||
//下发
|
||||
|
||||
}
|
||||
// @Scheduled(cron = "0/30 * * * * ?")
|
||||
// public void taskPublish(){
|
||||
// List<SchBaseTask> tasks = iSchBaseTaskService.list(new QueryWrapper<SchBaseTask>()
|
||||
// .eq("is_send", true)
|
||||
// .eq("is_delete",false)
|
||||
// .lt("status", StatusEnum.FORM_STATUS.code("生成")));
|
||||
// //...调度逻辑
|
||||
// //下发
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -65,11 +66,12 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
|
||||
@Autowired
|
||||
private WmsToAcsService wmsToAcsService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructattrService iStIvtStructattrService;
|
||||
|
||||
@Autowired
|
||||
ISysUserService userService;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.google.gson.JsonArray;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.system_manage.service.quartz.task.TaskScheduleService;
|
||||
@@ -92,12 +93,37 @@ public class SchBaseTaskController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping ("/cancelTask")
|
||||
@Log("批量取消任务")
|
||||
public ResponseEntity<Object> cancelTask(@RequestBody List<SchBaseTask> list) {
|
||||
iSchBaseTaskService.cancelTask(list);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping ("/delCtuIvt")
|
||||
@Log("清除CTU库库存")
|
||||
public ResponseEntity<Object> delCtuIvt() {
|
||||
iSchBaseTaskService.deleteCtuIvt();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping ("/updateLockIvt")
|
||||
@Log("清空技改锁")
|
||||
public ResponseEntity<Object> updateLockIvt() {
|
||||
iSchBaseTaskService.updateLockIvt(StatusEnum.LOCK.code("技改锁"));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/taskMsgSchedule")
|
||||
public ResponseEntity<Object> taskMsgSchedule() {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
||||
@@ -115,21 +115,22 @@ public class MoveStorageTask extends AbstractTask {
|
||||
iStIvtStructattrService.changeStruct(schBaseTask.getPoint_code1(), schBaseTask.getVehicle_code(), schBaseTask.getTask_type(), null, Boolean.FALSE, schBaseTask.getPoint_code2());
|
||||
iStIvtStructattrService.changeStruct(schBaseTask.getPoint_code2(), schBaseTask.getVehicle_code(), schBaseTask.getTask_type(), null, Boolean.TRUE, schBaseTask.getPoint_code2());
|
||||
if ("99".equals(schBaseTask.getSource_form_id())) {
|
||||
//移库完成后,起点作为临时锁,支持技改,不再入库,技改完成后需要解锁
|
||||
//移库完成后,起点作为技改锁,支持技改,不再入库,技改完成后需要解锁
|
||||
iStIvtStructattrService.update(
|
||||
new UpdateWrapper<StIvtStructattr>()
|
||||
.set("lock_type", StatusEnum.LOCK.code("临时锁"))
|
||||
.set("lock_type", StatusEnum.LOCK.code("技改锁"))
|
||||
.set("is_used",0)
|
||||
.eq("struct_code", schBaseTask.getPoint_code1())
|
||||
);
|
||||
List<SchBaseTask> taskList = taskService.list(new QueryWrapper<SchBaseTask>().eq("source_form_id", "99").lt("status", StatusEnum.FORM_STATUS.code("完成")));
|
||||
// List<SchBaseTask> taskList = taskService.list(new QueryWrapper<SchBaseTask>().eq("source_form_id", "99").lt("status", StatusEnum.FORM_STATUS.code("完成")));
|
||||
//移库任务完成,解锁需要维护不能分配的区域
|
||||
if (taskList.size() == 0) {
|
||||
UpdateWrapper<StIvtStructattr> wrapper = new UpdateWrapper<>();
|
||||
wrapper.set("update_time", DateUtil.now())
|
||||
.set("lock_type", StatusEnum.LOCK.code("无锁"))
|
||||
.eq("lock_type", StatusEnum.LOCK.code("暂停锁"));
|
||||
iStIvtStructattrService.update(wrapper);
|
||||
}
|
||||
// if (taskList.size() == 0) {
|
||||
// UpdateWrapper<StIvtStructattr> wrapper = new UpdateWrapper<>();
|
||||
// wrapper.set("update_time", DateUtil.now())
|
||||
// .set("lock_type", StatusEnum.LOCK.code("无锁"))
|
||||
// .eq("lock_type", StatusEnum.LOCK.code("禁分配锁"));
|
||||
// iStIvtStructattrService.update(wrapper);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,12 +58,14 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
|
||||
void taskSchedule(List<SchBaseTask> list);
|
||||
void taskSchedule(List<SchBaseTask> list);
|
||||
|
||||
void cancelTask(List<SchBaseTask> list);
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
void deleteCtuIvt();
|
||||
|
||||
|
||||
void updateLockIvt(String lock_type);
|
||||
|
||||
/**
|
||||
* 任务操作
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface SchBaseTaskMapper extends BaseMapper<SchBaseTask> {
|
||||
int updateVehiclemater();
|
||||
|
||||
int updateCStockIvt();
|
||||
|
||||
int updateFStockIvt(@Param("lock_type") String lock_type);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -137,4 +137,8 @@
|
||||
UPDATE `st_ivt_structattr` SET vehicle_code=null,lock_type='00' WHERE stor_code iN ('CStockId','HStockId') AND is_used ='1'
|
||||
</update>
|
||||
|
||||
<update id="updateFStockIvt">
|
||||
update `st_ivt_structattr` set lock_type = '00' where lock_type = #{lock_type}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -163,6 +163,12 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
schBaseTaskMapper.updateCStockIvt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLockIvt(String lock_type) {
|
||||
schBaseTaskMapper.updateFStockIvt(lock_type);
|
||||
schBaseTaskMapper.updateFStockIvt("98");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void taskSchedule(List<SchBaseTask> list) {
|
||||
@@ -190,6 +196,19 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelTask(List<SchBaseTask> list) {
|
||||
if (ObjectUtils.isEmpty(list)) {
|
||||
throw new BadRequestException("任务信息不存在");
|
||||
}
|
||||
list.forEach(r -> {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("task_code", r.getTask_code());
|
||||
param.put("status", StatusEnum.FORM_STATUS.code("取消"));
|
||||
this.operation(param);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void create(SchBaseTask entity) {
|
||||
@@ -398,26 +417,41 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
|
||||
|
||||
private void moveTask(SchBaseTask task, String struct_code, StIvtStructattr stIvtStructattr) {
|
||||
AtomicReference<String> moveStruct = new AtomicReference<>();
|
||||
/**
|
||||
* 1.判断对应浅位是否存在料箱
|
||||
* 2.如果有则判断是否存在出库任务
|
||||
* 3.如果没有则生成移库任务
|
||||
*/
|
||||
|
||||
String blockPoint = StructUtil.getZdPoint(stIvtStructattr.getRow_num(), stIvtStructattr.getStruct_code());
|
||||
StIvtStructattr block = iStIvtStructattrService.getOne(new QueryWrapper<StIvtStructattr>()
|
||||
.eq("struct_code", blockPoint)
|
||||
.isNotNull("vehicle_code"));
|
||||
this.update(new UpdateWrapper<SchBaseTask>()
|
||||
.set("status", StatusEnum.FORM_STATUS.code("生成"))
|
||||
.set("remark", struct_code + "出库阻挡二次下发")
|
||||
.set("remark", blockPoint + "出库阻挡二次下发")
|
||||
.set("update_time", DateUtil.now())
|
||||
.eq("task_code", task.getTask_code()));
|
||||
StIvtStructattr struct = iStIvtStructattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("struct_code", struct_code));
|
||||
String vehicleCode = struct.getVehicle_code();
|
||||
RedissonUtils.lock(() -> {
|
||||
System.out.println("---3--" + Thread.currentThread().getName());
|
||||
//出阻挡说明是同排跟任务一个类型载具
|
||||
Map process = SpringContextHolder.getBean(DecisionHandler.class).dispenseTransa(ListOf.of("limitStorage", "depthPriority", "alleyAve"), new JSONObject(MapOf.of("is_move", true, "stor_code", stIvtStructattr.getStor_code(), "vehicle_code", task.getVehicle_code(), "errorTask", "errorTask")));
|
||||
moveStruct.set(((Map<String, String>) process.get("form_data")).get("end_struct_code"));
|
||||
}, "1" + stIvtStructattr.getStor_code(), 5);
|
||||
Map moveForm = MapOf.of("task_type", StatusEnum.IOBILL_TYPE_MOVE.code("异常位移库")
|
||||
, "is_send", false
|
||||
, "vehicle_code", StringUtils.isEmpty(vehicleCode) ? "YCZJ" + task.getTask_code() : vehicleCode, "form_data", new JSONObject(MapOf.of("start_struct_code", struct_code, "end_struct_code", moveStruct.get())));
|
||||
moveStorageTask.createTask(new JSONObject(moveForm));
|
||||
log.info("-----出库分配:深位查询浅位是否有货:{}", block != null);
|
||||
if (block != null) {
|
||||
int count =this.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("point_code1", block.getStruct_code())
|
||||
.lt("status", StatusEnum.FORM_STATUS.code("完成")));
|
||||
if (count == 0) {
|
||||
AtomicReference<String> moveStruct = new AtomicReference<>();
|
||||
RedissonUtils.lock(() -> {
|
||||
System.out.println("---3--" + Thread.currentThread().getName());
|
||||
//出阻挡说明是同排跟任务一个类型载具
|
||||
Map process = SpringContextHolder.getBean(DecisionHandler.class).dispenseTransa(ListOf.of("limitStorage", "depthPriority", "alleyAve"), new JSONObject(MapOf.of("is_move", true, "stor_code", stIvtStructattr.getStor_code(), "vehicle_code", task.getVehicle_code(), "errorTask", "errorTask")));
|
||||
moveStruct.set(((Map<String, String>) process.get("form_data")).get("end_struct_code"));
|
||||
}, "1" + stIvtStructattr.getStor_code(), 5);
|
||||
Map moveForm = MapOf.of("task_type", StatusEnum.IOBILL_TYPE_MOVE.code("异常位移库")
|
||||
, "is_send", false
|
||||
, "vehicle_code", StringUtils.isEmpty(block.getVehicle_code()) ? "YCZJ" + task.getTask_code() : block.getVehicle_code(), "form_data", new JSONObject(MapOf.of("start_struct_code", block.getStruct_code(), "end_struct_code", moveStruct.get())));
|
||||
moveStorageTask.createTask(new JSONObject(moveForm));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private JSONObject rzd(StIvtStructattr stIvtStructattr, SchBaseTask task) {
|
||||
String task_code = task.getTask_code();
|
||||
MdPbVehicleMater vehicleCode = iMdPbVehicleMaterService
|
||||
|
||||
@@ -28,6 +28,13 @@ public interface CockpitService {
|
||||
JSONObject synthesizeInfo();
|
||||
|
||||
|
||||
/**
|
||||
* 货位数据缓存
|
||||
*/
|
||||
JSONObject updateSynthesizeInfo();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 领料分析
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.pda_manage.cockpit.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.pda_manage.cockpit.service.dao.CockpitTemp;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} (CockpitTemp)服务接口层
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
public interface IcockpitTempService extends IService<CockpitTemp> {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.nl.wms.pda_manage.cockpit.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} (CockpitTemp)实体类
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("cockpit_temp")
|
||||
public class CockpitTemp extends Model<CockpitTemp> {
|
||||
|
||||
private static final long serialVersionUID = -7739291296662381393L;
|
||||
//@TableId(type = IdType.ASSIGN_ID)
|
||||
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.NONE)
|
||||
private Integer id;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String code;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @return 主键值
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.nl.wms.pda_manage.cockpit.service.dao;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} (CockpitTemp)数据传输类
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CockpitTempDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String code;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
@@ -14,6 +15,7 @@ import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.dispatch_manage.point.service.impl.SchBasePointServiceImpl;
|
||||
import org.nl.wms.external_system.dto.InteracteDto;
|
||||
import org.nl.wms.pda_manage.cockpit.service.CockpitService;
|
||||
import org.nl.wms.pda_manage.cockpit.service.dao.CockpitTemp;
|
||||
import org.nl.wms.pda_manage.cockpit.service.dao.PointInfo;
|
||||
import org.nl.wms.pda_manage.cockpit.service.dao.TaskInfo;
|
||||
import org.nl.wms.pda_manage.cockpit.service.mapper.CockpitMapper;
|
||||
@@ -57,6 +59,10 @@ public class CockpitServiceImpl implements CockpitService {
|
||||
@Resource
|
||||
private SchBasePointServiceImpl schBasePointServiceImpl;
|
||||
|
||||
|
||||
@Resource
|
||||
private CockpitTempServiceImpl cockpitTempServiceImpl;
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd");
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
@@ -78,12 +84,290 @@ public class CockpitServiceImpl implements CockpitService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 货位综合分析
|
||||
*/
|
||||
@Override
|
||||
public JSONObject synthesizeInfo() {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// //货位使用
|
||||
// CompletableFuture<List<Map<String, Object>>> task1 = CompletableFuture.supplyAsync(() -> {
|
||||
// Integer total1 = 0;
|
||||
// Integer used1 = 0;
|
||||
// Integer free1 = 0;
|
||||
// String percent1 = "0%";
|
||||
// Integer total2 = 0;
|
||||
// Integer used2 = 0;
|
||||
// Integer free2 = 0;
|
||||
// String percent2 = "0%";
|
||||
// JSONObject item1 = new JSONObject();
|
||||
// JSONObject item3 = new JSONObject();
|
||||
// long startTime1 = System.currentTimeMillis();
|
||||
// //库存信息
|
||||
// List<StIvtStructattr> ivtList = cockpitMapper.queryStorage();
|
||||
// if (ObjectUtil.isNotEmpty(ivtList)) {
|
||||
// //料箱库
|
||||
// List<StIvtStructattr> fstockList = ivtList.stream().filter(r -> "FStockId".equals(r.getStor_code())).collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotEmpty(fstockList)) {
|
||||
// total1 = fstockList.size();
|
||||
// if (total1 > 0) {
|
||||
// // 计算已使用的数量
|
||||
// long used = fstockList.stream().filter(r -> StringUtils.isNotEmpty(r.getVehicle_code())).count();
|
||||
// used1 = (int) used;
|
||||
// free1 = total1 - used1;
|
||||
// double percentage = (double) used1 / total1 * 100;
|
||||
// BigDecimal bd = new BigDecimal(percentage).setScale(2, RoundingMode.HALF_UP);
|
||||
// double roundedPercentage = bd.doubleValue();
|
||||
// percent1 = roundedPercentage + "%";
|
||||
// }
|
||||
// }
|
||||
// //托盘库
|
||||
// List<StIvtStructattr> fstockPalletList = ivtList.stream().filter(r -> "FStockPallet".equals(r.getStor_code())).collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotEmpty(fstockPalletList)) {
|
||||
// total2 = fstockPalletList.size();
|
||||
// if (total2 > 0) {
|
||||
// long used = fstockPalletList.stream().filter(r -> StringUtils.isNotEmpty(r.getVehicle_code())).count();
|
||||
// used2 = (int) used;
|
||||
// free2 = total2 - used2;
|
||||
// double percentage = (double) used2 / total2 * 100;
|
||||
// BigDecimal bd = new BigDecimal(percentage).setScale(2, RoundingMode.HALF_UP);
|
||||
// double roundedPercentage = bd.doubleValue();
|
||||
// percent2 = roundedPercentage + "%";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// item1.put("total", total1);
|
||||
// item1.put("used", used1);
|
||||
// item1.put("free", free1);
|
||||
// item1.put("percent", percent1);
|
||||
// item3.put("total", total2);
|
||||
// item3.put("used", used2);
|
||||
// item3.put("free", free2);
|
||||
// item3.put("percent", percent2);
|
||||
// jsonObject.put("lx_used", item1);
|
||||
// jsonObject.put("tp_used", item3);
|
||||
// log.info("获取货位使用信息耗时:{}", System.currentTimeMillis() - startTime1);
|
||||
// return null;
|
||||
// }, pool);
|
||||
// task1.exceptionally((e) -> {
|
||||
// log.error("获取货位使用信息异常:{}", e.getMessage(), e);
|
||||
// return null;
|
||||
// });
|
||||
// CompletableFuture<List<Map<String, Object>>> task2 = CompletableFuture.supplyAsync(() -> {
|
||||
// long startTime2 = System.currentTimeMillis();
|
||||
// Integer total1 = 0;
|
||||
// Integer box1 = 0;
|
||||
// String time1 = "0h";
|
||||
// Integer total2 = 0;
|
||||
// Integer box2 = 0;
|
||||
// String time2 = "0h";
|
||||
// Integer total3 = 0;
|
||||
// Integer box3 = 0;
|
||||
// String time3 = "0h";
|
||||
// Integer total4 = 0;
|
||||
// Integer box4 = 0;
|
||||
// String time4 = "0h";
|
||||
// JSONArray item2 = new JSONArray();
|
||||
// JSONArray item4 = new JSONArray();
|
||||
// JSONObject obj1 = new JSONObject();
|
||||
// JSONObject obj2 = new JSONObject();
|
||||
// JSONObject obj3 = new JSONObject();
|
||||
// JSONObject obj4 = new JSONObject();
|
||||
// obj1.put("total", total1);
|
||||
// obj1.put("box", box1);
|
||||
// obj1.put("time", time1);
|
||||
// obj2.put("total", total2);
|
||||
// obj2.put("box", box2);
|
||||
// obj2.put("time", time2);
|
||||
// obj3.put("total", total3);
|
||||
// obj3.put("box", box3);
|
||||
// obj3.put("time", time3);
|
||||
// obj4.put("total", total4);
|
||||
// obj4.put("box", box4);
|
||||
// obj4.put("time", time4);
|
||||
// List<TaskInfo> taskList1 = cockpitMapper.getTaskListByDays(0);
|
||||
// List<TaskInfo> taskList = new ArrayList<>(taskList1.stream()
|
||||
// .collect(Collectors.toMap(
|
||||
// task -> task.getVehicle_code() + "_" + task.getCreate_time(),
|
||||
// task -> task,
|
||||
// (existing, replacement) -> existing
|
||||
// ))
|
||||
// .values());
|
||||
// if (ObjectUtil.isNotEmpty(taskList)) {
|
||||
// //料箱库入库
|
||||
// List<TaskInfo> stockList1 = taskList.stream()
|
||||
// .filter(r -> Integer.parseInt(r.getTask_type()) <= 12 && "FStockId".equals(r.getStor_code()))
|
||||
// .collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotEmpty(stockList1)) {
|
||||
// obj1 = getElapsedTime(obj1, stockList1, true);
|
||||
// }
|
||||
// //料箱库出库
|
||||
// List<TaskInfo> stockList2 = taskList.stream()
|
||||
// .filter(r -> (Integer.parseInt(r.getTask_type()) >= 20 && Integer.parseInt(r.getTask_type()) <= 25) && "FStockId".equals(r.getStor_code()) && Integer.parseInt(r.getTask_type()) != 23)
|
||||
// .collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotEmpty(stockList2)) {
|
||||
// obj2 = getElapsedTime(obj2, stockList2, false);
|
||||
// List<TaskInfo> stockList22 = taskList.stream()
|
||||
// .filter(r -> "2114".equals(r.getPoint_code2()) || "1101".equals(r.getPoint_code1()))
|
||||
// .collect(Collectors.toList());
|
||||
// int box = stockList22.stream().filter(r -> StringUtils.isNotBlank(r.getUpdate_time()))
|
||||
// .mapToInt(taskInfo -> taskInfo.getVehicle_code().split(",").length)
|
||||
// .sum();
|
||||
// if (Double.parseDouble(obj2.getString("time").trim().replace("h", "")) > 1) {
|
||||
// //根据箱数计算
|
||||
// if (box < 100) {
|
||||
// obj2.put("time", 1 + "h");
|
||||
// } else {
|
||||
// BigDecimal baseBox = BigDecimal.valueOf(100);
|
||||
// BigDecimal baseHours = BigDecimal.valueOf(1.1);
|
||||
// BigDecimal roundedTotalHours = BigDecimal.valueOf(box)
|
||||
// .divide(baseBox, 10, RoundingMode.HALF_UP)
|
||||
// .multiply(baseHours)
|
||||
// .setScale(1, RoundingMode.HALF_UP);
|
||||
// obj2.put("time", roundedTotalHours + "h");
|
||||
// }
|
||||
// }
|
||||
// obj2.put("box", box);
|
||||
// }
|
||||
// //托盘库入库
|
||||
// List<TaskInfo> stockList3 = taskList.stream().filter(r -> (Integer.parseInt(r.getTask_type()) <= 14||Integer.parseInt(r.getTask_type()) == 30)&&r.getVehicle_code().contains("T")).collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotEmpty(stockList3)) {
|
||||
// obj3 = getElapsedTime(obj3, stockList3, true);
|
||||
// }
|
||||
// //托盘库出库
|
||||
// List<TaskInfo> stockList4 = taskList.stream()
|
||||
// .filter(r ->
|
||||
// ((Integer.parseInt(r.getTask_type()) >= 20 && Integer.parseInt(r.getTask_type()) <= 22)
|
||||
// || Integer.parseInt(r.getTask_type()) == 40)
|
||||
// && r.getVehicle_code().contains("T")
|
||||
// )
|
||||
// .collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotEmpty(stockList4)) {
|
||||
// obj4 = getElapsedTime(obj4, stockList4, true);
|
||||
// }
|
||||
// }
|
||||
// item2.add(obj1);
|
||||
// item2.add(obj2);
|
||||
// item4.add(obj3);
|
||||
// item4.add(obj4);
|
||||
// jsonObject.put("lx_task", item2);
|
||||
// jsonObject.put("tp_task", item4);
|
||||
// log.info("获取今日出入库任务信息耗时:{}", System.currentTimeMillis() - startTime2);
|
||||
// return null;
|
||||
// }, pool);
|
||||
// task2.exceptionally((e) ->
|
||||
// {
|
||||
// log.error("获取今日出入库任务信息异常:{}", e.getMessage(), e);
|
||||
// return null;
|
||||
// });
|
||||
// CompletableFuture<List<Map<String, Object>>> task3 = CompletableFuture.supplyAsync(() -> {
|
||||
// long startTime3 = System.currentTimeMillis();
|
||||
// JSONArray jsonArray1 = new JSONArray();
|
||||
// JSONArray jsonArray2 = new JSONArray();
|
||||
// //前5名
|
||||
// JSONObject obj0 = new JSONObject();
|
||||
// //其他
|
||||
// JSONObject obj1 = new JSONObject();
|
||||
// JSONObject obj2 = new JSONObject();
|
||||
// JSONObject obj3 = new JSONObject();
|
||||
// List<MdMeMaterialbase> materList = cockpitMapper.getMaterInfos();
|
||||
// if (ObjectUtil.isNotEmpty(materList)) {
|
||||
// List<MdMeMaterialbase> fstockList = materList.stream().filter(r -> "FStockId".equals(r.getProduct_area())).collect(Collectors.toList());
|
||||
// List<MdMeMaterialbase> fstockPalletList = materList.stream().filter(r -> "FStockPallet".equals(r.getProduct_area())).collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotEmpty(fstockList)) {
|
||||
// getMaterialAnalysis(jsonArray1, obj0, obj1, fstockList);
|
||||
// } else {
|
||||
// obj0.put("total", "0");
|
||||
// jsonArray1.add(obj0);
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(fstockPalletList)) {
|
||||
// getMaterialAnalysis(jsonArray2, obj2, obj3, fstockPalletList);
|
||||
// } else {
|
||||
// obj1.put("total", "0");
|
||||
// jsonArray2.add(obj1);
|
||||
// }
|
||||
// } else {
|
||||
// obj0.put("total", "0");
|
||||
// obj1.put("total", "0");
|
||||
// jsonArray1.add(obj0);
|
||||
// jsonArray2.add(obj1);
|
||||
// }
|
||||
// jsonObject.put("lx_inventory", jsonArray1);
|
||||
// jsonObject.put("tp_inventory", jsonArray2);
|
||||
// log.info("获取实时物料库存信息耗时:{}", System.currentTimeMillis() - startTime3);
|
||||
// return null;
|
||||
// }, pool);
|
||||
// task3.exceptionally((e) ->
|
||||
// {
|
||||
// log.error("获取实时物料库存信息异常:{}", e.getMessage(), e);
|
||||
// return null;
|
||||
// });
|
||||
// CompletableFuture<List<Map<String, Object>>> task4 = CompletableFuture.supplyAsync(() -> {
|
||||
// long startTime4 = System.currentTimeMillis();
|
||||
// List<Map<String, Object>> lx_in_default = new ArrayList<>();
|
||||
// List<Map<String, Object>> lx_out_default = new ArrayList<>();
|
||||
// List<Map<String, Object>> tp_in_default = new ArrayList<>();
|
||||
// List<Map<String, Object>> tp_out_default = new ArrayList<>();
|
||||
// List<TaskInfo> result1 = cockpitMapper.getTaskCountsByDays();
|
||||
// List<TaskInfo> result = new ArrayList<>(result1.stream()
|
||||
// .collect(Collectors.toMap(
|
||||
// task -> task.getVehicle_code() + "_" + task.getCreate_time(),
|
||||
// task -> task,
|
||||
// (existing, replacement) -> existing
|
||||
// ))
|
||||
// .values());
|
||||
// //料箱库入库
|
||||
// List<TaskInfo> stockList1 = result.stream()
|
||||
// .filter(r -> Integer.parseInt(r.getTask_type()) <= 12 && "FStockId".equals(r.getStor_code()))
|
||||
// .collect(Collectors.toList());
|
||||
// //料箱库出库
|
||||
// List<TaskInfo> stockList2 = result.stream()
|
||||
// .filter(r -> Integer.parseInt(r.getTask_type()) >= 20 && Integer.parseInt(r.getTask_type()) <= 22 && "FStockId".equals(r.getStor_code()))
|
||||
// .collect(Collectors.toList());
|
||||
// //托盘库入库
|
||||
// List<TaskInfo> stockList3 = result.stream().filter(r -> (Integer.parseInt(r.getTask_type()) <= 14 || Integer.parseInt(r.getTask_type()) == 30) && r.getVehicle_code().contains("T")).collect(Collectors.toList());
|
||||
// //托盘库出库
|
||||
// List<TaskInfo> stockList4 = result.stream()
|
||||
// .filter(r ->
|
||||
// ((Integer.parseInt(r.getTask_type()) >= 20 && Integer.parseInt(r.getTask_type()) <= 22)
|
||||
// || Integer.parseInt(r.getTask_type()) == 40)
|
||||
// && r.getVehicle_code().contains("T")
|
||||
// ).collect(Collectors.toList());
|
||||
// //计算每天的数量
|
||||
// getWeekWorkStatistics(stockList1, lx_in_default, 7);
|
||||
// getWeekWorkStatistics(stockList2, lx_out_default, 7);
|
||||
// getWeekWorkStatistics(stockList3, tp_in_default, 7);
|
||||
// getWeekWorkStatistics(stockList4, tp_out_default, 7);
|
||||
// jsonObject.put("lx_in_week", lx_in_default);
|
||||
// jsonObject.put("lx_out_week", lx_out_default);
|
||||
// jsonObject.put("tp_in_week", tp_in_default);
|
||||
// jsonObject.put("tp_out_week", tp_out_default);
|
||||
// log.info("获取7天出入库趋势信息耗时:{}", System.currentTimeMillis() - startTime4);
|
||||
// return null;
|
||||
// }, pool);
|
||||
// task4.exceptionally((e) ->
|
||||
// {
|
||||
// log.error("获取7天出入库趋势信息异常:{}", e.getMessage(), e);
|
||||
// return null;
|
||||
// });
|
||||
// CompletableFuture<Void> allQuery = CompletableFuture.allOf(task1, task2, task3, task4);
|
||||
// CompletableFuture<JSONObject> future = allQuery.thenApply((result) -> jsonObject).exceptionally((e) -> {
|
||||
// log.error("获取综合信息异常:{}", e.getMessage(), e);
|
||||
// return null;
|
||||
// });
|
||||
// future.join();
|
||||
CockpitTemp data = cockpitTempServiceImpl.getOne(new LambdaUpdateWrapper<CockpitTemp>().eq(CockpitTemp::getCode, "all"));
|
||||
jsonObject = JSON.parseObject(data.getValue());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject updateSynthesizeInfo() {
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
//货位使用
|
||||
CompletableFuture<List<Map<String, Object>>> task1 = CompletableFuture.supplyAsync(() -> {
|
||||
Integer total1 = 0;
|
||||
@@ -94,6 +378,10 @@ public class CockpitServiceImpl implements CockpitService {
|
||||
Integer used2 = 0;
|
||||
Integer free2 = 0;
|
||||
String percent2 = "0%";
|
||||
Integer total3 = 0;
|
||||
Integer used3 = 0;
|
||||
Integer free3 = 0;
|
||||
String percent3 = "0%";
|
||||
JSONObject item1 = new JSONObject();
|
||||
JSONObject item3 = new JSONObject();
|
||||
long startTime1 = System.currentTimeMillis();
|
||||
@@ -129,7 +417,33 @@ public class CockpitServiceImpl implements CockpitService {
|
||||
percent2 = roundedPercentage + "%";
|
||||
}
|
||||
}
|
||||
//ctu
|
||||
List<StIvtStructattr> ctuList = ivtList.stream().filter(r -> "CStockId".equals(r.getStor_code())).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(ctuList)) {
|
||||
total3 = ctuList.size();
|
||||
if (total3 > 0) {
|
||||
long used = ctuList.stream().filter(r -> StringUtils.isNotEmpty(r.getVehicle_code())).count();
|
||||
used3 = (int) used;
|
||||
free3 = total3 - used3;
|
||||
double percentage = (double) used3 / total3 * 100;
|
||||
BigDecimal bd = new BigDecimal(percentage).setScale(2, RoundingMode.HALF_UP);
|
||||
double roundedPercentage = bd.doubleValue();
|
||||
percent3 = roundedPercentage + "%";
|
||||
}
|
||||
}
|
||||
}
|
||||
jsonObject1.put("lx_total", total1);
|
||||
jsonObject1.put("lx_used", used1);
|
||||
jsonObject1.put("lx_free", free1);
|
||||
jsonObject1.put("lx_percent", percent1);
|
||||
jsonObject1.put("tp_total", total2);
|
||||
jsonObject1.put("tp_used", used2);
|
||||
jsonObject1.put("tp_free", free2);
|
||||
jsonObject1.put("tp_percent", percent2);
|
||||
jsonObject1.put("ctu_total", total3);
|
||||
jsonObject1.put("ctu_used", used3);
|
||||
jsonObject1.put("ctu_free", free3);
|
||||
jsonObject1.put("ctu_percent", percent3);
|
||||
item1.put("total", total1);
|
||||
item1.put("used", used1);
|
||||
item1.put("free", free1);
|
||||
@@ -224,7 +538,7 @@ public class CockpitServiceImpl implements CockpitService {
|
||||
obj2.put("box", box);
|
||||
}
|
||||
//托盘库入库
|
||||
List<TaskInfo> stockList3 = taskList.stream().filter(r -> (Integer.parseInt(r.getTask_type()) <= 14||Integer.parseInt(r.getTask_type()) == 30)&&r.getVehicle_code().contains("T")).collect(Collectors.toList());
|
||||
List<TaskInfo> stockList3 = taskList.stream().filter(r -> (Integer.parseInt(r.getTask_type()) <= 14 || Integer.parseInt(r.getTask_type()) == 30) && r.getVehicle_code().contains("T")).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(stockList3)) {
|
||||
obj3 = getElapsedTime(obj3, stockList3, true);
|
||||
}
|
||||
@@ -345,12 +659,24 @@ public class CockpitServiceImpl implements CockpitService {
|
||||
return null;
|
||||
});
|
||||
CompletableFuture<Void> allQuery = CompletableFuture.allOf(task1, task2, task3, task4);
|
||||
//CompletableFuture<Void> allQuery = CompletableFuture.allOf(task1, task4);
|
||||
CompletableFuture<JSONObject> future = allQuery.thenApply((result) -> jsonObject).exceptionally((e) -> {
|
||||
log.error("获取综合信息异常:{}", e.getMessage(), e);
|
||||
return null;
|
||||
});
|
||||
future.join();
|
||||
return jsonObject;
|
||||
jsonObject1.forEach((key, value) -> {
|
||||
LambdaUpdateWrapper<CockpitTemp> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(CockpitTemp::getCode, key);
|
||||
updateWrapper.set(CockpitTemp::getValue, value);
|
||||
cockpitTempServiceImpl.update(updateWrapper);
|
||||
});
|
||||
String json = jsonObject.toJSONString();
|
||||
LambdaUpdateWrapper<CockpitTemp> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(CockpitTemp::getCode, "all");
|
||||
updateWrapper.set(CockpitTemp::getValue, json);
|
||||
cockpitTempServiceImpl.update(updateWrapper);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.nl.wms.pda_manage.cockpit.service.impl;
|
||||
import org.nl.wms.pda_manage.cockpit.service.dao.CockpitTemp;
|
||||
import org.nl.wms.pda_manage.cockpit.service.mapper.CockpitTempMapper;
|
||||
import org.nl.wms.pda_manage.cockpit.service.IcockpitTempService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* {@code @Description:} (CockpitTemp)服务实现层
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
@Service("cockpitTempService")
|
||||
public class CockpitTempServiceImpl extends ServiceImpl<CockpitTempMapper, CockpitTemp> implements IcockpitTempService {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
FROM
|
||||
st_ivt_structattr
|
||||
WHERE
|
||||
stor_code IN ('FStockId','FStockPallet')
|
||||
AND is_used = '1'
|
||||
is_used = '1'
|
||||
</select>
|
||||
<select id="getTaskListByDays" resultType="org.nl.wms.pda_manage.cockpit.service.dao.TaskInfo">
|
||||
SELECT
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.wms.pda_manage.cockpit.service.mapper;
|
||||
|
||||
import org.nl.wms.pda_manage.cockpit.service.dao.CockpitTemp;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* {@code @Description:} (CockpitTemp)数据持久层
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
public interface CockpitTempMapper extends BaseMapper<CockpitTemp> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.pda_manage.cockpit.service.mapper.CockpitTempMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -61,7 +61,7 @@ public class CheckStorageService {
|
||||
mst.setCreate_name(user);
|
||||
mst.setCreate_time(now);
|
||||
mst.setId(IdUtil.getStringId());
|
||||
mst.setStatus(StatusEnum.FORM_STATUS.code("生成"));
|
||||
mst.setStatus(StatusEnum.FORM_STATUS.code("执行中"));
|
||||
mst.setCode(CodeUtil.getNewCode(mst.getForm_type()));
|
||||
list.add(mst);
|
||||
for (Object itemO : items) {
|
||||
@@ -70,15 +70,15 @@ public class CheckStorageService {
|
||||
dtl.setCreate_name(user);
|
||||
dtl.setCreate_time(now);
|
||||
dtl.setId(IdUtil.getStringId());
|
||||
dtl.setStatus(StatusEnum.FORM_STATUS.code("生成"));
|
||||
dtl.setStatus(StatusEnum.FORM_STATUS.code("执行中"));
|
||||
dtl.setParent_id(mst.getId());
|
||||
structs.add(dtl.getForm_data().getString("struct_code"));
|
||||
list.add(dtl);
|
||||
}
|
||||
iFormDataService.saveBatch(list);
|
||||
iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
||||
.set("lock_type", StatusEnum.LOCK.code("移库锁"))
|
||||
.in("struct_code",structs));
|
||||
// iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
||||
// .set("lock_type", StatusEnum.LOCK.code("移库锁"))
|
||||
// .in("struct_code",structs));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,26 +2,18 @@ package org.nl.wms.stor_manage.move.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.publish.BussEventMulticaster;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.base_manage.vehicle.service.IBmVehicleInfoService;
|
||||
import org.nl.wms.base_manage.vehicle.service.dao.BmVehicleInfo;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionDto;
|
||||
import org.nl.wms.flow_manage.monitor.event.FlowContinueEvent;
|
||||
import org.nl.wms.flow_manage.monitor.event.FlowStartEvent;
|
||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
|
||||
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||
@@ -33,8 +25,6 @@ import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/*
|
||||
@@ -82,13 +72,13 @@ public class MovingService {
|
||||
structs.add(dtl.getForm_data().getString("end_struct_code"));
|
||||
list.add(dtl);
|
||||
}
|
||||
if (structs.size() != items.size()*2){
|
||||
throw new BadRequestException("移库分配异常:库位信息不正确");
|
||||
}
|
||||
// if (structs.size() != items.size() * 2) {
|
||||
// throw new BadRequestException("移库分配异常:库位信息不正确");
|
||||
// }
|
||||
iFormDataService.saveBatch(list);
|
||||
iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
||||
.set("lock_type", StatusEnum.LOCK.code("移库锁"))
|
||||
.in("struct_code",structs));
|
||||
// iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
||||
// .set("lock_type", StatusEnum.LOCK.code("移库锁"))
|
||||
// .in("struct_code",structs));
|
||||
}
|
||||
@Transactional
|
||||
public void update(JSONObject form){
|
||||
@@ -150,33 +140,52 @@ public class MovingService {
|
||||
}
|
||||
|
||||
|
||||
public void taskOpen(JSONObject form){
|
||||
public void taskOpen(JSONObject form) {
|
||||
PmFormData mst = form.toJavaObject(PmFormData.class);
|
||||
if (StringUtils.isNotEmpty(mst.getProc_inst_id())){
|
||||
if (StringUtils.isNotEmpty(mst.getProc_inst_id())) {
|
||||
throw new BadRequestException("下发失败:当前单据已存在流程,请勿重新下发");
|
||||
}
|
||||
JSONObject mstJ = (JSONObject) JSON.toJSON(mst);
|
||||
ExecutionDto dto = new ExecutionDto();
|
||||
dto.setForm_id(mst.getId());
|
||||
dto.setForm_type(mst.getForm_type());
|
||||
dto.setSource_form_type(mst.getSource_form_type());
|
||||
dto.setSource_form_id(mst.getSource_form_id());
|
||||
dto.setT(mstJ);
|
||||
dto.setItem(packageT(mstJ,"id"));
|
||||
FlowStartEvent startEvent = new FlowStartEvent("st_ivt_move",
|
||||
(proc_inst_id, empPlace) -> iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||
.set("proc_inst_id", proc_inst_id)
|
||||
.eq("is_delete",false)
|
||||
.eq("vehicle_code", empPlace))
|
||||
, null);
|
||||
startEvent.setDto(dto);
|
||||
startEvent.setCallback(proc_inst_id->{
|
||||
iFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||
.set("status",StatusEnum.FORM_STATUS.code("执行中"))
|
||||
.set("proc_inst_id",proc_inst_id)
|
||||
.eq("id",mst.getId()));
|
||||
});
|
||||
BussEventMulticaster.Publish(startEvent);
|
||||
JSONArray jsonArray = form.getJSONArray("children");
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
if (ObjectUtils.isNotEmpty(jsonObject)) {
|
||||
JSONObject json = jsonObject.getJSONObject("form_data");
|
||||
if ((ObjectUtils.isNotEmpty(json))) {
|
||||
String structCode = json.getString("start_struct_code");
|
||||
if (StringUtils.isNotBlank(structCode)) {
|
||||
iStIvtStructattrService.createMoveTask(structCode);
|
||||
}
|
||||
}
|
||||
iFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||
.set("status",StatusEnum.FORM_STATUS.code("完成"))
|
||||
.eq("id",jsonObject.getString("id")));
|
||||
}
|
||||
}
|
||||
iFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||
.set("status",StatusEnum.FORM_STATUS.code("完成"))
|
||||
.eq("id",form.getString("id")));
|
||||
// JSONObject mstJ = (JSONObject) JSON.toJSON(mst);
|
||||
// ExecutionDto dto = new ExecutionDto();
|
||||
// dto.setForm_id(mst.getId());
|
||||
// dto.setForm_type(mst.getForm_type());
|
||||
// dto.setSource_form_type(mst.getSource_form_type());
|
||||
// dto.setSource_form_id(mst.getSource_form_id());
|
||||
// dto.setT(mstJ);
|
||||
// dto.setItem(packageT(mstJ,"id"));
|
||||
// FlowStartEvent startEvent = new FlowStartEvent("st_ivt_move",
|
||||
// (proc_inst_id, empPlace) -> iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||
// .set("proc_inst_id", proc_inst_id)
|
||||
// .eq("is_delete",false)
|
||||
// .eq("vehicle_code", empPlace))
|
||||
// , null);
|
||||
// startEvent.setDto(dto);
|
||||
// startEvent.setCallback(proc_inst_id->{
|
||||
// iFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||
// .set("status",StatusEnum.FORM_STATUS.code("执行中"))
|
||||
// .set("proc_inst_id",proc_inst_id)
|
||||
// .eq("id",mst.getId()));
|
||||
// });
|
||||
// BussEventMulticaster.Publish(startEvent);
|
||||
|
||||
}
|
||||
private List<ExecutionDto> packageT(JSONObject current,String itemField){
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.nl.wms.stor_manage.struct.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -38,6 +38,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -172,6 +173,9 @@ public class StIvtStructattrController {
|
||||
@PostMapping("/createMoveTask")
|
||||
@Log("批量移库下发")
|
||||
public ResponseEntity<Object> createMoveTask(@RequestBody String structCodeList) {
|
||||
if (StringUtils.isBlank(structCodeList)) {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
structattrService.createMoveTask(structCodeList);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@@ -200,6 +204,29 @@ public class StIvtStructattrController {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseEntity<Object> unlock(@RequestBody JSONObject form) {
|
||||
String vehicleCode = form.getString("vehicle_code");
|
||||
StIvtStructattr struct = iStIvtStructattrService.getOne(new LambdaQueryWrapper<StIvtStructattr>().eq(StIvtStructattr::getVehicle_code, vehicleCode));
|
||||
if (struct.getLock_type().equals(StatusEnum.LOCK.code("禁分配锁"))) {
|
||||
String originalCode = struct.getStruct_code(); // "L03-26-41"
|
||||
String parentCode = originalCode.substring(0, originalCode.lastIndexOf("-"));
|
||||
vehicleCode = "L02-03,L02-04,L02-05,L02-05";
|
||||
QueryWrapper<StIvtStructattr> query1 = new QueryWrapper<StIvtStructattr>()
|
||||
.likeRight("struct_code", parentCode)
|
||||
.isNotNull("vehicle_code")
|
||||
.eq("lock_type", StatusEnum.LOCK.code("禁分配锁"));
|
||||
List<StIvtStructattr> list = iStIvtStructattrService.list(query1);
|
||||
List<String> structCodes = list.stream()
|
||||
.map(StIvtStructattr::getStruct_code)
|
||||
.collect(Collectors.toList());
|
||||
if (!structCodes.isEmpty()) {
|
||||
iStIvtStructattrService.update(new LambdaUpdateWrapper<StIvtStructattr>()
|
||||
.set(StIvtStructattr::getLock_type, StatusEnum.LOCK.code("无锁"))
|
||||
.set(StIvtStructattr::getIs_used, 1)
|
||||
.set(StIvtStructattr::getUpdate_time, DateUtil.now())
|
||||
.set(StIvtStructattr::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.in(StIvtStructattr::getStruct_code, structCodes));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
List<MdPbVehicleMater> ones = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>()
|
||||
.eq("vehicle_code", vehicleCode)
|
||||
.eq("is_delete", false));
|
||||
|
||||
@@ -224,6 +224,9 @@
|
||||
<if test="query.vehicle_code != null and query.vehicle_code != ''">
|
||||
and struct.vehicle_code is not null
|
||||
</if>
|
||||
<if test="query.vehicleCode != null and query.vehicleCode != ''">
|
||||
and struct.vehicle_code LIKE '%${query.vehicleCode}%'
|
||||
</if>
|
||||
<if test="query.stor_code != null and query.stor_code != ''">
|
||||
and struct.stor_code = #{query.stor_code}
|
||||
</if>
|
||||
|
||||
@@ -20,6 +20,7 @@ public class StructattrQuery extends BaseQuery<StIvtStructattr> {
|
||||
private String lock_type;
|
||||
private Boolean is_used;
|
||||
private String vehicle_code;
|
||||
private String vehicleCode;
|
||||
private Boolean has_vehicle = Boolean.FALSE;
|
||||
private String material;
|
||||
private Boolean has;
|
||||
|
||||
@@ -480,10 +480,7 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
@Override
|
||||
@Transactional
|
||||
public void createMoveTask(String structCodeList) {
|
||||
if (StringUtils.isBlank(structCodeList)) {
|
||||
return;
|
||||
}
|
||||
Set<String> structCodeSet;
|
||||
Set<String> structCodeSet = new HashSet<>();
|
||||
String structCodeQuery;
|
||||
String structCode = structCodeList.trim();
|
||||
if (structCode.contains(",")) {
|
||||
@@ -492,51 +489,91 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
String[] parts = otherStructCode.split(",");
|
||||
structCodeSet = new HashSet<>(Arrays.asList(parts));
|
||||
} else {
|
||||
structCodeSet = new HashSet<>();
|
||||
structCodeSet.add(otherStructCode);
|
||||
}
|
||||
structCodeQuery = structCode.substring(0, structCode.indexOf(","));
|
||||
} else {
|
||||
structCodeSet = new HashSet<>();
|
||||
structCodeQuery = structCode;
|
||||
}
|
||||
ISchBaseTaskService taskService = SpringContextHolder.getBean(ISchBaseTaskService.class);
|
||||
QueryWrapper<SchBaseTask> query1 = new QueryWrapper<SchBaseTask>()
|
||||
.likeRight("point_code1", structCodeQuery)
|
||||
.lt("status", StatusEnum.FORM_STATUS.code("完成"));
|
||||
List<SchBaseTask> schBaseTaskList = taskService.list(query1);
|
||||
if (!CollectionUtils.isEmpty(schBaseTaskList)) {
|
||||
throw new BadRequestException("当前同排同列库位在任务,请完成后再下发批量移库任务");
|
||||
// ISchBaseTaskService taskService = SpringContextHolder.getBean(ISchBaseTaskService.class);
|
||||
// QueryWrapper<SchBaseTask> query1 = new QueryWrapper<SchBaseTask>()
|
||||
// .likeRight("point_code1", structCodeQuery)
|
||||
// .lt("status", StatusEnum.FORM_STATUS.code("完成"));
|
||||
// List<SchBaseTask> schBaseTaskList = taskService.list(query1);
|
||||
// if (!CollectionUtils.isEmpty(schBaseTaskList)) {
|
||||
// throw new BadRequestException("当前同排同列库位在任务,请完成后再下发批量移库任务");
|
||||
// }
|
||||
Boolean isAllMove;
|
||||
QueryWrapper<StIvtStructattr> query = new QueryWrapper<>();
|
||||
query.eq("is_used", true);
|
||||
if (structCodeQuery.contains("-") && structCodeQuery.indexOf("-", structCodeQuery.indexOf("-") + 1) != -1) {
|
||||
isAllMove = false;
|
||||
query.eq("struct_code", structCodeQuery);
|
||||
} else if (structCodeQuery.contains("-")) {
|
||||
String[] arr = structCodeQuery.substring(1).split("-");
|
||||
int pai = Integer.parseInt(arr[0]);
|
||||
int lie = Integer.parseInt(arr[1]);
|
||||
query.eq("row_num", pai).eq("col_num", lie);
|
||||
isAllMove = true;
|
||||
} else {
|
||||
isAllMove = false;
|
||||
return;
|
||||
}
|
||||
if (structCodeQuery.contains("L")) {
|
||||
query.eq("sect_code","LXBCP01");
|
||||
} else {
|
||||
query.eq("stor_code", StatusEnum.STOCK_INFO.code("托盘库"));
|
||||
}
|
||||
//L01-02,L02-03,L03-01,L02-04
|
||||
QueryWrapper<StIvtStructattr> query = new QueryWrapper<StIvtStructattr>()
|
||||
.eq("is_used", true)
|
||||
.likeRight("struct_code", structCodeQuery)
|
||||
.eq("stor_code", StatusEnum.STOCK_INFO.code("料箱库"));
|
||||
List<StIvtStructattr> list = this.list(query);
|
||||
List<StIvtStructattr> list1 = list.stream().filter(r -> StringUtils.isNotBlank(r.getVehicle_code())).collect(Collectors.toList());
|
||||
list1.stream().filter(r -> StringUtils.isNotBlank(r.getVehicle_code())).collect(Collectors.toList());
|
||||
Set<String> list2 = list.stream()
|
||||
.filter(r -> StringUtils.isBlank(r.getVehicle_code()))
|
||||
.map(StIvtStructattr::getStruct_code)
|
||||
.collect(Collectors.toSet());
|
||||
if (ObjectUtils.isNotEmpty(list1)) {
|
||||
if (ObjectUtils.isNotEmpty(structCodeSet)) {
|
||||
UpdateWrapper<StIvtStructattr> updateWrapper = new UpdateWrapper<StIvtStructattr>()
|
||||
.set("lock_type", "98");
|
||||
updateWrapper.and(wrapper -> {
|
||||
boolean first = true;
|
||||
for (String code : structCodeSet) {
|
||||
if (first) {
|
||||
wrapper.likeRight("struct_code", code);
|
||||
first = false;
|
||||
} else {
|
||||
wrapper.or().likeRight("struct_code", code);
|
||||
if (ObjectUtils.isNotEmpty(list1)) {
|
||||
if (ObjectUtils.isNotEmpty(structCodeSet)) {
|
||||
Set<String> finalStructCodeSet = structCodeSet.stream()
|
||||
.filter(code -> ObjectUtils.isNotEmpty(code) && !code.trim().isEmpty())
|
||||
.collect(Collectors.toSet());
|
||||
if (ObjectUtils.isEmpty(finalStructCodeSet)) {
|
||||
log.warn("structCodeSet过滤后为空,跳过更新操作");
|
||||
return;
|
||||
}
|
||||
QueryWrapper<StIvtStructattr> checkWrapper = new QueryWrapper<>();
|
||||
boolean hasFirst = true;
|
||||
for (String code : finalStructCodeSet) {
|
||||
if (hasFirst) {
|
||||
checkWrapper.likeRight("struct_code", code);
|
||||
hasFirst = false;
|
||||
} else {
|
||||
checkWrapper.or().likeRight("struct_code", code);
|
||||
}
|
||||
}
|
||||
int matchingCount = this.count(checkWrapper);
|
||||
if (matchingCount == 0) {
|
||||
log.info("未找到任何匹配的库位记录。structCodeSet: {}", finalStructCodeSet);
|
||||
return;
|
||||
}
|
||||
UpdateWrapper<StIvtStructattr> updateWrapper = new UpdateWrapper<StIvtStructattr>()
|
||||
.set("lock_type", StatusEnum.LOCK.code("禁分配锁"))
|
||||
.set("is_used", 0).eq("is_used", 1);
|
||||
updateWrapper.and(wrapper -> {
|
||||
boolean firstCondition = true;
|
||||
for (String code : finalStructCodeSet) {
|
||||
if (firstCondition) {
|
||||
wrapper.likeRight("struct_code", code);
|
||||
firstCondition = false;
|
||||
} else {
|
||||
wrapper.or().likeRight("struct_code", code);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
});
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
}
|
||||
//list1= list1.subList(0, Math.min(list.size(), 10));
|
||||
list1.forEach(r -> {
|
||||
DELAY_EXECUTOR.execute(() -> {
|
||||
try {
|
||||
@@ -552,7 +589,9 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
Map moveForm = MapOf.of("task_type", StatusEnum.IOBILL_TYPE_MOVE.code("移库")
|
||||
, "is_send", false
|
||||
, "vehicle_code", StringUtils.isEmpty(vehicleCode) ? "YCZJ" + r.getVehicle_code() : vehicleCode, "form_data", new JSONObject(MapOf.of("start_struct_code", r.getStruct_code(), "end_struct_code", moveStruct.get())));
|
||||
moveForm.put("isAllMove", "1");
|
||||
if (isAllMove) {
|
||||
moveForm.put("isAllMove", "1");
|
||||
}
|
||||
SpringContextHolder.getBean(MoveStorageTask.class).createTask(new JSONObject(moveForm));
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
@@ -564,7 +603,7 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
});
|
||||
if (ObjectUtils.isNotEmpty(list2)) {
|
||||
LambdaUpdateWrapper<StIvtStructattr> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(StIvtStructattr::getLock_type, "99");
|
||||
lambdaUpdateWrapper.set(StIvtStructattr::getLock_type, StatusEnum.LOCK.code("技改锁")).set(StIvtStructattr::getIs_used, 0);
|
||||
lambdaUpdateWrapper.in(StIvtStructattr::getStruct_code, list2);
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package org.nl.wms.system_manage.service.quartz.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.config.lucene.LuceneAppender;
|
||||
import org.nl.wms.pda_manage.cockpit.service.impl.CockpitServiceImpl;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/3/22 17:14
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SyncCockpitScheduleService {
|
||||
|
||||
@Autowired
|
||||
private CockpitServiceImpl cockpitServiceImpl;
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
MDC.put("requestMethod", "TaskScheduleService#run");
|
||||
MDC.put("requestIp", "127.0.0.1");
|
||||
MDC.put("requestTime", DateUtil.now());
|
||||
syncData();
|
||||
} finally {
|
||||
LuceneAppender.traceIdTL.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void syncData() {
|
||||
cockpitServiceImpl.updateSynthesizeInfo();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -13,12 +13,14 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.*;
|
||||
import org.nl.config.lucene.LuceneAppender;
|
||||
import org.nl.wms.base_manage.material.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.config_manage.form_struc.service.impl.BmFormStrucServiceImpl;
|
||||
import org.nl.wms.dispatch_manage.task.service.impl.SchBaseTaskServiceImpl;
|
||||
import org.nl.wms.external_system.erp.dto.ErpQuery;
|
||||
import org.nl.wms.external_system.erp.dto.ErpSec;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
@@ -52,6 +54,9 @@ public class SyncErpBillsScheduleService {
|
||||
|
||||
@Autowired
|
||||
private SyncFormMappingServiceImpl syncFormMappingServiceImpl;
|
||||
@Autowired
|
||||
private SchBaseTaskServiceImpl schBaseTaskServiceImpl;
|
||||
|
||||
|
||||
@Autowired
|
||||
private BmFormStrucServiceImpl bmFormStrucServiceImpl;
|
||||
@@ -105,7 +110,7 @@ public class SyncErpBillsScheduleService {
|
||||
MDC.put("requestIp", "127.0.0.1");
|
||||
MDC.put("requestTime", DateUtil.now());
|
||||
LuceneAppender.traceIdTL.set(BaseCode.intToChars(IdUtil.getLongId()));
|
||||
// List<SyncFormMapping> list = syncFormMappingServiceImpl.list(new LambdaQueryWrapper<SyncFormMapping>().in(SyncFormMapping::getForm_type, "ka7c19edf9d4b4b39b8cc4a06802163b0"));
|
||||
//schBaseTaskServiceImpl.updateLockIvt(StatusEnum.LOCK.code("禁分配锁"));
|
||||
List<BmFormStruc> strucList = bmFormStrucServiceImpl.list(new LambdaQueryWrapper<BmFormStruc>().eq(BmFormStruc::getIs_sync, "1"));
|
||||
Set<String> structSet = strucList.stream().map(BmFormStruc::getForm_type).collect(Collectors.toSet());
|
||||
List<SyncFormMapping> list = syncFormMappingServiceImpl.list(new LambdaQueryWrapper<SyncFormMapping>().in(SyncFormMapping::getForm_type, structSet));
|
||||
|
||||
@@ -35,8 +35,18 @@
|
||||
@click="delCtuIvt"
|
||||
>人工清除CTU库库存
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-warning"-->
|
||||
<!-- @click="updateLockIvt"-->
|
||||
<!-- >批量解除技改禁用仓位锁-->
|
||||
<!-- </el-button>-->
|
||||
</crudOperation>
|
||||
<Log ref="log" />
|
||||
|
||||
</div>
|
||||
<!--Form表单-->
|
||||
<el-dialog
|
||||
@@ -205,7 +215,7 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import Crontab from './components/crontab'
|
||||
import { delCtuIvt } from '@/views/wms/dispatch_manage/task/schBaseTask'
|
||||
import { delCtuIvt, updateLockIvt } from '@/views/wms/dispatch_manage/task/schBaseTask'
|
||||
import * as crudSchBaseTask from '@/views/wms/dispatch_manage/task/schBaseTask'
|
||||
import crudUser from '@/views/system/user/user'
|
||||
|
||||
@@ -312,6 +322,21 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
updateLockIvt() {
|
||||
this.$confirm(`此操作将清空本次技改库位的禁用锁,清除后锁数据无法恢复,本次技改确认完成后再操作!`, '警告', {
|
||||
confirmButtonText: '人工清除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$confirm(`二次提醒:此操作将清空所有技改的禁用锁,清除后锁数据无法恢复,请谨慎操作,本次技改确认完成后再操作!`, '警告', {
|
||||
confirmButtonText: '我要清除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
})
|
||||
})
|
||||
},
|
||||
delMethod(id) {
|
||||
this.delLoading = true
|
||||
crudJob.del([id]).then(() => {
|
||||
|
||||
@@ -172,6 +172,7 @@
|
||||
<!-- style="width: 60px"-->
|
||||
<!-- />-->
|
||||
<el-button type="primary" @click="taskScheduler()">执行整出任务</el-button>
|
||||
<el-button type="warning" @click="cancelTask()">批量取消任务</el-button>
|
||||
<!-- </span>-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
@@ -290,13 +291,13 @@
|
||||
@click="doOperate(scope.row, 'a')"
|
||||
>完成
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-success"
|
||||
:disabled="scope.row.status==='80' || scope.row.status==='82' || scope.row.status==='90'"
|
||||
@click="doOperate(scope.row, 'e')"
|
||||
>强制完成
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-success"-->
|
||||
<!-- :disabled="scope.row.status==='80' || scope.row.status==='82' || scope.row.status==='90'"-->
|
||||
<!-- @click="doOperate(scope.row, 'e')"-->
|
||||
<!-- >强制完成-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-error"
|
||||
@@ -467,12 +468,16 @@ export default {
|
||||
this.query.vehicle_code = ''
|
||||
this.crud.toQuery()
|
||||
},
|
||||
taskScheduler() {
|
||||
cancelTask() {
|
||||
if (this.crud.selections.length === 0) {
|
||||
this.crud.notify('请选择一个任务', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudSchBaseTask.scheduler(JSON.stringify(this.crud.selections)).then(res => {
|
||||
if (this.crud.selections.length > 20) {
|
||||
this.crud.notify('取消任务数量一次不允许超过20个', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudSchBaseTask.cancelTask(JSON.stringify(this.crud.selections)).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
|
||||
@@ -213,13 +213,13 @@
|
||||
@click="doOperate(scope.row, 'a')"
|
||||
>完成
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-success"
|
||||
:disabled="scope.row.status==='80' || scope.row.status==='82' || scope.row.status==='90'"
|
||||
@click="doOperate(scope.row, 'e')"
|
||||
>强制完成
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-success"-->
|
||||
<!-- :disabled="scope.row.status==='80' || scope.row.status==='82' || scope.row.status==='90'"-->
|
||||
<!-- @click="doOperate(scope.row, 'e')"-->
|
||||
<!-- >强制完成-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-error"
|
||||
|
||||
@@ -46,6 +46,14 @@ export function scheduler(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function cancelTask(data) {
|
||||
return request({
|
||||
url: 'api/schBaseTask/cancelTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delCtuIvt(data) {
|
||||
return request({
|
||||
url: 'api/schBaseTask/delCtuIvt',
|
||||
@@ -53,5 +61,12 @@ export function delCtuIvt(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function updateLockIvt(data) {
|
||||
return request({
|
||||
url: 'api/schBaseTask/updateLockIvt',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getTaskStatusList, operation, scheduler, delCtuIvt }
|
||||
export default { add, edit, del, getTaskStatusList, operation, scheduler, delCtuIvt, cancelTask, updateLockIvt }
|
||||
|
||||
@@ -40,6 +40,14 @@
|
||||
placeholder="物料编码模糊查询"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具码">
|
||||
<el-input
|
||||
v-model="query.vehicleCode"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="载具码模糊查询"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user