Merge branch '0.8.X' of https://gitee.com/hdka/klp-oa into 0.8.X
This commit is contained in:
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 查询产品销售话术列表
|
||||
export function listProductSalesScript(query) {
|
||||
return request({
|
||||
url: '/klp/productSalesScript/list',
|
||||
url: '/wms/productSalesScript/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function listProductSalesScript(query) {
|
||||
// 查询产品销售话术,只要标题和内容有一个配置就会被返回
|
||||
export function searchProductSalesScript(keyword) {
|
||||
return request({
|
||||
url: '/klp/productSalesScript/list',
|
||||
url: '/wms/productSalesScript/list',
|
||||
method: 'get',
|
||||
params: { keyword }
|
||||
})
|
||||
@@ -21,7 +21,7 @@ export function searchProductSalesScript(keyword) {
|
||||
// 查询产品销售话术详细
|
||||
export function getProductSalesScript(scriptId) {
|
||||
return request({
|
||||
url: '/klp/productSalesScript/' + scriptId,
|
||||
url: '/wms/productSalesScript/' + scriptId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export function getProductSalesScript(scriptId) {
|
||||
// 新增产品销售话术
|
||||
export function addProductSalesScript(data) {
|
||||
return request({
|
||||
url: '/klp/productSalesScript',
|
||||
url: '/wms/productSalesScript',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -38,7 +38,7 @@ export function addProductSalesScript(data) {
|
||||
// 修改产品销售话术
|
||||
export function updateProductSalesScript(data) {
|
||||
return request({
|
||||
url: '/klp/productSalesScript',
|
||||
url: '/wms/productSalesScript',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -47,7 +47,7 @@ export function updateProductSalesScript(data) {
|
||||
// 删除产品销售话术
|
||||
export function delProductSalesScript(scriptId) {
|
||||
return request({
|
||||
url: '/klp/productSalesScript/' + scriptId,
|
||||
url: '/wms/productSalesScript/' + scriptId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -72,7 +72,7 @@ export function delProductSalesScript(scriptId) {
|
||||
// 获取产品咨询热度排行
|
||||
export function getProductRanking() {
|
||||
return request({
|
||||
url: '/klp/productSalesScript/dashboard/ranking',
|
||||
url: '/wms/productSalesScript/dashboard/ranking',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/productSalesScript/export', {
|
||||
this.download('wms/productSalesScript/export', {
|
||||
...this.queryParams
|
||||
}, `productSalesScript_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
@@ -453,7 +453,7 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('klp/purchasePlan/export', {
|
||||
this.download('wms/purchasePlan/export', {
|
||||
...this.queryParams
|
||||
}, `purchasePlan_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
@@ -376,7 +376,7 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('klp/purchasePlanDetail/export', {
|
||||
this.download('wms/purchasePlanDetail/export', {
|
||||
...this.queryParams
|
||||
}, `purchasePlanDetail_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('klp/schedulePlan/export', {
|
||||
this.download('wms/schedulePlan/export', {
|
||||
...this.queryParams
|
||||
}, `schedulePlan_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
@@ -418,7 +418,7 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('klp/stockIo/export', {
|
||||
this.download('wms/stockIo/export', {
|
||||
...this.queryParams
|
||||
}, `stockIo_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
@@ -457,7 +457,7 @@ export default {
|
||||
this.reset();
|
||||
},
|
||||
handleExport() {
|
||||
this.download('klp/stockIoDetail/export', {
|
||||
this.download('wms/stockIoDetail/export', {
|
||||
...this.queryParams
|
||||
}, `stockIoDetail_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.klp.domain.vo.ProductRankingVo;
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/klp/productSalesScript")
|
||||
@RequestMapping("/wms/productSalesScript")
|
||||
public class WmsProductSalesScriptController extends BaseController {
|
||||
|
||||
private final IWmsProductSalesScriptService iWmsProductSalesScriptService;
|
||||
@@ -67,12 +67,12 @@ public class WmsProductSalesScriptController extends BaseController {
|
||||
public R<WmsProductSalesScriptVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long scriptId) {
|
||||
WmsProductSalesScriptVo vo = iWmsProductSalesScriptService.queryById(scriptId);
|
||||
|
||||
|
||||
// 记录产品访问次数到Redis
|
||||
if (vo != null && vo.getProductId() != null) {
|
||||
iWmsProductSalesScriptService.recordProductViewCount(vo.getProductId());
|
||||
}
|
||||
|
||||
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class WmsStockController extends BaseController {
|
||||
@PostMapping("/export")
|
||||
public void export(WmsStockBo bo, HttpServletResponse response) {
|
||||
List<WmsStockVo> list = iWmsStockService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "库存:原材料/产品与库区/库位的存放关系", WmsStockVo.class, response);
|
||||
ExcelUtil.exportExcel(list, "库存:原材料-产品与库区-库位的存放关系", WmsStockVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -163,4 +163,13 @@ public class WmsStockIoController extends BaseController {
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
@PostMapping("/scanOutStock")
|
||||
public R<Void> scanOutStock(@RequestBody WmsStockIoDetailBo bo) {
|
||||
try {
|
||||
boolean result = iWmsStockIoService.scanOutStockByBo(bo);
|
||||
return toAjax(result);
|
||||
} catch (Exception e) {
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
@Data
|
||||
public class CustomerRegionVO {
|
||||
private String region;
|
||||
private int customerCount;
|
||||
}
|
||||
@@ -12,30 +12,30 @@ import java.util.List;
|
||||
@Data
|
||||
public class DashboardOverviewVO {
|
||||
|
||||
/**
|
||||
* 订单汇总
|
||||
*/
|
||||
private OrderSummaryVO orderSummary;
|
||||
|
||||
/**
|
||||
* 销售经理饼图
|
||||
*/
|
||||
private List<SalesManagerPieVO> salesManagerPie;
|
||||
|
||||
/**
|
||||
* 产品销量排行
|
||||
*/
|
||||
private List<ProductRankVO> productRank;
|
||||
|
||||
/**
|
||||
* 订单物料分析
|
||||
*/
|
||||
private List<OrderMaterialVO> orderMaterial;
|
||||
|
||||
/**
|
||||
* 客户分布
|
||||
*/
|
||||
private List<CustomerRegionVO> customerRegion;
|
||||
// /**
|
||||
// * 订单汇总
|
||||
// */
|
||||
// private OrderSummaryVO orderSummary;
|
||||
//
|
||||
// /**
|
||||
// * 销售经理饼图
|
||||
// */
|
||||
// private List<SalesManagerPieVO> salesManagerPie;
|
||||
//
|
||||
// /**
|
||||
// * 产品销量排行
|
||||
// */
|
||||
// private List<ProductRankVO> productRank;
|
||||
//
|
||||
// /**
|
||||
// * 订单物料分析
|
||||
// */
|
||||
// private List<OrderMaterialVO> orderMaterial;
|
||||
//
|
||||
// /**
|
||||
// * 客户分布
|
||||
// */
|
||||
// private List<CustomerRegionVO> customerRegion;
|
||||
|
||||
// ========== 新增业务区域 ==========
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
@Data
|
||||
public class OrderMaterialVO {
|
||||
private String materialName;
|
||||
private double usedCount;
|
||||
private double stockCount;
|
||||
private double purchaseCycle;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
@Data
|
||||
public class OrderSummaryVO {
|
||||
private int totalOrderCount;
|
||||
private int finishedOrderCount;
|
||||
private double finishedRate;
|
||||
private int monthFinishedOrderCount;
|
||||
private double monthFinishedRate;
|
||||
private int lastMonthTotalOrderCount;
|
||||
private int lastMonthFinishedOrderCount;
|
||||
private double lastMonthFinishedRate;
|
||||
private double totalOrderCountGrowthRate;
|
||||
private double finishedOrderCountGrowthRate;
|
||||
private double finishedRateGrowthRate;
|
||||
private double monthFinishedOrderCountGrowthRate;
|
||||
private double monthFinishedRateGrowthRate;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
@Data
|
||||
public class ProductRankVO {
|
||||
private String productName;
|
||||
private double totalSales;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
@Data
|
||||
public class SalesManagerPieVO {
|
||||
private String salesManager;
|
||||
private double totalSales;
|
||||
}
|
||||
@@ -14,43 +14,43 @@ import java.util.List;
|
||||
* @date 2025-07-18
|
||||
*/
|
||||
public interface WmsProductMapper extends BaseMapperPlus<WmsProductMapper, WmsProduct, WmsProductVo> {
|
||||
// 订单汇总
|
||||
@Select("SELECT " +
|
||||
"COUNT(*) AS totalOrderCount, " +
|
||||
"SUM(CASE WHEN order_status=2 THEN 1 ELSE 0 END) AS finishedOrderCount, " +
|
||||
"ROUND(SUM(CASE WHEN order_status=2 THEN 1 ELSE 0 END)/COUNT(*), 4) AS finishedRate, " +
|
||||
"SUM(CASE WHEN order_status=2 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(NOW(), '%Y-%m') THEN 1 ELSE 0 END) AS monthFinishedOrderCount, " +
|
||||
"ROUND(SUM(CASE WHEN order_status=2 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(NOW(), '%Y-%m') THEN 1 ELSE 0 END)/COUNT(*), 4) AS monthFinishedRate, " +
|
||||
"(SELECT COUNT(*) FROM wms_order WHERE del_flag=0 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), '%Y-%m')) AS lastMonthTotalOrderCount, " +
|
||||
"(SELECT SUM(CASE WHEN order_status=2 THEN 1 ELSE 0 END) FROM wms_order WHERE del_flag=0 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), '%Y-%m')) AS lastMonthFinishedOrderCount, " +
|
||||
"(SELECT ROUND(SUM(CASE WHEN order_status=2 THEN 1 ELSE 0 END)/COUNT(*), 4) FROM wms_order WHERE del_flag=0 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), '%Y-%m')) AS lastMonthFinishedRate " +
|
||||
"FROM wms_order WHERE del_flag=0")
|
||||
OrderSummaryVO selectOrderSummary();
|
||||
|
||||
// 销售经理饼图
|
||||
@Select("SELECT sales_manager, SUM(od.quantity) AS totalSales " +
|
||||
"FROM wms_order o JOIN wms_order_detail od ON o.order_id = od.order_id " +
|
||||
"WHERE o.order_status = 2 AND o.del_flag=0 GROUP BY o.sales_manager")
|
||||
List<SalesManagerPieVO> selectSalesManagerPie();
|
||||
|
||||
// 产品销量排行
|
||||
@Select("SELECT p.product_name, SUM(od.quantity) AS totalSales " +
|
||||
"FROM wms_order_detail od JOIN wms_product p ON od.product_id = p.product_id " +
|
||||
"GROUP BY p.product_name ORDER BY totalSales DESC LIMIT 10")
|
||||
List<ProductRankVO> selectProductRank();
|
||||
|
||||
// 订单物料分析(只分析库存量和销售销量)
|
||||
@Select("SELECT p.product_name AS materialName, SUM(od.quantity) AS usedCount, " +
|
||||
"(SELECT IFNULL(SUM(quantity),0) FROM wms_stock s WHERE s.item_type='product' AND s.item_id = p.product_id AND s.del_flag=0) AS stockCount, " +
|
||||
"0 AS purchaseCycle " +
|
||||
"FROM wms_order_detail od JOIN wms_product p ON od.product_id = p.product_id " +
|
||||
"GROUP BY p.product_id, p.product_name")
|
||||
List<OrderMaterialVO> selectOrderMaterial();
|
||||
|
||||
// 客户分布热力图
|
||||
@Select("SELECT o.customer_name AS region, COUNT(*) AS customerCount " +
|
||||
"FROM wms_order o WHERE o.del_flag=0 GROUP BY o.customer_name")
|
||||
List<CustomerRegionVO> selectCustomerRegion();
|
||||
// // 订单汇总
|
||||
// @Select("SELECT " +
|
||||
// "COUNT(*) AS totalOrderCount, " +
|
||||
// "SUM(CASE WHEN order_status=2 THEN 1 ELSE 0 END) AS finishedOrderCount, " +
|
||||
// "ROUND(SUM(CASE WHEN order_status=2 THEN 1 ELSE 0 END)/COUNT(*), 4) AS finishedRate, " +
|
||||
// "SUM(CASE WHEN order_status=2 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(NOW(), '%Y-%m') THEN 1 ELSE 0 END) AS monthFinishedOrderCount, " +
|
||||
// "ROUND(SUM(CASE WHEN order_status=2 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(NOW(), '%Y-%m') THEN 1 ELSE 0 END)/COUNT(*), 4) AS monthFinishedRate, " +
|
||||
// "(SELECT COUNT(*) FROM wms_order WHERE del_flag=0 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), '%Y-%m')) AS lastMonthTotalOrderCount, " +
|
||||
// "(SELECT SUM(CASE WHEN order_status=2 THEN 1 ELSE 0 END) FROM wms_order WHERE del_flag=0 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), '%Y-%m')) AS lastMonthFinishedOrderCount, " +
|
||||
// "(SELECT ROUND(SUM(CASE WHEN order_status=2 THEN 1 ELSE 0 END)/COUNT(*), 4) FROM wms_order WHERE del_flag=0 AND DATE_FORMAT(create_time, '%Y-%m')=DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), '%Y-%m')) AS lastMonthFinishedRate " +
|
||||
// "FROM wms_order WHERE del_flag=0")
|
||||
// OrderSummaryVO selectOrderSummary();
|
||||
//
|
||||
// // 销售经理饼图
|
||||
// @Select("SELECT sales_manager, SUM(od.quantity) AS totalSales " +
|
||||
// "FROM wms_order o JOIN wms_order_detail od ON o.order_id = od.order_id " +
|
||||
// "WHERE o.order_status = 2 AND o.del_flag=0 GROUP BY o.sales_manager")
|
||||
// List<SalesManagerPieVO> selectSalesManagerPie();
|
||||
//
|
||||
// // 产品销量排行
|
||||
// @Select("SELECT p.product_name, SUM(od.quantity) AS totalSales " +
|
||||
// "FROM wms_order_detail od JOIN wms_product p ON od.product_id = p.product_id " +
|
||||
// "GROUP BY p.product_name ORDER BY totalSales DESC LIMIT 10")
|
||||
// List<ProductRankVO> selectProductRank();
|
||||
//
|
||||
// // 订单物料分析(只分析库存量和销售销量)
|
||||
// @Select("SELECT p.product_name AS materialName, SUM(od.quantity) AS usedCount, " +
|
||||
// "(SELECT IFNULL(SUM(quantity),0) FROM wms_stock s WHERE s.item_type='product' AND s.item_id = p.product_id AND s.del_flag=0) AS stockCount, " +
|
||||
// "0 AS purchaseCycle " +
|
||||
// "FROM wms_order_detail od JOIN wms_product p ON od.product_id = p.product_id " +
|
||||
// "GROUP BY p.product_id, p.product_name")
|
||||
// List<OrderMaterialVO> selectOrderMaterial();
|
||||
//
|
||||
// // 客户分布热力图
|
||||
// @Select("SELECT o.customer_name AS region, COUNT(*) AS customerCount " +
|
||||
// "FROM wms_order o WHERE o.del_flag=0 GROUP BY o.customer_name")
|
||||
// List<CustomerRegionVO> selectCustomerRegion();
|
||||
|
||||
// ========== 新增业务区域查询方法 ==========
|
||||
|
||||
|
||||
@@ -77,4 +77,6 @@ public interface IWmsStockIoService {
|
||||
|
||||
|
||||
boolean scanInStockByBo(WmsStockIoDetailBo bo);
|
||||
|
||||
boolean scanOutStockByBo(WmsStockIoDetailBo bo);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import com.klp.domain.vo.WmsProductVo;
|
||||
import com.klp.domain.WmsProduct;
|
||||
import com.klp.mapper.WmsProductMapper;
|
||||
import com.klp.service.IWmsProductService;
|
||||
import com.klp.domain.vo.OrderSummaryVO;
|
||||
import com.klp.domain.vo.PerformanceAreaVO;
|
||||
import com.klp.domain.vo.CurrentSituationAreaVO;
|
||||
import com.klp.domain.vo.RecommendationAreaVO;
|
||||
@@ -126,38 +125,38 @@ public class WmsProductServiceImpl implements IWmsProductService {
|
||||
@Override
|
||||
public DashboardOverviewVO getDashboardOverview() {
|
||||
DashboardOverviewVO vo = new DashboardOverviewVO();
|
||||
|
||||
// ========== 原有业务逻辑 ==========
|
||||
OrderSummaryVO summary = baseMapper.selectOrderSummary();
|
||||
// 计算增长率
|
||||
summary.setTotalOrderCountGrowthRate(
|
||||
summary.getLastMonthTotalOrderCount() == 0 ? 0 :
|
||||
(double)(summary.getTotalOrderCount() - summary.getLastMonthTotalOrderCount()) / summary.getLastMonthTotalOrderCount()
|
||||
);
|
||||
summary.setFinishedOrderCountGrowthRate(
|
||||
summary.getLastMonthFinishedOrderCount() == 0 ? 0 :
|
||||
(double)(summary.getFinishedOrderCount() - summary.getLastMonthFinishedOrderCount()) / summary.getLastMonthFinishedOrderCount()
|
||||
);
|
||||
summary.setFinishedRateGrowthRate(
|
||||
summary.getLastMonthFinishedRate() == 0 ? 0 :
|
||||
(summary.getFinishedRate() - summary.getLastMonthFinishedRate()) / summary.getLastMonthFinishedRate()
|
||||
);
|
||||
summary.setMonthFinishedOrderCountGrowthRate(
|
||||
summary.getLastMonthFinishedOrderCount() == 0 ? 0 :
|
||||
(double)(summary.getMonthFinishedOrderCount() - summary.getLastMonthFinishedOrderCount()) / summary.getLastMonthFinishedOrderCount()
|
||||
);
|
||||
summary.setMonthFinishedRateGrowthRate(
|
||||
summary.getLastMonthFinishedRate() == 0 ? 0 :
|
||||
(summary.getMonthFinishedRate() - summary.getLastMonthFinishedRate()) / summary.getLastMonthFinishedRate()
|
||||
);
|
||||
vo.setOrderSummary(summary);
|
||||
vo.setSalesManagerPie(baseMapper.selectSalesManagerPie());
|
||||
vo.setProductRank(baseMapper.selectProductRank());
|
||||
vo.setOrderMaterial(baseMapper.selectOrderMaterial());
|
||||
vo.setCustomerRegion(baseMapper.selectCustomerRegion());
|
||||
|
||||
// // ========== 原有业务逻辑 ==========
|
||||
// OrderSummaryVO summary = baseMapper.selectOrderSummary();
|
||||
// // 计算增长率
|
||||
// summary.setTotalOrderCountGrowthRate(
|
||||
// summary.getLastMonthTotalOrderCount() == 0 ? 0 :
|
||||
// (double)(summary.getTotalOrderCount() - summary.getLastMonthTotalOrderCount()) / summary.getLastMonthTotalOrderCount()
|
||||
// );
|
||||
// summary.setFinishedOrderCountGrowthRate(
|
||||
// summary.getLastMonthFinishedOrderCount() == 0 ? 0 :
|
||||
// (double)(summary.getFinishedOrderCount() - summary.getLastMonthFinishedOrderCount()) / summary.getLastMonthFinishedOrderCount()
|
||||
// );
|
||||
// summary.setFinishedRateGrowthRate(
|
||||
// summary.getLastMonthFinishedRate() == 0 ? 0 :
|
||||
// (summary.getFinishedRate() - summary.getLastMonthFinishedRate()) / summary.getLastMonthFinishedRate()
|
||||
// );
|
||||
// summary.setMonthFinishedOrderCountGrowthRate(
|
||||
// summary.getLastMonthFinishedOrderCount() == 0 ? 0 :
|
||||
// (double)(summary.getMonthFinishedOrderCount() - summary.getLastMonthFinishedOrderCount()) / summary.getLastMonthFinishedOrderCount()
|
||||
// );
|
||||
// summary.setMonthFinishedRateGrowthRate(
|
||||
// summary.getLastMonthFinishedRate() == 0 ? 0 :
|
||||
// (summary.getMonthFinishedRate() - summary.getLastMonthFinishedRate()) / summary.getLastMonthFinishedRate()
|
||||
// );
|
||||
// vo.setOrderSummary(summary);
|
||||
// vo.setSalesManagerPie(baseMapper.selectSalesManagerPie());
|
||||
// vo.setProductRank(baseMapper.selectProductRank());
|
||||
// vo.setOrderMaterial(baseMapper.selectOrderMaterial());
|
||||
// vo.setCustomerRegion(baseMapper.selectCustomerRegion());
|
||||
|
||||
// ========== 新增业务区域逻辑 ==========
|
||||
|
||||
|
||||
// 业绩区数据
|
||||
PerformanceAreaVO performanceArea = new PerformanceAreaVO();
|
||||
performanceArea.setProductSalesPerformance(baseMapper.selectProductSalesPerformance());
|
||||
|
||||
@@ -19,6 +19,8 @@ import com.klp.service.IWmsProductionLineService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 产线Service业务层处理
|
||||
@@ -47,10 +49,8 @@ public class WmsProductionLineServiceImpl implements IWmsProductionLineService {
|
||||
public TableDataInfo<WmsProductionLineVo> queryPageList(WmsProductionLineBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsProductionLine> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsProductionLineVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
// 填充负载信息
|
||||
fillLoadInfo(result.getRecords());
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class WmsProductionLineServiceImpl implements IWmsProductionLineService {
|
||||
// 批量查询负载信息
|
||||
List<LineLoadInfo> loadInfoList = baseMapper.selectLineLoadInfo(lineIds);
|
||||
Map<Long, LineLoadInfo> loadInfoMap = loadInfoList.stream()
|
||||
.collect(java.util.stream.Collectors.toMap(LineLoadInfo::getLineId, java.util.function.Function.identity()));
|
||||
.collect(Collectors.toMap(LineLoadInfo::getLineId, Function.identity()));
|
||||
// 填充到VO
|
||||
for (WmsProductionLineVo vo : productionLineList) {
|
||||
LineLoadInfo loadInfo = loadInfoMap.get(vo.getLineId());
|
||||
|
||||
@@ -162,6 +162,27 @@ public class WmsStockIoServiceImpl implements IWmsStockIoService {
|
||||
changeStock(bo.getWarehouseId(), bo.getItemType(), bo.getItemId(), bo.getQuantity(), true, unit);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean scanOutStockByBo(WmsStockIoDetailBo bo) {
|
||||
String unit = bo.getUnit();
|
||||
// 如果unit为空,自动查item表补全
|
||||
if (unit == null || unit.trim().isEmpty()) {
|
||||
if ("product".equals(bo.getItemType())) {
|
||||
WmsProduct p = productMapper.selectById(bo.getItemId());
|
||||
unit = p != null ? p.getUnit() : null;
|
||||
} else if ("raw_material".equals(bo.getItemType())) {
|
||||
WmsRawMaterial r = rawMaterialMapper.selectById(bo.getItemId());
|
||||
unit = r != null ? r.getUnit() : null;
|
||||
}
|
||||
}
|
||||
if (unit == null || unit.trim().isEmpty()) {
|
||||
throw new RuntimeException("未能获取到单位");
|
||||
}
|
||||
// 出库操作
|
||||
changeStock(bo.getWarehouseId(), bo.getItemType(), bo.getItemId(), bo.getQuantity(), false, unit);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
line_id AS lineId,
|
||||
COUNT(*) AS planDetailCount,
|
||||
SUM(DATEDIFF(end_date, start_date) + 1) AS totalPlanDays
|
||||
SUM(DATEDIFF(end_date, GREATEST(start_date, CURDATE())) + 1) AS totalPlanDays
|
||||
FROM
|
||||
wms_schedule_plan_detail
|
||||
WHERE
|
||||
@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<foreach collection="lineIds" item="lineId" open="(" separator="," close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
AND end_date >= CURDATE()
|
||||
AND del_flag = 0
|
||||
GROUP BY
|
||||
line_id
|
||||
|
||||
Reference in New Issue
Block a user