升级后现场优化相关代码

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.vo.BaseBarcodesOutTaskVo;
import com.shkj.wms.vo.BaseBarcodesOutVo;
import com.shkj.wms.vo.BaseContainerVo;
import com.shkj.wms.vo.BaseInOutQtyVo;
import com.sun.org.apache.xpath.internal.operations.Bool;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;

@ -71,6 +71,7 @@ public class BusinBillInController extends BaseController {
@PostMapping("/saveBillTaskIn")
@RepeatSubmit
public Result<Boolean> saveBillTaskIn(@Valid @RequestBody BillTaskAddbo billTaskAddbo){
logger.info("人工入库信息:"+JsonUtil.toJSONString(billTaskAddbo));
if (billTaskAddbo.getContainerCode() == null){
if (billTaskAddbo.getContainerCodes() == null){
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.IPutInOutStorageService;
import com.shkj.wms.utils.JsonUtil;
import com.sun.xml.internal.bind.v2.TODO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;

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

@ -1932,6 +1932,9 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
if (!Result.isOk(booleanResult)) {
return booleanResult;
}
if (!outBaseLocation.getLocationStatus().equals("1") ||!outBaseLocation.getLocationStatus().equals("2")){
return Result.err().msg("移出货位已预占:"+outBaseLocation.getLocationStatus());
}
// 查询移出货位是否有未完成的任务
LambdaQueryWrapper<BusinDataTask> wrapper = new LambdaQueryWrapper<BusinDataTask>()
.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.StringUtils;
import com.shkj.system.service.ISysParameterService;
import com.shkj.wms.bo.AssingEmptyLocBo;
import com.shkj.wms.bo.BasePointDeviceQueryBo;
import com.shkj.wms.domain.*;
import com.shkj.wms.enums.TaskStatusEnum;
@ -75,6 +76,9 @@ public class IBusinContainerUpkeepServiceImpl extends ServiceImpl<BusinContainer
@Resource
BaseContainerMapper baseContainerMapper;
@Resource
IBaseLocationService iBaseLocationService;
@Override
public List<BusinContainerUpkeepVo> getContainerUpkeepDate(BusinContainerUpkeepQueryBo bo) {
//治具保养周期
@ -90,6 +94,8 @@ public class IBusinContainerUpkeepServiceImpl extends ServiceImpl<BusinContainer
@Override
public Result<Boolean> saveBusintContainerUpkeepEnd(BusinContainerUpkeepAddBo bo) {
log.info("治具入库参数:"+JsonUtil.toJSONString(bo));
//更新保养的记录,新增
BusinContainerUpkeep businContainerUpkeep = this.baseMapper.selectById(bo.getId());
if(businContainerUpkeep != null){
@ -134,12 +140,27 @@ public class IBusinContainerUpkeepServiceImpl extends ServiceImpl<BusinContainer
//TODO 呼叫AGV,判断任务是否有需要空治具的任务,如果有,则送达
Map map = iBusinEnptyContainerServiceImpl.checkWareForEmptycon();
if(ObjectUtils.isEmpty(map)){
// Map map = iBusinEnptyContainerServiceImpl.checkWareForEmptycon();
AssingEmptyLocBo emptyLocBo =null;
Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo);
if (!Result.isOk(locationVoResult)){
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 toPpoint = pointDeviceVo.getPointNo();
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());
// basePoint1.setIsOccupy("0");
// basePointService.updateById(basePoint1);
BasePoint basePoint = new BasePoint();
//取货完成后,不释放码头空闲状态,待AGV取货后,进行释放
/* BasePoint basePoint = new BasePoint();
basePoint.setPointNo(bo.getPointNo());
basePoint = iBasePointService.selectBasePoint(basePoint);
basePoint.setIsOccupy("0");
iBasePointService.updateById(basePoint);
iBasePointService.updateById(basePoint);*/
//更新货位状态为已分配
if (locationVo!=null){
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());
toPpoint = dataTaskVo.getTaskPath();
stuat=true;
}else if (stuats){
}
else if (stuats){
// Map map = checkWareForEmptycon();
AssingEmptyLocBo emptyLocBo = new AssingEmptyLocBo();
Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo);
@ -688,7 +689,7 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
bo.setTunnel(locationVo.getTunnel());
bo.setRoute(locationVo.getRoute());
bo.setIsDeep("2");
log.info("空托入查詢條件:"+JsonUtil.toJSONString(bo));
log.info("空托入查詢條件:"+JsonUtil.toJSONString(bo));
List<BaseLocationVo> baseLocationVos = baseLocationMapper.queryBaseLocationListByDerive1(bo);
log.info("如果查询到的是单深位,查找到的双深位货位:"+JsonUtil.toJSONString(baseLocationVos));
if (baseLocationVos.size() > 0) {

@ -443,12 +443,25 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe
toPpoint = dataTaskVo.getTaskPath();
stuat=true;
}else if (stuats){
Map map = iBusinEnptyContainerServiceImpl.checkWareForEmptycon();
if(ObjectUtils.isEmpty(map)){
// Map map = iBusinEnptyContainerServiceImpl.checkWareForEmptycon();
AssingEmptyLocBo emptyLocBo =null;
Result<BaseLocationVo> locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo);
if (!Result.isOk(locationVoResult)){
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());
toPpoint = pointDeviceVo.getPointNo();
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import java.awt.*;
@ -147,7 +146,7 @@ public class PdfConvertHtmlUtil {
* @return
*/
public static String bufferedImageToBase64(BufferedImage bufferedImage) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
/* ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
String png_base64 = "";
try {
ImageIO.write(bufferedImage, "png", byteArrayOutputStream);// 写入流中
@ -160,7 +159,8 @@ public class PdfConvertHtmlUtil {
} catch (IOException e) {
e.printStackTrace();
}
return png_base64;
return png_base64;*/
return null;
}

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

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

@ -236,11 +236,11 @@
task
left join (select task_code,min(goods_no) goods_no from busin_data_task_goods where 1=1
<if test="createTimeS !=null and createTimeS !=''">
and create_time>=#{createTimeS}
and DATE_FORMAT(create_time,'%Y-%m-%d')>=#{createTimeS}
</if>
<if test="createTimeE !=null and createTimeE !=''">
and create_time &lt;=#{createTimeE}
and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;=#{createTimeE}
</if>
group by task_code) taskGoods
on task.id=taskGoods.task_code
@ -249,11 +249,11 @@
<where>
<if test="createTimeS !=null and createTimeS !=''">
and task.create_time>=#{createTimeS}
and DATE_FORMAT(task.create_time,'%Y-%m-%d')>=#{createTimeS}
</if>
<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 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 count(distinct loc.id) as locQty, alltmp.stockqty as stockqty,
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
left join(
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 (
select count(id) emptyLocQty,tunnel from base_location
where location_status=0
where location_status=0 and is_del=0
group by 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
GROUP BY g.color, g.vehiche_model,loc.tunnel
GROUP BY g.color, g.vehiche_model,loc.tunnel,emptyCon.tunnel
</select>

Loading…
Cancel
Save