升级后现场优化相关代码

main
Comair 1 year ago
parent d5fea3c5ca
commit faa65fdbec
  1. 4
      shkj-wms/src/main/java/com/shkj/wms/controller/business/BaseBarcodesController.java
  2. 1
      shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinBillInController.java
  3. 1
      shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java
  4. 2
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  5. 3
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java
  6. 35
      shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinContainerUpkeepServiceImpl.java
  7. 5
      shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java
  8. 21
      shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java
  9. 6
      shkj-wms/src/main/java/com/shkj/wms/utils/PdfConvertHtmlUtil.java
  10. 6
      shkj-wms/src/main/java/com/shkj/wms/vo/SysStockVCLocationVo.java
  11. 1
      shkj-wms/src/main/resources/mapper/wms/BusinContainerUpkeepMapper.xml
  12. 8
      shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml
  13. 12
      shkj-wms/src/main/resources/mapper/wms/SysStockMapper.xml

@ -13,12 +13,8 @@ import com.shkj.wms.service.IBaseBarcodesOutService;
import com.shkj.wms.service.IBaseGoodsDataService; import com.shkj.wms.service.IBaseGoodsDataService;
import com.shkj.wms.vo.BaseBarcodesOutTaskVo; import com.shkj.wms.vo.BaseBarcodesOutTaskVo;
import com.shkj.wms.vo.BaseBarcodesOutVo; import com.shkj.wms.vo.BaseBarcodesOutVo;
import com.shkj.wms.vo.BaseContainerVo;
import com.shkj.wms.vo.BaseInOutQtyVo; import com.shkj.wms.vo.BaseInOutQtyVo;
import com.sun.org.apache.xpath.internal.operations.Bool;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

