看板前端和接口修改
master
xs 7 months ago
parent ed42221638
commit e763d2271a

@ -15,21 +15,21 @@ public class FifthMesBorderController {
private FifthMesBorderService fifthMesBorderService; private FifthMesBorderService fifthMesBorderService;
/** /**
* * ()
*/ */
@GetMapping("/productProgress") @GetMapping("/productProgress")
public AjaxResult productProgress(){ public AjaxResult productProgress(){
return AjaxResult.success(fifthMesBorderService.productProgress()); return AjaxResult.success(fifthMesBorderService.productProgress());
} }
/** /**
* *
*/ */
@GetMapping("/workOrderProgress") @GetMapping("/workOrderProgress")
public AjaxResult workOrderProgress(){ public AjaxResult workOrderProgress(){
return AjaxResult.success(fifthMesBorderService.workOrderProgress()); return AjaxResult.success(fifthMesBorderService.workOrderProgress());
} }
/** /**
* *
*/ */
@GetMapping("/productionQualified") @GetMapping("/productionQualified")
public AjaxResult productionQualified(){ public AjaxResult productionQualified(){
@ -44,7 +44,7 @@ public class FifthMesBorderController {
return AjaxResult.success(fifthMesBorderService.orderTime()); return AjaxResult.success(fifthMesBorderService.orderTime());
} }
/** /**
* * ()
*/ */
@GetMapping("/orderEfficiency") @GetMapping("/orderEfficiency")
public AjaxResult orderEfficiency(){ public AjaxResult orderEfficiency(){

@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.text.DecimalFormat; import java.text.DecimalFormat;
@Service @Service
public class FourthMesBoardServiceImpl implements IFourthMesBoardService { public class FourthMesBoardServiceImpl implements IFourthMesBoardService {
@Autowired @Autowired
@ -68,7 +69,7 @@ public class FourthMesBoardServiceImpl implements IFourthMesBoardService {
latestProductOrder.setMesProductPlanList(mesProductPlanList); latestProductOrder.setMesProductPlanList(mesProductPlanList);
List<MesBaseProcessInfo> mesBaseProcessInfoList = this.computeProcessPercentage(mesProductPlanList); List<MesBaseProcessInfo> mesBaseProcessInfoList = this.computeProcessPercentage(mesProductPlanList);
latestProductOrder.setBaseProcessInfoList(mesBaseProcessInfoList); latestProductOrder.setBaseProcessInfoList(mesBaseProcessInfoList);
} }
@ -79,17 +80,17 @@ public class FourthMesBoardServiceImpl implements IFourthMesBoardService {
/** /**
* *
*/ */
private List<MesBaseProcessInfo> computeProcessPercentage(List<MesProductPlan> mesProductPlanList){ private List<MesBaseProcessInfo> computeProcessPercentage(List<MesProductPlan> mesProductPlanList) {
//所有工序加起来的占比 //所有工序加起来的占比
int totalPercentage = mesProductPlanList.stream() int totalPercentage = mesProductPlanList.stream()
.mapToInt(MesProductPlan::getProcessPercentageInt) .mapToInt(MesProductPlan::getProcessPercentageInt)
.reduce(0, Integer::sum); .reduce(0, Integer::sum);
Map<Long,String> processInfo = new HashMap<>(); Map<Long, String> processInfo = new HashMap<>();
processInfo.put(41L,"激光切割"); processInfo.put(41L, "激光切割");
processInfo.put(42L,"折弯"); processInfo.put(42L, "折弯");
processInfo.put(43L,"焊接"); processInfo.put(43L, "焊接");
processInfo.put(44L,"装配"); processInfo.put(44L, "装配");
Map<Long, List<MesProductPlan>> processIdMap = mesProductPlanList.stream().collect(Collectors.groupingBy(MesProductPlan::getProcessId)); Map<Long, List<MesProductPlan>> processIdMap = mesProductPlanList.stream().collect(Collectors.groupingBy(MesProductPlan::getProcessId));
@ -100,10 +101,14 @@ public class FourthMesBoardServiceImpl implements IFourthMesBoardService {
int processTotalPercentage = mesProductPlans.stream() int processTotalPercentage = mesProductPlans.stream()
.mapToInt(MesProductPlan::getProcessPercentageInt) .mapToInt(MesProductPlan::getProcessPercentageInt)
.reduce(0, Integer::sum); .reduce(0, Integer::sum);
int computePercentage = processTotalPercentage/totalPercentage*75; int computePercentage = 0 ;
if (totalPercentage>0){
computePercentage = processTotalPercentage / totalPercentage * 75;
}
MesBaseProcessInfo baseProcessInfo = new MesBaseProcessInfo();//喷塑 MesBaseProcessInfo baseProcessInfo = new MesBaseProcessInfo();//喷塑
baseProcessInfo.setProcessPercentage(computePercentage+"%"); baseProcessInfo.setProcessPercentage(computePercentage + "%");
baseProcessInfo.setProcessName(processInfo.get(processId)); baseProcessInfo.setProcessName(processInfo.get(processId));
mesBaseProcessInfoList.add(baseProcessInfo); mesBaseProcessInfoList.add(baseProcessInfo);
} }
@ -124,12 +129,13 @@ public class FourthMesBoardServiceImpl implements IFourthMesBoardService {
/** /**
* 4 * 4
*
* @return * @return
*/ */
@Override @Override
public JSONObject getQualityAndAvailablePercentage(){ public JSONObject getQualityAndAvailablePercentage() {
JSONObject resultJson = new JSONObject(); JSONObject resultJson = new JSONObject();
// 定义良率范围 // 定义良率范围
double passRateMin = 95.0; // 最小值 double passRateMin = 95.0; // 最小值
double passRateMax = 100.0; // 最大值 double passRateMax = 100.0; // 最大值
@ -137,7 +143,7 @@ public class FourthMesBoardServiceImpl implements IFourthMesBoardService {
double passRate = generateRandomWithOneDecimal(passRateMin, passRateMax); double passRate = generateRandomWithOneDecimal(passRateMin, passRateMax);
//不良率 //不良率
double failureRate = 100-passRate; double failureRate = 100 - passRate;
DecimalFormat df = new DecimalFormat("#.0"); DecimalFormat df = new DecimalFormat("#.0");
@ -147,9 +153,9 @@ public class FourthMesBoardServiceImpl implements IFourthMesBoardService {
double availableRate = generateRandomWithOneDecimal(availableRateMin, availableRateMax); double availableRate = generateRandomWithOneDecimal(availableRateMin, availableRateMax);
resultJson.put("passRate",passRate+"%"); resultJson.put("passRate", passRate + "%");
resultJson.put("failureRate",Double.parseDouble(df.format(failureRate))+"%"); resultJson.put("failureRate", Double.parseDouble(df.format(failureRate)) + "%");
resultJson.put("availableRate",availableRate+"%"); resultJson.put("availableRate", availableRate + "%");
return resultJson; return resultJson;

@ -25,6 +25,8 @@ public class MesProduceStatisticsDetail extends BaseEntity
@Excel(name = "生产工单ID") @Excel(name = "生产工单ID")
private Long productOrderId; private Long productOrderId;
private String productOrderStatus;
private String dispatchType; private String dispatchType;
private Long dispatchId; private Long dispatchId;
@ -132,6 +134,14 @@ public class MesProduceStatisticsDetail extends BaseEntity
return productOrderId; return productOrderId;
} }
public String getProductOrderStatus() {
return productOrderStatus;
}
public void setProductOrderStatus(String productOrderStatus) {
this.productOrderStatus = productOrderStatus;
}
public String getDispatchType() { public String getDispatchType() {
return dispatchType; return dispatchType;
} }

@ -210,6 +210,8 @@ public class MesProductPlan extends BaseEntity
private String processPercentage; private String processPercentage;
private String orderStatus;//生产工单状态
public Long getSaleOrderId() { public Long getSaleOrderId() {
return saleOrderId; return saleOrderId;
} }
@ -647,6 +649,14 @@ public class MesProductPlan extends BaseEntity
this.processPercentage = processPercentage; this.processPercentage = processPercentage;
} }
public String getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -831,8 +831,10 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
queryProductPlandetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH); queryProductPlandetail.setPlanDetailStatus(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH);
queryProductPlandetail.setStatisticsFlag("1"); queryProductPlandetail.setStatisticsFlag("1");
List<MesProductPlanDetail> mesProductPlanDetailList = mesProductPlanDetailMapper.selectMesProductPlanDetailList4Statistics(queryProductPlandetail); List<MesProductPlanDetail> mesProductPlanDetailList = mesProductPlanDetailMapper.selectMesProductPlanDetailList4Statistics(queryProductPlandetail);
List<MesProductPlanDetail> filterProductPlanDetailList = mesProductPlanDetailList.stream()
.filter(mppd-> mppd.getRealBeginTime()!=null && mppd.getRealEndTime()!=null).collect(Collectors.toList());
for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList) { for (MesProductPlanDetail mesProductPlanDetail : filterProductPlanDetailList) {
MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanId(mesProductPlanDetail.getPlanId()); MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanId(mesProductPlanDetail.getPlanId());
//计算工时 //计算工时
@ -877,6 +879,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
MesProduceStatisticsDetail mesProduceStatisticsDetail = new MesProduceStatisticsDetail(); MesProduceStatisticsDetail mesProduceStatisticsDetail = new MesProduceStatisticsDetail();
mesProduceStatisticsDetail.setProductOrderId(mesProductPlan.getProductOrderId()); mesProduceStatisticsDetail.setProductOrderId(mesProductPlan.getProductOrderId());
mesProduceStatisticsDetail.setProductOrderStatus(mesProductPlan.getOrderStatus());
mesProduceStatisticsDetail.setDispatchType(mesProductPlan.getDispatchType()); mesProduceStatisticsDetail.setDispatchType(mesProductPlan.getDispatchType());
mesProduceStatisticsDetail.setDispatchId(mesProductPlan.getDispatchId()); mesProduceStatisticsDetail.setDispatchId(mesProductPlan.getDispatchId());
mesProduceStatisticsDetail.setSaleOrderId(mesProductPlan.getSaleOrderId()); mesProduceStatisticsDetail.setSaleOrderId(mesProductPlan.getSaleOrderId());

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="MesProduceStatisticsDetail" id="MesProduceStatisticsDetailResult"> <resultMap type="MesProduceStatisticsDetail" id="MesProduceStatisticsDetailResult">
<result property="statisticsDetailId" column="statistics_detail_id" /> <result property="statisticsDetailId" column="statistics_detail_id" />
<result property="productOrderId" column="product_order_id" /> <result property="productOrderId" column="product_order_id" />
<result property="productOrderStatus" column="product_order_status" />
<result property="dispatchType" column="dispatch_type" /> <result property="dispatchType" column="dispatch_type" />
<result property="dispatchId" column="dispatch_id" /> <result property="dispatchId" column="dispatch_id" />
<result property="saleOrderId" column="sale_order_id" /> <result property="saleOrderId" column="sale_order_id" />
@ -87,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into mes_produce_statistics_detail insert into mes_produce_statistics_detail
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">product_order_id,</if> <if test="productOrderId != null">product_order_id,</if>
<if test="productOrderStatus != null">product_order_status,</if>
<if test="dispatchType != null">dispatch_type,</if> <if test="dispatchType != null">dispatch_type,</if>
<if test="dispatchId != null">dispatch_id,</if> <if test="dispatchId != null">dispatch_id,</if>
<if test="saleOrderId != null">sale_order_id,</if> <if test="saleOrderId != null">sale_order_id,</if>
@ -112,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">#{productOrderId},</if> <if test="productOrderId != null">#{productOrderId},</if>
<if test="productOrderStatus != null">#{productOrderStatus},</if>
<if test="dispatchType != null">#{dispatchType},</if> <if test="dispatchType != null">#{dispatchType},</if>
<if test="dispatchId != null">#{dispatchId},</if> <if test="dispatchId != null">#{dispatchId},</if>
<if test="saleOrderId != null">#{saleOrderId},</if> <if test="saleOrderId != null">#{saleOrderId},</if>

@ -460,16 +460,16 @@
<select id="productProgress" resultType="com.hw.mes.domain.MesProductOrder"> <select id="productProgress" resultType="com.hw.mes.domain.MesProductOrder">
SELECT x.* FROM `hwjy-cloud`.mes_product_order x where x.dispatch_id =4 order by x.real_begin_time desc limit 1 SELECT x.* FROM `hwjy-cloud`.mes_product_order x where x.dispatch_id =4 order by x.real_begin_time desc limit 1
</select> </select>
<select id="selectFifthWorkorder" resultType="com.hw.mes.domain.MesProductOrder"> <select id="selectFifthWorkorder" resultMap="MesProductOrderResult">
select select
x.* x.order_code,x.plan_amount,x.complete_amount,mbmi.material_name
from from
`hwjy-cloud`.mes_product_order x mes_product_order x left join mes_base_material_info mbmi on x.material_id=mbmi.material_id
where where
x.dispatch_id = 4 x.dispatch_id = 4
and x.real_begin_time > now() - interval 1 month and x.plan_begin_time > now() - interval 1 month
order by order by
x.real_begin_time asc x.plan_begin_time desc
</select> </select>
<select id="getLatestWorkOrder" resultType="com.hw.mes.domain.MesProductOrder"> <select id="getLatestWorkOrder" resultType="com.hw.mes.domain.MesProductOrder">
SELECT x.* FROM `hwjy-cloud`.mes_product_order x where x.plan_begin_time > now() - interval 1 month order by plan_begin_time asc LIMIT 1 SELECT x.* FROM `hwjy-cloud`.mes_product_order x where x.plan_begin_time > now() - interval 1 month order by plan_begin_time asc LIMIT 1
@ -535,7 +535,7 @@
from from
mes_produce_statistics_detail a left join mes_base_process_info b on a.process_id = b.process_id mes_produce_statistics_detail a left join mes_base_process_info b on a.process_id = b.process_id
where where
a.product_order_id in ( a.product_order_id = (
select select
product_order_id product_order_id
from from
@ -545,7 +545,7 @@
( (
select select
max(real_begin_time) real_begin_time max(real_begin_time) real_begin_time
from mes_produce_statistics_detail) group by product_order_id) group by a.real_begin_time ,a.real_end_time,a.process_id ,a.product_order_id from mes_produce_statistics_detail where product_order_status='2')) group by a.real_begin_time ,a.real_end_time,a.process_id ,a.product_order_id
</select> </select>
<select id="orderEfficiency" resultType="com.hw.mes.domain.MesProduceStatisticsDetail"> <select id="orderEfficiency" resultType="com.hw.mes.domain.MesProduceStatisticsDetail">
select select

@ -58,6 +58,7 @@
<result property="productId" column="product_id"/> <result property="productId" column="product_id"/>
<result property="dispatchType" column="dispatch_type"/> <result property="dispatchType" column="dispatch_type"/>
<result property="dispatchId" column="dispatch_id"/> <result property="dispatchId" column="dispatch_id"/>
<result property="orderStatus" column="order_status"/>
</resultMap> </resultMap>
<resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult"> <resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult">
@ -584,7 +585,8 @@
b.sale_order_id, b.sale_order_id,
b.saleorder_code, b.saleorder_code,
b.dispatch_type, b.dispatch_type,
b.dispatch_id b.dispatch_id,
b.order_status
from mes_product_plan a left join mes_product_order b on a.product_order_id = b.product_order_id from mes_product_plan a left join mes_product_order b on a.product_order_id = b.product_order_id
where a.plan_id = #{planId} where a.plan_id = #{planId}
</select> </select>

@ -272,7 +272,7 @@
<if test="selectFlag != null and selectFlag != ''">and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id)</if> <if test="selectFlag != null and selectFlag != ''">and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id)</if>
<if test="parentIds != null and parentIds != ''">and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds}))</if> <if test="parentIds != null and parentIds != ''">and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds}))</if>
</where> </where>
order by mso.saleorder_code,mso.erp_modify_date desc order by mso.erp_modify_date desc
</select> </select>

