Compare commits
14 Commits
dev_2026-0
...
cadd79f47d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cadd79f47d | ||
|
|
495c1bdfa4 | ||
|
|
4d91edae40 | ||
|
|
8d59bd9dd9 | ||
|
|
8e4b6326b6 | ||
|
|
43c0959060 | ||
|
|
70aac257c0 | ||
|
|
77f434ddaa | ||
|
|
1ebbc22aaf | ||
|
|
d7128d6e67 | ||
|
|
57a88b6dba | ||
|
|
813660cf93 | ||
|
|
5d6814bdef | ||
|
|
e7bc45add5 |
@@ -0,0 +1,84 @@
|
||||
package com.lideeyunji.core.framework.controller;
|
||||
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount;
|
||||
import com.lideeyunji.core.framework.params.SaAggParam;
|
||||
import com.lideeyunji.core.framework.service.INewGrBiSaAggMonthCountService;
|
||||
import com.lideeyunji.core.framework.service.INewGrBiSaAggYearCountService;
|
||||
import com.lideeyunji.core.framework.utils.FuncWeb;
|
||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||
import com.lideeyunji.tool.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.lideeyunji.tool.framework.yunji.model.global.BaseWebResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 综合销售情况月维度Controller
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-19
|
||||
*/
|
||||
@TenantIgnore
|
||||
@RestController
|
||||
@RequestMapping(lideeYunJiBaseConstant.REQUEST_URL_START+"/agg/month")
|
||||
public class NewGrBiSaAggMonthCountController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService;
|
||||
|
||||
@Autowired
|
||||
private INewGrBiSaAggYearCountService newGrBiSaAggYearCountService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询综合销售情况月维度-总计
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermission('agg:month:total:detail')")
|
||||
@PostMapping("/total/detail")
|
||||
public BaseWebResult getTotalDetail(HttpServletRequest req)
|
||||
{
|
||||
Map<String, Object> params = FuncWeb.getParameterBodyMap(req);
|
||||
SaAggParam saAggParam = new SaAggParam();
|
||||
String groupField = params.get("Group by").toString();
|
||||
if (params.containsKey("usemonth")){
|
||||
saAggParam.setUseMonth(params.get("usemonth").toString());
|
||||
}
|
||||
if(params.containsKey("useyear")){
|
||||
saAggParam.setUseYear(params.get("useyear").toString());
|
||||
}
|
||||
if(params.containsKey("customname")){
|
||||
saAggParam.setCustomName(Arrays.asList(params.get("customname").toString().split(",")));
|
||||
}
|
||||
if (params.containsKey("zonename")){
|
||||
saAggParam.setZoneName(Arrays.asList(params.get("zonename").toString().split( ",")));
|
||||
}
|
||||
if (params.containsKey("saletypename")){
|
||||
saAggParam.setSaleTypeName(Arrays.asList(params.get("saletypename").toString().split( ",")));
|
||||
}
|
||||
|
||||
if (params.containsKey("salername")){
|
||||
saAggParam.setSalerName(Arrays.asList(params.get("salername").toString().split( ",")));
|
||||
}
|
||||
if (params.containsKey("dosagename")){
|
||||
saAggParam.setDosageName(Arrays.asList(params.get("dosagename").toString().split( ",")));
|
||||
}
|
||||
if (params.containsKey("stdGoodsName")){
|
||||
saAggParam.setStdGoodsName(Arrays.asList(params.get("stdGoodsName").toString().split( ",")));
|
||||
}
|
||||
if (params.containsKey("usemonth") || groupField.contains("usemonth")){
|
||||
List<NewGrBiSaAggMonthCount> list = newGrBiSaAggMonthCountService.getTotalDetail(saAggParam);
|
||||
return BaseWebResult.success(list);
|
||||
}else{
|
||||
List<NewGrBiSaAggYearCount> list = newGrBiSaAggYearCountService.getTotalDetail(saAggParam);
|
||||
return BaseWebResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.lideeyunji.core.framework.controller;
|
||||
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount;
|
||||
import com.lideeyunji.core.framework.params.SaAggParam;
|
||||
import com.lideeyunji.core.framework.service.INewGrBiSaAggYearCountService;
|
||||
import com.lideeyunji.core.framework.utils.FuncWeb;
|
||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||
import com.lideeyunji.tool.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.lideeyunji.tool.framework.yunji.model.global.BaseWebResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 综合销售情况年维度Controller
|
||||
*
|
||||
* @author king
|
||||
* @date 2026-03-19
|
||||
*/
|
||||
@TenantIgnore
|
||||
@RestController
|
||||
@RequestMapping(lideeYunJiBaseConstant.REQUEST_URL_START+"/agg/year")
|
||||
public class NewGrBiSaAggYearCountController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private INewGrBiSaAggYearCountService newGrBiSaAggYearCountService;
|
||||
|
||||
// /**
|
||||
// * 查询综合销售情况年维度-总计
|
||||
// */
|
||||
//// @PreAuthorize("@ss.hasPermi('agg:month:total:detail')")
|
||||
// @PostMapping("/total/detail")
|
||||
// public BaseWebResult getTotalDetail(HttpServletRequest req) {
|
||||
// Map<String, Object> params = FuncWeb.getParameterBodyMap(req);
|
||||
// SaAggParam saAggParam = new SaAggParam();
|
||||
// String groupField = params.get("Group by").toString();
|
||||
// LinkedList<String> groupFieldList = new LinkedList<>(Arrays.asList(groupField.split(",")));
|
||||
//
|
||||
// if (params.containsKey("useyear")) {
|
||||
// saAggParam.setUseYear(params.get("useyear").toString());
|
||||
// if (!groupField.contains("useyear")) {
|
||||
// groupFieldList.addFirst("useyear");
|
||||
// }
|
||||
// }
|
||||
// if (params.containsKey("customname")) {
|
||||
// saAggParam.setCustomName(Arrays.asList(params.get("customname").toString().split( ",")));
|
||||
// if (!groupField.contains("customname")) {
|
||||
// groupFieldList.addLast("customname");
|
||||
// }
|
||||
// }
|
||||
// if (params.containsKey("zonename")) {
|
||||
// saAggParam.setZoneName(Arrays.asList(params.get("zonename").toString().split( ",")));
|
||||
// if (!groupField.contains("zonename")) {
|
||||
// groupFieldList.addLast("zonename");
|
||||
// }
|
||||
// }
|
||||
// if (params.containsKey("saletypename")) {
|
||||
// saAggParam.setSaleTypeName(Arrays.asList(params.get("saletypename").toString().split( ",")));
|
||||
// if (!groupField.contains("saletypename")) {
|
||||
// groupFieldList.addLast("saletypename");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (params.containsKey("salername")) {
|
||||
// saAggParam.setSalerName(Arrays.asList(params.get("salername").toString().split( ",")));
|
||||
// if (!groupField.contains("salername")) {
|
||||
// groupFieldList.addLast("salername");
|
||||
// }
|
||||
// }
|
||||
// if (params.containsKey("dosagename")) {
|
||||
// saAggParam.setDosageName(Arrays.asList(params.get("dosagename").toString().split( ",")));
|
||||
// if (!groupField.contains("dosagename")) {
|
||||
// groupFieldList.addLast("dosagename");
|
||||
// }
|
||||
// }
|
||||
// if (params.containsKey("stdGoodsName")) {
|
||||
// saAggParam.setStdGoodsName(Arrays.asList(params.get("stdGoodsName").toString().split( ",")));
|
||||
// if (!groupField.contains("stdGoodsName")) {
|
||||
// groupFieldList.addLast("stdGoodsName");
|
||||
// }
|
||||
// }
|
||||
// saAggParam.setGroupFieldList(groupFieldList);
|
||||
// List<NewGrBiSaAggYearCount> list = newGrBiSaAggYearCountService.getTotalDetail(saAggParam);
|
||||
// return BaseWebResult.success(list);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.lideeyunji.core.framework.enhance.example.report.bygl;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.mapper.ByglByjhMapper;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.common.constant.ByglConstant;
|
||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保养管理-保养方案
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("byglByfaPlugin")
|
||||
public class ByglByfaPlugin implements AroundAdvicePlugin {
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
|
||||
private static final String SCHEME_ID_PREFIX = "FA";
|
||||
|
||||
@Autowired
|
||||
private ByglByjhMapper byglByjhMapper;
|
||||
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||
//新增方法默认状态字段(1启用)
|
||||
params.put("state", ByglConstant.FA_STATE_QY);
|
||||
// 获取并验证scheme_id
|
||||
String scheme_id = lideeYunJiUtils.getMap2Str(params, "scheme_id");
|
||||
boolean needGenerateNewId = shouldGenerateNewSchemeId(scheme_id);
|
||||
if(needGenerateNewId){
|
||||
String newSchemeId = generateSchemeId();
|
||||
params.put("scheme_id", newSchemeId);
|
||||
log.info("生成新方案ID: {}", newSchemeId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需要生成新的方案ID
|
||||
*/
|
||||
private boolean shouldGenerateNewSchemeId(String scheme_id) {
|
||||
if(StringUtils.isBlank(scheme_id)){
|
||||
return true;
|
||||
}
|
||||
Map<String, Object> existingScheme = byglByjhMapper.getSchemeBySchemeId(scheme_id);
|
||||
return Func.isNotEmpty(existingScheme);
|
||||
}
|
||||
/**
|
||||
* 生成方案ID
|
||||
* 格式:FA + 时间戳(yyyyMMddHHmmss)
|
||||
*/
|
||||
private String generateSchemeId() {
|
||||
return SCHEME_ID_PREFIX + LocalDateTime.now().format(DATE_TIME_FORMATTER);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package com.lideeyunji.core.framework.enhance.example.report.bygl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.lideeyunji.core.framework.adapter.FrameWorkAdapter;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.entity.ByManagementGd;
|
||||
import com.lideeyunji.core.framework.entity.ByManagementJl;
|
||||
import com.lideeyunji.core.framework.entity.ByManagementYs;
|
||||
import com.lideeyunji.core.framework.mapper.ByManagementGdMapper;
|
||||
import com.lideeyunji.core.framework.mapper.ByManagementJlMapper;
|
||||
import com.lideeyunji.core.framework.mapper.ByManagementYsMapper;
|
||||
import com.lideeyunji.core.framework.mapper.ByglByjhMapper;
|
||||
import com.lideeyunji.tool.framework.common.constant.ByglConstant;
|
||||
import com.lideeyunji.tool.framework.common.util.object.BeanUtils;
|
||||
import com.lideeyunji.tool.framework.yunji.tool.spring.SpringUtils;
|
||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保养管理-保养工单编辑
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("byglBygdBjPlugin")
|
||||
public class ByglBygdBjPlugin implements AroundAdvicePlugin {
|
||||
|
||||
/**
|
||||
* 操作类型常量
|
||||
*/
|
||||
private static final String SUBMIT_TYPE_CL = "cl";
|
||||
private static final String SUBMIT_TYPE_YS = "ys";
|
||||
|
||||
/**
|
||||
* 状态常量
|
||||
*/
|
||||
private static final int NOT_DELETED = 0;
|
||||
|
||||
@Autowired
|
||||
private ByglByjhMapper byglByjhMapper;
|
||||
|
||||
@Autowired
|
||||
private ByManagementJlMapper byManagementJlMapper;
|
||||
|
||||
@Autowired
|
||||
private ByManagementYsMapper byManagementYsMapper;
|
||||
|
||||
@Autowired
|
||||
private ByManagementGdMapper byManagementGdMapper;
|
||||
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||
String submit_type = lideeYunJiUtils.getMap2Str(params, "submit_type");
|
||||
log.info("开始处理工单操作,submit_type: {}", submit_type);
|
||||
if(StringUtils.isBlank(submit_type)){
|
||||
log.info("submit_type为空,跳过处理");
|
||||
return;
|
||||
}
|
||||
String id = lideeYunJiUtils.getMap2Str(params, "id");
|
||||
validateParams(id, submit_type);
|
||||
FrameWorkAdapter adapter = SpringUtils.getBean(FrameWorkAdapter.class);
|
||||
|
||||
switch (submit_type) {
|
||||
case SUBMIT_TYPE_CL://处理操作
|
||||
handleClOperation(id, params, adapter);
|
||||
break;
|
||||
case SUBMIT_TYPE_YS://验收操作
|
||||
handleYsOperation(id, params, adapter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验收操作
|
||||
*/
|
||||
private void handleYsOperation(String id, Map<String, Object> params, FrameWorkAdapter adapter) {
|
||||
String gdys_yj = lideeYunJiUtils.getMap2Str(params, "gdys_yj");
|
||||
String pjxj = lideeYunJiUtils.getMap2Str(params, "pjxj");
|
||||
|
||||
ByManagementJl jl = byManagementJlMapper.selectById(id);
|
||||
|
||||
jl.setYsTime(DateUtil.now());
|
||||
jl.setPjxj(pjxj);
|
||||
jl.setState(ByglConstant.YSZT_STATE_YYS);
|
||||
jl.setGdysYj(gdys_yj);
|
||||
jl.setUpdateTime(LocalDateTime.now());
|
||||
jl.setUpdateUser(adapter.getOnlineUserId());
|
||||
|
||||
byManagementJlMapper.updateById(jl);
|
||||
|
||||
ByManagementYs ys = BeanUtils.toBean(jl, ByManagementYs.class);
|
||||
if(ys == null){
|
||||
throw new RuntimeException("对象转换失败");
|
||||
}
|
||||
byManagementYsMapper.updateById(ys);
|
||||
|
||||
log.info("工单验收成功,ID: {}", id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理操作
|
||||
*/
|
||||
private void handleClOperation(String id, Map<String, Object> params, FrameWorkAdapter adapter) {
|
||||
String bygd_cljg = lideeYunJiUtils.getMap2Str(params, "bygd_cljg");
|
||||
|
||||
int result = byglByjhMapper.updateClBygd(id, bygd_cljg, ByglConstant.BY_STATE_YWC);
|
||||
|
||||
if (result <= 0) {
|
||||
log.info("工单处理失败,ID: {}", id);
|
||||
return;
|
||||
}
|
||||
ByManagementGd gd = byManagementGdMapper.selectById(id);
|
||||
ByManagementJl jl = createByManagementJl(gd, adapter);
|
||||
byManagementJlMapper.insert(jl);
|
||||
syncToYsTable(jl);
|
||||
|
||||
log.info("工单处理成功,ID: {}", id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建保养记录
|
||||
*/
|
||||
private ByManagementJl createByManagementJl(ByManagementGd gd, FrameWorkAdapter adapter) {
|
||||
ByManagementJl jl = new ByManagementJl();
|
||||
jl.setId(IdWorker.getId());
|
||||
jl.setOrderId(gd.getOrderId());
|
||||
jl.setOrderName(gd.getOrderName());
|
||||
jl.setEquipmentInfo(gd.getEquipmentInfo());
|
||||
jl.setUpkeepLevel(gd.getUpkeepLevel());
|
||||
jl.setUpkeepTime(gd.getUpkeepTime());
|
||||
jl.setPriority(gd.getPriority());
|
||||
jl.setState(ByglConstant.YSZT_STATE_DYS);
|
||||
jl.setExecutor(gd.getExecutor());
|
||||
jl.setCreateTime(LocalDateTime.now());
|
||||
jl.setCreateUser(adapter.getOnlineUserId());
|
||||
jl.setIsDeleted(NOT_DELETED);
|
||||
return jl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步到验收表
|
||||
*/
|
||||
private void syncToYsTable(ByManagementJl jl) {
|
||||
ByManagementYs ys = BeanUtils.toBean(jl, ByManagementYs.class);
|
||||
if(ys == null){
|
||||
throw new RuntimeException("对象转换失败");
|
||||
}
|
||||
byManagementYsMapper.insert(ys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数校验
|
||||
*/
|
||||
private void validateParams(String id, String submit_type) {
|
||||
if(StringUtils.isBlank(id)){
|
||||
throw new IllegalArgumentException("工单ID不能为空");
|
||||
}
|
||||
if(!SUBMIT_TYPE_CL.equals(submit_type) && !SUBMIT_TYPE_YS.equals(submit_type)){
|
||||
throw new IllegalArgumentException("不支持的操作类型: " + submit_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
package com.lideeyunji.core.framework.enhance.example.report.bygl;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.mapper.ByglByjhMapper;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.common.constant.ByglConstant;
|
||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保养管理-保养工单
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("byglBygdPlugin")
|
||||
public class ByglBygdPlugin implements AroundAdvicePlugin {
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
|
||||
private static final String ORDER_ID_PREFIX = "GD";
|
||||
|
||||
@Autowired
|
||||
private ByglByjhMapper byglByjhMapper;
|
||||
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||
//新增方法默认状态字段
|
||||
params.put("order_state",ByglConstant.GD_STATE_DKS);
|
||||
String order_id = lideeYunJiUtils.getMap2Str(params, "order_id");
|
||||
boolean needGenerateNewId = shouldGenerateNewOrderId(order_id);
|
||||
if(needGenerateNewId){
|
||||
String newOrderId = generateOrderId();
|
||||
params.put("order_id",newOrderId);
|
||||
log.info("生成新工单ID: {}", newOrderId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
|
||||
}
|
||||
/**
|
||||
* 判断是否需要生成新的工单ID
|
||||
*/
|
||||
private boolean shouldGenerateNewOrderId(String order_id) {
|
||||
if(StringUtils.isBlank(order_id)){
|
||||
return true;
|
||||
}
|
||||
Map<String, Object> existingOrder = byglByjhMapper.getOrderByPlanId(order_id);
|
||||
return Func.isNotEmpty(existingOrder);
|
||||
}
|
||||
/**
|
||||
* 生成工单ID
|
||||
* 格式:GD + 时间戳(yyyyMMddHHmmss)
|
||||
*/
|
||||
private String generateOrderId() {
|
||||
return ORDER_ID_PREFIX + LocalDateTime.now().format(DATE_TIME_FORMATTER);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.lideeyunji.core.framework.enhance.example.report.bygl;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.mapper.ByglByjhMapper;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保养管理-保养计划-列表
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("byglByjlLbPlugin")
|
||||
public class ByglByjhLbPlugin implements AroundAdvicePlugin {
|
||||
|
||||
@Autowired
|
||||
private ByglByjhMapper byglByjhMapper;
|
||||
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
List<Map<String, Object>> records = enhanceContext.getResult().getRecords();
|
||||
if (Func.isEmpty(records)) {
|
||||
return;
|
||||
}
|
||||
for (Map<String, Object> record : records) {
|
||||
String plan_id = lideeYunJiUtils.getMap2Str(record, "plan_id");
|
||||
Map<String, Object> countByPlanId = byglByjhMapper.getCountByPlanId(plan_id);
|
||||
record.put("plan_count",lideeYunJiUtils.getMap2Long(countByPlanId,"jhs"));
|
||||
record.put("completed_count",lideeYunJiUtils.getMap2Long(countByPlanId,"wcs"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
package com.lideeyunji.core.framework.enhance.example.report.bygl;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.mapper.ByglByjhMapper;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.common.constant.ByglConstant;
|
||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 保养管理-保养计划-新增
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("byglByjhPlugin")
|
||||
public class ByglByjhPlugin implements AroundAdvicePlugin {
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
|
||||
private static final String PLAN_ID_PREFIX = "BYJH";
|
||||
|
||||
@Autowired
|
||||
private ByglByjhMapper byglByjhMapper;
|
||||
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||
//新增方法默认状态字段
|
||||
params.put("plan_state", ByglConstant.JH_STATE_JXZ);
|
||||
String plan_id = lideeYunJiUtils.getMap2Str(params, "plan_id");
|
||||
boolean needGenerateNewId = shouldGenerateNewPlanId(plan_id);
|
||||
if(needGenerateNewId){
|
||||
String newPlanId = generatePlanId();
|
||||
params.put("plan_id",newPlanId);
|
||||
log.info("生成新计划ID: {}", newPlanId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需要生成新的计划ID
|
||||
*/
|
||||
private boolean shouldGenerateNewPlanId(String plan_id) {
|
||||
if(StringUtils.isBlank(plan_id)){
|
||||
return true;
|
||||
}
|
||||
Map<String, Object> existingPlan = byglByjhMapper.getPlanByPlanId(plan_id);
|
||||
return Func.isNotEmpty(existingPlan);
|
||||
}
|
||||
/**
|
||||
* 生成计划ID
|
||||
* 格式:BYJH + 时间戳(yyyyMMddHHmmss)
|
||||
*/
|
||||
private String generatePlanId() {
|
||||
return PLAN_ID_PREFIX + LocalDateTime.now().format(DATE_TIME_FORMATTER);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.lideeyunji.core.framework.enhance.example.report.xtsy;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportBeforeAdvicePlugin;
|
||||
import com.lideeyunji.tool.framework.exception.lideeYunJiException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -22,6 +23,9 @@ public class zhxsqkLineReportEnhance implements ReportBeforeAdvicePlugin {
|
||||
log.info("进入=======>zhxsqkLineReportEnhance=======>execute");
|
||||
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||
if (params.containsKey("Group by")) {
|
||||
if(params.containsKey("goodsname")){
|
||||
throw new lideeYunJiException("在选择维度时,“货品名称”不能有值!");
|
||||
}
|
||||
List<String> groupFieldList = Arrays.asList(params.get("Group by").toString().split(","));
|
||||
String sql;
|
||||
if((groupFieldList.contains("usemonth") || params.containsKey("usemonth"))){
|
||||
@@ -68,9 +72,8 @@ public class zhxsqkLineReportEnhance implements ReportBeforeAdvicePlugin {
|
||||
executePluginSql.append(" ROUND(SUM(last_year_data.last_year_profit) / 10000, 2) AS lastYearProfit, \n");//上年毛利额(元)
|
||||
executePluginSql.append(" ROUND(SUM(last_year_data.last_year_cost) / 10000, 2) AS lastYearCost, \n"); //上年销售成本(元)
|
||||
|
||||
// executePluginSql.append(" ROUND(avg(current_year_data.profit_change), 2) as profitchange, \n"); //毛利变动(元)
|
||||
// executePluginSql.append(" ROUND(avg(current_year_data.profit_growth), 2) as profitgrowth, \n"); //毛利额增长率
|
||||
// executePluginSql.append(" ROUND(avg(current_year_data.this_profit_rate), 2) as thisprofitrate, \n"); //本年毛利率
|
||||
// executePluginSql.append(" CONCAT(ROUND((max(total_year_data.this_year_sa_money_sum))/100000000 ,2), '亿') AS thissamoney_s, \n");
|
||||
// executePluginSql.append(" CONCAT(ROUND((max(total_year_data.this_year_profit_sum))/100000000 ,2), '亿') AS thisprofit_s, \n");
|
||||
executePluginSql.append(" COALESCE(ROUND(sum(current_year_data.this_year_sa_money) / SUM(total_year_data.this_year_sa_money_sum) * 100, 2), 0) AS this_year_sa_money_share, \n");//上年销售金额占比
|
||||
executePluginSql.append(" COALESCE (ROUND( sum(current_year_data.this_year_profit)/SUM(total_year_data.this_year_profit_sum) * 100, 2), 0 ) as thisprofitshare, \n"); //本年毛利额占比
|
||||
executePluginSql.append(" -- 数量同比(原有) \n");
|
||||
@@ -157,7 +160,6 @@ public class zhxsqkLineReportEnhance implements ReportBeforeAdvicePlugin {
|
||||
executePluginSql.append(" SUM(this_year_sa_money) AS this_year_sa_money_sum, \n");
|
||||
executePluginSql.append(" SUM(this_year_profit) AS this_year_profit_sum \n");
|
||||
executePluginSql.append(" FROM new_gr_bi_sa_agg_year_count \n");
|
||||
executePluginSql.append(" WHERE use_year = 2026 \n");
|
||||
executePluginSql.append(" GROUP BY use_year) as total_year_data \n");
|
||||
executePluginSql.append(" ON total_year_data.use_year = current_year_data.use_year \n");
|
||||
|
||||
@@ -236,23 +238,24 @@ public class zhxsqkLineReportEnhance implements ReportBeforeAdvicePlugin {
|
||||
if (groupFieldList.contains("stdGoodsName") || params.containsKey("stdGoodsName")) { //标准品名
|
||||
executePluginSql.append(" current_month.std_goods_name as stdGoodsName, \n");
|
||||
}
|
||||
executePluginSql.append(" SUM(current_month.this_month_sa_qty) as thisMonthSaQty, "); //本月销售数量(件)
|
||||
executePluginSql.append(" ROUND(SUM(current_month.this_month_sa_money) / 10000, 2) as thisMonthSaMoney, "); //本月销售金额(元)
|
||||
executePluginSql.append(" ROUND(SUM(current_month.this_month_profit) / 10000, 2) as thisMonthProfit, "); //本月毛利额(元)
|
||||
executePluginSql.append(" ROUND(SUM(current_month.this_month_cost) / 10000, 2) as thisMonthCost, "); //本月成本(元)
|
||||
executePluginSql.append(" SUM(current_month.this_month_sa_qty) as thisMonthSaQty, \n"); //本月销售数量(件)
|
||||
executePluginSql.append(" ROUND(SUM(current_month.this_month_sa_money) / 10000, 2) as thisMonthSaMoney, \n"); //本月销售金额(元)
|
||||
executePluginSql.append(" ROUND(SUM(current_month.this_month_profit) / 10000, 2) as thisMonthProfit, \n"); //本月毛利额(元)
|
||||
executePluginSql.append(" ROUND(SUM(current_month.this_month_cost) / 10000, 2) as thisMonthCost, \n"); //本月成本(元)
|
||||
|
||||
executePluginSql.append(" SUM(last_month_data.last_month_sa_qty) as lastMonthSaQty, "); //上月销售数量(件)
|
||||
executePluginSql.append(" ROUND(SUM(last_month_data.last_month_sa_money) / 10000, 2) as lastMonthSaMoney, "); //上月销售金额(元)
|
||||
executePluginSql.append(" ROUND(SUM(last_month_data.last_month_profit) / 10000, 2) as lastMonthProfit, "); //上月毛利额(元)
|
||||
executePluginSql.append(" ROUND(SUM(last_month_data.last_month_cost) / 10000, 2) as lastMonthCost, "); //上月成本(元)
|
||||
executePluginSql.append(" SUM(last_month_data.last_month_sa_qty) as lastMonthSaQty, \n"); //上月销售数量(件)
|
||||
executePluginSql.append(" ROUND(SUM(last_month_data.last_month_sa_money) / 10000, 2) as lastMonthSaMoney, \n"); //上月销售金额(元)
|
||||
executePluginSql.append(" ROUND(SUM(last_month_data.last_month_profit) / 10000, 2) as lastMonthProfit, \n"); //上月毛利额(元)
|
||||
executePluginSql.append(" ROUND(SUM(last_month_data.last_month_cost) / 10000, 2) as lastMonthCost, \n"); //上月成本(元)
|
||||
|
||||
executePluginSql.append(" ROUND(SUM(yoy_month.yoy_month_sa_qty)/ 10000, 2) as yoyMonthSaQty, \n"); //同比月销售数量(件)
|
||||
executePluginSql.append(" ROUND(SUM(yoy_month.yoy_month_sa_money) / 10000, 2) as yoyMonthSaMoney, \n"); //同比月销售金额(元)
|
||||
executePluginSql.append(" ROUND(SUM(yoy_month.yoy_month_profit) / 10000, 2) as yoyMonthProfit, \n"); //同比月毛利额(元)
|
||||
executePluginSql.append(" ROUND(SUM(yoy_month.yoy_month_cost) / 10000, 2) as yoyMonthCost, \n"); //同比月成本(元)
|
||||
|
||||
executePluginSql.append(" ROUND(SUM(yoy_month.yoy_month_sa_qty)/ 10000, 2) as yoyMonthSaQty, "); //同比月销售数量(件)
|
||||
executePluginSql.append(" ROUND(SUM(yoy_month.yoy_month_sa_money) / 10000, 2) as yoyMonthSaMoney, "); //同比月销售金额(元)
|
||||
executePluginSql.append(" ROUND(SUM(yoy_month.yoy_month_profit) / 10000, 2) as yoyMonthProfit, "); //同比月毛利额(元)
|
||||
executePluginSql.append(" ROUND(SUM(yoy_month.yoy_month_cost) / 10000, 2) as yoyMonthCost, "); //同比月成本(元)
|
||||
executePluginSql.append(" GROUP_CONCAT(DISTINCT current_month.province_id ORDER BY current_month.province_id SEPARATOR ',') as province_id, \n"); //行政区域ID
|
||||
executePluginSql.append(" GROUP_CONCAT(DISTINCT current_month.province_name ORDER BY current_month.province_name SEPARATOR ',') as province_name, \n"); //行政区域名称
|
||||
executePluginSql.append(" CASE WHEN (CASE WHEN sum(yoy_month.yoy_month_sa_qty) = 0 THEN IF(sum(current_month.this_month_sa_qty) > 0, 100, 0)\n");
|
||||
executePluginSql.append(" CASE WHEN (CASE WHEN sum(yoy_month.yoy_month_sa_qty) = 0 THEN IF(sum(current_month.this_month_sa_qty) > 0, 100, 0)\n");
|
||||
executePluginSql.append(" ELSE (sum(current_month.this_month_sa_qty) - sum(yoy_month.yoy_month_sa_qty)) / sum(yoy_month.yoy_month_sa_qty) * 100 END) > 0 THEN\n");
|
||||
executePluginSql.append(" CONCAT('🟢 ', ROUND((CASE WHEN sum(yoy_month.yoy_month_sa_qty) = 0 THEN IF(sum(current_month.this_month_sa_qty) > 0, 100, 0)\n");
|
||||
executePluginSql.append(" ELSE (sum(current_month.this_month_sa_qty) - sum(yoy_month.yoy_month_sa_qty)) / sum(yoy_month.yoy_month_sa_qty) * 100 END), 2))\n");
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
|
||||
package com.lideeyunji.core.framework.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 保养管理-保养工单
|
||||
*/
|
||||
@TableName("by_management_gd")
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class ByManagementGd extends BaseTenantEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 工单名称
|
||||
*/
|
||||
private String orderName;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String deviceTypeName;
|
||||
|
||||
/**
|
||||
*设备
|
||||
*/
|
||||
private String equipmentInfo;
|
||||
|
||||
/**
|
||||
*设备编号
|
||||
*/
|
||||
private String equipmentCode;
|
||||
|
||||
/**
|
||||
*保养级别
|
||||
*/
|
||||
private String upkeepLevel;
|
||||
|
||||
|
||||
/**
|
||||
*优先级
|
||||
*/
|
||||
private String priority;
|
||||
|
||||
/**
|
||||
*可能更换零件
|
||||
*/
|
||||
private String possibleReplacements;
|
||||
|
||||
/**
|
||||
*计划保养时间
|
||||
*/
|
||||
private String planUpkeepTime;
|
||||
|
||||
/**
|
||||
*是否申请备件
|
||||
*/
|
||||
private String applyForParts;
|
||||
|
||||
/**
|
||||
*是否已停机
|
||||
*/
|
||||
private String isStopped;
|
||||
|
||||
|
||||
/**
|
||||
*执行人
|
||||
*/
|
||||
private String executor;
|
||||
|
||||
/**
|
||||
*状态
|
||||
*/
|
||||
private String orderState;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
private String upkeepTime;
|
||||
|
||||
/**
|
||||
* 保养方案
|
||||
*/
|
||||
private String schemeId;
|
||||
|
||||
/**
|
||||
* 处理结果
|
||||
*/
|
||||
private String bygdCljg;
|
||||
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
private String planId;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
package com.lideeyunji.core.framework.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 保养管理-保养记录
|
||||
*/
|
||||
@TableName("by_management_jl")
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class ByManagementJl extends BaseTenantEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 工单名称
|
||||
*/
|
||||
private String orderName;
|
||||
|
||||
/**
|
||||
*设备
|
||||
*/
|
||||
private String equipmentInfo;
|
||||
|
||||
/**
|
||||
*优先级
|
||||
*/
|
||||
private String priority;
|
||||
|
||||
/**
|
||||
*保养级别
|
||||
*/
|
||||
private String upkeepLevel;
|
||||
|
||||
/**
|
||||
*完成时间
|
||||
*/
|
||||
private String upkeepTime;
|
||||
|
||||
/**
|
||||
*状态
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
*执行人
|
||||
*/
|
||||
private String executor;
|
||||
|
||||
/**
|
||||
*验收时间
|
||||
*/
|
||||
private String ysTime;
|
||||
|
||||
/**
|
||||
*评价星级
|
||||
*/
|
||||
private String pjxj;
|
||||
|
||||
/**
|
||||
*验收意见
|
||||
*/
|
||||
private String gdysYj;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
package com.lideeyunji.core.framework.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 保养管理-保养验收
|
||||
*/
|
||||
@TableName("by_management_ys")
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class ByManagementYs extends BaseTenantEntity {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 工单名称
|
||||
*/
|
||||
private String orderName;
|
||||
|
||||
/**
|
||||
*设备
|
||||
*/
|
||||
private String equipmentInfo;
|
||||
|
||||
/**
|
||||
*优先级
|
||||
*/
|
||||
private String priority;
|
||||
|
||||
/**
|
||||
*保养级别
|
||||
*/
|
||||
private String upkeepLevel;
|
||||
|
||||
/**
|
||||
*完成时间
|
||||
*/
|
||||
private String upkeepTime;
|
||||
|
||||
/**
|
||||
*状态
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
*执行人
|
||||
*/
|
||||
private String executor;
|
||||
|
||||
/**
|
||||
*验收时间
|
||||
*/
|
||||
private String ysTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.lideeyunji.core.framework.entity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import jdk.nashorn.internal.ir.annotations.Ignore;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -149,7 +150,11 @@ public class NewGrBiSaAggMonthCount implements Serializable
|
||||
private BigDecimal thisMonthProfitShare;
|
||||
|
||||
|
||||
@TableField(value = "thissamoney_s")
|
||||
private BigDecimal thisMonthSaMoney_s;
|
||||
|
||||
@TableField(value = "thisprofit_s")
|
||||
private BigDecimal thisMonthProfit_s;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -145,8 +145,10 @@ public class NewGrBiSaAggYearCount implements Serializable
|
||||
@TableField(value = "this_year_profit_change")
|
||||
private BigDecimal thisYearProfitChange;
|
||||
|
||||
@TableField(value = "this_year_sa_money_s")
|
||||
private BigDecimal thissamoney_s;
|
||||
|
||||
|
||||
|
||||
@TableField(value = "this_year_profit_s")
|
||||
private BigDecimal thisprofit_s;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lideeyunji.core.framework.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lideeyunji.core.framework.entity.ByManagementGd;
|
||||
|
||||
/**
|
||||
* 保养管理-保养工单Mapper接口
|
||||
*
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
public interface ByManagementGdMapper extends BaseMapper<ByManagementGd> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lideeyunji.core.framework.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lideeyunji.core.framework.entity.ByManagementJl;
|
||||
|
||||
/**
|
||||
* 保养管理-保养记录Mapper接口
|
||||
*
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
public interface ByManagementJlMapper extends BaseMapper<ByManagementJl> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lideeyunji.core.framework.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lideeyunji.core.framework.entity.ByManagementYs;
|
||||
|
||||
/**
|
||||
* 保养管理-保养验收Mapper接口
|
||||
*
|
||||
* @date 2026-03-20
|
||||
*/
|
||||
public interface ByManagementYsMapper extends BaseMapper<ByManagementYs> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
package com.lideeyunji.core.framework.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.Master;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Master
|
||||
public interface ByglByjhMapper{
|
||||
|
||||
Map<String,Object> getCountByPlanId(String plan_id);
|
||||
|
||||
Map<String,Object> getPlanByPlanId(String plan_id);
|
||||
|
||||
Map<String, Object> getOrderByPlanId(String order_id);
|
||||
|
||||
Map<String, Object> getSchemeBySchemeId(String scheme_id);
|
||||
|
||||
int updateClBygd(String id, String bygd_cljg, String order_state);
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.lideeyunji.core.framework.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lideeyunji.core.framework.params.SaAggParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 综合销售情况月维度Mapper接口
|
||||
@@ -59,4 +63,7 @@ public interface NewGrBiSaAggMonthCountMapper extends BaseMapper<NewGrBiSaAggMon
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNewGrBiSaAggMonthCountByIds(Long[] ids);
|
||||
|
||||
@DS(value = "#dataSourceType")
|
||||
List<NewGrBiSaAggMonthCount> getTotalDetail(@Param("dataSourceType") String dataSourceType, @Param("saAggParam") SaAggParam saAggParam);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.lideeyunji.core.framework.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lideeyunji.core.framework.params.SaAggParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 综合销售情况年维度Mapper接口
|
||||
@@ -59,4 +63,8 @@ public interface NewGrBiSaAggYearCountMapper extends BaseMapper<NewGrBiSaAggYear
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNewGrBiSaAggYearCountByIds(Long[] ids);
|
||||
|
||||
|
||||
@DS(value = "#dataSourceType")
|
||||
List<NewGrBiSaAggYearCount> getTotalDetail(@Param("dataSourceType") String dataSourceType,@Param("saAggParam") SaAggParam saAggParam);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.lideeyunji.core.framework.params;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SaAggParam {
|
||||
private String useYear;
|
||||
private String useMonth;
|
||||
private List<String> customName;
|
||||
private List<String> zoneName;
|
||||
private List<String> saleTypeName;
|
||||
private List<String> salerName;
|
||||
private List<String> dosageName;
|
||||
private List<String> stdGoodsName;
|
||||
|
||||
private List<String> groupFieldList;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.lideeyunji.core.framework.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount;
|
||||
import com.lideeyunji.core.framework.params.SaAggParam;
|
||||
|
||||
/**
|
||||
* 综合销售情况月维度Service接口
|
||||
@@ -58,4 +59,6 @@ public interface INewGrBiSaAggMonthCountService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNewGrBiSaAggMonthCountById(Long id);
|
||||
|
||||
List<NewGrBiSaAggMonthCount> getTotalDetail(SaAggParam saAggParam);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.lideeyunji.core.framework.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount;
|
||||
import com.lideeyunji.core.framework.params.SaAggParam;
|
||||
|
||||
/**
|
||||
* 综合销售情况年维度Service接口
|
||||
@@ -58,4 +59,6 @@ public interface INewGrBiSaAggYearCountService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNewGrBiSaAggYearCountById(Long id);
|
||||
|
||||
List<NewGrBiSaAggYearCount> getTotalDetail(SaAggParam saAggParam);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.lideeyunji.core.framework.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lideeyunji.core.framework.params.SaAggParam;
|
||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.lideeyunji.core.framework.mapper.NewGrBiSaAggMonthCountMapper;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount;
|
||||
@@ -87,4 +90,9 @@ public class NewGrBiSaAggMonthCountServiceImpl extends ServiceImpl<NewGrBiSaAggM
|
||||
{
|
||||
return this.baseMapper.deleteNewGrBiSaAggMonthCountById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NewGrBiSaAggMonthCount> getTotalDetail(SaAggParam saAggParam) {
|
||||
return this.baseMapper.getTotalDetail(lideeYunJiBaseConstant.DS_ERP_BI_DATA, saAggParam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.lideeyunji.core.framework.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lideeyunji.core.framework.params.SaAggParam;
|
||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.lideeyunji.core.framework.mapper.NewGrBiSaAggYearCountMapper;
|
||||
import com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount;
|
||||
@@ -87,4 +90,9 @@ public class NewGrBiSaAggYearCountServiceImpl extends ServiceImpl<NewGrBiSaAggYe
|
||||
{
|
||||
return this.baseMapper.deleteNewGrBiSaAggYearCountById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NewGrBiSaAggYearCount> getTotalDetail(SaAggParam saAggParam) {
|
||||
return this.baseMapper.getTotalDetail(lideeYunJiBaseConstant.DS_ERP_BI_DATA, saAggParam);
|
||||
}
|
||||
}
|
||||
|
||||
50
lidee-core/src/main/resources/mapper/bygl/ByglByjhMapper.xml
Normal file
50
lidee-core/src/main/resources/mapper/bygl/ByglByjhMapper.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lideeyunji.core.framework.mapper.ByglByjhMapper">
|
||||
|
||||
<select id="getCountByPlanId" resultType="java.util.Map">
|
||||
SELECT
|
||||
COUNT(*) AS jhs,
|
||||
COUNT(CASE WHEN order_state = '1' THEN 1 ELSE NULL END) AS wcs
|
||||
FROM
|
||||
by_management_gd
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
AND plan_id = #{plan_id}
|
||||
</select>
|
||||
|
||||
<select id="getPlanByPlanId" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
by_management_plan
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
AND plan_id = #{plan_id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getOrderByPlanId" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
by_management_gd
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
AND order_id = #{order_id}
|
||||
</select>
|
||||
|
||||
<select id="getSchemeBySchemeId" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
by_management_fa
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
AND scheme_id = #{scheme_id}
|
||||
</select>
|
||||
|
||||
<update id="updateClBygd">
|
||||
update by_management_gd set bygd_cljg = #{bygd_cljg}, order_state = #{order_state}, upkeep_time = DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%s') where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -38,12 +38,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="lastMonthProfitShare" column="last_month_profit_share" />
|
||||
<result property="thisMonthSaMoneyShare" column="this_month_sa_money_share" />
|
||||
<result property="thisMonthProfitShare" column="this_month_profit_share" />
|
||||
<result property="thisMonthSaMoney_s" column="thissamoney_s" />
|
||||
<result property="thisMonthProfit_s" column="thisprofit_s" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNewGrBiSaAggMonthCountVo">
|
||||
select id, use_year, use_month, zone_id, zone_name, sale_type_id, sale_type_name, custom_id, custom_name, dosage_id, dosage_name, goods_id, std_goods_name, province_id, province_name, saler_id, saler_name, this_month_sa_qty, last_month_sa_qty, yoy_month_sa_qty, this_month_sa_money, last_month_sa_money, yoy_month_sa_money, this_month_profit, last_month_profit, yoy_month_profit, this_month_cost, last_month_cost, yoy_month_cost, this_month_profit_rate, last_month_profit_rate, last_month_profit_share, this_month_sa_money_share, this_month_profit_share from new_gr_bi_sa_agg_month_count
|
||||
</sql>
|
||||
|
||||
<select id="getTotalDetail" parameterType="com.lideeyunji.core.framework.params.SaAggParam" resultMap="NewGrBiSaAggMonthCountResult">
|
||||
SELECT
|
||||
ROUND(SUM(this_month_sa_money) / 10000, 2) AS thissamoney_s,
|
||||
ROUND(SUM(this_month_profit) / 10000, 2) AS thisprofit_s
|
||||
FROM new_gr_bi_sa_agg_month_count
|
||||
<where>
|
||||
<if test="saAggParam.useYear != null and saAggParam.useYear != ''"> and use_year = #{saAggParam.useYear}</if>
|
||||
<if test="saAggParam.useMonth != null and saAggParam.useMonth != ''"> and use_month = #{saAggParam.useMonth}</if>
|
||||
<if test="saAggParam.customName != null and saAggParam.customName != ''"> and custom_name in
|
||||
<foreach collection="saAggParam.customName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.zoneName != null and saAggParam.zoneName != ''"> and zone_name in
|
||||
<foreach collection="saAggParam.zoneName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.saleTypeName != null and saAggParam.saleTypeName != ''"> and sale_type_name in
|
||||
<foreach collection="saAggParam.saleTypeName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.salerName != null and saAggParam.salerName != '' "> and saler_name in
|
||||
<foreach collection="saAggParam.salerName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.dosageName != null and saAggParam.dosageName != ''"> and dosage_name in
|
||||
<foreach collection="saAggParam.dosageName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.stdGoodsName != null and saAggParam.stdGoodsName != '' "> and std_goods_name in
|
||||
<foreach item="field" collection="saAggParam.stdGoodsName" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNewGrBiSaAggMonthCountList" parameterType="com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount" resultMap="NewGrBiSaAggMonthCountResult">
|
||||
<include refid="selectNewGrBiSaAggMonthCountVo"/>
|
||||
<where>
|
||||
|
||||
@@ -37,12 +37,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="thisYearSaMoneyGrowth" column="this_year_sa_money_growth" />
|
||||
<result property="thisYearProfitGrowth" column="this_year_profit_growth" />
|
||||
<result property="thisYearProfitChange" column="this_year_profit_change" />
|
||||
<result property="thissamoney_s" column="this_year_sa_money_s" />
|
||||
<result property="thisprofit_s" column="this_year_profit_s" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNewGrBiSaAggYearCountVo">
|
||||
select id, use_year, zone_id, zone_name, sale_type_id, sale_type_name, custom_id, custom_name, dosage_id, dosage_name, std_goods_name, province_id, province_name, saler_id, saler_name, this_year_sa_qty, last_year_sa_qty, this_year_sa_money, last_year_sa_money, this_year_profit, last_year_profit, this_year_cost, last_year_cost, this_year_profit_rate, last_year_profit_rate, this_year_profit_share, last_year_profit_share, this_year_sa_money_share, last_year_sa_money_share, this_year_sa_money_growth, this_year_profit_growth, this_year_profit_change from new_gr_bi_sa_agg_year_count
|
||||
</sql>
|
||||
|
||||
<select id="getTotalDetail" parameterType="com.lideeyunji.core.framework.params.SaAggParam" resultMap="NewGrBiSaAggYearCountResult">
|
||||
SELECT
|
||||
ROUND(SUM(this_year_sa_money) / 10000, 2) AS this_year_sa_money_s,
|
||||
ROUND(SUM(this_year_profit) / 10000, 2) AS this_year_profit_s
|
||||
FROM new_gr_bi_sa_agg_year_count
|
||||
<where>
|
||||
<if test="saAggParam.useYear != null and saAggParam.useYear != ''"> and use_year = #{saAggParam.useYear}</if>
|
||||
<if test="saAggParam.customName != null and saAggParam.customName != ''"> and custom_name in
|
||||
<foreach collection="saAggParam.customName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.zoneName != null and saAggParam.zoneName != ''"> and zone_name in
|
||||
<foreach collection="saAggParam.zoneName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.saleTypeName != null and saAggParam.saleTypeName != ''"> and sale_type_name in
|
||||
<foreach collection="saAggParam.saleTypeName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.salerName != null and saAggParam.salerName != '' "> and saler_name in
|
||||
<foreach collection="saAggParam.salerName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.dosageName != null and saAggParam.dosageName != ''"> and dosage_name in
|
||||
<foreach collection="saAggParam.dosageName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.stdGoodsName != null and saAggParam.stdGoodsName != '' "> and std_goods_name in
|
||||
<foreach collection="saAggParam.stdGoodsName" item="field" separator="," open="(" close=")">#{field}</foreach>
|
||||
</if>
|
||||
</where>
|
||||
<!-- <if test="saAggParam.groupFieldList != null and saAggParam.groupFieldList.size() > 0">-->
|
||||
<!-- <!– 这里根据前端传入的参数拼接动态的 GROUP BY 子句 –>-->
|
||||
<!-- GROUP BY-->
|
||||
<!-- <foreach item="field" collection="saAggParam.groupFieldList" separator=",">-->
|
||||
<!-- #{field}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
</select>
|
||||
|
||||
<select id="selectNewGrBiSaAggYearCountList" parameterType="com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount" resultMap="NewGrBiSaAggYearCountResult">
|
||||
<include refid="selectNewGrBiSaAggYearCountVo"/>
|
||||
<where>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
package com.lideeyunji.tool.framework.common.constant;
|
||||
|
||||
/**
|
||||
* 保养管理
|
||||
*/
|
||||
public interface ByglConstant {
|
||||
|
||||
/**进行中*/
|
||||
String JH_STATE_JXZ = "0";
|
||||
/**已完成*/
|
||||
String JH_STATE_YWC = "1";
|
||||
|
||||
/**待开始*/
|
||||
String GD_STATE_DKS = "0";
|
||||
/**已完成*/
|
||||
String BY_STATE_YWC = "1";
|
||||
|
||||
/**方案停用*/
|
||||
String FA_STATE_TY = "0";
|
||||
/**方案启用*/
|
||||
String FA_STATE_QY = "1";
|
||||
|
||||
/**待验收*/
|
||||
String YSZT_STATE_DYS = "0";
|
||||
/**已验收*/
|
||||
String YSZT_STATE_YYS = "1";
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user