Commit a1e55246 authored by liuzeheng's avatar liuzeheng

Merge branch 'dev'

# Conflicts:
#	yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/makeBillOfLading/MakeBillOfLadingServiceImpl.java
parents 100c0bb6 9f702dca
...@@ -381,12 +381,24 @@ public class CustomerDO extends BaseDO { ...@@ -381,12 +381,24 @@ public class CustomerDO extends BaseDO {
private String creditLevelNameEn; private String creditLevelNameEn;
/**
* 主联系人id
*/
@TableField(exist = false)
private String defaultContactId;
/** /**
* 主联系人 * 主联系人
*/ */
@TableField(exist = false) @TableField(exist = false)
private String defaultContactName; private String defaultContactName;
/**
* 主联系电话
* 不加区号
*/
@TableField(exist = false)
private String contactPhone ;
/** /**
* 主联系电话 * 主联系电话
*/ */
......
...@@ -69,6 +69,8 @@ public class CustomerRespVO extends CustomerBaseVO { ...@@ -69,6 +69,8 @@ public class CustomerRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "公海池捞取时间") @ApiModelProperty(value = "公海池捞取时间")
private Date catchTime; private Date catchTime;
@ApiModelProperty(value = "主联系人Id")
private Long defaultContactId ;
@ApiModelProperty(value = "主联系人") @ApiModelProperty(value = "主联系人")
private String defaultContactName; private String defaultContactName;
...@@ -76,6 +78,9 @@ public class CustomerRespVO extends CustomerBaseVO { ...@@ -76,6 +78,9 @@ public class CustomerRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "主联系电话") @ApiModelProperty(value = "主联系电话")
private String defaultContactPhone; private String defaultContactPhone;
@ApiModelProperty(value = "主联系电话(不加区号)")
private String contactPhone ;
@ApiModelProperty(value = "主邮箱") @ApiModelProperty(value = "主邮箱")
private String defaultEmail; private String defaultEmail;
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
from (select a.*, from (select a.*,
c.name as default_contact_name, c.name as default_contact_name,
concat(c.area_code, c.phone_new, '') as default_contact_phone, concat(c.area_code, c.phone_new, '') as default_contact_phone,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social, c.social as default_social,
c.email as default_email, c.email as default_email,
c.social_number as default_social_number, c.social_number as default_social_number,
......
...@@ -23,5 +23,15 @@ ...@@ -23,5 +23,15 @@
<artifactId>yudao-module-delivery-core</artifactId> <artifactId>yudao-module-delivery-core</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-system-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-system-impl</artifactId>
<version>${revision}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermission;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermissionPageReq;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermissionResp;
import cn.iocoder.yudao.module.delivery.service.EcwReportPermissionService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import javax.validation.*;
import io.swagger.v3.oas.annotations.Operation;
import java.util.ArrayList;
import java.util.List;
/**
* 报表权限(EcwReportPermission)表控制层
*
* @author lanbm
* @since 2024-04-09 23:10:39
*/
@RestController
@RequestMapping("/Report/EcwReportPermission")
public class EcwReportPermissionController {
/**
* 服务对象
*/
@Resource
private EcwReportPermissionService ecwReportPermissionService;
@Resource
private RedisHelper redisHelper;
private ErrorCode eCode;
/*
权限校验函数 lanbm 2024-04-15 add
*/
private boolean isRight(EcwReportPermission ecwReportPermission) {
//单表对象查询
LambdaQueryWrapper<EcwReportPermission> lambdaQueryWrapper =
new LambdaQueryWrapper();
lambdaQueryWrapper.eq(EcwReportPermission::getUserId,
ecwReportPermission.getUserId());
if (ecwReportPermission.getPermissionFw() == 3) {
lambdaQueryWrapper.eq(EcwReportPermission::getPermissionFw,
3);
List<EcwReportPermission> objList = ecwReportPermissionService.list(lambdaQueryWrapper);
if (objList != null && objList.size() > 0) {
eCode = new ErrorCode(2024041501,
"用户的全公司权限已存在,不用再次添加");
return false;
}
} else if (ecwReportPermission.getPermissionFw() == 1) {
//个人
lambdaQueryWrapper.eq(EcwReportPermission::getPermissionFw,
1);
List<EcwReportPermission> objList = ecwReportPermissionService.list(lambdaQueryWrapper);
if (objList != null && objList.size() > 0) {
eCode = new ErrorCode(2024041502,
"用户的个人权限已存在,不用再次添加");
return false;
}
} else if (ecwReportPermission.getPermissionFw() == 2) {
//部门
lambdaQueryWrapper.eq(EcwReportPermission::getPermissionFw,
2);
lambdaQueryWrapper.eq(EcwReportPermission::getDeptId,
ecwReportPermission.getDeptId());
List<EcwReportPermission> objList = ecwReportPermissionService.list(lambdaQueryWrapper);
if (objList != null && objList.size() > 0) {
eCode = new ErrorCode(2024041503,
"用户的部门权限已存在,不用再次添加");
return false;
}
}
return true;
}
/**
* 新增数据
*
* @param ecwReportPermission 实体
* @return 新增结果
*/
@PostMapping("/create")
public CommonResult<Long> create(@Valid @RequestBody EcwReportPermission ecwReportPermission) {
boolean bR = isRight(ecwReportPermission);
if (bR == false) {
return error(eCode);
}
//System.out.println(ecwReportPermission);
return success(ecwReportPermissionService.create(ecwReportPermission));
}
/**
* 编辑数据
*
* @param ecwReportPermission 实体
* @return 编辑结果
*/
@PostMapping("/update")
public CommonResult<Boolean> update(@RequestBody EcwReportPermission ecwReportPermission) {
/*
boolean bR = isRight(ecwReportPermission);
if (bR == false) {
return error(eCode);
}*/
ecwReportPermissionService.update(ecwReportPermission);
return success(true);
}
/**
* 删除数据
*
* @param id 主键
* @return 删除是否成功
*/
@GetMapping("/delete")
public CommonResult<Boolean> delete(@RequestParam Long id) {
ecwReportPermissionService.delete(id);
return success(true);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("/get")
public CommonResult<EcwReportPermission> getModel(@RequestParam("id") Long id) {
EcwReportPermission ecwReportPermission = ecwReportPermissionService.getModel(id);
return success(ecwReportPermission);
}
/*
获取当前用户的报表权限 lanbm 2024-04-15 add
*/
@GetMapping("/getCurUserPermission")
public CommonResult<EcwReportPermission> getCurUserPermission() {
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
LambdaQueryWrapper<EcwReportPermission> lambdaQueryWrapper =
new LambdaQueryWrapper();
lambdaQueryWrapper.eq(EcwReportPermission::getUserId, loginUserId);
List<EcwReportPermission> objList = ecwReportPermissionService.list(lambdaQueryWrapper);
if (objList == null || objList.size() == 0) {
ErrorCode eCode = new ErrorCode(2024041504,
"当前用户未分配报表权限,请联系系统管理员处理。");
return error(eCode);
}
return success(objList.get(0));
}
/**
* 查询所有数据
*
* @return 实例对象集合
*/
@GetMapping
public CommonResult queryAll() {
return success(this.ecwReportPermissionService.list());
}
/**
* 分页查询
*
* @return 分页对象集合
*/
@GetMapping("/page")
@Operation(summary = "获取分页查询列表")
public CommonResult<PageResult<EcwReportPermissionResp>> getListPage(@Valid EcwReportPermissionPageReq PageReq) {
//myBatisPlus分页
//return success(this.ecwReportPermissionService.getListPage(PageReq));
//通过自定义SQL语句分页 lanbm 2024-04-15 add
redisHelper.set("123","测试");
List<String>l=new ArrayList<>();
l.add("112");
l.add("12444");
redisHelper.set("myTest",l.toString());
return success(this.ecwReportPermissionService.getListPageCustom(PageReq));
}
}
package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq;
import cn.iocoder.yudao.module.delivery.service.EcwVzService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import javax.validation.*;
import io.swagger.v3.oas.annotations.Operation;
/**
* V值转换配置参数(EcwVz)表控制层
*
* @author lanbm
* @since 2024-04-02
*/
@RestController
@RequestMapping("/ecwVz/vz")
public class EcwVzController {
/**
* 服务对象
*/
@Resource
private EcwVzService ecwVzService;
private final String HYPG = "海运拼柜";
private final String ZXKY = "专线空运";
/**
* 新增数据
*
* @param ecwVz 实体
* @return 新增结果
*/
@PostMapping("/create")
public CommonResult<Long> create(@Valid @RequestBody EcwVz ecwVz) {
System.out.println(ecwVz);
EcwVz temp = ecwVzService.getOne(new LambdaQueryWrapperX<EcwVz>()
.eqIfPresent(EcwVz::getTitleZh, ecwVz.getTitleZh()));
if (temp == null) {
return success(ecwVzService.create(ecwVz));
} else {
ecwVz.setId(temp.getId());
ecwVzService.update(ecwVz);
return success(ecwVz.getId());
}
}
/**
* 编辑数据
*
* @param ecwVz 实体
* @return 编辑结果
*/
@PostMapping("/update")
public CommonResult<Boolean> update(@RequestBody EcwVz ecwVz) {
//System.out.println(ecwVz);
ecwVzService.update(ecwVz);
return success(true);
}
/**
* 删除数据
*
* @param id 主键
* @return 删除是否成功
*/
@GetMapping("/delete")
public CommonResult<Boolean> delete(@RequestParam Long id) {
//自定义物理删除方法
ecwVzService.delete(id);
return success(true);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("/get")
public CommonResult<EcwVz> getModel(@RequestParam("id") Long id) {
EcwVz ecwVz = ecwVzService.getModel(id);
return success(ecwVz);
}
/**
* 查询所有数据
*
* @return 实例对象集合
*/
@GetMapping
public CommonResult queryAll() {
return success(this.ecwVzService.list());
}
/**
* 分页查询
*
* @return 分页对象集合
*/
@GetMapping("/page")
@Operation(summary = "获取分页查询列表")
public CommonResult<PageResult<EcwVz>> selectPage(@Valid EcwVzPageReq PageReq) {
return success(this.ecwVzService.selectPage(PageReq));
}
}
package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.iocoder.yudao.module.delivery.entity.Employee;
import cn.iocoder.yudao.module.delivery.entity.EmployeePageReq;
import cn.iocoder.yudao.module.delivery.service.EmployeeService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import javax.validation.*;
import io.swagger.v3.oas.annotations.Operation;
/**
* (Employee)表控制层
*
* @author lanbm
* @since 2024-03-27 21:25:55
*/
@RestController
@RequestMapping("employee")
public class EmployeeController {
/**
* 服务对象
*/
@Resource
private EmployeeService employeeService;
/**
* 新增数据
*
* @param employee 实体
* @return 新增结果
*/
@PostMapping("/create")
public CommonResult<Long> create(@Valid @RequestBody Employee employee) {
return success(employeeService.create(employee));
}
/**
* 编辑数据
*
* @param employee 实体
* @return 编辑结果
*/
@PostMapping("/update")
public CommonResult<Boolean> update(@RequestBody Employee employee) {
employeeService.update(employee);
return success(true);
}
/**
* 删除数据
*
* @param id 主键
* @return 删除是否成功
*/
@GetMapping("/delete")
public CommonResult<Boolean> delete(@RequestParam Long id) {
employeeService.delete(id);
return success(true);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("/get")
public CommonResult<Employee> getModel(@RequestParam("id") Long id) {
Employee employee = employeeService.getModel(id);
return success(employee);
}
/**
* 查询所有数据
*
* @return 实例对象集合
*/
@GetMapping
public CommonResult queryAll() {
return success(this.employeeService.list());
}
/**
* 分页查询
*
* @return 分页对象集合
*/
@GetMapping("/page")
@Operation(summary = "获取分页查询列表")
public CommonResult<PageResult<Employee>> getListPage(@Valid EmployeePageReq PageReq) {
return success(this.employeeService.getListPage(PageReq));
}
}
package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisExcelResp;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp;
import cn.iocoder.yudao.module.delivery.service.SalesAnalysisService;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
/**
* (SalesAnalysis)销售分析报表
*
* @author lanbm add
* @since 2024-03-31
*/
@RestController
@RequestMapping("/Report/SalesAnalysis")
public class SalesAnalysisControl {
@Autowired
private SalesAnalysisService salesAnalysisService;
/*
数据字典项
*/
@Autowired
private DictDataApi dictDataApi;
/*
客户分析列表 lanbm 2024-04-02 add
*/
@GetMapping("/getListPage")
public CommonResult<PageResult<SalesAnalysisResp>> getListPage(@Valid SalesAnalysisReq query) {
System.out.println("订单分析查询条件:" + query);
/*
SalesAnalysisReq query = JSON.parseObject(JSON.toJSONString(map),
SalesAnalysisReq.class);
*/
//订单状态
List<DictDataRespDTO> dic_order_status =
dictDataApi.getDictDatas("order_status");
Map<String, String> map_order_status = new HashMap<>();
for (DictDataRespDTO d : dic_order_status
) {
map_order_status.put(d.getValue(), d.getLabel());
}
PageResult<SalesAnalysisResp> pageResult =
salesAnalysisService.getListPage(query);
int nPm = query.getStart() + 1;
for (SalesAnalysisResp r : pageResult.getList()
) {
r.setPx(nPm);
nPm++;
//订单状态
r.setStatusName(map_order_status.get(r.getStatus()));
if (r.getTransportId() == "1")
r.setTransportIdName("海运拼柜");
else if (r.getTransportId() == "3")
r.setTransportIdName("专线空运");
}
return success(pageResult);
}
/*
lanbm 2024-04-24 add
*/
@GetMapping("/exportExcel")
@ApiOperation("导出销售分析数据")
@OperateLog(type = EXPORT)
public void export(HttpServletResponse response,
@Valid SalesAnalysisReq Req)
throws IOException {
System.out.println("订单分析查询数据导出查询条件:" + Req);
List<SalesAnalysisExcelResp> list = salesAnalysisService.getList(Req);
ExcelUtils.write(response, "销售分析数据.xls", "销售分析数据",
SalesAnalysisExcelResp.class, list);
}
}
package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.delivery.entity.SalesReportReq;
import cn.iocoder.yudao.module.delivery.entity.SalesReportResp;
import cn.iocoder.yudao.module.delivery.service.SalesReportService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* (Employee)表控制层
*
* @author lanbm
* @since 2024-03-27 21:25:55
*/
@RestController
@Api(tags = "管理后台 -统计报表")
@RequestMapping("/Report/SalesReport")
public class SalesReportControl {
//ecw_order_departure 订单始发地
//ecw_order_consignor 订单发货人
//ecw_order_consignee 订单收货人
//订单表 ecw_order
//drawee 付款人 付款人:1 发货人 2 收货人 3 自定义
//status 订单状态 0草稿 2待入仓,3入参中
@Autowired
private SalesReportService salesReportService;
/*
首次成交的客户数统计
lanbm 2024-04-01
*/
@PostMapping("/FirstCustomerCount")
public CommonResult<Integer> FirstCustomerCount(@RequestBody SalesReportReq Req) {
int nR=salesReportService.FirstCustomerCount(Req);
return success(nR);
}
/*
按运输方式统计重量和方数
lanbm 2024-04-01
*/
@PostMapping("/SalesReportCount")
public CommonResult<SalesReportResp> SalesReportCount(@RequestBody SalesReportReq Req) {
String s="";
SalesReportResp re=salesReportService.SalesReportCount(Req);
return success(re);
}
/*
图表分析统计结果
lanbm 2024-04-01 add
*/
@PostMapping("/SalesReportList")
public CommonResult<Integer> SalesReportList(@RequestBody SalesReportReq Req) {
int nR=salesReportService.FirstCustomerCount(Req);
return success(nR);
}
}
package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq;
import cn.iocoder.yudao.module.delivery.entity.deptex.DeptEx;
import cn.iocoder.yudao.module.delivery.mapper.DeptExMapper;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSimpleResp2VO;
import cn.iocoder.yudao.module.system.convert.user.UserConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.service.dept.DeptService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@RestController
@Api(tags = "管理后台 -统计报表")
@RequestMapping("/Report/SysDeptEx")
public class SysDeptExtControl {
//lanbm 2024-04-19 添加的系统基础扩展功能
@Resource
private DeptExMapper deptExMapper;
@Resource
private AdminUserService userService;
@Resource
private DeptService deptService;
@GetMapping("/getDeptChild")
@Operation(summary = "根据父机部门获取子部门")
public CommonResult<List<DeptEx>> getDeptChild(@Valid DeptEx Req) {
return success(deptExMapper.getDeptChild(Req));
}
@GetMapping("/listServiceUser")
@ApiOperation(value = "获取客服岗人员列表", notes = "只包含客服用户,主要用于前端的下拉选项")
public CommonResult<List<UserSimpleResp2VO>> listServiceUser(@Valid DeptEx Req) {
List<AdminUserDO> list =
userService.getUsersByPostIds(Arrays.asList(2L, 19L));
List<UserSimpleResp2VO> resultList =
UserConvert.INSTANCE.convertList05(list);
if (CollectionUtil.isNotEmpty(resultList)) {
List<Long> deptIds =
resultList.stream().map(t -> t.getDeptId()).
filter(Objects::nonNull).distinct().
collect(Collectors.toList());
Map<Long, DeptDO> deptMap = deptService.getDeptMap(deptIds);
if (CollectionUtil.isNotEmpty(deptMap)) {
for (UserSimpleResp2VO userSimpleResp2VO : resultList) {
if (userSimpleResp2VO.getDeptId() != null) {
DeptDO deptDO = deptMap.get(userSimpleResp2VO.getDeptId());
if (deptDO != null) {
userSimpleResp2VO.setDeptName(deptDO.getName());
}
}
}
}
}
List<DeptEx> listDept = deptExMapper.getDeptChild(Req);
List<Long> deptQuanX = new ArrayList<>();
for (DeptEx d : listDept
) {
deptQuanX.add(d.getId());
}
List<UserSimpleResp2VO> list2 = new ArrayList<>();
for (UserSimpleResp2VO u : resultList
) {
if (deptQuanX.contains(u.getDeptId())) {
list2.add(u);
}
}
// 排序后,返回给前端
return success(list2);
}
}
package cn.iocoder.yudao.module.delivery.convert;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisExcelResp;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import java.util.List;
/*
model类型转换 lanbm 2024-04-27 add
https://www.cnblogs.com/DDgougou/articles/13365277.html
*/
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface CustomerAnalysis {
/*****转换MapStruct*****/
CustomerAnalysis INSTANCE = Mappers.getMapper(CustomerAnalysis.class);
// @Mapping(target = "salesmanid", ignore = true)
// @Mapping(source = "salesmanid",target ="salesmanid",ignore = true)
CustomerAnalysisExcelResp convert(CustomerAnalysisResp bean);
List<CustomerAnalysisExcelResp> convertList(List<CustomerAnalysisResp> list);
}
package cn.iocoder.yudao.module.delivery.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class CustomerAnalysisExcelResp {
/*
排名编号
*/
@ExcelProperty("排名编号")
private int px;
/*
客户编号
*/
@ExcelProperty("客户编号")
private String number;
/*
客户姓名
*/
@ExcelProperty("客户姓名")
private String name;
/*
客户经理姓名
*/
@ExcelProperty("客户经理")
private String salesman;
/*
客户经理部门名称
*/
@ExcelProperty("部门")
private String deptname;
/*
总值,海运拼柜,专线空运
*/
@ExcelProperty("总V值")
private BigDecimal allsumvolume;
/*
总V值同比显示信息
*/
@ExcelProperty("总V值同比")
private String allsumvolumeTbShow;
/*
海运拼柜
*/
@ExcelProperty("海运拼柜")
private BigDecimal sumvolumeV1;
/*
海运占比
*/
@ExcelProperty("海运占比")
private String seaZb;
/*
海运同比显示
*/
@ExcelProperty("海运同比")
private String sumvolumeTbShow1;
/*
专线空运V值
*/
@ExcelProperty("专线空运")
private BigDecimal sumweightV3;
/*
空运占比
*/
@ExcelProperty("空运占比")
private String airZb;
/*
空运同比显示
*/
@ExcelProperty("空运同比")
private String sumweightTbShow3;
/*
月均
*/
@ExcelProperty("月均")
private String monthAvg;
/*
月均同比
*/
@ExcelProperty("月均同比")
private String monthAvgTbShow;
/*
海运月均方数
*/
@ExcelProperty("海运月均方数")
private String seaMonthAvg;
/*
海运月均方数同比
*/
@ExcelProperty("海运月均同比")
private String seaMonthAvgTb;
/*
空运月均重量
*/
@ExcelProperty("空运月均重量")
private String airMothAvg;
/*
空运月均同比
*/
@ExcelProperty("空运月均同比")
private String airMothAvgTb;
/*
重货总V值
*/
@ExcelProperty("重货总V值")
private BigDecimal weightSumV;
/*
重货占比
*/
@ExcelProperty("重货占比")
private String weithtSumZb;
/*
泡货总V值
*/
@ExcelProperty("泡货总V值")
private BigDecimal phSumV;
/*
泡货占比
*/
@ExcelProperty("泡货占比")
private String phSumZb;
/*
控货总V值
*/
@ExcelProperty("控货总V值")
private BigDecimal khSumV;
/*
控货总占比
*/
@ExcelProperty("控货占比")
private String khSumZb;
/*
是否首次成交
*/
@ExcelProperty("是否首次成交")
private String isFirst;
/*
首次成交时间
*/
@ExcelProperty("首次成交时间")
private String firstDate;
/*
提货率
*/
@ExcelProperty("提货率")
private String thL;
/*
客户业绩类型
是否新客户:1是新客户,0是老客户
*/
@ExcelProperty("客户业绩类型")
private String cusYjType;
/*
客户来源名称
*/
@ExcelProperty("客户来源")
private String sourcename;
/*
客户国家
*/
@ExcelProperty("客户国家")
private String country;
/*
客户角色
*/
@ExcelProperty("客户角色")
private String customerrole;
/*
客户创建日期
*/
@ExcelProperty("客户创建日期")
private String createtime;
}
package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
/*
客户分析报表
逻辑数据大部分集中在表 ecw_customer
lanbm 2024-03-31 add
*/
@Schema(description = "管理后台 - 客户分析查询参数")
@Data
@ToString(callSuper = true)
public class CustomerAnalysisReq extends PageParam {
private int start;
private int size;
/*
客户编号
*/
//private String number;
/*
客户名称
*/
private String name;
private String searchtype;
/*
是否新客户
*/
private int isnew;
/*
客户国家
*/
private String country;
/*
客户来源
*/
private int source;
/*
销售经理
*/
private String salesmanid;
/*
部门ID
*/
private String deptid;
/*
客户姓名
*/
private String cusname;
/*
客户编号
*/
private String cusno;
/*
是否首次成交 0是否,1是
*/
private int first;
/*
客户角色
*/
private String customerrole;
/*
数据筛选类型
*/
private String searchDataType1;
private String searchDataType2;
private String searchDataType3;
/*
客户时间筛选条件
*/
private String searchDataType4;
private String sdate4;
private String edate4;
/*
时间筛选类型
首次成交日期,客户创建日期
*/
private String SearchDateType;
private String sdate;
//对比开始日期
private String sduibidate;
private String edate;
//对比结束日期
private String eduibidate;
/*
对比年份
*/
private String duibiYear;
private String curYear;//统计年份
/*
统计时间跨度 总月数,用户计算月均
*/
private int nMonth;
}
package cn.iocoder.yudao.module.delivery.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/*
客户分析结果
lanbm 2024-04-02 add
字段值名称首字母要小写,字段中不能含有下划线
*/
@ApiModel("管理后台-客户分析报表结果")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CustomerAnalysisResp {
/*
排名编号
*/
private int px;
/*
客户编号
*/
private String number;
private String id;
/*
客户姓名
*/
private String name;
/*
客户经理姓名
*/
private String salesman;
/*
客户经理所在的部门
*/
private String deptid;
/*
部门名称
*/
private String deptname;
/*
客户经理ID
customer_service 客户表中的跟进客服
*/
private String salesmanid;
/*
总值,海运拼柜,专线空运
*/
private BigDecimal allsumvolume;
/*
总值同比
*/
private BigDecimal allsumvolumeTb;
/*
总V值同比显示信息
*/
private String allsumvolumeTbShow;
/*
海运拼柜
*/
private BigDecimal sumvolume1;
private BigDecimal sumvolumeV1;
private BigDecimal sumvolumeTb1;
private BigDecimal sumvolumeTbV1;
/*
海运拼柜占比
*/
private String seaZb;
/*
海运同比显示
*/
private String sumvolumeTbShow1;
/*
专线空运
*/
private BigDecimal sumweight3;
private BigDecimal sumweightV3;
private BigDecimal sumweightTb3;
private BigDecimal sumweightTbV3;
/*
空运占比
*/
private String airZb;
/*
空运同步显示
*/
private String sumweightTbShow3;
/*
月均
*/
private String monthAvg;
private String monthAvgTb;
/*
月均同比
*/
private String monthAvgTbShow;
/*
海运月均方数
*/
private String seaMonthAvg;
/*
海运月均方数同比
*/
private String seaMonthAvgTb;
/*
空运月均重量
*/
private String airMothAvg;
/*
空运月均同比
*/
private String airMothAvgTb;
/*
重货总V值
*/
private BigDecimal weightSumV;
/*
重货占比
*/
private String weithtSumZb;
/*
泡货总V值
*/
private BigDecimal phSumV;
/*
泡货占比
*/
private String phSumZb;
/*
控货总V值
*/
private BigDecimal khSumV;
/*
控货总占比
*/
private String khSumZb;
/*
是否首次成交
*/
private String isFirst;
/*
首次成交时间
*/
private String firstDate;
/*
入库总箱数
*/
private int chargequantity;
/*
提货数
*/
private int pickquantity;
/*
提货率
*/
private String thL;
/*
客户业绩类型
是否新客户:1是新客户,0是老客户
*/
private String cusYjType;
/*
客户来源
*/
private String source;
/*
客户来源名称
*/
private String sourcename;
/*
客户国家
*/
private String country;
private int countryID;
/*
客户角色
*/
private String customerrole;
/*
对应数据字典中的客户类别 type
*/
private String type;
/*
客户创建日期
*/
private String createtime;
}
package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
/*
客户看板请求参数
lanbm 2024-03-31 add
*/
@Schema(description = "管理后台 - 客户看板查询参数")
@Data
@ToString(callSuper = true)
public class CustomerReportReq extends PageParam {
private int start;
private int size;
/*
统计开始日期
*/
private String sDate;
private String sDuiBiDate;
private String sHuanhuanBiDate;//环比日期
/*
统计结束日期
*/
private String eDate;
private String eDuiBiDate;
private String eHuanBiDate;//环比日期
/*
对比年份
*/
private String duibiYear;
private String curYear;//统计年份
/*
部门ID
*/
private String deptid;
/*
客户经理
*/
private String salesmanid;
private Integer pageNo ;
private Integer pageSize;
}
package cn.iocoder.yudao.module.delivery.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/*
客户看板结果
lanbm 2024-04-02 add
*/
@ApiModel("管理后台-客户看报表结果")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CustomerReportResp {
//同比,和上一年的比较
//环比 和上一个月的比较
/*
客户编号
*/
private String number;
/*
客户姓名
*/
private String name;
/*
客户经理姓名
*/
private String salesman;
/*
客户经理ID
customer_service 客户表中的跟进客服
*/
private String salesmanid;
/*
总值,海运拼柜,专线空运
*/
private BigDecimal allsumvolume;
/*
总值同比
*/
private BigDecimal allsumvolumeTb;
private String allsumvolumeTbMsg;
/*
海运拼柜
*/
private BigDecimal sumvolume1;
private BigDecimal sumvolumeTb1;
/*
海运拼柜占比
*/
private String seaZb;
/*
专线空运
*/
private BigDecimal sumweight3;
private BigDecimal sumweightTb3;
/*
空运占比
*/
private String airZb;
private String deptname;
/*
对比年份
*/
private String duibiYear;
}
package cn.iocoder.yudao.module.delivery.entity;
import java.util.Date;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
/**
* 报表权限(EcwReportPermission)实体类
*
* @author lanbm
* @since 2024-04-09 23:10:39
*/
@TableName("ecw_report_permission")
@Data
@EqualsAndHashCode(callSuper = true)
public class EcwReportPermission extends BaseDO {
private Long id;
/**
* 用户ID
*/
private String userId;
/**
* 权限范围1是本人,2部门,3是全公司
*/
private Integer permissionFw;
/**
* 部门详情
* 权限类型是本人 此字段为空
* 权限是部门,部门信息用,分开
* 权限是全公司,此字段为空
*/
private String deptId;
/*
是否有数据导出权
*/
private int exportdataq;
}
package cn.iocoder.yudao.module.delivery.entity;
import java.util.Date;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 分页 Request")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class EcwReportPermissionPageReq extends PageParam {
private int start;
private int size;
private String userId; //用户ID
private Integer permissionFw;//权限范围
private String deptId; //部门信息
}
package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 报表权限(EcwReportPermission)实体类
*
* @author lanbm
* @since 2024-04-09 23:10:39
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class EcwReportPermissionResp extends BaseDO {
private Long id;
/**
* 用户ID
*/
private String userId;
/**
* 用户名称
*/
private String userName;
/**
* 权限范围1是本人,2部门,3是全公司
*/
private Integer permissionFw;
/**
* 部门详情
* 权限类型是本人 此字段为空
* 权限是部门,部门信息用,分开
* 权限是全公司,此字段为空
*/
private String deptId;
/*
部门名称
*/
private String deptName;
}
package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
/**
* V值转换配置参数(EcwVz)实体类
*
* @author lanbm
* @since 2024-04-02 22:38:22
*/
@TableName("ecw_vz")
@Data
@EqualsAndHashCode(callSuper = true)
public class EcwVz extends BaseDO {
private Long id;
/**
* 运输方式
*/
private String titleZh;
/**
* 英文名称
*/
private String titleEn;
/**
* 单位符号 KG,M3 立方
*/
private String fuhao;
/*
1KG对应的VZ,1立方对应的V值
*/
private float vz;
/**
* 0显示 1不显示
*/
private Integer status;
/**
* 排序
*/
private Integer aorder;
}
package cn.iocoder.yudao.module.delivery.entity;
import java.util.Date;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 分页 Request")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class EcwVzPageReq extends PageParam {
/**
* 运输方式
*/
private String titleZh;
/**
* 单位符号 KG,M3 立方
*/
private String fuhao;
}
package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
/**
* (Employee)实体类
*
* @author lanbm
* @since 2024-03-27 21:25:55
*/
@TableName("employee")
@Data
@EqualsAndHashCode(callSuper = true)
public class Employee extends BaseDO {
/**
* 员工编号
*/
private Long id;
/**
* 姓名
*/
private String name;
/**
* 性别
*/
private String empGender;
/**
* 年龄
*/
private Integer age;
/**
* 电子邮件
*/
private String email;
}
package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 分页 Request")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class EmployeePageReq extends PageParam {
}
package cn.iocoder.yudao.module.delivery.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class SalesAnalysisExcelResp {
/*
排名编号
*/
private int px;
@ExcelProperty("排名")
/*
订单编号
*/
private String orderNo;
@ExcelProperty("订单编号")
/*
提单号
*/
private String tidanNo;
@ExcelProperty("提单号")
/*
订单发货人编号
*/
private String orderConsignorName;
@ExcelProperty("发货人名称")
/*
订单发货人客户ID,用户链接
*/
private String orderConsignorCusId;
/*
订单收货人名称
*/
@ExcelProperty("订单收货人名称")
private String orderConsigneeName;
/*
订单收货人客户编号,用于链接
*/
private String orderConsigneeCusId;
/*
客户经理
*/
private String salesmanid;
@ExcelProperty("客户经理")
private String salesmanidName;
/*
订单状态
*/
private String status;
@ExcelProperty("订单状态")
private String statusName;
/*
运输方式
*/
private String transportId;
@ExcelProperty("运输方式")
private String transportIdName;
/*
始发仓
*/
@ExcelProperty("始发仓")
private String startwarehousename;
/*
目的国
*/
/*
目的城市
*/
/*
目的仓
*/
@ExcelProperty("目的仓")
private String dstwarehousename;
/*
渠道
*/
private String channelid;
@ExcelProperty("渠道")
private String channelidName;
/*
唛头
*/
@ExcelProperty("唛头")
private String marks;
/*
入仓箱数
*/
@ExcelProperty("入仓箱数")
private String sumquantity;
/*
入仓体积
*/
@ExcelProperty("入仓体积")
private String sumvolume;
/*
入仓重量
*/
@ExcelProperty("入仓重量")
private String sumweight;
/*
是否控货
*/
@ExcelProperty("是否控货")
private String iscargocontrol;
/*
创建时间
*/
@ExcelProperty("创建时间")
private String createtime;
}
package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
/*
lanbm 2024-03-31 add
*/
@Schema(description = "管理后台 - 销售分析查询参数")
@Data
@ToString(callSuper = true)
public class SalesAnalysisReq extends PageParam {
private int start;
private int size;
/*
运输方式
1 海运柜拼柜 2海运整柜 3专线空运 4海空联运
*/
private int transportId;
/*
订单编号查询类型
*/
private String SearchType1;
/*
订单编号
*/
private String orderNo;
/*
提单编号
*/
private String tidanNo;
/*
销售经理
*/
private String salesmanId;
/*
部门ID
*/
private String deptId;
/*
唛头
*/
private String marks;
/*
是否控货
*/
private int isCargoControl;
}
package cn.iocoder.yudao.module.delivery.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/*
销售分析查询结果 lanbm 2024-04-02
*/
@ApiModel("管理后台-销售分析报表结果")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalesAnalysisResp {
/*
排名编号
*/
private int px;
/*
订单编号
*/
private String orderNo;
/*
提单号
*/
private String tidanNo;
/*
订单发货人编号
*/
private String orderConsignorName;
/*
订单发货人客户ID,用户链接
*/
private String orderConsignorCusId;
/*
订单收货人名称
*/
private String orderConsigneeName;
/*
订单收货人客户编号,用于链接
*/
private String orderConsigneeCusId;
/*
客户经理
*/
private String salesmanid;
private String salesmanidName;
/*
订单状态
*/
private String status;
private String statusName;
/*
运输方式
*/
private String transportId;
private String transportIdName;
/*
始发仓
*/
private String startwarehousename;
/*
目的国
*/
/*
目的城市
*/
/*
目的仓
*/
private String dstwarehousename;
/*
渠道
*/
private String channelid;
private String channelidName;
/*
唛头
*/
private String marks;
/*
入仓箱数
*/
private String sumquantity;
/*
入仓体积
*/
private String sumvolume;
/*
入仓重量
*/
private String sumweight;
/*
是否控货
*/
private String iscargocontrol;
/*
创建时间
*/
private String createtime;
}
package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/*
销售看板查询请求参数
逻辑数据大部分集中在表 ecw_order
lanbm 2024-03-31 add
*/
@Schema(description = "管理后台-销售看板查询参数")
@Data
@ToString(callSuper = true)
public class SalesReportReq {
/*
销售经理
*/
private String salesmanid;
/*
部门ID
*/
private String deptid;
/*
对比年份
*/
private String duibiYear;
}
package cn.iocoder.yudao.module.delivery.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.math.BigDecimal;
/*
model字段中不能有下划线,否则转对象会失败
*/
@ApiModel("管理后台 -销售看板查询结果")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalesReportResp {
/*
所有运输方式的总体积,换算V值结果
*/
private BigDecimal allsumvolume;
/*
海运体积
*/
private BigDecimal sumvolume1;
/*
专线空运重量
*/
private BigDecimal sumweight3;
}
package cn.iocoder.yudao.module.delivery.entity.bar;
import cn.iocoder.yudao.module.delivery.entity.CustomerReportResp;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/*
客户看板返回给图表的Model
lanbm 2024-04-03 add
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CustomerReportBar {
private yAxis objyAxis;
private List<series> obSseries;
private List<CustomerReportResp> resultList;
/*
记录总数 lanbm 2024-04-14 add
*/
private long total;
}
package cn.iocoder.yudao.module.delivery.entity.bar;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class series {
private String name;
private String type;
private List<String> data;
/*
设置不同系列之间的间距
*/
private String barGap;
/*
设置同一系列中不同柱之间的间距
*/
private String barCategoryGap;
/*
自定义提示信息
*/
private String myTip;
}
package cn.iocoder.yudao.module.delivery.entity.bar;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class yAxis {
private String type;
private List<String> data;
/*
是否倒序
*/
private boolean inverse;
}
package cn.iocoder.yudao.module.delivery.entity.deptex;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DeptEx {
//部门扩展功能 model
private Long id;
private String name;
private Long parentId;
}
package cn.iocoder.yudao.module.delivery.entity.orderdata;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 订单业务数据")
@Data
@ToString(callSuper = true)
public class view_order_businesstime {
private int orderid;
private String orderno;
private String tidanno;
private String transportid;
/*
客户id
*/
private String customerid;
/*
是否控货
*/
private String iscargocontrol;
private String ordertype;
private String businesstime;
private int chargequantity;
private int picknum;
private BigDecimal chargevolume;
private BigDecimal chargeweight;
private BigDecimal vz;
}
package cn.iocoder.yudao.module.delivery.enums;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
public interface ErrorCodeConstants {
ErrorCode TEST_NOT_EXISTS = new ErrorCode(2004020001, "单号配置不存在");
}
\ No newline at end of file
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisExcelResp;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp;
import cn.iocoder.yudao.module.delivery.entity.Employee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* (CustomerAnalysis)客户分析
*
* @author lanbm
* @since 2024-04-01
*/
@Mapper
public interface CustomerAnalysisMapper {
List<CustomerAnalysisResp> getListPage(CustomerAnalysisReq req);
/*
lanbm 2024-04-26 add
*/
List<CustomerAnalysisResp> getListPage_New(CustomerAnalysisReq req);
/*
获取查询条件的总数
*/
Long GetCount(CustomerAnalysisReq req);
List<CustomerAnalysisExcelResp>getList(CustomerAnalysisReq req);
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisExcelResp;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CustomerAnalysisMapper2 {
List<CustomerAnalysisResp> getListPage(CustomerAnalysisReq req);
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerReportReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerReportResp;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* (CustomerReport)客户报表
*
* @author lanbm
* @since 2024-04-01
*/
@Mapper
public interface CustomerReportMapper {
List<CustomerReportResp> getListPage(CustomerReportReq req);
/*
获取查询条件的总数
*/
Long GetCount(CustomerReportReq req);
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.delivery.entity.deptex.DeptEx;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface DeptExMapper extends BaseMapperX<DeptEx> {
List<DeptEx> getDeptChild(DeptEx QueryReq);
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.delivery.entity.*;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import java.util.List;
/**
* 报表权限(EcwReportPermission)表数据库访问层
*
* @author lanbm
* @since 2024-04-09 23:10:40
*/
@Mapper
public interface EcwReportPermissionMapper extends BaseMapperX<EcwReportPermission> {
/*
简单的单表查询,开发效率高,如果关联多表还是是XML比较好
lanbm 2024-04-15 add
*/
default List<EcwReportPermission> selectList(EcwReportPermission QueryReq) {
return selectList(new LambdaQueryWrapperX<EcwReportPermission>()
.eqIfPresent(EcwReportPermission::getPermissionFw, QueryReq.getPermissionFw())
);
}
default PageResult<EcwReportPermission> selectPage(EcwReportPermissionPageReq PageReq) {
return selectPage(PageReq, new LambdaQueryWrapperX<EcwReportPermission>()
.eqIfPresent(EcwReportPermission::getPermissionFw, PageReq.getPermissionFw())
.orderByDesc(EcwReportPermission::getUpdateTime)
);
}
/*
实现物理删除
lanbm 2024-04-08 add
*/
int deleteById2(Long id);
/*
lanbm 2024-04-15 add
*/
List<EcwReportPermissionResp> getListPageCustom(EcwReportPermissionPageReq PageReq);
/*
获取查询条件的总数
*/
Long GetCount(EcwReportPermissionPageReq req);
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import java.util.List;
/**
* V值转换配置参数(EcwVz)表数据库访问层
*
* @author lanbm
* @since 2024-04-02 22:38:22
*/
@Mapper
public interface EcwVzMapper extends BaseMapperX<EcwVz> {
default List<EcwVz> selectList(EcwVz QueryReq) {
return selectList(new LambdaQueryWrapperX<EcwVz>());
}
default PageResult<EcwVz> selectPage(EcwVzPageReq PageReq) {
return selectPage(PageReq, new LambdaQueryWrapperX<EcwVz>()
.likeIfPresent(EcwVz::getTitleZh, PageReq.getTitleZh())
.likeIfPresent(EcwVz::getFuhao, PageReq.getFuhao())
);
}
/*
实现物理删除
lanbm 2024-04-08 add
*/
int deleteById2(Long id);
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.iocoder.yudao.module.delivery.entity.Employee;
import cn.iocoder.yudao.module.delivery.entity.EmployeePageReq;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import java.util.List;
/**
* (Employee)表数据库访问层
*
* @author lanbm
* @since 2024-03-27 21:25:56
*/
@Mapper
public interface EmployeeMapper extends BaseMapperX<Employee> {
default List<Employee> selectList(Employee QueryReq) {
return selectList(new LambdaQueryWrapperX<Employee>());
}
default PageResult<Employee> selectPage(EmployeePageReq PageReq) {
return selectPage(PageReq, new LambdaQueryWrapperX<Employee>());
}
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.delivery.entity.*;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* (SalesAnalysis)销售分析
*
* @author lanbm
* @since 2024-04-01
*/
@Mapper
public interface SalesAnalysisMapper {
List<SalesAnalysisResp> getListPage(SalesAnalysisReq req);
/*
获取查询条件的总数
*/
Long GetCount(SalesAnalysisReq req);
/*
导出报表列表 lanbm 2024-04-24 add
*/
List<SalesAnalysisExcelResp>getList(SalesAnalysisReq req);
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.module.delivery.entity.SalesReportReq;
import cn.iocoder.yudao.module.delivery.entity.SalesReportResp;
import org.apache.ibatis.annotations.Mapper;
/**
* (SalesReport)销售报表
*
* @author lanbm
* @since 2024-04-01
*/
@Mapper
public interface SalesReportMapper {
SalesReportResp SalesReportCount(SalesReportReq Req);
int FirstCustomerCount(SalesReportReq Req);
}
package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.module.delivery.entity.orderdata.view_order_businesstime;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/*
订单业务数据 lanbm 2024-04-25 add
*/
@Mapper
public interface view_order_businesstimeMapper {
/*
// 升序排序
List<Dictionaries> dictionaries =
list.stream().sorted().collect(Collectors.toList());
// 降序排序
List<Dictionaries> dictionaries =
list.stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList());
// 定制升序排序
List<Dictionaries> dictionaries =
list.stream().sorted(Comparator.comparing(Student::getAge)).collect(Collectors.toList());
// 定制降序排序
List<Dictionaries> dictionaries =
list.stream().sorted(Comparator.comparing(Student::getAge).reverseOrder()).collect(Collectors.toList());
*/
/*
获取订单业务数据 lanbm 2024-04-25
*/
List<view_order_businesstime> getOrderBusinessData();
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.delivery.entity.*;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.List;
public interface CustomerAnalysisService {
PageResult<CustomerAnalysisResp> getListPage(CustomerAnalysisReq req)
throws JsonProcessingException;
PageResult<CustomerAnalysisResp> getListPage_New(CustomerAnalysisReq req)
throws JsonProcessingException;
List<CustomerAnalysisExcelResp>getList(CustomerAnalysisReq req);
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisExcelResp;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp;
import java.util.List;
public interface CustomerAnalysisService2 {
List<CustomerAnalysisResp> getList(CustomerAnalysisReq req);
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.delivery.entity.CustomerReportReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerReportResp;
import java.util.List;
public interface CustomerReportService {
PageResult<CustomerReportResp> getListPage(CustomerReportReq req);
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermission;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermissionPageReq;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermissionResp;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import java.util.*;
import javax.validation.*;
/**
* 报表权限(EcwReportPermission)表服务接口
*
* @author lanbm
* @since 2024-04-09 23:10:42
*/
public interface EcwReportPermissionService extends IService<EcwReportPermission> {
/**
* 创建测试
*
* @param createReq 创建信息
* @return 编号
*/
Long create(@Valid EcwReportPermission createReq);
/**
* 更新测试
*
* @param updateReq 更新信息
*/
void update(@Valid EcwReportPermission updateReq);
/**
* 删除测试
*
* @param id 编号
*/
void delete(Long id);
/**
* 获得测试
*
* @param id 编号
* @return 测试
*/
EcwReportPermission getModel(Long id);
/**
* 获得测试列表
*
* @param ids 编号
* @return 测试列表
*/
List<EcwReportPermission> getQueryList(Collection<Long> ids);
/**
* 获得测试列表, 用于 Excel 导出
*
* @param query 查询
* @return 测试列表
*/
List<EcwReportPermission> selectList(EcwReportPermission query);
/**
* 获得测试分页
*
* @param page 查询
* @return 测试分页
*/
PageResult<EcwReportPermission> getListPage(EcwReportPermissionPageReq page);
/*
自定义的分页函数 lanbm 2024-04-15 add
*/
PageResult<EcwReportPermissionResp> getListPageCustom (EcwReportPermissionPageReq page);
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import java.util.*;
import javax.validation.*;
/**
* V值转换配置参数(EcwVz)表服务接口
*
* @author lanbm
* @since 2024-04-02 22:38:22
*/
public interface EcwVzService extends IService< EcwVz > {
/**
* 创建测试
* @param createReq 创建信息
* @return 编号
*/
Long create(@Valid EcwVz createReq);
/**
* 更新测试
* @param updateReq 更新信息
*/
void update(@Valid EcwVz updateReq);
/**
* 删除测试
* @param id 编号
*/
void delete(Long id);
/**
* 获得测试
* @param id 编号
* @return 测试
*/
EcwVz getModel(Long id);
/**
* 获得测试列表
* @param ids 编号
* @return 测试列表
*/
List<EcwVz> getQueryList(Collection<Long> ids);
/**
* 获得测试列表, 用于 Excel 导出
* @param query 查询
* @return 测试列表
*/
List<EcwVz> getQueryList(EcwVz query);
/**
* 获得测试分页
* @param page 查询
* @return 测试分页
*/
PageResult<EcwVz> selectPage(EcwVzPageReq page);
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.module.delivery.entity.Employee;
import cn.iocoder.yudao.module.delivery.entity.EmployeePageReq;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import java.util.*;
import javax.validation.*;
/**
* (Employee)表服务接口
*
* @author lanbm
* @since 2024-03-27 21:25:56
*/
public interface EmployeeService extends IService<Employee> {
/**
* 创建测试
*
* @param createReq 创建信息
* @return 编号
*/
Long create(@Valid Employee createReq);
/**
* 更新测试
*
* @param updateReq 更新信息
*/
void update(@Valid Employee updateReq);
/**
* 删除测试
*
* @param id 编号
*/
void delete(Long id);
/**
* 获得测试
*
* @param id 编号
* @return 测试
*/
Employee getModel(Long id);
/**
* 获得测试列表
*
* @param ids 编号
* @return 测试列表
*/
List<Employee> getQueryList(Collection<Long> ids);
/**
* 获得测试列表, 用于 Excel 导出
*
* @param query 查询
* @return 测试列表
*/
List<Employee> getQueryList(Employee query);
/**
* 获得测试分页
*
* @param page 查询
* @return 测试分页
*/
PageResult<Employee> getListPage(EmployeePageReq page);
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.i18n.core.I18nMessage;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisExcelResp;
import cn.iocoder.yudao.module.delivery.entity.CustomerReportReq;
import cn.iocoder.yudao.module.delivery.mapper.CustomerAnalysisMapper;
import cn.iocoder.yudao.module.delivery.service.CustomerAnalysisService;
import cn.iocoder.yudao.module.delivery.service.CustomerReportService;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/*
lanbm 2024-04-01 add
客户分析列表
*/
@Service("CustomerAnalysisService")
public class CustomerAnalysisImpl implements CustomerAnalysisService {
@Autowired
private CustomerAnalysisMapper customerAnalysisMapper;
@Resource
private RedisHelper redisHelper;
public List<CustomerAnalysisExcelResp> getList(CustomerAnalysisReq req) {
return customerAnalysisMapper.getList(req);
}
public PageResult<CustomerAnalysisResp> getListPage(CustomerAnalysisReq req)
throws JsonProcessingException {
IPage<CustomerAnalysisResp> mpPage = MyBatisUtils.buildPage(req);
long total = customerAnalysisMapper.GetCount(req);
System.out.println("符合条件的客户总数:" + String.valueOf(total));
int start = (req.getPageNo() - 1) * req.getPageSize();
int size = req.getPageSize();
req.setSize(size);
req.setStart(start);
/*
List<CustomerAnalysisResp> list = null;
String sList = redisHelper.get("CustomerAnalysisRespList");
if (sList == null || sList.length() == 0) {
list = customerAnalysisMapper.getListPage(req);
ObjectMapper objectMapper = new ObjectMapper();
// 将List转换为JSON字符串
String json = objectMapper.writeValueAsString(list);
redisHelper.set("CustomerAnalysisRespList", json);
} else {
list = JSON.parseArray(sList, CustomerAnalysisResp.class);
}
*/
List<CustomerAnalysisResp> list = customerAnalysisMapper.getListPage(req);
return new PageResult<>(list, total, mpPage.getSize(),
req.getPageNo(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
private List<CustomerAnalysisResp> GetPageResult(
List<CustomerAnalysisResp> list, int pageNum, int pageSize) {
/*
// 正序
Collections.sort(list, (a, b) -> {
return a.排序字段 - b.排序字段;
});
// 倒序
Collections.sort(list, (a, b) -> {
return b.排序字段 - a.排序字段;
});*/
// 总数
int total = list.size();
// 分页数据
List<CustomerAnalysisResp> subList =
list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
return subList;
}
/*
lanbm 2024-04-26 add
*/
public PageResult<CustomerAnalysisResp> getListPage_New(CustomerAnalysisReq req)
throws JsonProcessingException {
List<CustomerAnalysisResp> list = customerAnalysisMapper.getListPage_New(req);
long total=list.size();
list = GetPageResult(list, req.getPageNo(), req.getPageSize());
return new PageResult<>(list, total, req.getPageSize(),
req.getPageNo(),
(total + req.getPageSize() - 1) / req.getPageSize());
}
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisExcelResp;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp;
import cn.iocoder.yudao.module.delivery.mapper.CustomerAnalysisMapper;
import cn.iocoder.yudao.module.delivery.mapper.CustomerAnalysisMapper2;
import cn.iocoder.yudao.module.delivery.service.CustomerAnalysisService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("CustomerAnalysisImpl2")
public class CustomerAnalysisImpl2 implements CustomerAnalysisService2 {
@Autowired
private CustomerAnalysisMapper2 customerAnalysisMapper2;
public List<CustomerAnalysisResp> getList(CustomerAnalysisReq req) {
return customerAnalysisMapper2.getListPage(req);
}
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp;
import cn.iocoder.yudao.module.delivery.entity.CustomerReportReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerReportResp;
import cn.iocoder.yudao.module.delivery.mapper.CustomerAnalysisMapper;
import cn.iocoder.yudao.module.delivery.mapper.CustomerReportMapper;
import cn.iocoder.yudao.module.delivery.service.CustomerReportService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("CustomerReportService")
public class CustomerReportImpl implements CustomerReportService {
@Autowired
private CustomerReportMapper customerReportMapper;
public PageResult<CustomerReportResp> getListPage(CustomerReportReq req) {
IPage<CustomerReportResp> mpPage = MyBatisUtils.buildPage(req);
long total = customerReportMapper.GetCount(req);
System.out.println("符合条件的客户总数:"+String.valueOf(total));
int start = (req.getPageNo() - 1) * req.getPageSize();
int size = req.getPageSize();
req.setSize(size);
req.setStart(start);
List<CustomerReportResp> list = customerReportMapper.getListPage(req);
return new PageResult<>(list, total, mpPage.getSize(),
req.getPageNo(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermissionResp;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermission;
import cn.iocoder.yudao.module.delivery.entity.EcwReportPermissionPageReq;
import cn.iocoder.yudao.module.delivery.mapper.EcwReportPermissionMapper;
import cn.iocoder.yudao.module.delivery.service.EcwReportPermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import javax.validation.Valid;
/**
* 报表权限(EcwReportPermission)表服务实现类
*
* @author lanbm
* @since 2024-04-09 23:10:41
*/
@Service("ecwReportPermissionService")
public class EcwReportPermissionServiceImpl extends ServiceImpl<EcwReportPermissionMapper, EcwReportPermission> implements EcwReportPermissionService {
@Autowired
private EcwReportPermissionMapper ecwReportPermissionMapper;
/**
* 创建测试
*
* @param createReq 创建信息
* @return 编号
*/
public Long create(@Valid EcwReportPermission createReq) {
ecwReportPermissionMapper.insert(createReq);
return createReq.getId();
}
/**
* 更新测试
*
* @param updateReq 更新信息
*/
public void update(@Valid EcwReportPermission updateReq) {
ecwReportPermissionMapper.updateById(updateReq);
}
/**
* 物理删除记录,避免表存在无用的记录,影响查询效率
*
* @param id 编号
*/
public void delete(Long id) {
ecwReportPermissionMapper.deleteById2(id);
}
/**
* 获得测试
*
* @param id 编号
* @return 测试
*/
public EcwReportPermission getModel(Long id) {
return ecwReportPermissionMapper.selectById(id);
}
/**
* 获得测试列表
*
* @param ids 编号
* @return 测试列表
*/
public List<EcwReportPermission> getQueryList(Collection<Long> ids) {
return ecwReportPermissionMapper.selectBatchIds(ids);
}
/**
* 获得测试列表, 用于 Excel 导出
*
* @param query 查询
* @return 列表
*/
public List<EcwReportPermission> selectList(EcwReportPermission query) {
return ecwReportPermissionMapper.selectList(query);
}
/**
* 获得测试分页
*
* @param page 分页查询
* @param page 查询
* @return 分页列表
*/
public PageResult<EcwReportPermission> getListPage(EcwReportPermissionPageReq page) {
return ecwReportPermissionMapper.selectPage(page);
}
/*
自定义的分页函数 lanbm 2024-04-15 add
*/
public PageResult<EcwReportPermissionResp> getListPageCustom(EcwReportPermissionPageReq page) {
IPage<EcwReportPermission> mpPage = MyBatisUtils.buildPage(page);
long total = ecwReportPermissionMapper.GetCount(page);
int start = (page.getPageNo() - 1) * page.getPageSize();
int size = page.getPageSize();
page.setSize(size);
page.setStart(start);
List<EcwReportPermissionResp> list =
ecwReportPermissionMapper.getListPageCustom(page);
return new PageResult<>(list, total, mpPage.getSize(),
page.getPageNo(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq;
import cn.iocoder.yudao.module.delivery.mapper.EcwVzMapper;
import cn.iocoder.yudao.module.delivery.service.EcwVzService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import javax.validation.Valid;
/**
* V值转换配置参数(EcwVz)表服务实现类
*
* @author lanbm
* @since 2024-04-02 22:38:22
*/
@Service("ecwVzService")
public class EcwVzServiceImpl extends ServiceImpl<EcwVzMapper,EcwVz> implements EcwVzService {
@Autowired
private EcwVzMapper ecwVzMapper;
/**
* 创建测试
* @param createReq 创建信息
* @return 编号
*/
public Long create(@Valid EcwVz createReq)
{
ecwVzMapper.insert(createReq);
return createReq.getId();
}
/**
* 更新测试
* @param updateReq 更新信息
*/
public void update(@Valid EcwVz updateReq)
{
ecwVzMapper.updateById(updateReq);
}
/**
* 删除测试
* @param id 编号
*/
public void delete(Long id)
{
ecwVzMapper.deleteById2(id);
}
/**
* 获得测试
* @param id 编号
* @return 测试
*/
public EcwVz getModel(Long id)
{
return ecwVzMapper.selectById(id);
}
/**
* 获得测试列表
* @param ids 编号
* @return 测试列表
*/
public List<EcwVz> getQueryList(Collection<Long> ids)
{
return ecwVzMapper. selectBatchIds(ids);
}
/**
* 获得测试列表, 用于 Excel 导出
* @param query 查询
* @return 列表
*/
public List<EcwVz> getQueryList(EcwVz query)
{
return ecwVzMapper. selectList(query);
}
/**
* 获得测试分页
* @param page 分页查询
* @param page 查询
* @return 分页列表
*/
public PageResult<EcwVz> selectPage(EcwVzPageReq page)
{
return ecwVzMapper.selectPage(page);
}
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.delivery.entity.Employee;
import cn.iocoder.yudao.module.delivery.entity.EmployeePageReq;
import cn.iocoder.yudao.module.delivery.mapper.EmployeeMapper;
import cn.iocoder.yudao.module.delivery.service.EmployeeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import javax.validation.Valid;
/**
* (Employee)表服务实现类
*
* @author lanbm
* @since 2024-03-27 21:25:56
*/
@Service("employeeService")
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements EmployeeService {
@Autowired
private EmployeeMapper employeeMapper;
/**
* 创建测试
*
* @param createReq 创建信息
* @return 编号
*/
public Long create(@Valid Employee createReq) {
employeeMapper.insert(createReq);
return createReq.getId();
}
/**
* 更新测试
*
* @param updateReq 更新信息
*/
public void update(@Valid Employee updateReq) {
employeeMapper.updateById(updateReq);
}
/**
* 删除测试
*
* @param id 编号
*/
public void delete(Long id) {
employeeMapper.deleteById(id);
}
/**
* 获得测试
*
* @param id 编号
* @return 测试
*/
public Employee getModel(Long id) {
return employeeMapper.selectById(id);
}
/**
* 获得测试列表
*
* @param ids 编号
* @return 测试列表
*/
public List<Employee> getQueryList(Collection<Long> ids) {
return employeeMapper.selectBatchIds(ids);
}
/**
* 获得测试列表, 用于 Excel 导出
*
* @param query 查询
* @return 列表
*/
public List<Employee> getQueryList(Employee query) {
return employeeMapper.selectList(query);
}
/**
* 获得测试分页
*
* @param page 分页查询
* @param page 查询
* @return 分页列表
*/
public PageResult<Employee> getListPage(EmployeePageReq page) {
return employeeMapper.selectPage(page);
}
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.delivery.entity.*;
import cn.iocoder.yudao.module.delivery.mapper.SalesAnalysisMapper;
import cn.iocoder.yudao.module.delivery.service.SalesAnalysisService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/*
lanbm 2024-04-01
*/
@Service("SalesAnalysisService")
public class SalesAnalysisImpl implements SalesAnalysisService {
@Autowired
private SalesAnalysisMapper salesAnalysisMapper;
public List<SalesAnalysisExcelResp> getList(SalesAnalysisReq req)
{
return salesAnalysisMapper.getList(req);
}
public PageResult<SalesAnalysisResp> getListPage(SalesAnalysisReq req) {
IPage<SalesAnalysisResp> mpPage = MyBatisUtils.buildPage(req);
long total = salesAnalysisMapper.GetCount(req);
System.out.println("符合条件的客户总数:"+String.valueOf(total));
int start = (req.getPageNo() - 1) * req.getPageSize();
int size = req.getPageSize();
req.setSize(size);
req.setStart(start);
List<SalesAnalysisResp> list = salesAnalysisMapper.getListPage(req);
return new PageResult<>(list, total, mpPage.getSize(),
req.getPageNo(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.module.delivery.entity.SalesReportReq;
import cn.iocoder.yudao.module.delivery.entity.SalesReportResp;
import cn.iocoder.yudao.module.delivery.mapper.EmployeeMapper;
import cn.iocoder.yudao.module.delivery.mapper.SalesReportMapper;
import cn.iocoder.yudao.module.delivery.service.SalesReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/*
销售看板统计报表
lanbm 2024-04-01 add
*/
@Service("SalesReportService")
public class SalesReportImpl implements SalesReportService {
@Autowired
private SalesReportMapper salesReportMapper;
public SalesReportResp SalesReportCount(SalesReportReq Req) {
return salesReportMapper.SalesReportCount(Req);
}
public int FirstCustomerCount(SalesReportReq Req) {
return salesReportMapper.FirstCustomerCount(Req);
}
}
package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.module.delivery.entity.orderdata.view_order_businesstime;
import cn.iocoder.yudao.module.delivery.mapper.SalesReportMapper;
import cn.iocoder.yudao.module.delivery.mapper.view_order_businesstimeMapper;
import cn.iocoder.yudao.module.delivery.service.view_order_businesstimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/*
lanbm 2024-04-25 add
*/
@Service("view_order_businesstimeServiceImpl")
public class view_order_businesstimeServiceImpl implements
view_order_businesstimeService {
@Autowired
private view_order_businesstimeMapper vieworderbusinesstimeMapper;
public List<view_order_businesstime> getOrderBusinessData() {
return vieworderbusinesstimeMapper.getOrderBusinessData();
}
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.delivery.entity.*;
import java.util.List;
public interface SalesAnalysisService {
PageResult<SalesAnalysisResp> getListPage(SalesAnalysisReq page);
List<SalesAnalysisExcelResp> getList(SalesAnalysisReq req);
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.module.delivery.entity.SalesReportReq;
import cn.iocoder.yudao.module.delivery.entity.SalesReportResp;
public interface SalesReportService {
SalesReportResp SalesReportCount(SalesReportReq Req);
int FirstCustomerCount(SalesReportReq Req);
}
package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.module.delivery.entity.orderdata.view_order_businesstime;
import java.util.List;
/*
订单业务数据 lanbm 2024-04-25 add
*/
public interface view_order_businesstimeService {
List<view_order_businesstime> getOrderBusinessData();
}
<?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="cn.iocoder.yudao.module.delivery.mapper.CustomerAnalysisMapper2">
<select id="getListPage"
parameterType="cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq"
resultType="cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp">
SELECT number,name,c.id,(
SELECT nickname from system_user where id=c.customer_service
) as salesman,c.customer_service as salesmanid,
(SELECT label from system_dict_data
where dict_type='customer_source' and value=c.source) as sourcename,
c.source,(u_d.dept_id) as deptid,(u_d.deptName) as deptname,
1 AS allsumvolume,
2 as allsumvolumeTb,
3 AS sumvolume1,
4 as sumvolumeTb1,
5 AS sumweight3,
6 as sumweightTb3,
7 as monthAvg,
8 as monthAvgTb,
9 as seaMonthAvg,
10 as seaMonthAvgTb,
11 as airMothAvg,
12 as airMothAvgTb,
13 as weightSumV,
14 as phSumV,
15 as khSumV,
(CASE WHEN c.is_new = 1 THEN '是' ELSE '否' END) as isFirst,
(if(c.is_new = 1,c.update_time,''))as firstDate,
16 as chargequantity,
17 as pickquantity,
(CASE WHEN c.is_new = 1 THEN '新客户' ELSE '旧客户' END ) as cusYjType,
(SELECT name_zh from ecw_country where deleted=0 and id=c.country) as country,
c.country as countryID, c.type,
c.create_time as createtime
from ecw_customer c left join (
SELECT d.NAME as deptName,u.dept_id,u.id as userid FROM
system_user u LEFT JOIN system_dept d ON u.dept_id = d.id
) AS u_d ON c.customer_service = u_d.userid
<include refid="WherePage"/>
</select>
<sql id="WherePage">
<where>
and c.deleted = 0
<if test="name!=null and name!=''">
<choose>
<when test="searchtype =='in'.toString()">
and (name like concat('%',#{name},'%') or
number like concat('%',#{name},'%'))
</when>
<when test="searchtype =='notin'.toString()">
and (name not like concat('%',#{name},'%') or
number not like concat('%',#{name},'%'))
</when>
<when test="searchtype =='eq'.toString()">
and (name= #{name} or number=#{name})
</when>
<when test="searchtype =='noeq'.toString()">
and (name != #{name} or number != #{name})
</when>
<otherwise>
and (name= #{name} or number=#{name})
</otherwise>
</choose>
</if>
<if test="isnew!=null and isnew!=''">
and is_new= #{isnew}
</if>
<if test="source!=null and source!=''">
and source= #{source}
</if>
<if test="customerrole!=null and customerrole!=''">
and type= #{customerrole}
</if>
<if test="country!=null and country!=''">
and c.country= #{country}
</if>
<if test="salesmanid!=null and salesmanid!=''">
<!--有具体的客户经理,就不算掉入公海池客户-->
and c.is_in_open_sea=0
and c.customer_service= #{salesmanid}
</if>
<if test="deptid!=null and deptid!=''">
and u_d.dept_id= #{deptid}
</if>
<if test="searchDataType4!=null and searchDataType4!=''">
<if test="sdate4!=null and sdate4!=''
and edate4!=null and edate4!=''">
<choose>
<when test="searchDataType4 =='1'">
and firstDate BETWEEN #{sdate4} AND #{edate4}
</when>
<when test="searchDataType4 =='0'">
and c.create_time BETWEEN #{sdate4} AND #{edate4}
</when>
</choose>
</if>
</if>
</where>
</sql>
<select id="GetCount" resultType="java.lang.Long">
SELECT count(1)
from ecw_customer
<include refid="WherePage"/>
</select>
</mapper>
<?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="cn.iocoder.yudao.module.delivery.mapper.CustomerReportMapper">
<select id="getListPage"
parameterType="cn.iocoder.yudao.module.delivery.entity.CustomerReportReq"
resultType="cn.iocoder.yudao.module.delivery.entity.CustomerReportResp">
SELECT number,name,(
SELECT nickname from system_user where id=c.customer_service
) as salesman,c.customer_service as salesmanid,
source,create_time as createtime,
(u_d.dept_id) as deptid,(u_d.deptName) as deptname,
<!--总V值 2024-04-22-->
(SELECT round(sum(vz),2) FROM view_order_businesstime WHERE customer_id = c.id AND business_time BETWEEN '${sDate}' AND '${eDate}') AS allsumvolume,
(SELECT round(sum(vz),2) FROM view_order_businesstime WHERE customer_id = c.id AND business_time BETWEEN '${sDuiBiDate}' AND '${eDuiBiDate}') as allsumvolumeTb,
<!--海运-->
(SELECT round(sum(charge_volume)/(SELECT vz FROM ecw_vz WHERE fuhao ='M3' LIMIT 1),2) FROM view_order_businesstime WHERE customer_id = c.id AND transport_id = 1 AND business_time BETWEEN '${sDate}' AND '${eDate}') AS sumvolume1,
(SELECT round(sum(charge_volume)/(SELECT vz FROM ecw_vz WHERE fuhao ='M3' LIMIT 1),2) FROM view_order_businesstime WHERE customer_id = c.id AND transport_id = 1 AND business_time BETWEEN '${sDuiBiDate}' AND '${eDuiBiDate}') as sumvolumeTb1,
<!--空运-->
(SELECT round(sum(charge_weight),2)/(SELECT vz FROM ecw_vz WHERE fuhao ='KG' LIMIT 1 ) FROM view_order_businesstime WHERE customer_id = c.id AND transport_id = 3 AND business_time BETWEEN '${sDate}' AND '${eDate}') AS sumweight3,
(SELECT round(sum(charge_weight),2)/(SELECT vz FROM ecw_vz WHERE fuhao ='KG' LIMIT 1 ) FROM view_order_businesstime WHERE customer_id = c.id AND transport_id = 3 AND business_time BETWEEN '${sDuiBiDate}' AND '${eDuiBiDate}') as sumweightTb3
from ecw_customer c left join (SELECT d.NAME as deptName,u.dept_id,u.id as userid FROM
system_user u LEFT JOIN system_dept d ON u.dept_id = d.id) AS u_d ON c.customer_service = u_d.userid
<include refid="WherePage"/>
ORDER BY allsumvolume desc
limit 0,30
</select>
<sql id="WherePage">
<where>
and c.deleted = 0
<if test="salesmanid!=null and salesmanid!=''">
and c.customer_service= #{salesmanid}
</if>
<if test="deptid!=null and deptid!=''">
and u_d.dept_id= #{deptid}
</if>
</where>
</sql>
<select id="GetCount" resultType="java.lang.Long">
SELECT count(1)
from ecw_customer c left join
(SELECT d.NAME as deptName,u.dept_id,u.id as userid FROM
system_user u LEFT JOIN system_dept d ON u.dept_id = d.id
) AS u_d ON c.customer_service = u_d.userid
<include refid="WherePage"/>
</select>
</mapper>
<?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="cn.iocoder.yudao.module.delivery.mapper.DeptExMapper">
<select id="getDeptChild"
resultType="cn.iocoder.yudao.module.delivery.entity.deptex.DeptEx">
WITH RECURSIVE recursion (id, name, parent_id, sort) AS (
SELECT T1.id,
T1.name,
T1.parent_id,
T1.sort
FROM system_dept T1
WHERE T1.id = #{id}
UNION ALL
SELECT T2.id,
T2.name,
T2.parent_id,
T2.sort
FROM system_dept T2,
recursion T3
WHERE T2.parent_id = T3.id
)
SELECT T.id,
T.name,
T.parent_id as parentId
FROM recursion T
ORDER BY T.id asc;
</select>
</mapper>
<?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="cn.iocoder.yudao.module.delivery.mapper.EcwReportPermissionMapper">
<select id="getListPageCustom"
parameterType="cn.iocoder.yudao.module.delivery.entity.EcwReportPermissionPageReq"
resultType="cn.iocoder.yudao.module.delivery.entity.EcwReportPermissionResp">
SELECT p.*,s.nickname as userName,d.name as deptName
from ecw_report_permission p
LEFT JOIN system_user s on p.user_id=s.id
LEFT JOIN system_dept d on p.dept_id=d.id
<include refid="WherePage"/>
</select>
<select id="GetCount" resultType="java.lang.Long">
SELECT count(1) from ecw_report_permission p
LEFT JOIN system_user s on p.user_id=s.id
LEFT JOIN system_dept d on p.dept_id=d.id
<include refid="WherePage"/>
</select>
<sql id="WherePage">
<where>
<if test="userId!=null and userId!=''">
and p.user_id= #{userId}
</if>
<if test="permissionFw!=null and permissionFw!=''">
and p.permission_fw=#{permissionFw}
</if>
<if test="deptId!=null and deptId!=''">
and p.dept_id= #{deptId}
</if>
</where>
</sql>
<!--2024-04-22-->
<delete id="deleteById2">
delete from ecw_report_permission where id = #{id}
</delete>
</mapper>
<?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="cn.iocoder.yudao.module.delivery.mapper.EcwVzMapper">
<delete id="deleteById2">
delete
from ecw_vz
where id = #{id}
</delete>
<!--2024-04-22-->
</mapper>
<?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="cn.iocoder.yudao.module.delivery.mapper.EmployeeMapper">
<select id="pageCC" resultType="cn.iocoder.yudao.module.delivery.entity.Employee">
select *
from employee ${ew.customSqlSegment}
</select>
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.delivery.entity.Employee">
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="emp_gender" property="empGender"/>
<result column="age" property="age"/>
<result column="email" property="email"/>
</resultMap>
<!-- 通用查询结果列 2024-04-22-->
<sql id="Base_Column_List">
id, name, emp_gender, age, email </sql>
</mapper>
...@@ -4,11 +4,14 @@ import java.util.*; ...@@ -4,11 +4,14 @@ import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO; import cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO;
import cn.iocoder.yudao.module.system.enums.permission.MenuIdEnum;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.depository.vo.warehouse.*; import cn.iocoder.yudao.module.depository.vo.warehouse.*;
import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseDO; import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseDO;
import org.slf4j.LoggerFactory;
/** /**
* 仓库 Convert * 仓库 Convert
...@@ -37,4 +40,7 @@ public interface WarehouseConvert { ...@@ -37,4 +40,7 @@ public interface WarehouseConvert {
List<RegionWarehouse> convertList03(List<RegionDO> list); List<RegionWarehouse> convertList03(List<RegionDO> list);
RegionWarehouse convert01(RegionDO bean); RegionWarehouse convert01(RegionDO bean);
List<WarehouseTreeRegionVO> convertTreeRegion(List<WarehouseTreeRegionVO> list);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment