Merge remote-tracking branch 'origin/master_merge_0523' into master_merge_0523
This commit is contained in:
@@ -100,7 +100,7 @@ public class PdmBiSubpackagerelationController {
|
||||
*
|
||||
* @param whereJson 查询条件
|
||||
*/
|
||||
@PostMapping ("/queryContainerNameBySaleOrder")
|
||||
@PostMapping("/queryContainerNameBySaleOrder")
|
||||
@SaIgnore
|
||||
@Log("根据订单号查询子卷信息")
|
||||
public ResponseEntity<Object> queryContainerNameBySaleOrder(@RequestBody Map whereJson) {
|
||||
@@ -159,13 +159,14 @@ public class PdmBiSubpackagerelationController {
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/zjInBound")
|
||||
@SaIgnore
|
||||
@Log("子卷装箱查询")
|
||||
//@SaCheckPermission("@el.check(updateEntityList)")
|
||||
public ResponseEntity<Object> zjInBound(@RequestBody JSONObject whereJson) {
|
||||
List list = pdmBiSubpackagerelationService.zjInBound(whereJson);
|
||||
return new ResponseEntity<>(TableDataInfo.build(list),HttpStatus.OK);
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -174,10 +175,10 @@ public class PdmBiSubpackagerelationController {
|
||||
@Log("子卷装箱入库")
|
||||
//@SaCheckPermission("@el.check(updateEntityList)")
|
||||
public ResponseEntity<Object> zjInBoundConfirm(@RequestBody JSONObject whereJson) {
|
||||
RedissonUtils.lock(c->{
|
||||
RedissonUtils.lock(c -> {
|
||||
pdmBiSubpackagerelationService.zjInBoundConfirm(whereJson);
|
||||
},"zjInBound",0,this,"装箱入库在操作,稍后再试");
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
}, "zjInBound", 0, this, "装箱入库在操作,稍后再试");
|
||||
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/boxReturn")
|
||||
@@ -185,14 +186,13 @@ public class PdmBiSubpackagerelationController {
|
||||
@Log("装箱位木箱回库")
|
||||
//@SaCheckPermission("@el.check(updateEntityList)")
|
||||
public ResponseEntity<Object> boxReturn(@RequestBody JSONObject whereJson) {
|
||||
RedissonUtils.lock(c->{
|
||||
RedissonUtils.lock(c -> {
|
||||
pdmBiSubpackagerelationService.boxReturn(whereJson);
|
||||
},"zjInBound",0,this,"装箱送回在操作,稍后再试");
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
}, "zjInBound", 0, this, "装箱送回在操作,稍后再试");
|
||||
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/transferBoxPackageToMes")
|
||||
@Log("传输子卷包装关系至LMS")
|
||||
//@SaCheckPermission("@el.check(updateEntityList)")
|
||||
@@ -202,6 +202,15 @@ public class PdmBiSubpackagerelationController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getPointCode")
|
||||
@Log("传输子卷包装关系至LMS")
|
||||
@SaIgnore
|
||||
//@SaCheckPermission("@el.check(updateEntityList)")
|
||||
public ResponseEntity<Object> getPointCode(@RequestBody JSONObject whereJson) {
|
||||
Integer num = whereJson.getInteger("num");
|
||||
return new ResponseEntity<>(pdmBiSubpackagerelationService.getPointCode(num),HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
@@ -225,7 +234,6 @@ public class PdmBiSubpackagerelationController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/schdule")
|
||||
@Log("定时调度")
|
||||
@SaIgnore
|
||||
@@ -242,22 +250,30 @@ public class PdmBiSubpackagerelationController {
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> ycgzd(@RequestBody JSONObject param) {
|
||||
String pointCode = param.getString("point_code");
|
||||
if (StringUtils.isEmpty(pointCode)){
|
||||
if (StringUtils.isEmpty(pointCode)) {
|
||||
throw new BadRequestException("人工管制点不能为空");
|
||||
}
|
||||
// "ZXQ_135" : "ZXQ_136";
|
||||
// "ZXQ_135" : "ZXQ_136";
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("point_code1", pointCode);
|
||||
autoSendVehicleToDjq.getPointCode(task,PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
|
||||
autoSendVehicleToDjq.getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/downloadData")
|
||||
@SaIgnore
|
||||
public void downloadData(Integer day, HttpServletResponse response) {
|
||||
RedissonUtils.lock(a->{
|
||||
pdmBiSubpackagerelationService.downloadData(3,(HttpServletResponse)a);
|
||||
public void downloadData(Integer day, HttpServletResponse response) {
|
||||
RedissonUtils.lock(a -> {
|
||||
pdmBiSubpackagerelationService.downloadData(3, (HttpServletResponse) a);
|
||||
return null;
|
||||
},"下载任务时间",response);
|
||||
}, "下载任务时间", response);
|
||||
}
|
||||
|
||||
@PostMapping("/checkCode")
|
||||
@Log("三码合一校验")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> checkCode(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdmBiSubpackagerelationService.checkCode(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,8 @@ public interface IpdmBiSubpackagerelationService extends IService<PdmBiSubpackag
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
String getPointCode(Integer whereJson);
|
||||
|
||||
void createSubTest(JSONObject jo);
|
||||
|
||||
|
||||
@@ -141,6 +143,7 @@ public interface IpdmBiSubpackagerelationService extends IService<PdmBiSubpackag
|
||||
*/
|
||||
void downloadData(Integer day, HttpServletResponse response);
|
||||
|
||||
JSONObject checkCode(JSONObject jo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
.eq("status", "0")
|
||||
.in("container_name", split));
|
||||
if (CollectionUtils.isEmpty(subList)) {
|
||||
throw new BadRequestException("当前子卷还为组盘");
|
||||
throw new BadRequestException("当前子卷还未组盘");
|
||||
}
|
||||
if (subList.size() != split.length) {
|
||||
throw new BadRequestException("子卷包装信息与子卷不相符合");
|
||||
@@ -377,19 +377,10 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
if (StringUtils.isEmpty(containerName)) {
|
||||
throw new BadRequestException("子卷编码不能为空");
|
||||
}
|
||||
String deviceCode = "ZXQ_1_1";
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_type", "010908")
|
||||
.eq("is_delete", "0")
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
int count2 = packageinfoivtService.count(new QueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq("point_status", PackageInfoIvtEnum.POINT_STATUS.code("装箱区"))
|
||||
.eq("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("合格品")));
|
||||
if (count + count2 > 8) {
|
||||
throw new BadRequestException("当前装箱区木箱任务已满,稍后再试");
|
||||
}
|
||||
|
||||
String[] split = containerName.split(",");
|
||||
|
||||
String deviceCode = this.getPointCode(split.length);
|
||||
|
||||
//理论毛重
|
||||
List<PdmBiSubpackagerelation> subList = this.list(new QueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq("status", "0")
|
||||
@@ -446,23 +437,23 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
if (ObjectUtil.isEmpty(浅Attr)) {
|
||||
throw new BadRequestException(boxAttr.getString("struct_code") + "对应浅货位信息不正确");
|
||||
}
|
||||
List<SchBaseTask> list = taskService.list(new QueryWrapper<SchBaseTask>()
|
||||
.eq("is_delete", "0")
|
||||
.and(wq -> wq.eq("point_code1", 浅Attr.getString("struct_code")).or().eq("point_code2", 浅Attr.getString("struct_code")))
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
if (ObjectUtil.isEmpty(浅Attr.getString("storagevehicle_code"))) {
|
||||
if (!浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
throw new BadRequestException("木箱货位" + boxAttr.getString("struct_code") + "的浅货位存在正在执行的任务");
|
||||
if (!浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定")) && ObjectUtil.isNotEmpty(list)) {
|
||||
throw new BadRequestException("木箱货位" + boxAttr.getString("struct_code") + "的浅货位存在正在执行的任务" + list.get(0).getTask_code());
|
||||
}
|
||||
} else {
|
||||
if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
// 判断浅货位木箱和深货位木箱是否相同规格
|
||||
task_group_id = outBoxManageService.createBoxMove(浅Attr);
|
||||
} else {
|
||||
List<SchBaseTask> list = taskService.list(new QueryWrapper<SchBaseTask>()
|
||||
.eq("is_delete", "0")
|
||||
.eq("point_code1", 浅Attr.getString("struct_code"))
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
throw new BadRequestException("当前木箱所在货位" + boxAttr.getString("struct_code") + "对应浅货位" + 浅Attr.getString("struct_code") + "存在任务" + 浅Attr.getString("task_code"));
|
||||
throw new BadRequestException("当前木箱所在货位" + boxAttr.getString("struct_code") + "对应浅货位" + 浅Attr.getString("struct_code") + "存在任务" + list.get(0).getTask_code());
|
||||
}
|
||||
throw new BadRequestException("当前木箱所在货位" + boxAttr.getString("struct_code") + "对应浅货位" + 浅Attr.getString("struct_code") + "被锁定" + 浅Attr.getString("task_code"));
|
||||
throw new BadRequestException("当前木箱所在货位" + boxAttr.getString("struct_code") + "对应浅货位" + 浅Attr.getString("struct_code") + "被锁定" + 浅Attr.getString("storagevehicle_code"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -628,7 +619,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
}
|
||||
|
||||
|
||||
private String getPointCode(Integer entitySize) {
|
||||
public String getPointCode(Integer entitySize) {
|
||||
//装箱区对接位
|
||||
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("装箱位"))
|
||||
@@ -637,10 +628,79 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
if (ObjectUtils.isEmpty(bstIvtPackageinfoivtList)) {
|
||||
throw new BadRequestException("没有可用的装箱区对接位");
|
||||
}
|
||||
|
||||
Iterator<BstIvtPackageinfoivt> iterator = bstIvtPackageinfoivtList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
BstIvtPackageinfoivt r = iterator.next();
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_type", "010908")
|
||||
.eq("is_delete", "0")
|
||||
.eq("vehicle_code2", r.getBlock())
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
int count2 = packageinfoivtService.count(new QueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq("point_status", PackageInfoIvtEnum.POINT_STATUS.code("装箱区"))
|
||||
.eq("block", r.getBlock())
|
||||
.eq("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("合格品")));
|
||||
if (count + count2 + entitySize > 10) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(bstIvtPackageinfoivtList)) {
|
||||
throw new BadRequestException("当前装箱区木箱任务已满,稍后再试");
|
||||
}
|
||||
|
||||
String pointCode = "";
|
||||
//装箱区任务数
|
||||
List<Map<String, Object>> zxTaskCount = bstIvtPackageinfoivtMapper.getZxqTaskCount();
|
||||
if (ObjectUtils.isNotEmpty(zxTaskCount)) {
|
||||
Set<String> packageCodeSet = bstIvtPackageinfoivtList.stream()
|
||||
.map(BstIvtPackageinfoivt::getPoint_code)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 从zxTaskCount中过滤出bstIvtPackageinfoivtList不包含的point_code,并按count和point_code2排序
|
||||
List<Map<String, Object>> filteredZxTaskCount = zxTaskCount.stream()
|
||||
.filter(map -> {
|
||||
Object pointCodeObj = map.get("point_code");
|
||||
String code = pointCodeObj != null ? pointCodeObj.toString() : null;
|
||||
// 过滤掉包含在packageCodeSet中的,只保留包含的
|
||||
return code != null && packageCodeSet.contains(code);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return filteredZxTaskCount.get(0).get("point_code").toString();
|
||||
} else {
|
||||
pointCode = bstIvtPackageinfoivtList.get(0).getPoint_code();
|
||||
}
|
||||
|
||||
return pointCode;
|
||||
}
|
||||
|
||||
public String getPointCode2(Integer entitySize) {
|
||||
//装箱区对接位
|
||||
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("装箱位"))
|
||||
.eq(BstIvtPackageinfoivt::getIs_used, IOSEnum.IS_NOTANDYES.code("是"))
|
||||
.orderByAsc(BstIvtPackageinfoivt::getPoint_code));
|
||||
if (ObjectUtils.isEmpty(bstIvtPackageinfoivtList)) {
|
||||
throw new BadRequestException("没有可用的装箱区对接位");
|
||||
}
|
||||
|
||||
String deviceCode = "ZXQ_1_1";
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_type", "010908")
|
||||
.eq("is_delete", "0")
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
int count2 = packageinfoivtService.count(new QueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq("point_status", PackageInfoIvtEnum.POINT_STATUS.code("装箱区"))
|
||||
.eq("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("合格品")));
|
||||
if (count + count2 > 8) {
|
||||
throw new BadRequestException("当前装箱区木箱任务已满,稍后再试");
|
||||
}
|
||||
Map<String, Integer> resultMap = new LinkedHashMap<>();
|
||||
Set<String> zxIvtSet = bstIvtPackageinfoivtList.stream().map(BstIvtPackageinfoivt::getBlock).collect(Collectors.toSet());
|
||||
//装箱区任务数
|
||||
List<Map<String, Object>> zxTaskCount = bstIvtPackageinfoivtMapper.getZxqTaskCount(zxIvtSet);
|
||||
List<Map<String, Object>> zxTaskCount = bstIvtPackageinfoivtMapper.getZxqTaskCount();
|
||||
if (ObjectUtils.isNotEmpty(zxTaskCount)) {
|
||||
for (Map<String, Object> map : zxTaskCount) {
|
||||
String pointCode = map.get("point_code2").toString();
|
||||
@@ -671,7 +731,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
//任务数量超过10个不满足装箱任务创建
|
||||
result.removeIf(map -> {
|
||||
Map.Entry<String, Integer> entry = map.entrySet().iterator().next();
|
||||
return entry.getValue() + entitySize > 10;
|
||||
return entry.getValue() + entitySize > 8;
|
||||
});
|
||||
//获取数量最少的点位
|
||||
Optional<String> minPointCode = result.stream()
|
||||
@@ -942,12 +1002,47 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
strings[5] = "呼叫时间";
|
||||
new FileUtil().downloadExcelIO(ioData, strings, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> recordQuery(List<String> pcsn) {
|
||||
if (CollectionUtils.isEmpty(pcsn)){
|
||||
if (CollectionUtils.isEmpty(pcsn)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return this.baseMapper.recordQuery(pcsn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject checkCode(JSONObject jo) {
|
||||
//内标
|
||||
String nb_code = jo.getString("nb_code");
|
||||
//管标
|
||||
String gb_code = jo.getString("gb_code");
|
||||
//木箱码
|
||||
String box_code = jo.getString("box_code");
|
||||
//客户标签码
|
||||
String customer_code = jo.getString("customer_code");
|
||||
|
||||
if (!StrUtil.equals(nb_code, gb_code)) {
|
||||
throw new BadRequestException("内标【" + nb_code + "】和管标【" + gb_code + "】子卷号不一致!");
|
||||
}
|
||||
|
||||
if (!StrUtil.equals(box_code, customer_code)) {
|
||||
throw new BadRequestException("木箱码【" + box_code + "】和客户标签码【" + customer_code + "】箱号不一致!");
|
||||
}
|
||||
|
||||
PdmBiSubpackagerelation subDto = this.getOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, nb_code));
|
||||
if (ObjectUtil.isEmpty(subDto)) {
|
||||
throw new BadRequestException("子卷号【" + nb_code + "】在LMS系统上为查询到包装关系!");
|
||||
}
|
||||
if (StrUtil.isEmpty(subDto.getPackage_box_sn())) {
|
||||
throw new BadRequestException("子卷号【" + nb_code + "】在LMS系统上包装关系的木箱号为空!");
|
||||
}
|
||||
if (!StrUtil.equals(box_code, subDto.getPackage_box_sn())) {
|
||||
throw new BadRequestException("子卷号绑定的木箱码【" + subDto.getPackage_box_sn() + "】和木箱码【" + box_code + "】箱号不一致!");
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "校验通过!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,14 +10,15 @@ import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.pdm.ivt.service.dto.DeliveryPointIvtDto;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -38,6 +39,9 @@ public class BstIvtPackageinfoivtController {
|
||||
@Resource
|
||||
private IbstIvtPackageinfoivtService bstIvtPackageinfoivtService;
|
||||
|
||||
@Resource
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@@ -72,7 +76,6 @@ public class BstIvtPackageinfoivtController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
@@ -89,6 +92,7 @@ public class BstIvtPackageinfoivtController {
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param params 实体对象
|
||||
* @return 修改结果
|
||||
*/
|
||||
@@ -101,7 +105,6 @@ public class BstIvtPackageinfoivtController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
@@ -114,6 +117,15 @@ public class BstIvtPackageinfoivtController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/redisQueue")
|
||||
@SaIgnore
|
||||
public List<Object> getRedisQueue(@RequestParam("key") String key) {
|
||||
if (!"ZXQ_1_1".equals(key) && !"ZXQ_2_1".equals(key)) {
|
||||
throw new IllegalArgumentException("非法队列 key");
|
||||
}
|
||||
return redisUtils.lGet(key, 0, -1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface BstIvtPackageinfoivtMapper extends BaseMapper<BstIvtPackageinfo
|
||||
/**
|
||||
* 获取待检区到装箱区的任务数量
|
||||
*/
|
||||
List<Map<String, Object>> getZxqTaskCount(Set<String> groupIds);
|
||||
List<Map<String, Object>> getZxqTaskCount();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,26 +12,22 @@
|
||||
</select>
|
||||
<select id="getZxqTaskCount" resultType="java.util.Map">
|
||||
SELECT
|
||||
CASE
|
||||
WHEN t.task_type = '010704' THEN t.point_code2
|
||||
WHEN t.task_type = '010908' THEN t.vehicle_code2
|
||||
END AS point_code2,
|
||||
COUNT(*) AS count
|
||||
FROM sch_base_task t
|
||||
bp.point_code,
|
||||
COALESCE(COUNT(DISTINCT t.task_id), 0) AS count
|
||||
FROM
|
||||
bst_ivt_packageinfoivt bp -- 你的所有点位基准表
|
||||
LEFT JOIN sch_base_task t ON bp.point_code = t.point_code2
|
||||
AND t.task_type = '010704'
|
||||
AND t.task_status <![CDATA[ < ]]> '07'
|
||||
AND t.is_delete = '0'
|
||||
LEFT JOIN bst_ivt_packageinfoivt p ON t.point_code2 = p.point_code
|
||||
AND p.point_status = '5'
|
||||
WHERE
|
||||
t.task_type IN ('010704', '010908')
|
||||
AND t.create_time >= DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%s')
|
||||
AND t.task_status <![CDATA[ < ]]> '07'
|
||||
<if test="groupIds != null and groupIds.size() > 0">
|
||||
AND (t.task_type != '010908' OR t.vehicle_code2 IN
|
||||
<foreach item="code" collection="groupIds" open="(" separator="," close=")">#{code}</foreach>
|
||||
)
|
||||
</if>
|
||||
bp.point_code IN ('ZXQ_1_1', 'ZXQ_2_1') -- 指定需要的点位
|
||||
GROUP BY
|
||||
CASE
|
||||
WHEN t.task_type = '010704' THEN t.point_code2
|
||||
WHEN t.task_type = '010908' THEN t.vehicle_code2
|
||||
END
|
||||
bp.point_code
|
||||
ORDER BY
|
||||
count, bp.point_code;
|
||||
</select>
|
||||
<select id="getTaskList1" resultType="org.nl.b_lms.sch.task.dao.SchBaseTask">
|
||||
SELECT
|
||||
|
||||
@@ -40,6 +40,9 @@ public interface IbstIvtPackageinfoivtService extends IService<BstIvtPackageinfo
|
||||
*/
|
||||
List<BstIvtPackageinfoivt> checkEndPointTask(String ivtType, String ivtStatus, String pointCode,String sortType,String taskType);
|
||||
|
||||
List<BstIvtPackageinfoivt> checkEndPointTask2(String ivtType, String ivtStatus, String pointCode,String sortType,String taskType);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取等待点
|
||||
|
||||
@@ -434,6 +434,139 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BstIvtPackageinfoivt> checkEndPointTask2(String ivtType, String ivtStatus, String pointCode, String sortType, String taskType) {
|
||||
List<SchBaseTask> taskList;
|
||||
Set<String> pointSets;
|
||||
boolean isQueryGroup = false;
|
||||
List<BstIvtPackageinfoivt> returList = new ArrayList<>();
|
||||
//移库任务返回点位处理
|
||||
List<String> taskTypes = new ArrayList<>(Arrays.asList(
|
||||
PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"),
|
||||
PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->管制区)"),
|
||||
PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"),
|
||||
PackageInfoIvtEnum.TASK_TYPE.code("待检区->管制区"),
|
||||
PackageInfoIvtEnum.TASK_TYPE.code("管制区->待检区"),
|
||||
PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区")));
|
||||
if (taskTypes.contains(taskType)) {
|
||||
//是否查询相同组的库位
|
||||
isQueryGroup = true;
|
||||
}
|
||||
List<BstIvtPackageinfoivt> packageinfoivtList = getBstIvtPackageinfoivts2(ivtType, ivtStatus, sortType, isQueryGroup);
|
||||
Set<String> pointIds = packageinfoivtList.stream()
|
||||
.map(BstIvtPackageinfoivt::getPoint_code)
|
||||
.collect(Collectors.toSet());
|
||||
if (ObjectUtils.isEmpty(pointIds)) {
|
||||
return returList;
|
||||
}
|
||||
if (pointCode == null) {
|
||||
return packageinfoivtList;
|
||||
}
|
||||
if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务")) || pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"))) {
|
||||
taskList = bstIvtPackageinfoivtMapper.getTaskList(pointIds, pointIds, null, null);
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货分配"))) {
|
||||
taskList = bstIvtPackageinfoivtMapper.getTaskList(pointIds, pointIds, pointIds, null);
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货分配"))) {
|
||||
taskList = bstIvtPackageinfoivtMapper.getTaskList(pointIds, pointIds, null, pointIds);
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("四个点任务分配"))) {
|
||||
//四个点任务取货分配条件为取货完成信号即刻更新库存,所以不判断是否有起点任务
|
||||
taskList = new ArrayList<>();
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("四个点任务取货"))) {
|
||||
taskList = bstIvtPackageinfoivtMapper.getTaskList(pointIds, null, pointIds, null);
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("空载具放货"))) {
|
||||
taskList = bstIvtPackageinfoivtMapper.getTaskList(null, pointIds, null, pointIds);
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("空载具放货分配"))) {
|
||||
List<BstIvtPackageinfoivt> pointList = new ArrayList<>();
|
||||
List<BstIvtPackageinfoivt> ivtList = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具"))).sorted(Comparator.comparing(BstIvtPackageinfoivt::getSort_seq)).collect(Collectors.toList());
|
||||
List<BstIvtPackageinfoivt> vehicleList = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空"))).sorted(Comparator.comparing(BstIvtPackageinfoivt::getSort_seq).reversed()).collect(Collectors.toList());
|
||||
//有空载具
|
||||
if (ObjectUtils.isNotEmpty(ivtList)) {
|
||||
BstIvtPackageinfoivt bstIvtPackageinfoivt = new BstIvtPackageinfoivt();
|
||||
bstIvtPackageinfoivt.setPoint_code(ivtList.get(0).getPoint_code());
|
||||
bstIvtPackageinfoivt.setSort_seq(ivtList.get(0).getSort_seq());
|
||||
bstIvtPackageinfoivt.setIvt_status(ivtList.get(0).getIvt_status());
|
||||
returList.add(bstIvtPackageinfoivt);
|
||||
//判断是否有空载具阻挡
|
||||
pointList.add(getSecondaryIvt(vehicleList, returList));
|
||||
return pointList;
|
||||
} else {
|
||||
BstIvtPackageinfoivt bstIvtPackageinfoivt = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空"))).sorted(Comparator.comparing(BstIvtPackageinfoivt::getSort_seq).reversed()).collect(Collectors.toList()).get(0);
|
||||
pointList.add(bstIvtPackageinfoivt);
|
||||
return pointList;
|
||||
}
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务取货分配"))) {
|
||||
taskList = bstIvtPackageinfoivtMapper.getTaskList(pointIds, pointIds, pointIds, pointIds);
|
||||
} else {
|
||||
return packageinfoivtList;
|
||||
}
|
||||
// 未完成的任务点位汇集
|
||||
if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("四个点任务取货"))) {
|
||||
pointSets = taskList.stream()
|
||||
.flatMap(task -> Stream.of(
|
||||
task.getPoint_code1(),
|
||||
task.getPoint_code3()
|
||||
))
|
||||
.filter(point -> point != null && !point.trim().isEmpty())
|
||||
.collect(Collectors.toSet());
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("四个点任务分配"))) {
|
||||
pointSets = taskList.stream()
|
||||
.flatMap(task -> Stream.of(
|
||||
task.getPoint_code1()
|
||||
))
|
||||
.filter(point -> point != null && !point.trim().isEmpty())
|
||||
.collect(Collectors.toSet());
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("空载具放货"))) {
|
||||
pointSets = taskList.stream()
|
||||
.flatMap(task -> Stream.of(
|
||||
task.getPoint_code2(),
|
||||
task.getPoint_code4()
|
||||
))
|
||||
.filter(point -> point != null && !point.trim().isEmpty() && !point.equals("ZXQ_01_1") && !point.equals("ZXQ_01_2"))
|
||||
.collect(Collectors.toSet());
|
||||
//限制补空任务数量
|
||||
List<BstIvtPackageinfoivt> ivtList = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具"))).collect(Collectors.toList());
|
||||
Set<String> ivtpointSets = ivtList.stream().map(BstIvtPackageinfoivt::getPoint_code).collect(Collectors.toSet());
|
||||
if (ObjectUtils.isNotEmpty(ivtpointSets)) {
|
||||
//存在任务数量+已有库存数量大于3,不创建任务
|
||||
if (pointSets.size() + ivtpointSets.size() >= 3) {
|
||||
return returList;
|
||||
}
|
||||
}
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务")) || pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("放货任务"))) {
|
||||
pointSets = taskList.stream()
|
||||
.flatMap(task -> Stream.of(
|
||||
task.getPoint_code1(),
|
||||
task.getPoint_code2()
|
||||
))
|
||||
.filter(point -> point != null && !point.trim().isEmpty())
|
||||
.collect(Collectors.toSet());
|
||||
} else {
|
||||
pointSets = taskList.stream()
|
||||
.flatMap(task -> Stream.of(
|
||||
task.getPoint_code1(),
|
||||
task.getPoint_code2(),
|
||||
task.getPoint_code3(),
|
||||
task.getPoint_code4()
|
||||
))
|
||||
.filter(point -> point != null && !point.trim().isEmpty())
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
//移库任务返回点位处理
|
||||
if (isQueryGroup) {
|
||||
return getBstIvtPackageinfoivts(ivtStatus, pointSets, packageinfoivtList);
|
||||
}
|
||||
//符合条件的库存点位过滤掉已存在任务的点位
|
||||
List<BstIvtPackageinfoivt> planTaskList = packageinfoivtList.stream()
|
||||
.filter(p -> !pointSets.contains(p.getPoint_code()) && p.getIvt_status().equals(ivtStatus))
|
||||
.collect(Collectors.toList());
|
||||
//送空载具到空载具缓存位任务,需要判断是否存在已分配的且未完成的送空载具任务,如果存在,判断存在是否阻挡
|
||||
if (taskType.equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)")) || taskType.equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)"))) {
|
||||
return getNoBlockIvt(pointCode, taskList, planTaskList);
|
||||
} else {
|
||||
return planTaskList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 过滤不符合移库条件的同组库位
|
||||
@@ -607,6 +740,32 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
}
|
||||
}
|
||||
|
||||
public List<BstIvtPackageinfoivt> getBstIvtPackageinfoivts2(String ivtType, String ivtStatus, String sortType, boolean isQueryGroup) {
|
||||
LambdaQueryWrapper<BstIvtPackageinfoivt> queryWrapper = new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getPoint_status, ivtType);
|
||||
if (StringUtils.isNotEmpty(ivtStatus)) {
|
||||
queryWrapper.eq(BstIvtPackageinfoivt::getIvt_status, ivtStatus);
|
||||
}
|
||||
if (PackageInfoIvtEnum.SORT_TYPE.code("升序").equals(sortType)) {
|
||||
queryWrapper.orderByAsc(BstIvtPackageinfoivt::getSort_seq);
|
||||
} else if (PackageInfoIvtEnum.SORT_TYPE.code("降序").equals(sortType)) {
|
||||
queryWrapper.orderByDesc(BstIvtPackageinfoivt::getSort_seq);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(BstIvtPackageinfoivt::getSort_seq);
|
||||
}
|
||||
List<BstIvtPackageinfoivt> ivtList = bstIvtPackageinfoivtMapper.selectList(queryWrapper);
|
||||
if (isQueryGroup && ObjectUtils.isNotEmpty(ivtList)) {
|
||||
Set<String> colNumSet = ivtList.stream().map(BstIvtPackageinfoivt::getCol_num).collect(Collectors.toSet());
|
||||
//无分组点位
|
||||
if (colNumSet.contains("0")) {
|
||||
return ivtList;
|
||||
}
|
||||
return bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_status, ivtType).in(BstIvtPackageinfoivt::getCol_num, colNumSet));
|
||||
} else {
|
||||
return ivtList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取等待点
|
||||
|
||||
@@ -132,6 +132,7 @@ public class TwoExceptionInTask extends AbstractAcsTask {
|
||||
json.put("vehicle_code2", form.getString("vehicle_code2"));
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
json.put("remark",form.getString("remark"));
|
||||
json.put("request_param", form.getString("request_param"));
|
||||
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
|
||||
@@ -168,9 +168,17 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
attrTab.update(jsonAttr);
|
||||
//更新木箱信息
|
||||
JSONObject packageInfo = packageinfoivt.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
packageInfo.put("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
|
||||
packageInfo.put("container_name", jsonTask.getString("vehicle_code"));
|
||||
packageinfoivt.update(packageInfo);
|
||||
if (packageInfo.getString("plan").equals("0")) {
|
||||
packageInfo.put("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
|
||||
packageInfo.put("container_name", jsonTask.getString("vehicle_code"));
|
||||
packageinfoivt.update(packageInfo);
|
||||
}else {
|
||||
//校验当前目的地的木箱号与任务中的木箱号是否一致
|
||||
if (!packageInfo.getString("container_name").equals(jsonTask.getString("vehicle_code"))) {
|
||||
log.info("目的地的木箱号与任务中的木箱号不一致");
|
||||
}
|
||||
}
|
||||
|
||||
RedissonUtils.lock(c->{
|
||||
if (status.equals(TaskStatusEnum.FINISHED.getCode())) {
|
||||
immediateNotifyAcs(null);
|
||||
|
||||
@@ -55,6 +55,7 @@ public class SsxDjwTask extends AbstractAcsTask {
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<AcsTaskDto> addTask() {
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
List<SchBaseTask> taskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>().eq(SchBaseTask::getHandle_class, THIS_CLASS)
|
||||
|
||||
@@ -16,11 +16,14 @@ import org.nl.b_lms.sch.tasks.first_floor_area.SsxDjwTask;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
@@ -33,7 +36,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoExecuteWaitTask extends Prun{
|
||||
private final String THIS_CLASS = AutoExecuteWaitTask.class.getName();
|
||||
|
||||
@@ -50,10 +52,10 @@ public class AutoExecuteWaitTask extends Prun{
|
||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
||||
|
||||
//自动执行等待的桁架任务
|
||||
@Autowired
|
||||
public void run() {
|
||||
try {
|
||||
this.executeWaitTask();
|
||||
AutoExecuteWaitTask bean = SpringContextHolder.getBean(AutoExecuteWaitTask.class);
|
||||
bean.executeWaitTask();
|
||||
}catch (Exception ex){
|
||||
log.error(ex.getMessage());
|
||||
}
|
||||
@@ -64,6 +66,7 @@ public class AutoExecuteWaitTask extends Prun{
|
||||
* 放满与取空桁架任务
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Transactional
|
||||
public void executeWaitTask() {
|
||||
log.info(THIS_CLASS+"-放满与取空桁架定时任务开始执行扫描。");
|
||||
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.MultiSet;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
@@ -154,20 +155,31 @@ public class AutoSendVehicleToKzj extends Prun{
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
|
||||
Set<String> task_block = new HashSet<>();
|
||||
if (isCalling.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
//存在正在执行的行架任务
|
||||
List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||
.eq(SchBaseTask::getTask_type, "010909"));
|
||||
if (ObjectUtils.isNotEmpty(taskList)) {
|
||||
taskList.forEach(task -> {
|
||||
String point_code = task.getPoint_code1();
|
||||
BstIvtPackageinfoivt one = packageinfoivtService.getOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getPoint_code, point_code));
|
||||
task_block.add(one.getBlock());
|
||||
});
|
||||
/*if (ObjectUtils.isNotEmpty(taskList)) {
|
||||
log.warn("当前装箱区存在执行的行架任务"+taskList.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(",")));
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
//存在装箱区有空载具的点位
|
||||
List<BstIvtPackageinfoivt> zxqVehicleList = packageinfoivtService
|
||||
.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
|
||||
if (ObjectUtils.isNotEmpty(task_block)){
|
||||
zxqVehicleList = zxqVehicleList.stream().filter(zxq -> !task_block.contains(zxq.getBlock())).collect(Collectors.toList());
|
||||
}
|
||||
List<BstIvtPackageinfoivt> djqEmpList = packageinfoivtService
|
||||
.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空"));
|
||||
if (CollectionUtils.isEmpty(zxqVehicleList) || CollectionUtils.isEmpty(djqEmpList)) {
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -49,7 +50,7 @@ import static org.nl.wms.util.TaskUtil.getMaxNum;
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoSendZxToDjw extends Prun{
|
||||
public class AutoSendZxToDjw extends Prun {
|
||||
private final String THIS_CLASS = AutoSendZxToDjw.class.getName();
|
||||
|
||||
private final RedissonClient redissonClient;
|
||||
@@ -79,13 +80,12 @@ public class AutoSendZxToDjw extends Prun{
|
||||
private BstIvtBoxinfoMapper bstIvtBoxinfoMapper;
|
||||
|
||||
|
||||
|
||||
//装箱区->装箱对接位agv自动搬运任务
|
||||
@Autowired
|
||||
public void run() {
|
||||
try {
|
||||
this.sendZxToDjw();
|
||||
}catch (Exception ex){
|
||||
} catch (Exception ex) {
|
||||
log.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -93,18 +93,29 @@ public class AutoSendZxToDjw extends Prun{
|
||||
@SneakyThrows
|
||||
public void sendZxToDjw() {
|
||||
//装箱位有木箱
|
||||
List<BstIvtPackageinfoivt> zxwPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱位"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), "", PackageInfoIvtEnum.SORT_TYPE.code("升序"), PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位"));
|
||||
List<BstIvtPackageinfoivt> zxwPackageinfoivtList = packageinfoivtService.checkEndPointTask2(PackageInfoIvtEnum.POINT_STATUS.code("装箱位"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), "", PackageInfoIvtEnum.SORT_TYPE.code("升序"), PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位"));
|
||||
if (ObjectUtils.isEmpty(zxwPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_type", PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位"))
|
||||
.eq("is_delete", "0")
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
if (count>0){
|
||||
|
||||
Iterator<BstIvtPackageinfoivt> iterator = zxwPackageinfoivtList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
BstIvtPackageinfoivt r = iterator.next();
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_type", PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位"))
|
||||
.eq("point_code2", r.getPoint_code())
|
||||
.eq("is_delete", "0")
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
if (count > 0) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(zxwPackageinfoivtList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (BstIvtPackageinfoivt bstIvtPackageinfoivt : zxwPackageinfoivtList) {
|
||||
//装箱位上的木箱号
|
||||
String boxNo = bstIvtPackageinfoivt.getContainer_name();
|
||||
@@ -181,6 +192,7 @@ public class AutoSendZxToDjw extends Prun{
|
||||
//子卷号
|
||||
param.put("frpModel", paperSize);
|
||||
param.put("barcode", containerName);
|
||||
param.put("isHave", "0");
|
||||
jo.put("request_param", param.toString());
|
||||
zxDjwTask.createTask(jo);
|
||||
}
|
||||
@@ -287,6 +299,4 @@ public class AutoSendZxToDjw extends Prun{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.redisson.api.RList;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutobindZxqBox extends Prun {
|
||||
|
||||
private final String THIS_CLASS = AutobindZxqBox.class.getName();
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
@Resource
|
||||
private BstIvtPackageinfoivtMapper bstIvtPackageinfoivtMapper;
|
||||
|
||||
//待检区->装箱区agv自动搬运任务
|
||||
@Autowired
|
||||
public void run() {
|
||||
try {
|
||||
this.bindZxqBox();
|
||||
} catch (Exception ex) {
|
||||
log.error(ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 二次分配任务
|
||||
*/
|
||||
@SneakyThrows
|
||||
public void bindZxqBox() {
|
||||
log.info(THIS_CLASS + "-装箱对接位绑定木箱开始扫描。");
|
||||
RLock lock = redissonClient.getLock(THIS_CLASS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
//获取当前启用的装箱对接位
|
||||
//装箱区对接位
|
||||
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("装箱位"))
|
||||
// .eq(BstIvtPackageinfoivt::getIs_used, IOSEnum.IS_NOTANDYES.code("是"))
|
||||
.eq(BstIvtPackageinfoivt::getPlan, IOSEnum.IS_NOTANDYES.code("是"))
|
||||
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("空"))
|
||||
.orderByAsc(BstIvtPackageinfoivt::getPoint_code));
|
||||
bstIvtPackageinfoivtList.forEach(bstIvtPackage -> {
|
||||
//判断当前装箱对接位的木箱队列是否有值,有值则取第一个进行赋值
|
||||
Object o = redisUtils.lGetIndex(bstIvtPackage.getPoint_code(), 0);
|
||||
if (ObjectUtil.isNotEmpty(o)) {
|
||||
String firstElement = o.toString();
|
||||
bstIvtPackage.setIvt_status(PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
|
||||
bstIvtPackage.setContainer_name(firstElement);
|
||||
bstIvtPackage.setUpdate_time(DateUtil.now());
|
||||
bstIvtPackageinfoivtMapper.updateById(bstIvtPackage);
|
||||
log.info(bstIvtPackage.getPoint_code() + "绑定了木箱" + firstElement);
|
||||
redisUtils.lRemove(bstIvtPackage.getPoint_code(), 1, firstElement);
|
||||
} else {
|
||||
log.info("列表为空,无木箱可绑定。");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
log.info("满轴->待检区agv自动搬运任务正在创建被锁住。");
|
||||
}
|
||||
} finally {
|
||||
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,6 +44,6 @@ public interface IStIvtIostorinvdisService extends IService<StIvtIostorinvdis> {
|
||||
*/
|
||||
void confirmDisIn(String task_id);
|
||||
|
||||
List<StructAllsetDto> getDisStructSet(String iostorinvId);
|
||||
List<StructAllsetDto> getDisStructSet(String iostorinvId, String iostorinvDtlId);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,13 +20,14 @@ public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
|
||||
|
||||
/**
|
||||
* 获取全部已分配未下发的分配明细
|
||||
*
|
||||
* @param whereJson :{
|
||||
* iostorinvdtl_id: 明细标识 (自动取消时传)
|
||||
* box_no: 箱号 (自动取消时传)
|
||||
* iostorinv_id: 单据标识
|
||||
* bill_status: 明细状态
|
||||
* is_issued: 是否已下发
|
||||
* }
|
||||
* }
|
||||
* @return List<JSONObject> 分配明细实体类集合
|
||||
*/
|
||||
List<JSONObject> getDivIosDisAll(JSONObject whereJson);
|
||||
@@ -40,18 +41,15 @@ public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
|
||||
|
||||
/**
|
||||
* 获取此单据下/此明细下 所有未生成的分配明细
|
||||
*
|
||||
* @param whereJson :{
|
||||
* iostorinvdtl_id: 明细标识
|
||||
* iostorinv_id: 单据标识
|
||||
* }
|
||||
* }
|
||||
* @return List<JSONObject> 分配明细实体类集合
|
||||
*/
|
||||
List<JSONObject> getNotCreateDis(JSONObject whereJson);
|
||||
|
||||
@Select("select st_ivt_structattr.sect_id,st_ivt_structattr.block_num,st_ivt_structattr.row_num,st_ivt_structattr.out_order_seq,st_ivt_structattr.struct_code,st_ivt_structattr.placement_type \n" +
|
||||
"from st_ivt_iostorinvdis \n" +
|
||||
"left join st_ivt_structattr on st_ivt_iostorinvdis.struct_code = st_ivt_structattr.struct_code\n" +
|
||||
"where st_ivt_iostorinvdis.work_status = '00' and st_ivt_iostorinvdis.iostorinv_id = #{iostorinvId}")
|
||||
List<StructAllsetDto> getDisStructSet(String iostorinvId);
|
||||
List<StructAllsetDto> getDisStructSet(String iostorinvId,String iostorinvDtlId);
|
||||
|
||||
}
|
||||
|
||||
@@ -128,4 +128,20 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getDisStructSet" resultType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructAllsetDto">
|
||||
select st_ivt_structattr.sect_id,
|
||||
st_ivt_structattr.block_num,
|
||||
st_ivt_structattr.row_num,
|
||||
st_ivt_structattr.out_order_seq,
|
||||
st_ivt_structattr.struct_code,
|
||||
st_ivt_structattr.placement_type
|
||||
from st_ivt_iostorinvdis dis
|
||||
left join st_ivt_structattr on st_ivt_iostorinvdis.struct_code = st_ivt_structattr.struct_code
|
||||
where st_ivt_iostorinvdis.work_status = '00'
|
||||
and st_ivt_iostorinvdis.iostorinv_id = #{iostorinvId}
|
||||
<if test="iostorinvDtlId != null and iostorinvDtlId != ''">
|
||||
AND dis.iostorinvdtl_id = #{iostorinvDtlId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -151,8 +151,8 @@ public class StIvtIostorinvdisServiceImpl extends ServiceImpl<StIvtIostorinvdisM
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StructAllsetDto> getDisStructSet(String iostorinvId) {
|
||||
List<StructAllsetDto> structSet = this.baseMapper.getDisStructSet(iostorinvId);
|
||||
public List<StructAllsetDto> getDisStructSet(String iostorinvId ,String iostorinvDtlId) {
|
||||
List<StructAllsetDto> structSet = this.baseMapper.getDisStructSet(iostorinvId, iostorinvDtlId);
|
||||
return structSet;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,6 +154,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
//异常位
|
||||
jsonTaskParam.put("point_code2", "RK1003");
|
||||
jsonTaskParam.put("vehicle_code", boxNo);
|
||||
jsonTaskParam.put("remark", "当前托盘【"+whereJson.getString("vehicle_code")+"】已经绑定木箱【"+pcsn+"】,无法重复绑定!");
|
||||
jsonTaskParam.put("vehicle_code2", whereJson.getString("vehicle_code"));
|
||||
JSONObject request_param = new JSONObject();
|
||||
if (whereJson.getString("vehicle_code").startsWith("A")) {
|
||||
|
||||
@@ -142,7 +142,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
List<String> permission = new LinkedList<>();
|
||||
// 查看是否为管理员
|
||||
permission.add("admin");
|
||||
permission.addAll(sysMenuMapper.getPermissionByUserId(userDto.getString("userId")));
|
||||
permission.addAll(sysMenuMapper.getPermissionByUserId(userDto.getString("user_id")));
|
||||
return permission;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.ext.acs.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -178,6 +179,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
@Resource
|
||||
private SsxDjwTask ssxDjwTask;
|
||||
|
||||
@Resource
|
||||
private IbstIvtPackageinfoivtService ibstIvtPackageinfoivtService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISysParamService iSysParamService;
|
||||
@@ -3041,6 +3045,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
public JSONObject getIsUncap(JSONObject param) {
|
||||
String material_barcode = param.getString("material_barcode");
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
String task_code = param.getString("task");
|
||||
//干燥剂模板
|
||||
String desiccantTemplate = "6";
|
||||
//是否开盖
|
||||
@@ -3098,6 +3103,22 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
jsonObject.put("isUncap", isUncap);
|
||||
jsonObject.put("heightLevel", height);
|
||||
jsonObject.put("status", HttpStatus.OK.value());
|
||||
|
||||
//判断该任务是否属于空木箱出库任务
|
||||
SchBaseTask one = taskService.getOne(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getTask_code, task_code));
|
||||
if (one.getHandle_class().equals("org.nl.b_lms.sch.tasks.TwoOutBoxTask")){
|
||||
|
||||
BstIvtPackageinfoivt packageinfoivt = ibstIvtPackageinfoivtService.getOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getPoint_code, one.getPoint_code2()));
|
||||
if (packageinfoivt.getPlan().equals("1")){
|
||||
//往redis里面添加空木箱队列
|
||||
if (redisUtils.lGetListSize(one.getPoint_code2()) == 0 || !redisUtils.lGetIndex(one.getPoint_code2(), -1).equals(material_barcode)){
|
||||
redisUtils.lSet(one.getPoint_code2(),material_barcode);
|
||||
}else {
|
||||
log.info("reids队列中的最后一个木箱与当前木箱一致");
|
||||
}
|
||||
}
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
@@ -280,11 +280,14 @@ public class CheckOutBillController {
|
||||
@Log("出库单强制确认")
|
||||
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
iStIvtIostorinvOutService.confirm(whereJson);
|
||||
} else {
|
||||
checkOutBillService.confirmOrder(whereJson);
|
||||
}
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
RedissonUtils.lock(c -> {
|
||||
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
iStIvtIostorinvOutService.confirm(whereJson);
|
||||
} else {
|
||||
checkOutBillService.confirmOrder(whereJson);
|
||||
}
|
||||
}, iostorinv_id, 1, 120, null);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.nl.system.service.dept.dao.SysUserDept;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.OutTask;
|
||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||
@@ -3253,7 +3254,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
}
|
||||
// 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
|
||||
List<StructAllsetDto> structSet = iStIvtIostorinvdisService.getDisStructSet(whereJson.getString("iostorinv_id"));
|
||||
List<StructAllsetDto> structSet = iStIvtIostorinvdisService.getDisStructSet(whereJson.getString("iostorinv_id"),whereJson.getString("iostorinvdtl_id"));
|
||||
//同区同排排序:10302-04-01
|
||||
//口口回口回口口口1
|
||||
//口口回回口口口口2
|
||||
|
||||
@@ -264,7 +264,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
mp.put("销售订单", json.getString("sale_order_name"));
|
||||
mp.put("行号", "");
|
||||
}
|
||||
mp.put("出库日期", json.getString("input_time"));
|
||||
mp.put("出库日期", json.getString("confirm_time"));
|
||||
mp.put("产品规格", String.format("%.0f", json.getDoubleValue("width")));
|
||||
mp.put("产品厚度", json.getString("thickness"));
|
||||
mp.put("单位面积", json.getString("mass_per_unit_area"));
|
||||
|
||||
Reference in New Issue
Block a user