add:增加子卷质检接口

This commit is contained in:
2024-06-18 20:53:13 +08:00
parent daa1a8a64e
commit 810e8bb510
9 changed files with 125 additions and 32 deletions

View File

@@ -5,6 +5,7 @@ import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.pda.service.VehicleTwoService;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.modules.logging.annotation.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author liuxy
* @date 2022-05-25
@@ -26,6 +29,10 @@ public class VehicleTwoController {
@Autowired
private VehicleTwoService vehicleTwoService;
@Resource
private IbstIvtPackageinfoivtService bstIvtPackageInfoIvtService;
@PostMapping("/vehicleIn")
@Log("入空载具")
@SaIgnore
@@ -53,4 +60,13 @@ public class VehicleTwoController {
public ResponseEntity<Object> reback(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(vehicleTwoService.reback(whereJson), HttpStatus.OK);
}
@PostMapping("/updatePackageInfo")
@Log("一楼待检区-管制区子卷质检")
@SaIgnore
public ResponseEntity<Object> updatePackageInfo(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(bstIvtPackageInfoIvtService.update(whereJson), HttpStatus.OK);
}
}

View File

@@ -153,6 +153,9 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
*/
@Override
public List<PdmBiSubpackagerelation> queryContainerNameBySaleOrder(Map whereJson) {
if (!whereJson.containsKey("sale_order_name")) {
return null;
}
List<PdmBiSubpackagerelation> pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper.queryContainerNameBySaleOrder(whereJson.get("sale_order_name").toString());
Map<String, Long> countByGroup = pdmBiSubpackagerelationList.stream()
.filter(item -> item.getBox_group() != null)
@@ -386,9 +389,9 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
public void updateEntityList(JSONObject whereJson) {
List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class);
List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> r.getStatus().equals("0")).collect(Collectors.toList());
if (isOutBox.size() > 0) {
throw new BadRequestException("标记为黄色的子卷号已分配木箱,请重新选择未分配木箱的子卷");
}
if (isOutBox.size() > 0) {
throw new BadRequestException("标记为黄色的子卷号已分配木箱,请重新选择未分配木箱的子卷");
}
JSONArray jsonArray = whereJson.getJSONArray("tableMater");
if (jsonArray == null || jsonArray.size() == 0) {
throw new BadRequestException("无选中子卷信息");
@@ -441,7 +444,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
throw new BadRequestException("库位 -> 装箱对接位,木箱码不能为空!");
}
//更新子卷包装关系更新木箱号
CompletableFuture.runAsync(() -> {
CompletableFuture.runAsync(() -> {
try {
updateBoxInfo(entityList, boxSn);
} catch (Exception e) {

View File

@@ -0,0 +1,59 @@
package org.nl.b_lms.sch.point.controller;
import java.util.Set;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
/**
* {@code @Description:} 装箱区点位库存表(BstIvtPackageinfoivt)控制层
* {@code @Author:} gbx
*
* @since 2024-06-18
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/bstIvtPackageinfoivt")
@Slf4j
public class BstIvtPackageinfoivtController {
@Resource
private IbstIvtPackageinfoivtService bstIvtPackageinfoivtService;
/**
* 新增数据
*
* @param params 实体对象
* @return 新增结果
*/
@PostMapping
public ResponseEntity<Object> create(@RequestBody BstIvtPackageinfoivt params) {
bstIvtPackageinfoivtService.create(params);
return new ResponseEntity<>(HttpStatus.OK);
}
/**
* 删除数据
*
* @param ids 多个主键Id
* @return 删除结果
*/
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
bstIvtPackageinfoivtService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -1,5 +1,6 @@
package org.nl.b_lms.sch.point.service;
import com.alibaba.fastjson.JSONObject;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -54,9 +55,9 @@ public interface IbstIvtPackageinfoivtService extends IService<BstIvtPackageinfo
/**
* 编辑
*
* @param entity /
* @param whereJson /
*/
void update(BstIvtPackageinfoivt entity);
JSONObject update(JSONObject whereJson);
/**
* 多选删除

View File

@@ -1,9 +1,11 @@
package org.nl.b_lms.sch.point.service.impl;
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.toolkit.support.SFunction;
import jodd.net.HttpStatus;
import org.apache.commons.collections4.CollectionUtils;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
@@ -16,6 +18,7 @@ import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.common.utils.SecurityUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -139,15 +142,27 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
/**
* 编辑
*
* @param entity 对象实体
*/
@Override
public void update(BstIvtPackageinfoivt entity) {
// BstIvtPackageinfoivt dto = bstIvtPackageinfoivtMapper.selectById(entity.getId);
// if (dto == null) {
// throw new BadRequestException("不存在该数据!");
// }
bstIvtPackageinfoivtMapper.updateById(getBasicInfo(entity, false));
public JSONObject update(JSONObject whereJson) {
JSONObject result = new JSONObject();
if (!whereJson.containsKey("ivt_status") || !whereJson.containsKey("container_name")) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "子卷号或子卷品质为空");
return result;
}
//"有子卷","2","合格品","3","管制品","4"
BstIvtPackageinfoivt dto = bstIvtPackageinfoivtMapper.selectOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name")));
if (dto == null) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "不存在该数据!");
return result;
}
dto.setIvt_status(whereJson.getString("ivt_status"));
bstIvtPackageinfoivtMapper.updateById(getBasicInfo(dto, false));
result.put("status", org.springframework.http.HttpStatus.OK.value());
result.put("message", "检验成功!");
return result;
}
@@ -170,14 +185,14 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
* @param isCreate 是否创建
*/
private BstIvtPackageinfoivt getBasicInfo(BstIvtPackageinfoivt entity, boolean isCreate) {
// if (isCreate) {
// entity.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
// entity.setCreate_name(SecurityUtils.getCurrentNickName());
// entity.setCreate_time(DateUtil.now());
// }
// entity.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
// entity.setUpdate_optname(SecurityUtils.getCurrentNickName());
// entity.setUpdate_time(DateUtil.now());
if (isCreate) {
entity.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
entity.setCreate_name(SecurityUtils.getCurrentNickName());
entity.setCreate_time(DateUtil.now());
}
entity.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
entity.setUpdate_optname(SecurityUtils.getCurrentNickName());
entity.setUpdate_time(DateUtil.now());
return entity;
}

View File

@@ -135,7 +135,6 @@ public class MzhcwTask extends AbstractAcsTask {
toSsxTask.put("acs_task_type", PackageInfoIvtEnum.ACS_TASK_TYPE.code("桁架任务"));
toSsxTask.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"));
toSsxTask.put("vehicle_code", schBaseTask.getVehicle_code());
//toSsxTask.put("vehicle_code", containerInfo.getContainer_name());
//判断空载具缓存位是否有空载具库存,有就叫桁架去任一位置搬空载具
if (CollectionUtils.isNotEmpty(kzjPointList)) {
//直接创建搬运空载具任务

View File

@@ -64,10 +64,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -1753,7 +1750,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("二楼到一楼成品子卷到达一楼输送线sendProductToFirstFloor--------------------------" + whereJson.toString());
JSONObject result = new JSONObject();
if (StringUtils.isBlank(whereJson.getString("device_code")) || StringUtils.isBlank(whereJson.getString("material_barcode"))) {
throw new BadRequestException("接口sendProductToFirstFloor任务号或子卷号参数为空!");
throw new BadRequestException("接口sendProductToFirstFloor目标站点或子卷号参数为空!");
}
if (whereJson.getString("device_code").equals("null") || whereJson.getString("material_barcode").equals("null")) {
throw new BadRequestException("接口sendProductToFirstFloor目标站点或子卷号参数为null");
}
RLock lock = redissonClient.getLock(whereJson.getString("material_barcode"));
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
@@ -1777,7 +1777,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
jo.put("point_code2", mzPointList.get(0).getPoint_code());
List<BstIvtPackageinfoivt> kzjPointList = bstIvtPackageinfoivtList.stream()
.filter(r -> PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位").equals(r.getPoint_status())
&& PackageInfoIvtEnum.IVT_STATUS.code("空载具").equals(r.getIvt_status())).collect(Collectors.toList());
&& PackageInfoIvtEnum.IVT_STATUS.code("空载具").equals(r.getIvt_status()))
.sorted(Comparator.comparing(BstIvtPackageinfoivt::getSort_seq).reversed()).collect(Collectors.toList());
//空载具缓存位有空载具
if (CollectionUtils.isNotEmpty(kzjPointList)) {
jo.put("point_code3", kzjPointList.get(0).getPoint_code());
@@ -1794,6 +1795,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("")));
if (CollectionUtils.isEmpty(existTaskList)) {
JSONObject jo1 = new JSONObject();
//创建确定终点任务
jo1.put("acs_task_type", PackageInfoIvtEnum.ACS_TASK_TYPE.code("桁架任务"));
jo1.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"));
jo1.put("point_code2", "NBJ1002");
@@ -1926,8 +1928,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("applyTwo返回参数---------------------------------------------" + result.toString());
return result;
}
}
finally {
} finally {
if (tryLock) {
lock.unlock();
}