Commit e859082c authored by lanbaoming's avatar lanbaoming

2024-04-22报表XML文件

parent 6041c564
...@@ -4,23 +4,17 @@ package cn.iocoder.yudao.module.delivery.controller.admin; ...@@ -4,23 +4,17 @@ package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.iocoder.yudao.framework.common.exception.ErrorCode; import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.delivery.entity.*; import cn.iocoder.yudao.module.delivery.entity.*;
import cn.iocoder.yudao.module.delivery.service.CustomerAnalysisService; import cn.iocoder.yudao.module.delivery.service.CustomerAnalysisService;
import cn.iocoder.yudao.module.delivery.service.EcwReportPermissionService; import cn.iocoder.yudao.module.delivery.service.EcwReportPermissionService;
import cn.iocoder.yudao.module.delivery.service.SalesReportService;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi; import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.bouncycastle.ocsp.Req;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
......
...@@ -3,12 +3,14 @@ package cn.iocoder.yudao.module.delivery.controller.admin; ...@@ -3,12 +3,14 @@ package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq; import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisResp;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq; import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp; import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp;
import cn.iocoder.yudao.module.delivery.service.SalesAnalysisService; import cn.iocoder.yudao.module.delivery.service.SalesAnalysisService;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -16,6 +18,9 @@ import org.springframework.web.bind.annotation.*; ...@@ -16,6 +18,9 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; 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.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
...@@ -33,17 +38,55 @@ public class SalesAnalysisControl { ...@@ -33,17 +38,55 @@ public class SalesAnalysisControl {
@Autowired @Autowired
private SalesAnalysisService salesAnalysisService; private SalesAnalysisService salesAnalysisService;
/*
数据字典项
*/
@Autowired
private DictDataApi dictDataApi;
/* /*
客户分析列表 lanbm 2024-04-02 add 客户分析列表 lanbm 2024-04-02 add
*/ */
@PostMapping("/getListPage") @GetMapping("/getListPage")
public CommonResult<PageResult<SalesAnalysisResp>> getListPage(@RequestBody SalesAnalysisReq Req) { public CommonResult<PageResult<SalesAnalysisResp>> getListPage(@Valid SalesAnalysisReq query) {
PageResult<SalesAnalysisResp> pageResult=
salesAnalysisService.getListPage(Req); /*
return success(pageResult); 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);
}
@GetMapping("/exportExcel") @GetMapping("/exportExcel")
@ApiOperation("导出销售分析数据") @ApiOperation("导出销售分析数据")
......
...@@ -3,9 +3,7 @@ package cn.iocoder.yudao.module.delivery.entity; ...@@ -3,9 +3,7 @@ package cn.iocoder.yudao.module.delivery.entity;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.bouncycastle.crypto.tls.SRTPProtectionProfile;
/* /*
客户分析报表 客户分析报表
......
package cn.iocoder.yudao.module.delivery.entity; 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 lanbm 2024-03-31 add
*/ */
public class SalesAnalysisReq { @Schema(description = "管理后台 - 销售分析查询参数")
@Data
@ToString(callSuper = true)
public class SalesAnalysisReq extends PageParam {
private int start;
private int size;
/* /*
订单编号 订单编号
......
package cn.iocoder.yudao.module.delivery.entity; 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 销售分析查询结果 lanbm 2024-04-02
*/ */
@ApiModel("管理后台-销售分析报表结果")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalesAnalysisResp { public class SalesAnalysisResp {
/*
排名编号
*/
private int px;
/* /*
订单编号 订单编号
*/ */
...@@ -39,16 +56,20 @@ public class SalesAnalysisResp { ...@@ -39,16 +56,20 @@ public class SalesAnalysisResp {
/* /*
客户经理 客户经理
*/ */
private String salesmanid;
private String salesmanidName;
/* /*
订单状态 订单状态
*/ */
private String status; private String status;
private String statusName;
/* /*
运输方式 运输方式
*/ */
private String transportId; private String transportId;
private String transportIdName;
/* /*
始发仓 始发仓
...@@ -70,17 +91,34 @@ public class SalesAnalysisResp { ...@@ -70,17 +91,34 @@ public class SalesAnalysisResp {
/* /*
渠道 渠道
*/ */
private String channelid;
private String channelidName;
/* /*
唛头 唛头
*/ */
private String marks; private String marks;
/*
入仓箱数
*/
private String sumquantity;
/*
入仓体积
*/
private String sumvolume;
/*
入仓重量
*/
private String sumweight;
/* /*
是否控货 是否控货
*/ */
private String isCargoControl; private String iscargocontrol;
/* /*
创建时间 创建时间
......
package cn.iocoder.yudao.module.delivery.mapper; package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.delivery.entity.CustomerAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq; import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp; import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* (SalesAnalysis)销售分析 * (SalesAnalysis)销售分析
* *
...@@ -14,6 +17,11 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,6 +17,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface SalesAnalysisMapper { public interface SalesAnalysisMapper {
PageResult<SalesAnalysisResp> getListPage(SalesAnalysisReq req); List<SalesAnalysisResp> getListPage(SalesAnalysisReq req);
/*
获取查询条件的总数
*/
Long GetCount(SalesAnalysisReq req);
} }
package cn.iocoder.yudao.module.delivery.service.Impl; package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.framework.common.pojo.PageResult; 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.SalesAnalysisReq; import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp; import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp;
import cn.iocoder.yudao.module.delivery.mapper.SalesAnalysisMapper; import cn.iocoder.yudao.module.delivery.mapper.SalesAnalysisMapper;
import cn.iocoder.yudao.module.delivery.service.SalesAnalysisService; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/* /*
lanbm 2024-04-01 lanbm 2024-04-01
*/ */
...@@ -17,7 +22,22 @@ public class SalesAnalysisImpl implements SalesAnalysisService { ...@@ -17,7 +22,22 @@ public class SalesAnalysisImpl implements SalesAnalysisService {
@Autowired @Autowired
private SalesAnalysisMapper salesAnalysisMapper; private SalesAnalysisMapper salesAnalysisMapper;
public PageResult<SalesAnalysisResp> getListPage(SalesAnalysisReq page) { public PageResult<SalesAnalysisResp> getListPage(SalesAnalysisReq req) {
return null;
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());
} }
} }
...@@ -5,5 +5,6 @@ import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq; ...@@ -5,5 +5,6 @@ import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq;
import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp; import cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp;
public interface SalesAnalysisService { public interface SalesAnalysisService {
PageResult<SalesAnalysisResp> getListPage(SalesAnalysisReq page); PageResult<SalesAnalysisResp> getListPage(SalesAnalysisReq page);
} }
<?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.CustomerAnalysisMapper">
<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,
(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),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),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) 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) from view_order_businesstime where customer_id = c.id and transport_id=3 and
business_time BETWEEN '${sduibidate}' AND '${eduibidate}') as sumweightTb3,
'4' as monthAvg,
'5' as monthAvgTb,
'6' as seaMonthAvg,
'7' as seaMonthAvgTb,
'8' as airMothAvg,
'9' as airMothAvgTb,
<!--重货 计算占比,不计算同步-->
(select round(sum(vz),2) from view_order_businesstime where customer_id = c.id and order_type=2 and
business_time BETWEEN '${sdate}' AND '${edate}') as weightSumV,
<!--泡货 计算占比,不计算同步-->
(select round(sum(vz),2) from view_order_businesstime where customer_id = c.id and order_type=3 and
business_time BETWEEN '${sdate}' AND '${edate}') as phSumV,
<!--控货 计算占比,不计算同步-->
(select round(sum(vz),2) from view_order_businesstime where customer_id = c.id and is_cargo_control=1 and
business_time BETWEEN '${sdate}' AND '${edate}') as khSumV,
(CASE WHEN c.is_new = 1 THEN '是' ELSE '否' END) as isFirst,
(if(c.is_new = 1,c.update_time,''))as firstDate,
<!--提货率 已提货箱数除总入库总箱数-->
(select sum(charge_quantity) from view_order_businesstime where customer_id = c.id and is_cargo_control=1 and
business_time BETWEEN '${sdate}' AND '${edate}') as chargequantity,
(select sum(pick_num) from view_order_businesstime where customer_id = c.id and is_cargo_control=1 and
business_time BETWEEN '${sdate}' AND '${edate}') 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.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"/>
ORDER BY allsumvolume desc limit #{start}, #{size}
</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="searchDataType1!=null and searchDataType1!=''
and searchDataType2!=null and searchDataType2!=''
and searchDataType3!=null and searchDataType3!=''">
<choose>
<when test="searchDataType2 =='1'.toString()">
and #{searchDataType1} >= #{searchDataType3}
</when>
<when test="searchDataType2 =='2'.toString()">
and #{searchDataType1} = #{searchDataType3}
</when>
</choose>
</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.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值-->
(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),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),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)*100 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)*100 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>
</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.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>
<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>
</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>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, emp_gender, age, email </sql>
</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.SalesAnalysisMapper">
<select id="getListPage"
parameterType="cn.iocoder.yudao.module.delivery.entity.SalesAnalysisReq"
resultType="cn.iocoder.yudao.module.delivery.entity.SalesAnalysisResp">
select order_no as orderNo, tidan_no as tidanNo,
status,salesman_id as salesmanid,transport_id,marks,
channel_id as channelid,channel.name_zh as channelidName,
create_time as createtime,sum_quantity as sumquantity,
sum_volume as sumvolume,sum_weight as sumweight,
is_cargo_control as iscargocontrol
from ecw_order c
left join (SELECT ewl.id AS line_id,ew_start.id AS start_warehouse_id,
ew_dest.id AS dst_warehouse_id,ew_start.title_zh AS start_title_zh,
ew_dest.title_zh AS dst_warehouse_name,
ew_start.title_zh AS start_warehouse_name FROM ecw_warehouse_line ewl
LEFT JOIN ecw_warehouse ew_start ON ewl.start_warehouse_id = ew_start.id
LEFT JOIN ecw_warehouse ew_dest ON ewl.dest_warehouse_id = ew_dest.id
) w ON w.line_id = c.line_id
<!--始发仓-->
left join ecw_order_departure de on de.order_id = c.order_id
<!--目的仓-->
left join ecw_order_objective ob on ob.order_id = c.order_id
<!--订单关联渠道信息-->
left join ecw_channel channel on channel.channel_id =c.channel_id
<!--订单发货人信息-->
left join ecw_order_consignor nor on nor.order_id = c.order_id
<!--订单收货人信息-->
left join ecw_order_consignee nee on nee.order_id = c.order_id
<include refid="WherePage"/>
limit 1,10
</select>
<sql id="WherePage">
<where>
and c.deleted = 0
</where>
</sql>
<select id="GetCount" resultType="java.lang.Long">
SELECT count(1)
from ecw_order c
<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.SalesReportMapper">
<select id="SalesReportCount" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp">
SELECT
(
SELECT
sum( sum_volume )
FROM
ecw_order
WHERE
is_del = 0
AND ( transport_id = 1 OR transport_id = 3 )
AND create_time BETWEEN '2023-01-01'
AND '2023-03-31'
) AS allsumvolume,
( SELECT sum( sum_volume ) FROM ecw_order WHERE is_del = 0 AND transport_id = 1 AND create_time BETWEEN '2023-01-01' AND '2023-03-31' ) AS sumvolume1,
( SELECT sum( sum_weight ) FROM ecw_order WHERE is_del = 0 AND transport_id = 3 AND create_time BETWEEN '2023-01-01' AND '2023-03-31' ) AS sumweight3
FROM
DUAL
</select>
<select id="FirstCustomerCount" resultType="int">
SELECT count(c.customer_id) as s_customer_id from ecw_order a
left join ecw_order_consignee c on a.order_id=c.order_id
left join ecw_customer cc on cc.id=c.customer_id
where cc.is_new=0 and
a.is_del=0 and a.status>0 and
a.create_time BETWEEN '2023-01-01' AND'2023-01-31'
and a.drawee=2
</select>
</mapper>
...@@ -21,7 +21,6 @@ import java.util.Date; ...@@ -21,7 +21,6 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class ReceiptDO extends BaseDO { public class ReceiptDO extends BaseDO {
/** /**
* 主键 * 主键
*/ */
......
...@@ -11,29 +11,19 @@ import java.util.Arrays; ...@@ -11,29 +11,19 @@ import java.util.Arrays;
@Getter @Getter
public enum ReceiptStatusEnum implements IntArrayValuable { public enum ReceiptStatusEnum implements IntArrayValuable {
DRAFT(0, "草稿", "DRAFT"), DRAFT(0, "草稿", "DRAFT"),
RECEIPT_WAITING(1, "待收款", "RECEIPT_WAITING"), RECEIPT_WAITING(1, "待收款", "RECEIPT_WAITING"),
WRITE_OFF_WAITING(2, "待核销", "write_off_waiting"), WRITE_OFF_WAITING(2, "待核销", "write_off_waiting"),
WRITE_OFF_PART_ING(3, "已部分核销", "write_off_part_ing"), WRITE_OFF_PART_ING(3, "已部分核销", "write_off_part_ing"),
WRITE_OFF_ALL_SUCCESS(4, "已核销", "WRITE_OFF_ALL_SUCCESS"), WRITE_OFF_ALL_SUCCESS(4, "已核销", "WRITE_OFF_ALL_SUCCESS"),
WRITE_OFF_ALL_OPENING(5, "已核销,待开票", "WRITE_OFF_ALL_OPENING"), WRITE_OFF_ALL_OPENING(5, "已核销,待开票", "WRITE_OFF_ALL_OPENING"),
OPEN_BILL(6, "已开票", "OPEN_BILL"), OPEN_BILL(6, "已开票", "OPEN_BILL"),
APPROVE_ING(7, "审核中", "APPROVE_ING"), APPROVE_ING(7, "审核中", "APPROVE_ING"),
APPROVE_FAIL(8, "审核失败", "APPROVE_FAIL"), APPROVE_FAIL(8, "审核失败", "APPROVE_FAIL"),
APPROVE_NEGATION(9, "反审核中", "APPROVE_NEGATION"), APPROVE_NEGATION(9, "反审核中", "APPROVE_NEGATION"),
WRITE_OFF_ALL_ING(10, "全部核销中", "WRITE_OFF_ALL_ING"), WRITE_OFF_ALL_ING(10, "全部核销中", "WRITE_OFF_ALL_ING"),
WRITE_OFF_ALL_NEGATION(11, "反核销审核中", "WRITE_OFF_ALL_NEGATION"), WRITE_OFF_ALL_NEGATION(11, "反核销审核中", "WRITE_OFF_ALL_NEGATION"),
; ;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ReceiptStatusEnum::getValue).toArray(); public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ReceiptStatusEnum::getValue).toArray();
/** /**
......
...@@ -485,6 +485,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO ...@@ -485,6 +485,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
@Override @Override
public void createFinanceReceiptWriteOff(FinanceReceiptVo financeReceiptVo) { public void createFinanceReceiptWriteOff(FinanceReceiptVo financeReceiptVo) {
ReceiptDO receiptDO = validateReceiptBmpStatus(financeReceiptVo.getReceiptId()); ReceiptDO receiptDO = validateReceiptBmpStatus(financeReceiptVo.getReceiptId());
//判断收款单下的收款明细是不是全部核销完成 //判断收款单下的收款明细是不是全部核销完成
LambdaQueryWrapper<ReceiptItemDO> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ReceiptItemDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
...@@ -533,7 +534,6 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO ...@@ -533,7 +534,6 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
} }
} }
//创建收款单核销流程 //创建收款单核销流程
ReceiptApprovalDO approvalDO = new ReceiptApprovalDO(); ReceiptApprovalDO approvalDO = new ReceiptApprovalDO();
approvalDO.setReceiptId(financeReceiptVo.getReceiptId()); approvalDO.setReceiptId(financeReceiptVo.getReceiptId());
...@@ -551,7 +551,8 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO ...@@ -551,7 +551,8 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
update.setId(financeReceiptVo.getReceiptId()); update.setId(financeReceiptVo.getReceiptId());
update.setBmpStatus(BpmProcessInstanceResultEnum.PROCESS.getResult()); update.setBmpStatus(BpmProcessInstanceResultEnum.PROCESS.getResult());
//计算出核销比例 //计算出核销比例
BigDecimal proportion = totalAmount.divide(receiptDO.getReceivableTotalAmount(), 8, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(6, BigDecimal.ROUND_HALF_UP); BigDecimal proportion =
totalAmount.divide(receiptDO.getReceivableTotalAmount(), 8, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(6, BigDecimal.ROUND_HALF_UP);
update.setWriteOffProportion(proportion); update.setWriteOffProportion(proportion);
update.setState(ReceiptStatusEnum.WRITE_OFF_ALL_ING.getValue()); update.setState(ReceiptStatusEnum.WRITE_OFF_ALL_ING.getValue());
update.setBmpId(bpmId); update.setBmpId(bpmId);
......
...@@ -5,7 +5,7 @@ import org.springframework.boot.SpringApplication; ...@@ -5,7 +5,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
@EnableUeditor //@EnableUeditor
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module"}) @SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module"})
public class YudaoServerApplication { public class YudaoServerApplication {
......
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