@ -71,6 +71,7 @@ public class BusinBillInController extends BaseController {
@PostMapping("/saveBillTaskIn") @PostMapping("/saveBillTaskIn")
@RepeatSubmit @RepeatSubmit
public Result<Boolean> saveBillTaskIn(@Valid @RequestBody BillTaskAddbo billTaskAddbo){ public Result<Boolean> saveBillTaskIn(@Valid @RequestBody BillTaskAddbo billTaskAddbo){
logger.info("人工入库信息:"+JsonUtil.toJSONString(billTaskAddbo));
if (billTaskAddbo.getContainerCode() == null){ if (billTaskAddbo.getContainerCode() == null){
if (billTaskAddbo.getContainerCodes() == null){ if (billTaskAddbo.getContainerCodes() == null){
return Result.err().msg("无此治具号的容器"); return Result.err().msg("无此治具号的容器");

@ -33,7 +33,6 @@ import com.shkj.wms.service.IBaseGoodsDataService;
import com.shkj.wms.service.IBusinDataTaskService; import com.shkj.wms.service.IBusinDataTaskService;
import com.shkj.wms.service.IPutInOutStorageService; import com.shkj.wms.service.IPutInOutStorageService;
import com.shkj.wms.utils.JsonUtil; import com.shkj.wms.utils.JsonUtil;
import com.sun.xml.internal.bind.v2.TODO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

@ -387,6 +387,7 @@ public class ScheduledTasks {
businDataTaskVo.setToLayer(locationVo.getLayer()); businDataTaskVo.setToLayer(locationVo.getLayer());
businDataTaskVo.setToRow(locationVo.getLocationRow()); businDataTaskVo.setToRow(locationVo.getLocationRow());
businDataTaskVo.setTunnel(tunnel); businDataTaskVo.setTunnel(tunnel);
businDataTaskVo.setLocationId(locationVo.getId());
//获取货位对应的巷道及巷道对应的设备信息 //获取货位对应的巷道及巷道对应的设备信息
pointQueryBo.setTunnel(tunnel); pointQueryBo.setTunnel(tunnel);
pointQueryBo.setDirection("0"); pointQueryBo.setDirection("0");
@ -957,6 +958,7 @@ public class ScheduledTasks {
//获取货位及巷道; //获取货位及巷道;
String tunnel = locationVo.getTunnel(); String tunnel = locationVo.getTunnel();
businDataTaskVo.setTunnel(tunnel); businDataTaskVo.setTunnel(tunnel);
businDataTaskVo.setLocationId(locationVo.getId());
// Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(locationVo.getId()); // Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(locationVo.getId());
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTaskVo.getId()); List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTaskVo.getId());
BusinTaskExeBo exeBo = new BusinTaskExeBo(); BusinTaskExeBo exeBo = new BusinTaskExeBo();

@ -1932,6 +1932,9 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
if (!Result.isOk(booleanResult)) { if (!Result.isOk(booleanResult)) {
return booleanResult; return booleanResult;
} }
if (!outBaseLocation.getLocationStatus().equals("1") ||!outBaseLocation.getLocationStatus().equals("2")){
return Result.err().msg("移出货位已预占:"+outBaseLocation.getLocationStatus());
}
// 查询移出货位是否有未完成的任务 // 查询移出货位是否有未完成的任务
LambdaQueryWrapper<BusinDataTask> wrapper = new LambdaQueryWrapper<BusinDataTask>() LambdaQueryWrapper<BusinDataTask> wrapper = new LambdaQueryWrapper<BusinDataTask>()
.notIn(BusinDataTask::getTaskStatus, Arrays.asList("2", "3")) .notIn(BusinDataTask::getTaskStatus, Arrays.asList("2", "3"))

@ -10,6 +10,7 @@ import com.shkj.common.utils.DateUtils;
import com.shkj.common.utils.SecurityUtils; import com.shkj.common.utils.SecurityUtils;
import com.shkj.common.utils.StringUtils; import com.shkj.common.utils.StringUtils;
import com.shkj.system.service.ISysParameterService; import com.shkj.system.service.ISysParameterService;
import com.shkj.wms.bo.AssingEmptyLocBo;
import com.shkj.wms.bo.BasePointDeviceQueryBo; import com.shkj.wms.bo.BasePointDeviceQueryBo;
import com.shkj.wms.domain.*; import com.shkj.wms.domain.*;
import com.shkj.wms.enums.TaskStatusEnum; import com.shkj.wms.enums.TaskStatusEnum;
@ -75,6 +76,9 @@ public class IBusinContainerUpkeepServiceImpl extends ServiceImpl<BusinContainer
@Resource @Resource
BaseContainerMapper baseContainerMapper; BaseContainerMapper baseContainerMapper;
@Resource
IBaseLocationService iBaseLocationService;
@Override @Override
public List<BusinContainerUpkeepVo> getContainerUpkeepDate(BusinContainerUpkeepQueryBo bo) { public List<BusinContainerUpkeepVo> getContainerUpkeepDate(BusinContainerUpkeepQueryBo bo) {
//治具保养周期 //治具保养周期
@ -90,6 +94,8 @@ public class IBusinContainerUpkeepServiceImpl extends ServiceImpl<BusinContainer
@Override @Override
public Result<Boolean> saveBusintContainerUpkeepEnd(BusinContainerUpkeepAddBo bo) { public Result<Boolean> saveBusintContainerUpkeepEnd(BusinContainerUpkeepAddBo bo) {
log.info("治具入库参数:"+JsonUtil.toJSONString(bo));
//更新保养的记录,新增 //更新保养的记录,新增
BusinContainerUpkeep businContainerUpkeep = this.baseMapper.selectById(bo.getId()); BusinContainerUpkeep businContainerUpkeep = this.baseMapper.selectById(bo.getId());
if(businContainerUpkeep != null){ if(businContainerUpkeep != null){
@ -134,12 +140,27 @@ public class IBusinContainerUpkeepServiceImpl extends ServiceImpl<BusinContainer
//TODO 呼叫AGV,判断任务是否有需要空治具的任务,如果有,则送达 //TODO 呼叫AGV,判断任务是否有需要空治具的任务,如果有,则送达
Map map = iBusinEnptyContainerServiceImpl.checkWareForEmptycon(); // Map map = iBusinEnptyContainerServiceImpl.checkWareForEmptycon();
if(ObjectUtils.isEmpty(map)){
AssingEmptyLocBo emptyLocBo =null;
Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo);
if (!Result.isOk(locationVoResult)){
return Result.err().msg("暂无空治具存放区域"); return Result.err().msg("暂无空治具存放区域");
} }
BasePointDeviceVo pointDeviceVo = BeanUtil.toBean(map.get("basePointDeviceVo"),BasePointDeviceVo.class);
BaseLocationVo locationVo = BeanUtil.toBean(map.get("locationVo"), BaseLocationVo.class); BasePointDeviceVo pointDeviceVo = null;
BaseLocationVo locationVo =locationVoResult.getData();
BasePointDeviceQueryBo pointDeviceQueryBo = new BasePointDeviceQueryBo();
pointDeviceQueryBo.setTunnel(locationVo.getTunnel());
pointDeviceQueryBo.setDirection("0");
List<BasePointDeviceVo> basePointDeviceVos = baseLocationPlcMapper.selectBasePointByGroupno(pointDeviceQueryBo);
if (basePointDeviceVos.size() > 0) {
pointDeviceVo = basePointDeviceVos.get(0);
}
String agvType= String.valueOf(RCSTaskTypeEnum.A_TO_B_HAND_PUT.getValue()); String agvType= String.valueOf(RCSTaskTypeEnum.A_TO_B_HAND_PUT.getValue());
String toPpoint = pointDeviceVo.getPointNo(); String toPpoint = pointDeviceVo.getPointNo();
Long dspPlcId =Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id)); Long dspPlcId =Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id));
@ -223,12 +244,12 @@ public class IBusinContainerUpkeepServiceImpl extends ServiceImpl<BusinContainer
// BasePoint basePoint1 = basePointService.selectBasePointByPointNo(pointDevice.getPointNo()); // BasePoint basePoint1 = basePointService.selectBasePointByPointNo(pointDevice.getPointNo());
// basePoint1.setIsOccupy("0"); // basePoint1.setIsOccupy("0");
// basePointService.updateById(basePoint1); // basePointService.updateById(basePoint1);
//取货完成后,不释放码头空闲状态,待AGV取货后,进行释放
BasePoint basePoint = new BasePoint(); /* BasePoint basePoint = new BasePoint();
basePoint.setPointNo(bo.getPointNo()); basePoint.setPointNo(bo.getPointNo());
basePoint = iBasePointService.selectBasePoint(basePoint); basePoint = iBasePointService.selectBasePoint(basePoint);
basePoint.setIsOccupy("0"); basePoint.setIsOccupy("0");
iBasePointService.updateById(basePoint); iBasePointService.updateById(basePoint);*/
//更新货位状态为已分配 //更新货位状态为已分配
if (locationVo!=null){ if (locationVo!=null){
BaseLocation baseLocation = BeanUtil.toBean(locationVo,BaseLocation.class); BaseLocation baseLocation = BeanUtil.toBean(locationVo,BaseLocation.class);

@ -154,7 +154,8 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
agvType= String.valueOf(RCSTaskTypeEnum.TO_B_PUT.getValue()); agvType= String.valueOf(RCSTaskTypeEnum.TO_B_PUT.getValue());
toPpoint = dataTaskVo.getTaskPath(); toPpoint = dataTaskVo.getTaskPath();
stuat=true; stuat=true;
}else if (stuats){ }
else if (stuats){
// Map map = checkWareForEmptycon(); // Map map = checkWareForEmptycon();
AssingEmptyLocBo emptyLocBo = new AssingEmptyLocBo(); AssingEmptyLocBo emptyLocBo = new AssingEmptyLocBo();
Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo); Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo);
@ -688,7 +689,7 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
bo.setTunnel(locationVo.getTunnel()); bo.setTunnel(locationVo.getTunnel());
bo.setRoute(locationVo.getRoute()); bo.setRoute(locationVo.getRoute());
bo.setIsDeep("2"); bo.setIsDeep("2");
log.info("空托入查詢條件:"+JsonUtil.toJSONString(bo)); log.info("空托入查詢條件:"+JsonUtil.toJSONString(bo));
List<BaseLocationVo> baseLocationVos = baseLocationMapper.queryBaseLocationListByDerive1(bo); List<BaseLocationVo> baseLocationVos = baseLocationMapper.queryBaseLocationListByDerive1(bo);
log.info("如果查询到的是单深位,查找到的双深位货位:"+JsonUtil.toJSONString(baseLocationVos)); log.info("如果查询到的是单深位,查找到的双深位货位:"+JsonUtil.toJSONString(baseLocationVos));
if (baseLocationVos.size() > 0) { if (baseLocationVos.size() > 0) {

@ -443,12 +443,25 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe
toPpoint = dataTaskVo.getTaskPath(); toPpoint = dataTaskVo.getTaskPath();
stuat=true; stuat=true;
}else if (stuats){ }else if (stuats){
Map map = iBusinEnptyContainerServiceImpl.checkWareForEmptycon(); // Map map = iBusinEnptyContainerServiceImpl.checkWareForEmptycon();
if(ObjectUtils.isEmpty(map)){ AssingEmptyLocBo emptyLocBo =null;
Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo);
if (!Result.isOk(locationVoResult)){
return Result.err().msg("暂无空治具存放区域"); return Result.err().msg("暂无空治具存放区域");
} }
pointDeviceVo = BeanUtil.toBean(map.get("basePointDeviceVo"),BasePointDeviceVo.class);
locationVo = BeanUtil.toBean(map.get("locationVo"),BaseLocationVo.class); locationVo =locationVoResult.getData();
BasePointDeviceQueryBo pointDeviceQueryBo = new BasePointDeviceQueryBo();
pointDeviceQueryBo.setTunnel(locationVo.getTunnel());
pointDeviceQueryBo.setDirection("0");
List<BasePointDeviceVo> basePointDeviceVos = baseLocationPlcMapper.selectBasePointByGroupno(pointDeviceQueryBo);
if (basePointDeviceVos.size() > 0) {
pointDeviceVo = basePointDeviceVos.get(0);
}
agvType= String.valueOf(RCSTaskTypeEnum.A_TO_B_HAND_PUT.getValue()); agvType= String.valueOf(RCSTaskTypeEnum.A_TO_B_HAND_PUT.getValue());
toPpoint = pointDeviceVo.getPointNo(); toPpoint = pointDeviceVo.getPointNo();
dspPlcId=Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id)); dspPlcId=Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id));

@ -4,7 +4,6 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer; import org.apache.pdfbox.rendering.PDFRenderer;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.*; import java.awt.*;
@ -147,7 +146,7 @@ public class PdfConvertHtmlUtil {
* @return * @return
*/ */
public static String bufferedImageToBase64(BufferedImage bufferedImage) { public static String bufferedImageToBase64(BufferedImage bufferedImage) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); /* ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
String png_base64 = ""; String png_base64 = "";
try { try {
ImageIO.write(bufferedImage, "png", byteArrayOutputStream);// 写入流中 ImageIO.write(bufferedImage, "png", byteArrayOutputStream);// 写入流中
@ -160,7 +159,8 @@ public class PdfConvertHtmlUtil {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
return png_base64; return png_base64;*/
return null;
} }

@ -45,5 +45,11 @@ public class SysStockVCLocationVo {
*/ */
private Integer emptyLocQty; private Integer emptyLocQty;
/**
* 空托数量
*/
private Integer emptyConQty;
} }

@ -25,5 +25,6 @@
and conttainer.branch_id = #{branchId} and conttainer.branch_id = #{branchId}
</if> </if>
</where> </where>
limit 1
</select> </select>
</mapper> </mapper>

@ -236,11 +236,11 @@
task task
left join (select task_code,min(goods_no) goods_no from busin_data_task_goods where 1=1 left join (select task_code,min(goods_no) goods_no from busin_data_task_goods where 1=1
<if test="createTimeS !=null and createTimeS !=''"> <if test="createTimeS !=null and createTimeS !=''">
and create_time>=#{createTimeS} and DATE_FORMAT(create_time,'%Y-%m-%d')>=#{createTimeS}
</if> </if>
<if test="createTimeE !=null and createTimeE !=''"> <if test="createTimeE !=null and createTimeE !=''">
and create_time &lt;=#{createTimeE} and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;=#{createTimeE}
</if> </if>
group by task_code) taskGoods group by task_code) taskGoods
on task.id=taskGoods.task_code on task.id=taskGoods.task_code
@ -249,11 +249,11 @@
<where> <where>
<if test="createTimeS !=null and createTimeS !=''"> <if test="createTimeS !=null and createTimeS !=''">
and task.create_time>=#{createTimeS} and DATE_FORMAT(task.create_time,'%Y-%m-%d')>=#{createTimeS}
</if> </if>
<if test="createTimeE !=null and createTimeE !=''"> <if test="createTimeE !=null and createTimeE !=''">
and task.create_time &lt;=#{createTimeE} and DATE_FORMAT(task.create_time,'%Y-%m-%d') &lt;=#{createTimeE}
</if> </if>
<if test="taskCode !=null and taskCode !='' "> <if test="taskCode !=null and taskCode !='' ">

@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="vehicheColorLocationList" resultType="com.shkj.wms.vo.SysStockVCLocationVo" parameterType="com.shkj.wms.bo.SysReportStockQueryBo"> <select id="vehicheColorLocationList" resultType="com.shkj.wms.vo.SysStockVCLocationVo" parameterType="com.shkj.wms.bo.SysReportStockQueryBo">
select count(distinct loc.id) as locQty, alltmp.stockqty as stockqty, select count(distinct loc.id) as locQty, alltmp.stockqty as stockqty,
g.color, IFNULL(g.vehiche_model,'empty') as vehiche_model g.color, IFNULL(g.vehiche_model,'empty') as vehiche_model
,loc.tunnel ,sum(distinct emptyLoc.emptyLocQty) emptyLocQty ,loc.tunnel ,sum(distinct emptyLoc.emptyLocQty) emptyLocQty,sum(distinct emptyCon.emptyConQty) as emptyConQty
from base_location loc from base_location loc
left join( left join(
select count(distinct location_id) stockqty,goods_no,locGoods.tunnel from select count(distinct location_id) stockqty,goods_no,locGoods.tunnel from
@ -145,11 +145,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join base_goods_data g on g.goods_no=alltmp.goods_no left join base_goods_data g on g.goods_no=alltmp.goods_no
left join ( left join (
select count(id) emptyLocQty,tunnel from base_location select count(id) emptyLocQty,tunnel from base_location
where location_status=0 where location_status=0 and is_del=0
group by tunnel group by tunnel
) emptyLoc on emptyLoc.tunnel =loc.tunnel ) emptyLoc on emptyLoc.tunnel =loc.tunnel
left join (
select count(id) emptyConQty,tunnel from base_location
where location_status=2 and is_del=0
group by tunnel
)emptyCon on emptyCon.tunnel =loc.tunnel
where loc.is_del=0 where loc.is_del=0
GROUP BY g.color, g.vehiche_model,loc.tunnel GROUP BY g.color, g.vehiche_model,loc.tunnel,emptyCon.tunnel
</select> </select>

Loading…
Cancel
Save