2,3,5楼看板接口修改,及5楼仓储调度任务,库位占用率

master
马雪伟 2 days ago
parent 6537852996
commit 577322e4c1

@ -45,7 +45,13 @@ public class DmsRealtimeStatusHistory implements Serializable {
private Date syncTime;
private Date hour;
private Long timeCount;
public Long getTimeCount() {
return timeCount;
}
public void setTimeCount(Long timeCount) {
this.timeCount = timeCount;
}
public Long getHistoryId() {
return historyId;
@ -118,6 +124,13 @@ public class DmsRealtimeStatusHistory implements Serializable {
public void setSyncTime(Date syncTime) {
this.syncTime = syncTime;
}
public Date getHour() {
return hour;
}
public void setHour(Date hour) {
this.hour = hour;
}
}

@ -1,11 +1,9 @@
package com.hw.mes.board.service;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.mes.board.domain.RawAmount;
import com.hw.mes.board.domain.RecordIotenvInstant;
import com.hw.mes.domain.MesProductOrder;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@ -5,14 +5,13 @@ import com.hw.mes.board.domain.RecordIotenvInstant;
import com.hw.mes.board.service.ThirdMesBorderService;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.mapper.MesProductOrderMapper;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class ThirdMesBorderServiceImpl implements ThirdMesBorderService {
@Autowired
private MesProductOrderMapper mesProductOrderMapper;
@ -39,6 +38,7 @@ public class ThirdMesBorderServiceImpl implements ThirdMesBorderService {
rawAmount.setInStock(map.getInStock());
if (map.getMaterialId().equals(decimalMap.getMaterialId())){
rawAmount.setOutStock(decimalMap.getOutStock());
rawAmounts.add(rawAmount);
}
}
}

@ -9,6 +9,7 @@ import com.hw.mes.board.domain.DmsRealtimeStatusHistory;
import com.hw.mes.board.domain.RawAmount;
import com.hw.mes.board.domain.RecordIotenvInstant;
import com.hw.mes.domain.MesProductOrder;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
@ -16,6 +17,7 @@ import com.hw.mes.domain.MesProductOrder;
* @author Yinq
* @date 2024-02-20
*/
@Mapper
public interface MesProductOrderMapper
{
/**

@ -416,19 +416,19 @@
wms_product_instock
where
begin_time > now() -interval 7 day and warehouse_id = 231
group by hour order by hour desc
group by day order by day desc
</select>
<select id="dustAnalysis" resultType="com.hw.mes.board.domain.RecordIotenvInstant">
SELECT x.* FROM `hwjy-cloud`.record_iotenv_instant x order by x.collectTime desc limit 10
</select>
<select id="deviceTimeCount" resultType="com.hw.mes.board.domain.DmsRealtimeStatusHistory">
select
DATE_FORMAT(sync_time , '%Y-%m-%d %H:00:00') as hour,count(1)*10 timeCount
DATE_FORMAT(sync_time , '%Y-%m-%d %H:00:00') hour,count(1)*10 timeCount
from
dms_realtime_status_history
where
sync_time > now() - interval 7 hour
and status_value = true
and status_value = 'True'
and status_name = '烘干机风机状态'
group by hour

@ -29,6 +29,20 @@ public class FifthWmsBorderController {
public AjaxResult fifthPanake(){
return AjaxResult.success(fifthWmsBorderService.fifthPanake());
}
/**
*
*/
@GetMapping("/locationPercentage")
public AjaxResult locationPercentage(){
return AjaxResult.success(fifthWmsBorderService.locationPercentage());
}
/**
*
*/
@GetMapping("scheduleTask")
public AjaxResult scheduleTask(){
return AjaxResult.success(fifthWmsBorderService.scheduleTask());
}
}

@ -0,0 +1,13 @@
package com.hw.wms.board.domain;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class RawAmount {
private String materialId;
private BigDecimal inStock;
private BigDecimal outStock;
private String week;
}

@ -15,4 +15,8 @@ public interface FifthWmsBorderService {
Map locationCount();
Map fifthPanake();
BigDecimal locationPercentage();
List<WmsProductOutstockDetail> scheduleTask();
}

@ -1,5 +1,6 @@
package com.hw.wms.board.service;
import com.hw.wms.board.domain.RawAmount;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsRawOutstock;
@ -12,4 +13,6 @@ public interface ThirdWmsBorderService {
List<WmsBaseLocation> locationStatus();
List<WmsRawOutstock> productPlan();
}

@ -31,6 +31,11 @@ public class FifthWmsBoardServiceImpl implements FifthWmsBorderService {
private WmsBaseLocationMapper wmsBaseLocationMapper;
@Override
public List<WmsProductOutstockDetail> scheduleTask() {
return wmsProductOutstockMapper.scheduleTask();
}
@Override
public Map locationCount() {
HashMap map = new HashMap<>();
@ -52,6 +57,14 @@ public class FifthWmsBoardServiceImpl implements FifthWmsBorderService {
return map;
}
@Override
public BigDecimal locationPercentage() {
int allProductLocation = wmsBaseLocationMapper.selectAllProductLocation();
int productEmptyLocation = wmsBaseLocationMapper.selectAllProductEmptyLocation();
BigDecimal decimal = new BigDecimal(productEmptyLocation).divide(new BigDecimal(allProductLocation), 2, BigDecimal.ROUND_HALF_UP);
return decimal;
}
@Override
public Map fifthPanake() {
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectRawLocationPercentage();

@ -52,8 +52,12 @@ public class SecondWmsBoardServiceImpl implements SecondWmsBorderService {
List<WmsProductOutstock> outstocks = wmsProductStockMapper.selectOutStock();
Map<Long,List<WmsProductOutstock>> map = outstocks.stream().collect(Collectors.groupingBy(WmsProductOutstock::getProductId));
for (WmsProductInstock instock : instocks) {
WmsProductOutstock wmsProductOutstock = map.get(instock.getProductId()).get(0);
instock.setOutStockAmount(wmsProductOutstock.getOutstockQty());
if (map != null&&map.keySet().size()>0) {
WmsProductOutstock wmsProductOutstock = map.get(instock.getProductId()).get(0);
instock.setOutStockAmount(wmsProductOutstock.getOutstockQty());
}else {
instock.setOutStockAmount(new BigDecimal(0));
}
}
return instocks;
}

@ -1,5 +1,6 @@
package com.hw.wms.board.service.impl;
import com.hw.wms.board.domain.RawAmount;
import com.hw.wms.board.service.ThirdWmsBorderService;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsRawOutstock;
@ -7,12 +8,13 @@ import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.mapper.WmsRawInstockMapper;
import com.hw.wms.mapper.WmsRawOutstockMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class ThirdWmsBorderServiceImpl implements ThirdWmsBorderService {
@Autowired
private WmsRawInstockMapper wmsRawInstockMapper;
@ -31,6 +33,7 @@ public class ThirdWmsBorderServiceImpl implements ThirdWmsBorderService {
return hashMap;
}
@Override
public List<WmsRawOutstock> productPlan() {
return wmsRawOutstockMapper.productPlan();

@ -97,4 +97,8 @@ public interface WmsBaseLocationMapper
int selectAllLocation();
List<WmsBaseLocation> locationStatus();
int selectAllProductLocation();
int selectAllProductEmptyLocation();
}

@ -143,4 +143,6 @@ public interface WmsProductOutstockMapper
WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId);
List<WmsProductOutstock> locationCount();
List<WmsProductOutstockDetail> scheduleTask();
}

@ -318,6 +318,17 @@
where
warehouse_id = 512
</select>
<select id="selectAllProductLocation" resultType="java.lang.Integer">
select
count(1)
from
`hwjy-cloud`.wms_base_location
where
warehouse_id = 531
</select>
<select id="selectAllProductEmptyLocation" resultType="java.lang.Integer">
SELECT x.* FROM `hwjy-cloud`.wms_base_location x where x.warehouse_id = 531
</select>
</mapper>

@ -400,14 +400,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="locationCount" resultType="com.hw.wms.domain.WmsProductOutstock">
select
warehouse_id warehouse_id ,
sum(outstock_qty) outstock_qty
ifnull(sum(outstock_qty),0) outstock_qty
from
wms_product_outstock
where
apply_date > now() - interval 1 month
and warehouse_id = 531
</select>
<select id="scheduleTask" resultType="com.hw.wms.domain.WmsProductOutstockDetail">
SELECT x.* FROM `hwjy-cloud`.wms_product_outstock_detail x where x.begin_time > now() - interval 1 month
</select>
<update id="auditWmsProductOutstockByTaskCode" parameterType="WmsProductOutstock">
update wms_product_outstock

Loading…
Cancel
Save