@ -16,19 +16,22 @@ public class FifthWmsBorderController {
private FifthWmsBorderService fifthWmsBorderService; private FifthWmsBorderService fifthWmsBorderService;
/** /**
* * ()
*/ */
@GetMapping("/locationCount") @GetMapping("/locationCount")
public AjaxResult locationCount(){ public AjaxResult locationCount(){
return AjaxResult.success(fifthWmsBorderService.locationCount()); return AjaxResult.success(fifthWmsBorderService.locationCount());
} }
/** /**
* *
*/ */
@GetMapping("fifthPanake") @GetMapping("fifthPanake")
public AjaxResult fifthPanake(){ public AjaxResult fifthPanake(){
return AjaxResult.success(fifthWmsBorderService.fifthPanake()); return AjaxResult.success(fifthWmsBorderService.fifthPanake());
} }
/** /**
* *
*/ */

@ -15,29 +15,26 @@ public class SecondWmsBorderController {
private SecondWmsBorderService secondWmsBorderService; private SecondWmsBorderService secondWmsBorderService;
/** /**
* *
* @return
*/
@GetMapping("/todayInstockAmount")
public AjaxResult todayInstockAmount(){
return AjaxResult.success(secondWmsBorderService.todayInstockAmount());
}
/**
*
* @return * @return
*/ */
@GetMapping("/totalStock") @GetMapping("/totalStock")
public AjaxResult totalStock(){ public AjaxResult totalStock(){
return AjaxResult.success(secondWmsBorderService.totalStock()); return AjaxResult.success(secondWmsBorderService.totalStock());
} }
/** /**
* * 线
*/
@GetMapping("/locationCount")
public AjaxResult locationCount(){
return AjaxResult.success(secondWmsBorderService.locationCount());
}
/**
*
*/
@GetMapping("/tableInfo")
public AjaxResult tableInfo(){
return AjaxResult.success(secondWmsBorderService.tableInfo());
}
/**
* 线
*/ */
@GetMapping("/inAndOutStockInfo") @GetMapping("/inAndOutStockInfo")
public AjaxResult inAndOutStockInfo(){ public AjaxResult inAndOutStockInfo(){
@ -45,7 +42,7 @@ public class SecondWmsBorderController {
} }
/** /**
* * ()
* @return * @return
*/ */
@GetMapping("/instockTimeCount") @GetMapping("/instockTimeCount")
@ -53,12 +50,26 @@ public class SecondWmsBorderController {
return AjaxResult.success(secondWmsBorderService.instockTimeCount()); return AjaxResult.success(secondWmsBorderService.instockTimeCount());
} }
/** /**
* *
* @return
*/ */
@GetMapping("/todayInstockAmount") @GetMapping("/locationCount")
public AjaxResult todayInstockAmount(){ public AjaxResult locationCount(){
return AjaxResult.success(secondWmsBorderService.todayInstockAmount()); return AjaxResult.success(secondWmsBorderService.locationCount());
} }
/**
*
*/
@GetMapping("/tableInfo")
public AjaxResult tableInfo(){
return AjaxResult.success(secondWmsBorderService.tableInfo());
}
} }

