物料
This commit is contained in:
@@ -87,6 +87,15 @@ public class KpiController extends BaseController {
|
||||
return success(kpiService.getSpaceAnalysis(warehouseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增:根据仓库和巷道统计各状态货位数量
|
||||
*/
|
||||
@GetMapping("/spaceStatusCounts")
|
||||
public AjaxResult getSpaceStatusCounts(String warehouseId,
|
||||
String roadwayId) {
|
||||
return success(kpiService.getSpaceStatusCounts(warehouseId, roadwayId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取货位巷道数据
|
||||
*
|
||||
@@ -97,6 +106,7 @@ public class KpiController extends BaseController {
|
||||
public AjaxResult getRoadways(@RequestParam("warehouseId") String warehouseId){
|
||||
return success(kpiService.getRoadways(warehouseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取货位排数据
|
||||
*
|
||||
|
||||
@@ -40,11 +40,12 @@ public interface KpiService {
|
||||
|
||||
Map<String, Object> getPlatoons(String warehouseId, String roadwayId);
|
||||
|
||||
|
||||
Map<String,Object> getChartData(String warehouseId, String roadwayId, String thePlatoon);
|
||||
|
||||
Map<String,Object> getChartMag(String warehouseId, String theColumn, String theFloor, String thePlatoon);
|
||||
|
||||
|
||||
AjaxResult getInAnalysisByData(String warehouseId, String startTime, String endTime,String inOut);
|
||||
|
||||
// 新增:根据仓库和巷道统计各状态货位数量
|
||||
Map<String, Object> getSpaceStatusCounts(String warehouseId, String roadwayId);
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ public class KpiServiceImpl implements KpiService
|
||||
|
||||
// 为每个巷道添加数量,如果没有数据则为0
|
||||
for (String roadwayId : roadwayIds) {
|
||||
statusData.put(MessageUtils.message("kpi.spacePlan.roadway") + roadwayId, entry.getValue().getOrDefault(roadwayId, 0));
|
||||
statusData.put("巷道" + roadwayId, entry.getValue().getOrDefault(roadwayId, 0));
|
||||
}
|
||||
|
||||
result.add(statusData);
|
||||
@@ -289,6 +289,34 @@ public class KpiServiceImpl implements KpiService
|
||||
return response;
|
||||
}
|
||||
|
||||
// 新增:根据仓库和巷道统计各状态货位数量(用于前端饼图)
|
||||
@Override
|
||||
public Map<String, Object> getSpaceStatusCounts(String warehouseId, String roadwayId) {
|
||||
BasCargoSpace query = new BasCargoSpace();
|
||||
query.setWarehouseId(warehouseId);
|
||||
query.setRoadwayId(roadwayId);
|
||||
List<BasCargoSpace> list = basCargoSpaceMapper.selectBasCargoSpaceList(query);
|
||||
|
||||
Map<String, Integer> counts = new HashMap<>();
|
||||
counts.put("1", 0); // 空闲
|
||||
counts.put("2", 0); // 占用
|
||||
counts.put("3", 0); // 入库分配
|
||||
counts.put("4", 0); // 出库分配
|
||||
counts.put("5", 0); // 入库待检
|
||||
counts.put("6", 0); // 出库待检
|
||||
|
||||
for (BasCargoSpace space : list) {
|
||||
String status = space.getStatus();
|
||||
if (status != null && counts.containsKey(status)) {
|
||||
counts.put(status, counts.get(status) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
res.put("data", counts);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getRoadways(String warehouseId){
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
@@ -311,7 +339,7 @@ public class KpiServiceImpl implements KpiService
|
||||
for (String roadwayId : roadwaySet) {
|
||||
Map<String, String> roadway = new HashMap<>();
|
||||
roadway.put("value", roadwayId);
|
||||
roadway.put("label", MessageUtils.message("kpi.spacePlan.roadway") + roadwayId);
|
||||
roadway.put("name", roadwayId+"巷道");
|
||||
roadways.add(roadway);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,16 @@ public class OutStockoutFinish extends BaseEntity
|
||||
|
||||
private String remark;
|
||||
|
||||
private String supplierName;
|
||||
|
||||
public String getSupplierName() {
|
||||
return supplierName;
|
||||
}
|
||||
|
||||
public void setSupplierName(String supplierName) {
|
||||
this.supplierName = supplierName;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="finishDate" column="finish_date" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
<result property="supplierName" column="supplier_name" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
@@ -141,10 +142,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectOutStockoutFinishListByOutStockout" parameterType="OutStockout" resultMap="OutStockoutFinishResult">
|
||||
select distinct o.stockout_guid, o.stockout_id, o.out_type, o.create_date, o.department_no, o.customer_no, o.create_man_id, o.status, o.stockout_source,
|
||||
o.warehouse_id, o.class_now_id, o.exit_id, o.car_number, o.FID, o.erp_stockout_id,o.start_date,o.finish_date,bw.warehouse_name,bc.customer_name,o.remark from out_stockout_finish o
|
||||
left join bas_warehouse bw on bw.warehouse_id = o.warehouse_id
|
||||
left join bas_customer bc on bc.customer_no = o.customer_no
|
||||
o.class_now_id, o.exit_id, o.car_number, o.FID, o.erp_stockout_id,o.start_date,o.finish_date,o.remark from out_stockout_finish o
|
||||
left join out_stockout_detail_finish d on d.stockout_id = o.stockout_id
|
||||
left join bas_warehouse bw on bw.warehouse_id = d.warehouse_id
|
||||
left join bas_customer bc on bc.customer_no = d.out_id
|
||||
left join bas_supplier bs on bs.supplier_no = d.supplier_id
|
||||
left join bas_product bp on bp.product_id = d.product_id
|
||||
<where>
|
||||
<if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if>
|
||||
@@ -155,7 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createManId != null and createManId != ''"> and o.create_man_id = #{createManId}</if>
|
||||
<if test="status != null and status != ''"> and o.status = #{status}</if>
|
||||
<if test="stockoutSource != null and stockoutSource != ''"> and o.stockout_source = #{stockoutSource}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and o.warehouse_id = #{warehouseId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and d.warehouse_id = #{warehouseId}</if>
|
||||
<if test="classNowId != null and classNowId != ''"> and o.class_now_id = #{classNowId}</if>
|
||||
<if test="exitId != null and exitId != ''"> and o.exit_id = #{exitId}</if>
|
||||
<if test="carNumber != null and carNumber != ''"> and o.car_number = #{carNumber}</if>
|
||||
@@ -166,6 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productId != null and productId != ''"> and d.product_id = #{productId}</if>
|
||||
<if test="productName != null and productName != ''"> and bp.product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="customerName != null and customerName != ''"> and bc.customer_name like concat('%', #{customerName}, '%')</if>
|
||||
<if test="supplierName != null and supplierName != ''"> and bs.supplier_name like concat('%', #{supplierName}, '%')</if>
|
||||
<if test="remark != null and remark != ''"> and o.remark like concat('%', #{remark}, '%')</if>
|
||||
</where>
|
||||
order by o.create_date desc
|
||||
|
||||
Reference in New Issue
Block a user