|
|
@@ -39,13 +39,15 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.atomic.AtomicReference;
|
|
|
+import java.util.stream.Collectors;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
- * @desc : 报表数据源
|
|
|
* @author : 常皓宁
|
|
|
- * @date : 2024/4/11 8:49
|
|
|
+ * @desc : 报表数据源
|
|
|
+ * @date : 2024/4/11 8:49
|
|
|
*/
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
@@ -64,19 +66,20 @@ public class ReportService {
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
/**
|
|
|
- * @desc : 查询库存
|
|
|
+ * @desc : 查询库存
|
|
|
* @author : 常皓宁
|
|
|
- * @date : 2024/4/11 8:52
|
|
|
+ * @date : 2024/4/11 8:52
|
|
|
*/
|
|
|
public ResponseResultVO<List<Map<String, Object>>> getIvtDetailReport(Map<String, Object> param) {
|
|
|
// 获取系统基础数据
|
|
|
List<Map<String, Object>> list = reportMapper.getIvtDetailReport(param);
|
|
|
return ResponseResultUtil.success(list);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- * @desc : 采购明细报表(明细)
|
|
|
+ * @desc : 采购明细报表(明细)
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/4/10 16:39
|
|
|
+ * @date : 2024/4/10 16:39
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getPurDetailReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -84,17 +87,17 @@ public class ReportService {
|
|
|
return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
|
|
|
}
|
|
|
// 获取系统基础数据
|
|
|
- List<Map<String, Object>> list=new ArrayList<>();
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
PageList data = new PageList<>();
|
|
|
param.put("start", (Integer.parseInt(param.get("currentPage").toString()) - 1) * Integer.parseInt(param.get("pageSize").toString()));
|
|
|
param.put("end", Integer.parseInt(param.get("pageSize").toString()));
|
|
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
|
|
- if(param.get("flgViewItem")==null){
|
|
|
+ if (param.get("flgViewItem") == null) {
|
|
|
// 查询主表
|
|
|
- dataList= reportMapper.getPurReport(param);
|
|
|
- }else {
|
|
|
+ dataList = reportMapper.getPurReport(param);
|
|
|
+ } else {
|
|
|
// 查询明细
|
|
|
- dataList= reportMapper.getPurDetailReport(param);
|
|
|
+ dataList = reportMapper.getPurDetailReport(param);
|
|
|
}
|
|
|
data.setList(dataList);
|
|
|
data.setTotal(reportMapper.getSalesTrackingReportCount(param));
|
|
|
@@ -104,9 +107,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 销售明细报表
|
|
|
+ * @desc : 销售明细报表
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/4/11 13:22
|
|
|
+ * @date : 2024/4/11 13:22
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getOrderDetailReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -114,17 +117,17 @@ public class ReportService {
|
|
|
return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
|
|
|
}
|
|
|
// 获取系统基础数据
|
|
|
- List<Map<String, Object>> list=new ArrayList<>();
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
PageList data = new PageList<>();
|
|
|
param.put("start", (Integer.parseInt(param.get("currentPage").toString()) - 1) * Integer.parseInt(param.get("pageSize").toString()));
|
|
|
param.put("end", Integer.parseInt(param.get("pageSize").toString()));
|
|
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
|
|
- if(param.get("flgViewItem")==null){
|
|
|
+ if (param.get("flgViewItem") == null) {
|
|
|
// 查询主表
|
|
|
- dataList= reportMapper.getOrderReport(param);
|
|
|
- }else {
|
|
|
+ dataList = reportMapper.getOrderReport(param);
|
|
|
+ } else {
|
|
|
// 查询明细
|
|
|
- dataList= reportMapper.getOrderDetailReport(param);
|
|
|
+ dataList = reportMapper.getOrderDetailReport(param);
|
|
|
}
|
|
|
data.setList(dataList);
|
|
|
data.setTotal(reportMapper.getSalesTrackingReportCount(param));
|
|
|
@@ -134,9 +137,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 出库明细报表
|
|
|
+ * @desc : 出库明细报表
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/4/11 16:54
|
|
|
+ * @date : 2024/4/11 16:54
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getOutboundDetailReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -148,12 +151,12 @@ public class ReportService {
|
|
|
param.put("start", (Integer.parseInt(param.get("currentPage").toString()) - 1) * Integer.parseInt(param.get("pageSize").toString()));
|
|
|
param.put("end", Integer.parseInt(param.get("pageSize").toString()));
|
|
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
|
|
- if(param.get("flgViewItem")==null){
|
|
|
+ if (param.get("flgViewItem") == null) {
|
|
|
// 查询主表
|
|
|
- dataList= reportMapper.getOutboundReport(param);
|
|
|
- }else {
|
|
|
+ dataList = reportMapper.getOutboundReport(param);
|
|
|
+ } else {
|
|
|
// 查询明细
|
|
|
- dataList= reportMapper.getOutboundDetailReport(param);
|
|
|
+ dataList = reportMapper.getOutboundDetailReport(param);
|
|
|
}
|
|
|
data.setList(dataList);
|
|
|
data.setTotal(reportMapper.getOutboundDetailReportCount(param));
|
|
|
@@ -163,9 +166,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 入库明细报表
|
|
|
+ * @desc : 入库明细报表
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/4/11 16:54
|
|
|
+ * @date : 2024/4/11 16:54
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getInboundDetailReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -177,12 +180,12 @@ public class ReportService {
|
|
|
param.put("start", (Integer.parseInt(param.get("currentPage").toString()) - 1) * Integer.parseInt(param.get("pageSize").toString()));
|
|
|
param.put("end", Integer.parseInt(param.get("pageSize").toString()));
|
|
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
|
|
- if(param.get("flgViewItem")==null){
|
|
|
+ if (param.get("flgViewItem") == null) {
|
|
|
// 查询主表
|
|
|
- dataList= reportMapper.getInboundlReport(param);
|
|
|
- }else {
|
|
|
+ dataList = reportMapper.getInboundlReport(param);
|
|
|
+ } else {
|
|
|
// 查询明细
|
|
|
- dataList= reportMapper.getInboundDetailReport(param);
|
|
|
+ dataList = reportMapper.getInboundDetailReport(param);
|
|
|
}
|
|
|
data.setList(dataList);
|
|
|
data.setTotal(reportMapper.getSalesTrackingReportCount(param));
|
|
|
@@ -192,9 +195,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 客户收款明细表
|
|
|
+ * @desc : 客户收款明细表
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/4/16 11:29
|
|
|
+ * @date : 2024/4/16 11:29
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getRecPayDetailReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -216,9 +219,9 @@ public class ReportService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 销售跟踪表 列表查询
|
|
|
+ * @desc : 销售跟踪表 列表查询
|
|
|
* @author : 于继渤
|
|
|
- * @date : 2024/4/16 11:27
|
|
|
+ * @date : 2024/4/16 11:27
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getSalesTrackingReport(Map<String, Object> param) {
|
|
|
|
|
|
@@ -241,9 +244,9 @@ public class ReportService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 销售明细
|
|
|
+ * @desc : 销售明细
|
|
|
* @author : 于继渤
|
|
|
- * @date : 2024/4/16 11:27
|
|
|
+ * @date : 2024/4/16 11:27
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getSalesItemReport(Map<String, Object> param) {
|
|
|
|
|
|
@@ -266,9 +269,9 @@ public class ReportService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 采购跟踪表 列表查询
|
|
|
+ * @desc : 采购跟踪表 列表查询
|
|
|
* @author : 王英杰
|
|
|
- * @date : 2024/4/16 11:27
|
|
|
+ * @date : 2024/4/16 11:27
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getPurTrackingReport(Map<String, Object> param) {
|
|
|
|
|
|
@@ -291,28 +294,28 @@ public class ReportService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 采购跟踪表 明细查询
|
|
|
+ * @desc : 采购跟踪表 明细查询
|
|
|
* @author : 王英杰
|
|
|
- * @date : 2024/4/16 11:27
|
|
|
+ * @date : 2024/4/16 11:27
|
|
|
*/
|
|
|
public ResponseResultVO getPurTrackingReportDetail(String purId) {
|
|
|
|
|
|
- return ResponseResultUtil.success(reportMapper.getPurTrackingReportDetail(purId) );
|
|
|
+ return ResponseResultUtil.success(reportMapper.getPurTrackingReportDetail(purId));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 销售跟踪表 明细查询
|
|
|
+ * @desc : 销售跟踪表 明细查询
|
|
|
* @author : 于继渤
|
|
|
- * @date : 2024/4/16 11:27
|
|
|
+ * @date : 2024/4/16 11:27
|
|
|
*/
|
|
|
public ResponseResultVO getSalesTrackingReportDetail(String id) {
|
|
|
- return ResponseResultUtil.success(reportMapper.getSalesTrackingReportDetail(id) );
|
|
|
+ return ResponseResultUtil.success(reportMapper.getSalesTrackingReportDetail(id));
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 日结对账表
|
|
|
- * @date : 2024/4/24 15:11
|
|
|
+ * @desc : 日结对账表
|
|
|
+ * @date : 2024/4/24 15:11
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getDailyReconciliationReport(Map<String, Object> param) {
|
|
|
@@ -333,8 +336,8 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 日结对账表-查销售订单
|
|
|
- * @date : 2024/4/24 15:11
|
|
|
+ * @desc : 日结对账表-查销售订单
|
|
|
+ * @date : 2024/4/24 15:11
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getDailyReconciliationReportByOrder(Map<String, Object> param) {
|
|
|
@@ -356,8 +359,8 @@ public class ReportService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 日结对账表-查销售出库
|
|
|
- * @date : 2024/4/24 15:11
|
|
|
+ * @desc : 日结对账表-查销售出库
|
|
|
+ * @date : 2024/4/24 15:11
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getDailyReconciliationReportByOut(Map<String, Object> param) {
|
|
|
@@ -379,8 +382,8 @@ public class ReportService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 日结对账表-查收款单
|
|
|
- * @date : 2024/4/24 15:11
|
|
|
+ * @desc : 日结对账表-查收款单
|
|
|
+ * @date : 2024/4/24 15:11
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getDailyReconciliationReportByPay(Map<String, Object> param) {
|
|
|
@@ -401,14 +404,14 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 收发存汇总报表
|
|
|
+ * @desc : 收发存汇总报表
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/4/20 13:30
|
|
|
+ * @date : 2024/4/20 13:30
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getIvtSumReport(Map<String, Object> param) {
|
|
|
if (param.get("querys") != null) {
|
|
|
JSONObject querys = JSONObject.parseObject(param.get("querys").toString());
|
|
|
- param.put("querys",querys);
|
|
|
+ param.put("querys", querys);
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> list = reportMapper.getIvtSumReport(param);
|
|
|
@@ -430,9 +433,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 收发存汇总报表-明细
|
|
|
+ * @desc : 收发存汇总报表-明细
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/4/23 14:10
|
|
|
+ * @date : 2024/4/23 14:10
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getIvtItemReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -459,9 +462,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 供应商往来余额表
|
|
|
+ * @desc : 供应商往来余额表
|
|
|
* @author : 常皓宁
|
|
|
- * @date : 2024/4/25 13:27
|
|
|
+ * @date : 2024/4/25 13:27
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getSupAccount(Map<String, Object> param) {
|
|
|
param.put("start", (Integer.parseInt(param.get("currentPage").toString()) - 1) * Integer.parseInt(param.get("pageSize").toString()));
|
|
|
@@ -474,9 +477,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 供应商往来余额表明细
|
|
|
+ * @desc : 供应商往来余额表明细
|
|
|
* @author : 常皓宁
|
|
|
- * @date : 2024/4/25 13:27
|
|
|
+ * @date : 2024/4/25 13:27
|
|
|
*/
|
|
|
public ResponseResultVO<List<Map<String, Object>>> getSupAccountItem(Map<String, Object> param) {
|
|
|
// 获取系统基础数据
|
|
|
@@ -485,9 +488,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 资金日记账
|
|
|
+ * @desc : 资金日记账
|
|
|
* @author : 常皓宁
|
|
|
- * @date : 2024/4/26 16:43
|
|
|
+ * @date : 2024/4/26 16:43
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getFundReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -515,21 +518,21 @@ public class ReportService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @desc : 销售简报
|
|
|
- * @date : 2024/5/6 8:43
|
|
|
+ * @desc : 销售简报
|
|
|
+ * @date : 2024/5/6 8:43
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
- public ResponseResultVO<Map<String,Object>> getReportBatch(Map<String,Map<String,Object>> param){
|
|
|
- Map<String,Object> result = new HashMap<>();
|
|
|
- for(String key : param.keySet()){
|
|
|
- JSONObject valueObj = JSONObject.parseObject(reportMapper.getReportBatch(param.get(key)).get("report").getValue());
|
|
|
- result.put(key,valueObj);
|
|
|
+ public ResponseResultVO<Map<String, Object>> getReportBatch(Map<String, Map<String, Object>> param) {
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ for (String key : param.keySet()) {
|
|
|
+ JSONObject valueObj = JSONObject.parseObject(reportMapper.getReportBatch(param.get(key)).get("report").getValue());
|
|
|
+ result.put(key, valueObj);
|
|
|
}
|
|
|
return ResponseResultUtil.success(result);
|
|
|
}
|
|
|
|
|
|
|
|
|
-// @Autowired
|
|
|
+ // @Autowired
|
|
|
// private LogReportExportFeign logReportExportFeign;
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
public void export(HttpServletResponse response, String uuid) throws Exception {
|
|
|
@@ -538,29 +541,29 @@ public class ReportService {
|
|
|
|
|
|
List<ExportView> exportViews = new ArrayList<>();
|
|
|
|
|
|
- Map<String,Object> redisData = ((Map<String,Object>) redisUtil.get(uuid));
|
|
|
+ Map<String, Object> redisData = ((Map<String, Object>) redisUtil.get(uuid));
|
|
|
|
|
|
- Map<String,Map<String,Object>> params = (Map<String, Map<String, Object>>)redisData.get("params") ;
|
|
|
+ Map<String, Map<String, Object>> params = (Map<String, Map<String, Object>>) redisData.get("params");
|
|
|
/* 查询条件 */
|
|
|
String searchCondition = redisData.get("searchCond").toString();
|
|
|
/* 数据库查询出来的数据 */
|
|
|
- Map<String,Object> reportData = getReportBatch(params).getData();
|
|
|
+ Map<String, Object> reportData = getReportBatch(params).getData();
|
|
|
|
|
|
String fileName = redisData.get("fileName").toString();
|
|
|
// String filePath = redisData.get("filePath").toString();
|
|
|
|
|
|
exportViews.add(new ExportView());
|
|
|
exportViews.get(0).setCls(ExcelIndex.class);
|
|
|
- ExportParams indexExportParams = new ExportParams(searchCondition,"报表目录");
|
|
|
+ ExportParams indexExportParams = new ExportParams(searchCondition, "报表目录");
|
|
|
indexExportParams.setDataHandler(new ExcelDataHandler());
|
|
|
exportViews.get(0).setExportParams(indexExportParams);
|
|
|
exportViews.get(0).setTitleHeight(60);
|
|
|
List<ExcelIndex> sheetList = new ArrayList<>();
|
|
|
// String currentUserId = null;
|
|
|
// Long cpId = null;
|
|
|
- for(String key : params.keySet()){
|
|
|
+ for (String key : params.keySet()) {
|
|
|
sheetList.add(new ExcelIndex().setSheetName(TITLE_MAP.get(key)));
|
|
|
- Map<String,Object> currentMap = params.get(key);
|
|
|
+ Map<String, Object> currentMap = params.get(key);
|
|
|
/* 手动处理一下 userId */
|
|
|
// if(currentUserId == null){
|
|
|
// currentUserId = currentMap.get("userId").toString();
|
|
|
@@ -570,15 +573,15 @@ public class ReportService {
|
|
|
// cpId = Long.valueOf(currentMap.get("cpId").toString());
|
|
|
// }
|
|
|
Class<?> clazz = CLASS_MAP.get(key);
|
|
|
- List<?> list = JSONArray.parseArray(JSONArray.toJSONString(((Map<String,Object>)reportData.get(key)).get(currentMap.get("items").toString())),clazz);
|
|
|
+ List<?> list = JSONArray.parseArray(JSONArray.toJSONString(((Map<String, Object>) reportData.get(key)).get(currentMap.get("items").toString())), clazz);
|
|
|
ExportParams exportParams = new ExportParams(
|
|
|
TITLE_MAP.get(key),
|
|
|
- getTotal(currentMap.get("secondTitle").toString(), (Map<String,Object>)reportData.get(key), (List<String>)currentMap.get("calc10000")),
|
|
|
+ getTotal(currentMap.get("secondTitle").toString(), (Map<String, Object>) reportData.get(key), (List<String>) currentMap.get("calc10000")),
|
|
|
TITLE_MAP.get(key));
|
|
|
|
|
|
exportParams.setStyle(ExcelExportStyleImpl.class);
|
|
|
|
|
|
- ExportView exportView = new ExportView(exportParams,list,clazz);
|
|
|
+ ExportView exportView = new ExportView(exportParams, list, clazz);
|
|
|
exportViews.add(exportView);
|
|
|
}
|
|
|
exportViews.get(0).setDataList(sheetList);
|
|
|
@@ -597,21 +600,21 @@ public class ReportService {
|
|
|
// .setOpCreateUserId(currentUserId);
|
|
|
// ResponseResultVO<?> insertRes = logReportExportFeign.insert(logReportExportVo);
|
|
|
// if(insertRes.getCode() == 200){
|
|
|
- ExcelUtils.defaultExportMoreSheet(fileName + "-" +currentTime +".xls",response,exportMoreView);
|
|
|
+ ExcelUtils.defaultExportMoreSheet(fileName + "-" + currentTime + ".xls", response, exportMoreView);
|
|
|
// }else{
|
|
|
// throw new BaseBusinessException(insertRes.getCode(),insertRes.getMessage());
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 客户往来账
|
|
|
+ * @desc : 客户往来账
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/5/10 10:32
|
|
|
+ * @date : 2024/5/10 10:32
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getMacRecCurrentReport(Map<String, Object> param) {
|
|
|
if (param.get("querys") != null) {
|
|
|
JSONObject querys = JSONObject.parseObject(param.get("querys").toString());
|
|
|
- param.put("querys",querys);
|
|
|
+ param.put("querys", querys);
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> list = reportMapper.getMacRecCurrentReport(param);
|
|
|
@@ -633,9 +636,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 客户往来账明细
|
|
|
+ * @desc : 客户往来账明细
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/5/10 10:32
|
|
|
+ * @date : 2024/5/10 10:32
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getMacRecCurrentItemReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -662,14 +665,14 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 供应商往来账
|
|
|
+ * @desc : 供应商往来账
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/5/10 10:32
|
|
|
+ * @date : 2024/5/10 10:32
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getMacPayCurrentReport(Map<String, Object> param) {
|
|
|
if (param.get("querys") != null) {
|
|
|
JSONObject querys = JSONObject.parseObject(param.get("querys").toString());
|
|
|
- param.put("querys",querys);
|
|
|
+ param.put("querys", querys);
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> list = reportMapper.getMacPayCurrentReport(param);
|
|
|
@@ -691,9 +694,9 @@ public class ReportService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @desc : 供应商往来账明细
|
|
|
+ * @desc : 供应商往来账明细
|
|
|
* @author : 宋扬
|
|
|
- * @date : 2024/5/10 10:32
|
|
|
+ * @date : 2024/5/10 10:32
|
|
|
*/
|
|
|
public ResponseResultVO<PageList<Map<String, Object>>> getMacPayCurrentItemReport(Map<String, Object> param) {
|
|
|
// 校验分页参数
|
|
|
@@ -719,7 +722,45 @@ public class ReportService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * @desc : 客户收支表查询
|
|
|
+ * @author : 刘尧
|
|
|
+ * @date : 2024/6/6 14:27
|
|
|
+ */
|
|
|
+ public ResponseResultVO<List<Map<String, Object>>> getCusRecPayReportItem(Map<String, Object> params) {
|
|
|
+ List<Map<String, Object>> items = reportMapper.getCusRecPayReportItemByUser(params);
|
|
|
+ List<Map<String, Object>> arrears = reportMapper.getUserArrears(params);
|
|
|
+ // 判断类型
|
|
|
+ for (Map<String, Object> item : items) {
|
|
|
+ if (Double.valueOf(String.valueOf(item.get("outAmt")).equals("null") ? "0" : String.valueOf(item.get("outAmt"))) > 0) {
|
|
|
+ item.put("type", "销售出库");
|
|
|
+ } else if (Double.valueOf(String.valueOf(item.get("outAmt")).equals("null") ? "0" : String.valueOf(item.get("outAmt"))) < 0) {
|
|
|
+ item.put("type", "销售退货");
|
|
|
+ } else if (Double.valueOf(String.valueOf(item.get("sumAmtRec")).equals("null") ? "0" : String.valueOf(item.get("sumAmtRec"))) > 0) {
|
|
|
+ item.put("type", "客户收款");
|
|
|
+ } else if (Double.valueOf(String.valueOf(item.get("sumAmtRec")).equals("null") ? "0" : String.valueOf(item.get("sumAmtRec"))) < 0) {
|
|
|
+ item.put("type", "客户退款");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (Map<String, Object> map : arrears) {
|
|
|
+ // 筛选出符合条件的明细
|
|
|
+ List<Map<String, Object>> userArrearsItem = items.stream()
|
|
|
+ .filter(item -> item.get("objectId").equals(map.get("objectId")))
|
|
|
+ .filter(item -> (Double.valueOf(String.valueOf(item.get("outAmt")).equals("null") ? "0" : String.valueOf(item.get("outAmt"))) != 0
|
|
|
+ || Double.valueOf(String.valueOf(item.get("sumAmtRec")).equals("null") ? "0" : String.valueOf(item.get("sumAmtRec"))) != 0))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ AtomicReference<Double> total = new AtomicReference<>(0.00);
|
|
|
+ // 计算单用户的总计
|
|
|
+ userArrearsItem.forEach(item -> {
|
|
|
+ total.updateAndGet(v -> v + Double.valueOf(String.valueOf(item.get("outAmt")).equals("null") ? "0" : String.valueOf(item.get("outAmt")))
|
|
|
+ + Double.valueOf(String.valueOf(item.get("sumAmtRec")).equals("null") ? "0" : String.valueOf(item.get("sumAmtRec"))));
|
|
|
+ });
|
|
|
+ map.put("item", userArrearsItem);
|
|
|
+ map.put("totalMoney", total);
|
|
|
+ }
|
|
|
+
|
|
|
+ return ResponseResultUtil.success(arrears);
|
|
|
+ }
|
|
|
|
|
|
private static final Map<String, Class<?>> CLASS_MAP = ImmutableMap.<String, Class<?>>builder()
|
|
|
/* 销售分析 */
|
|
|
@@ -786,18 +827,18 @@ public class ReportService {
|
|
|
.put("staffSpuQty", StaffSpuQty.class)
|
|
|
|
|
|
/* 订单参考利润 - 品类排行 */
|
|
|
- .put("saleReferenceProfit1",categoryRanking.class)
|
|
|
+ .put("saleReferenceProfit1", categoryRanking.class)
|
|
|
/* 订单参考利润 - 部门排行 */
|
|
|
- .put("saleReferenceProfit2",orgRanking.class)
|
|
|
+ .put("saleReferenceProfit2", orgRanking.class)
|
|
|
/* 订单参考利润 - 业务员排行 */
|
|
|
- .put("saleReferenceProfit3",staffRanking.class)
|
|
|
+ .put("saleReferenceProfit3", staffRanking.class)
|
|
|
|
|
|
/* 出库参考利润 - 品类排行 */
|
|
|
- .put("outReferenceProfit1",categoryRanking.class)
|
|
|
+ .put("outReferenceProfit1", categoryRanking.class)
|
|
|
/* 出库参考利润 - 部门排行 */
|
|
|
- .put("outReferenceProfit2",orgRanking.class)
|
|
|
+ .put("outReferenceProfit2", orgRanking.class)
|
|
|
/* 出库参考利润 - 业务员排行 */
|
|
|
- .put("outReferenceProfit3",staffRanking.class)
|
|
|
+ .put("outReferenceProfit3", staffRanking.class)
|
|
|
|
|
|
.build();
|
|
|
|
|
|
@@ -805,7 +846,7 @@ public class ReportService {
|
|
|
/* 销售分析 */
|
|
|
.put("saleTask", "销售分析-销售任务")
|
|
|
.put("returnSituation", "销售分析-退货情况")
|
|
|
- .put("customerUnitPrice","销售分析-客单价")
|
|
|
+ .put("customerUnitPrice", "销售分析-客单价")
|
|
|
// .put("activityEffect1","销售分析-促销套餐活动效果")
|
|
|
// .put("activityEffect2","销售分析-促销单品活动效果")
|
|
|
// .put("customizedWisdom1","销售分析-定+智品类")
|
|
|
@@ -864,23 +905,23 @@ public class ReportService {
|
|
|
.put("staffSpuQty", "销售分析-业务员单品数量")
|
|
|
|
|
|
/* 订单参考利润 - 品类排行 */
|
|
|
- .put("saleReferenceProfit1","订单参考利润-品类排行")
|
|
|
+ .put("saleReferenceProfit1", "订单参考利润-品类排行")
|
|
|
/* 订单参考利润 - 部门排行 */
|
|
|
- .put("saleReferenceProfit2","订单参考利润-部门排行")
|
|
|
+ .put("saleReferenceProfit2", "订单参考利润-部门排行")
|
|
|
/* 订单参考利润 - 业务员排行 */
|
|
|
- .put("saleReferenceProfit3","订单参考利润-业务员排行")
|
|
|
+ .put("saleReferenceProfit3", "订单参考利润-业务员排行")
|
|
|
|
|
|
/* 出库参考利润 - 品类排行 */
|
|
|
- .put("outReferenceProfit1","出库参考利润-品类排行")
|
|
|
+ .put("outReferenceProfit1", "出库参考利润-品类排行")
|
|
|
/* 出库参考利润 - 部门排行 */
|
|
|
- .put("outReferenceProfit2","出库参考利润-部门排行")
|
|
|
+ .put("outReferenceProfit2", "出库参考利润-部门排行")
|
|
|
/* 出库参考利润 - 业务员排行 */
|
|
|
- .put("outReferenceProfit3","出库参考利润-业务员排行")
|
|
|
+ .put("outReferenceProfit3", "出库参考利润-业务员排行")
|
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
- private static String getTotal(String str,Map<String,Object> data,List<String> calcStr){
|
|
|
+ private static String getTotal(String str, Map<String, Object> data, List<String> calcStr) {
|
|
|
String returnStr = str;
|
|
|
Pattern dynamic = Pattern.compile(".*\\$\\{([A-Za-z0-9]+)\\}.*");
|
|
|
Pattern dynamicLimitCount = Pattern.compile("\\$\\{([A-Za-z0-9]+)\\}");
|
|
|
@@ -891,9 +932,9 @@ public class ReportService {
|
|
|
}
|
|
|
for (String it : params) {
|
|
|
String value = data.get(it).toString();
|
|
|
- if(value != null && calcStr.contains(it)){
|
|
|
+ if (value != null && calcStr.contains(it)) {
|
|
|
BigDecimal b = new BigDecimal(value);
|
|
|
- value = b.divide(BigDecimal.valueOf(10000),2, RoundingMode.HALF_UP).toString();
|
|
|
+ value = b.divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP).toString();
|
|
|
}
|
|
|
returnStr = returnStr.replaceAll("\\$\\{" + it + "\\}", value);
|
|
|
}
|