@ -39,21 +39,29 @@ public class FifthWmsBoardServiceImpl implements FifthWmsBorderService {
@Override @Override
public Map locationCount() { public Map locationCount() {
HashMap map = new HashMap<>(); HashMap map = new HashMap<>();
List<WmsProductInstock> list = wmsRawInstockMapper.locationCount(); List<WmsProductInstock> list = wmsRawInstockMapper.locationCount();//原料柜体和辅料近一个月入库数量
List<WmsRawOutstock> list1 = wmsRawOutstockMapper.locationCount(); List<WmsRawOutstock> list1 = wmsRawOutstockMapper.locationCount();//辅料近一个月出库数量
List<WmsProductInstock> list2 = wmsProductInstockMapper.locationCount(); List<WmsProductInstock> list2 = wmsProductInstockMapper.locationCount();
List<WmsProductOutstock> list3 = wmsProductOutstockMapper.locationCount(); List<WmsProductOutstock> list3 = wmsProductOutstockMapper.locationCount();
for (WmsProductInstock wmsProductInstock : list) { if(list!=null && !list.isEmpty()) {
if (wmsProductInstock.getWarehouseId()==511){ for (WmsProductInstock wmsProductInstock : list) {
map.put("rawInStock",wmsProductInstock.getInstockAmount()); if (wmsProductInstock.getWarehouseId() == 511) {
} map.put("rawInStock", wmsProductInstock.getInstockAmount().intValue());//原料柜体入库数量
if (wmsProductInstock.getWarehouseId()==512){ }
map.put("furawInStock",wmsProductInstock.getInstockAmount()); if (wmsProductInstock.getWarehouseId() == 512) {
map.put("furawInStock", wmsProductInstock.getInstockAmount().intValue());//辅料入库数量
}
} }
} }
map.put("rawOutStock",list1.get(0).getRealOutstockAmount()); if(list1!=null && !list1.isEmpty()) {
map.put("productInStock",list2.get(0).getInstockAmount()); map.put("rawOutStock", list1.get(0).getRealOutstockAmount().intValue());
map.put("productOutStock",list3.get(0).getOutstockQty()); }
if(list2!=null && !list2.isEmpty()) {
map.put("productInStock", list2.get(0).getInstockAmount().intValue());
}
if(list3!=null && !list3.isEmpty()) {
map.put("productOutStock", list3.get(0).getOutstockQty().intValue());
}
return map; return map;
} }
@ -67,9 +75,9 @@ public class FifthWmsBoardServiceImpl implements FifthWmsBorderService {
@Override @Override
public Map fifthPanake() { public Map fifthPanake() {
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectRawLocationPercentage(); List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectRawLocationPercentage();//原材料库存占比(原料柜体)
List<WmsProductStock> productStocks = wmsProductStockMapper.selectProductStockPercentage(); List<WmsProductStock> productStocks = wmsProductStockMapper.selectProductStockPercentage();
Integer emptyLocationCount = wmsBaseLocationMapper.selectEmptyLocation(); Integer emptyLocationCount = wmsBaseLocationMapper.selectEmptyLocation();//
Integer allLocation = wmsBaseLocationMapper.selectAllLocation(); Integer allLocation = wmsBaseLocationMapper.selectAllLocation();
BigDecimal emptyLocationPercentage = new BigDecimal(emptyLocationCount).divide(new BigDecimal(allLocation), 2, BigDecimal.ROUND_HALF_UP); BigDecimal emptyLocationPercentage = new BigDecimal(emptyLocationCount).divide(new BigDecimal(allLocation), 2, BigDecimal.ROUND_HALF_UP);
Integer oppylLocation = allLocation - emptyLocationCount; Integer oppylLocation = allLocation - emptyLocationCount;
@ -77,7 +85,7 @@ public class FifthWmsBoardServiceImpl implements FifthWmsBorderService {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("wmsRawStocks",wmsRawStocks); map.put("wmsRawStocks",wmsRawStocks);
map.put("productStocks",productStocks); map.put("productStocks",productStocks);
map.put("emptyLocationPercentage",emptyLocationPercentage); map.put("emptyLocationPercentage",emptyLocationPercentage);//辅料空料箱占比
map.put("opplyLocationPercentage",opplyLocationPercentage); map.put("opplyLocationPercentage",opplyLocationPercentage);
return map; return map;
} }

@ -63,7 +63,7 @@ public class FourthWmsBoardService implements IFourthWmsBoardService {
@Override @Override
public List<WmsStockTotal> getFourthFloorTotalProductStocks() { public List<WmsStockTotal> getFourthFloorTotalProductStocks() {
WmsStockTotal queryStockTotal = new WmsStockTotal(); WmsStockTotal queryStockTotal = new WmsStockTotal();
//todo: 需要设置仓库ID为431 queryStockTotal.setWarehouseId(431L);
List<WmsStockTotal> wmsStockTotalList = wmsStockTotalMapper.selectStockTotalListGroupByMaterial(queryStockTotal); List<WmsStockTotal> wmsStockTotalList = wmsStockTotalMapper.selectStockTotalListGroupByMaterial(queryStockTotal);
return wmsStockTotalList; return wmsStockTotalList;
} }

@ -12,11 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service @Service
public class SecondWmsBoardServiceImpl implements SecondWmsBorderService { public class SecondWmsBoardServiceImpl implements SecondWmsBorderService {
@ -62,16 +60,32 @@ public class SecondWmsBoardServiceImpl implements SecondWmsBorderService {
public List<WmsProductInstock> inAndOutStockInfo() { public List<WmsProductInstock> inAndOutStockInfo() {
List<WmsProductInstock> instocks = wmsProductStockMapper.selectInStock(); List<WmsProductInstock> instocks = wmsProductStockMapper.selectInStock();
List<WmsProductOutstock> outstocks = wmsProductStockMapper.selectOutStock(); List<WmsProductOutstock> outstocks = wmsProductStockMapper.selectOutStock();
Map<Date,List<WmsProductOutstock>> map = outstocks.stream().collect(Collectors.groupingBy(WmsProductOutstock::getDay)); Map<Date,List<WmsProductInstock>> instocksMap = instocks.stream().collect(Collectors.groupingBy(WmsProductInstock::getDay));
for (WmsProductInstock instock : instocks) { Map<Date,List<WmsProductOutstock>> outstocksMap = outstocks.stream().collect(Collectors.groupingBy(WmsProductOutstock::getDay));
if (map != null&&map.keySet().size()>0) { Set<Date> dateSet = Stream.concat(instocksMap.keySet().stream(), outstocksMap.keySet().stream())
WmsProductOutstock wmsProductOutstock = map.get(instock.getDay()).get(0); .collect(Collectors.toCollection(TreeSet::new));
instock.setOutStockAmount(wmsProductOutstock.getOutstockQty());
}else { List<WmsProductInstock> returnInstocks = new ArrayList<>();
instock.setOutStockAmount(new BigDecimal(0));
for (Date date : dateSet) {
WmsProductInstock returnInstock = new WmsProductInstock();
returnInstock.setDay(date);
if(instocksMap!=null){
List<WmsProductInstock> wmsProductInstocks = instocksMap.get(date);
if(wmsProductInstocks!=null && !wmsProductInstocks.isEmpty()){
returnInstock.setInstockAmount(wmsProductInstocks.get(0).getInstockAmount());
}
} }
if(outstocksMap!=null){
List<WmsProductOutstock> wmsProductOutstocks = outstocksMap.get(date);
if(wmsProductOutstocks!=null && !wmsProductOutstocks.isEmpty()){
returnInstock.setOutStockAmount(wmsProductOutstocks.get(0).getOutstockQty());
}
}
returnInstocks.add(returnInstock);
} }
return instocks; return returnInstocks;
} }
@Override @Override
@ -81,13 +95,13 @@ public class SecondWmsBoardServiceImpl implements SecondWmsBorderService {
@Override @Override
public Map<String, BigDecimal> locationCount() { public Map<String, BigDecimal> locationCount() {
int availibleLocation = wmsProductStockMapper.selectAvailibleLocation(); int availibleLocation = wmsProductStockMapper.selectAvailibleLocation();//可用库位数量
int toatlLocation = wmsProductStockMapper.selectTotalLocation(); int toatlLocation = wmsProductStockMapper.selectTotalLocation();//获取总库位数量
int opplyLocation = wmsProductStockMapper.selectOpplyLocation(); int opplyLocation = wmsProductStockMapper.selectOpplyLocation();
HashMap<String, BigDecimal> result = new HashMap<>(); HashMap<String, BigDecimal> result = new HashMap<>();
BigDecimal bigDecimal = new BigDecimal(toatlLocation); BigDecimal bigDecimal = new BigDecimal(toatlLocation);
BigDecimal availibleRate = new BigDecimal(availibleLocation).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP); BigDecimal availibleRate = new BigDecimal(availibleLocation).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);//可用库位占比
BigDecimal opplyRate = new BigDecimal(opplyLocation).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP); BigDecimal opplyRate = new BigDecimal(opplyLocation).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);//库存占用总库位的占用率
result.put("availibleRate",availibleRate); result.put("availibleRate",availibleRate);
result.put("opplyRate",opplyRate); result.put("opplyRate",opplyRate);
return result; return result;

@ -307,9 +307,9 @@
select select
count(1) count(1)
from from
`hwjy-cloud`.wms_base_location `hwjy-cloud`.wms_base_location wbl
where where
warehouse_id = 512 and container_code is null warehouse_id = 512 and not exists (select 1 from wms_raw_stock wrs where wbl.location_code=wrs.location_code)
</select> </select>
<select id="selectAllLocation" resultType="java.lang.Integer"> <select id="selectAllLocation" resultType="java.lang.Integer">
select select

@ -361,7 +361,7 @@
select count(1) FROM `hwjy-cloud`.wms_base_location where warehouse_id =231 and container_code is not null select count(1) FROM `hwjy-cloud`.wms_base_location where warehouse_id =231 and container_code is not null
</select> </select>
<select id="tableInfo" resultType="com.hw.wms.domain.WmsProductOutstockDetail"> <select id="tableInfo" resultType="com.hw.wms.domain.WmsProductOutstockDetail">
select * from wms_product_outstock_detail where begin_time > now() - interval 1 month and execute_status = 3 order by begin_time asc select * from wms_product_outstock_detail where warehouse_id=231 and begin_time > now() - interval 1 month and execute_status = 2 order by begin_time asc
</select> </select>
<select id="selectInStock" resultType="com.hw.wms.domain.WmsProductInstock"> <select id="selectInStock" resultType="com.hw.wms.domain.WmsProductInstock">
sELECT date_format(apply_date , '%Y-%m-%d 00:00:00') as day, sELECT date_format(apply_date , '%Y-%m-%d 00:00:00') as day,
@ -386,16 +386,16 @@
day day
</select> </select>
<select id="selectOneWeek" resultType="java.lang.Integer"> <select id="selectOneWeek" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_product_stock where instock_date > now() - interval 1 week SELECT count(1) FROM `hwjy-cloud`.wms_product_instock where warehouse_id=231 and apply_date > now() - interval 1 week
</select> </select>
<select id="selectTwoWeek" resultType="java.lang.Integer"> <select id="selectTwoWeek" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_product_stock where instock_date > now() - interval 2 week SELECT count(1) FROM `hwjy-cloud`.wms_product_instock where warehouse_id=231 and apply_date > now() - interval 2 week
</select> </select>
<select id="selectOneMonth" resultType="java.lang.Integer"> <select id="selectOneMonth" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_product_stock where instock_date > now() - interval 1 month SELECT count(1) FROM `hwjy-cloud`.wms_product_instock where warehouse_id=231 and apply_date > now() - interval 1 month
</select> </select>
<select id="selectHalfYear" resultType="java.lang.Integer"> <select id="selectHalfYear" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_product_stock where instock_date > now() - interval 6 month SELECT count(1) FROM `hwjy-cloud`.wms_product_instock where warehouse_id=231 and apply_date > now() - interval 6 month
</select> </select>
<select id="todayInstockAmount" resultType="java.math.BigDecimal"> <select id="todayInstockAmount" resultType="java.math.BigDecimal">
select select

@ -21,10 +21,10 @@
<HighChart key="chart4" ref="chart4"></HighChart> <HighChart key="chart4" ref="chart4"></HighChart>
</div> </div>
<div class="num1 num1_1" style="top: 11.9%;left: 13.4%;color:#5fc2f2">{{ topData.furawInStock[0] }}</div> <div class="num1 num1_1" style="top: 11.9%;left: 13.4%;color:#5fc2f2">{{ topData.rawInStock[0] }}</div>
<div class="num1 num1_2" style="top: 11.9%;left:15.7%;color:#5fc2f2">{{ topData.furawInStock[1] }}</div> <div class="num1 num1_2" style="top: 11.9%;left:15.7%;color:#5fc2f2">{{ topData.rawInStock[1] }}</div>
<div class="num1 num1_3" style="top: 11.9%;left:18%;color:#5fc2f2">{{ topData.furawInStock[2] }}</div> <div class="num1 num1_3" style="top: 11.9%;left:18%;color:#5fc2f2">{{ topData.rawInStock[2] }}</div>
<div class="num1 num1_4" style="top: 11.9%;left:20.4%;color:#5fc2f2">{{ topData.furawInStock[3] }}</div> <div class="num1 num1_4" style="top: 11.9%;left:20.4%;color:#5fc2f2">{{ topData.rawInStock[3] }}</div>
<div class="num1 num1_5" style="top: 11.9%;left:32.2%;color:#59ee7b">{{ topData.productInStock[0] }}</div> <div class="num1 num1_5" style="top: 11.9%;left:32.2%;color:#59ee7b">{{ topData.productInStock[0] }}</div>
<div class="num1 num1_6" style="top: 11.9%;left:34.6%;color:#59ee7b">{{ topData.productInStock[1] }}</div> <div class="num1 num1_6" style="top: 11.9%;left:34.6%;color:#59ee7b">{{ topData.productInStock[1] }}</div>
@ -36,10 +36,10 @@
<div class="num1 num1_11" style="top: 11.9%;left:55.7%;color:#f60008">{{ topData.productOutStock[2] }}</div> <div class="num1 num1_11" style="top: 11.9%;left:55.7%;color:#f60008">{{ topData.productOutStock[2] }}</div>
<div class="num1 num1_12" style="top: 11.9%;left:58.1%;color:#f60008">{{ topData.productOutStock[3] }}</div> <div class="num1 num1_12" style="top: 11.9%;left:58.1%;color:#f60008">{{ topData.productOutStock[3] }}</div>
<div class="num1 num1_13" style="top: 11.9%;left:69.9%;color:#59ee7b">{{ topData.rawInStock[0] }}</div> <div class="num1 num1_13" style="top: 11.9%;left:69.9%;color:#59ee7b">{{ topData.furawInStock[0] }}</div>
<div class="num1 num1_14" style="top: 11.9%;left:72.3%;color:#59ee7b">{{ topData.rawInStock[1] }}</div> <div class="num1 num1_14" style="top: 11.9%;left:72.3%;color:#59ee7b">{{ topData.furawInStock[1] }}</div>
<div class="num1 num1_15" style="top: 11.9%;left:74.6%;color:#59ee7b">{{ topData.rawInStock[2] }}</div> <div class="num1 num1_15" style="top: 11.9%;left:74.6%;color:#59ee7b">{{ topData.furawInStock[2] }}</div>
<div class="num1 num1_16" style="top: 11.9%;left:76.9%;color:#59ee7b">{{ topData.rawInStock[3] }}</div> <div class="num1 num1_16" style="top: 11.9%;left:76.9%;color:#59ee7b">{{ topData.furawInStock[3] }}</div>
<div class="num1 num1_17" style="top: 11.9%;left:88.7%;color:#f60008">{{ topData.rawOutStock[0] }}</div> <div class="num1 num1_17" style="top: 11.9%;left:88.7%;color:#f60008">{{ topData.rawOutStock[0] }}</div>
<div class="num1 num1_18" style="top: 11.9%;left:91%;color:#f60008">{{ topData.rawOutStock[1] }}</div> <div class="num1 num1_18" style="top: 11.9%;left:91%;color:#f60008">{{ topData.rawOutStock[1] }}</div>
@ -303,7 +303,7 @@ export default {
}] }]
}) })
let total = e.data.productStocks.map(v => parseFloat(v.totalAmount)).reduce((a, b) => a + b, 0) let total = e.data.wmsRawStocks.map(v => parseFloat(v.totalAmount)).reduce((a, b) => a + b, 0)
this.$refs.chart3.setData({ this.$refs.chart3.setData({
title: { title: {
text: '原材料库存占比', text: '原材料库存占比',
@ -375,7 +375,7 @@ export default {
{ {
type: 'pie', type: 'pie',
name: '占比', name: '占比',
data: e.data.productStocks.map(v => { data: e.data.wmsRawStocks.map(v => {
return { return {
name: v.materialName, name: v.materialName,
y: v.totalAmount, y: v.totalAmount,
@ -384,7 +384,7 @@ export default {
}) })
}] }]
}) })
let total1 = e.data.wmsRawStocks.map(v => parseFloat(v.totalAmount)).reduce((a, b) => a + b, 0) let total1 = e.data.productStocks.map(v => parseFloat(v.totalAmount)).reduce((a, b) => a + b, 0)
this.$refs.chart4.setData({ this.$refs.chart4.setData({
title: { title: {
text: '成品库存占比', text: '成品库存占比',
@ -456,7 +456,7 @@ export default {
{ {
type: 'pie', type: 'pie',
name: '占比', name: '占比',
data: e.data.wmsRawStocks.map(v => { data: e.data.productStocks.map(v => {
return { return {
name: v.materialName, name: v.materialName,
y: v.totalAmount, y: v.totalAmount,

@ -9,13 +9,13 @@
</div> </div>
<div class="table1"> <div class="table1">
<div style="background-color: #094170aa"> <div style="background-color: #094170aa">
<div class="scrollTableItem" style="color:#fff;font-weight: bold;width: 33%"> <div class="scrollTableItem" style="color:#fff;font-weight: bold;width: 15%">
库位 库位
</div> </div>
<div class="scrollTableItem" style="color:#fff;font-weight: bold;width: 33%"> <div class="scrollTableItem" style="color:#fff;font-weight: bold;width: 64%">
成品条码 成品条码
</div> </div>
<div class="scrollTableItem" style="color:#fff;font-weight: bold;width: 33%"> <div class="scrollTableItem" style="color:#fff;font-weight: bold;width: 10%">
数量 数量
</div> </div>
</div> </div>
@ -31,17 +31,17 @@
> >
<div :style='"background-color:" + ((index % 2 === 0)? "#053460aa":"#032d57aa") '> <div :style='"background-color:" + ((index % 2 === 0)? "#053460aa":"#032d57aa") '>
<div <div
class="scrollTableItem" style="width: 33%" class="scrollTableItem" style="width: 15%"
> >
{{ item.locationCode }} {{ item.locationCode }}
</div> </div>
<div <div
class="scrollTableItem" style="width: 33%" class="scrollTableItem" style="width: 64%"
> >
{{ item.productBarcode }} {{ item.productBarcode }}
</div> </div>
<div <div
class="scrollTableItem" style="width: 33%" class="scrollTableItem" style="width: 10%"
> >
{{ item.outstockAmount }} {{ item.outstockAmount }}
</div> </div>
@ -112,7 +112,7 @@ export default {
'库存总量统计', '库存总量统计',
'库位变化', '库位变化',
'入库时段统计', '入库时段统计',
'库位原理统计' '库位分析'
], ],
titlePosition: [ titlePosition: [
{ {

@ -126,12 +126,12 @@
<dict-tag :options="dict.type.dms_alarm_level" :value="scope.row.alarmLevel"/> <dict-tag :options="dict.type.dms_alarm_level" :value="scope.row.alarmLevel"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="通知方式" align="center" prop="noticeType" v-if="columns[4].visible"> <!-- <el-table-column label="通知方式" align="center" prop="noticeType" v-if="columns[4].visible">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<dict-tag :options="dict.type.dms_notice_type" <!-- <dict-tag :options="dict.type.dms_notice_type"-->
:value="scope.row.noticeType ? scope.row.noticeType.split(',') : []"/> <!-- :value="scope.row.noticeType ? scope.row.noticeType.split(',') : []"/>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="自动恢复标识" align="center" prop="recoverType" v-if="columns[5].visible"> <el-table-column label="自动恢复标识" align="center" prop="recoverType" v-if="columns[5].visible">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.dms_recover_type" :value="scope.row.recoverType"/> <dict-tag :options="dict.type.dms_recover_type" :value="scope.row.recoverType"/>
@ -207,16 +207,16 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="通知方式" prop="noticeType"> <!-- <el-form-item label="通知方式" prop="noticeType">-->
<el-checkbox-group v-model="form.noticeType"> <!-- <el-checkbox-group v-model="form.noticeType">-->
<el-checkbox <!-- <el-checkbox-->
v-for="dict in dict.type.dms_notice_type" <!-- v-for="dict in dict.type.dms_notice_type"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.value"> <!-- :label="dict.value">-->
{{ dict.label }} <!-- {{ dict.label }}-->
</el-checkbox> <!-- </el-checkbox>-->
</el-checkbox-group> <!-- </el-checkbox-group>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="自动恢复标识" prop="recoverType"> <el-form-item label="自动恢复标识" prop="recoverType">
<el-radio-group v-model="form.recoverType"> <el-radio-group v-model="form.recoverType">
<el-radio <el-radio

@ -162,12 +162,12 @@
<dict-tag :options="dict.type.dms_alarm_level" :value="scope.row.alarmLevel"/> <dict-tag :options="dict.type.dms_alarm_level" :value="scope.row.alarmLevel"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="通知方式" align="center" prop="noticeType" v-if="columns[21].visible" width="100"> <!-- <el-table-column label="通知方式" align="center" prop="noticeType" v-if="columns[21].visible" width="100">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<dict-tag :options="dict.type.dms_notice_type" <!-- <dict-tag :options="dict.type.dms_notice_type"-->
:value="scope.row.noticeType ? scope.row.noticeType.split(',') : []"/> <!-- :value="scope.row.noticeType ? scope.row.noticeType.split(',') : []"/>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="自动恢复标识" align="center" prop="recoverType" v-if="columns[22].visible"> <el-table-column label="自动恢复标识" align="center" prop="recoverType" v-if="columns[22].visible">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.dms_recover_type" :value="scope.row.recoverType"/> <dict-tag :options="dict.type.dms_recover_type" :value="scope.row.recoverType"/>

@ -45,7 +45,7 @@
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
@click="handleUnallocateMaterials" @click="handleUnallocateMaterials"
v-hasPermi="['wms:wmswarehouse:add']" v-hasPermi="['qms:checkrule:checkRuleDetail']"
>删除 >删除
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -99,7 +99,7 @@
size="mini" size="mini"
:disabled = "allocateMaterialBtnDisable" :disabled = "allocateMaterialBtnDisable"
@click="submitForm" @click="submitForm"
v-hasPermi="['wms:wmswarehouse:add']" v-hasPermi="['qms:checkrule:checkRuleDetail']"
>保存 >保存
</el-button> </el-button>
</el-form-item> </el-form-item>

Loading…
Cancel
Save