Commit 13545881 authored by liuzeheng's avatar liuzeheng

Merge remote-tracking branch 'origin/dev' into dev

parents 1e8d8540 870c4269
...@@ -9,6 +9,8 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; ...@@ -9,6 +9,8 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.copy.ProcessCopyPageReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.copy.ProcessCopyPageReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.copy.ProcessCopyRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.copy.ProcessCopyRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO;
import cn.iocoder.yudao.module.bpm.dal.mysql.task.BpmTaskExtMapper;
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService; import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -21,7 +23,9 @@ import org.springframework.web.bind.annotation.*; ...@@ -21,7 +23,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
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.web.core.util.WebFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
...@@ -42,6 +46,9 @@ public class BpmTaskController { ...@@ -42,6 +46,9 @@ public class BpmTaskController {
@Resource @Resource
private BpmProcessInstanceService processInstanceService; private BpmProcessInstanceService processInstanceService;
@Resource
private BpmTaskExtMapper taskExtMapper;
@GetMapping("todo-page") @GetMapping("todo-page")
@ApiOperation("获取 Todo 待办任务分页") @ApiOperation("获取 Todo 待办任务分页")
@PreAuthorize("@ss.hasPermission('bpm:task:query')") @PreAuthorize("@ss.hasPermission('bpm:task:query')")
...@@ -100,12 +107,22 @@ public class BpmTaskController { ...@@ -100,12 +107,22 @@ public class BpmTaskController {
//先校验流程是否同一类,然后批量审批 //先校验流程是否同一类,然后批量审批
//String jsonStr = JsonUtils.toJsonString(BpmList); //String jsonStr = JsonUtils.toJsonString(BpmList);
//JsonUtils.SaveLog("参数为:"+jsonStr); //JsonUtils.SaveLog("参数为:"+jsonStr);
long id= getLoginUserId(); long id = getLoginUserId();
for (BpmTaskApproveReqVO ReqVO : BpmList) { for (BpmTaskApproveReqVO ReqVO : BpmList) {
List<BpmTaskRespVO>taskList= //查询当前用户的待办任务
taskService.getTaskListByProcessInstanceId(ReqVO.getId()); List<BpmTaskExtDO> taskList1 =
if(taskList.size()>0) { taskExtMapper.selectListByProcessInstanceId(ReqVO.getId());
String sid=taskList.get(0).getId(); if (taskList1 == null || taskList1.size() == 0)
continue;
List<BpmTaskExtDO> taskList = taskList1.
stream().filter(t -> t.getAssigneeUserId() == id).
sorted(Comparator.comparingLong(BpmTaskExtDO::getId).reversed()).
collect(Collectors.toList());
if (taskList == null) continue;
if (taskList.size() > 0) {
String sid = taskList.get(0).getTaskId();
ReqVO.setId(sid); ReqVO.setId(sid);
//String jsonStr = JsonUtils.toJsonString(ReqVO); //String jsonStr = JsonUtils.toJsonString(ReqVO);
//JsonUtils.SaveLog("参数为:"+jsonStr); //JsonUtils.SaveLog("参数为:"+jsonStr);
...@@ -124,13 +141,20 @@ public class BpmTaskController { ...@@ -124,13 +141,20 @@ public class BpmTaskController {
@PreAuthorize("@ss.hasPermission('bpm:task:update')") @PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> rejectTask2(@Valid @RequestBody List<BpmTaskRejectReqVO> BpmList) { public CommonResult<Boolean> rejectTask2(@Valid @RequestBody List<BpmTaskRejectReqVO> BpmList) {
//先校验流程是否同一类,然后批量审批 //先校验流程是否同一类,然后批量审批
LoginUser l=SecurityFrameworkUtils.getLoginUser(); LoginUser l = SecurityFrameworkUtils.getLoginUser();
for (BpmTaskRejectReqVO reqVO : BpmList for (BpmTaskRejectReqVO reqVO : BpmList
) { ) {
List<BpmTaskRespVO>taskList= List<BpmTaskExtDO> taskList1 =
taskService.getTaskListByProcessInstanceId(reqVO.getId()); taskExtMapper.selectListByProcessInstanceId(reqVO.getId());
if(taskList.size()>0) { if (taskList1 == null || taskList1.size() == 0) continue;
String sid=taskList.get(0).getId();
List<BpmTaskExtDO> taskList = taskList1.stream().filter(t -> t.getAssigneeUserId() == l.getId()).
sorted(Comparator.comparingLong(BpmTaskExtDO::getId).reversed()).
collect(Collectors.toList());
if (taskList == null) continue;
if (taskList.size() > 0) {
String sid = taskList.get(0).getTaskId();
reqVO.setId(sid); reqVO.setId(sid);
taskService.rejectTask(l, reqVO); taskService.rejectTask(l, reqVO);
} }
......
...@@ -222,7 +222,8 @@ public class BpmTaskServiceImpl implements BpmTaskService { ...@@ -222,7 +222,8 @@ public class BpmTaskServiceImpl implements BpmTaskService {
@Override @Override
public List<BpmTaskRespVO> getTaskListByProcessInstanceId(String processInstanceId) { public List<BpmTaskRespVO> getTaskListByProcessInstanceId(String processInstanceId) {
// 获得任务列表 // 获得任务列表
List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery() List<HistoricTaskInstance> tasks =
historyService.createHistoricTaskInstanceQuery()
.processInstanceId(processInstanceId) .processInstanceId(processInstanceId)
.orderByHistoricTaskInstanceStartTime().desc() // 创建时间倒序 .orderByHistoricTaskInstanceStartTime().desc() // 创建时间倒序
.list(); .list();
...@@ -231,7 +232,9 @@ public class BpmTaskServiceImpl implements BpmTaskService { ...@@ -231,7 +232,9 @@ public class BpmTaskServiceImpl implements BpmTaskService {
} }
// 获得 TaskExtDO Map // 获得 TaskExtDO Map
List<BpmTaskExtDO> bpmTaskExtDOs = taskExtMapper.selectListByTaskIds(convertSet(tasks, HistoricTaskInstance::getId)); List<BpmTaskExtDO> bpmTaskExtDOs =
taskExtMapper.selectListByTaskIds(convertSet(tasks,
HistoricTaskInstance::getId));
Map<String, BpmTaskExtDO> bpmTaskExtDOMap = convertMap(bpmTaskExtDOs, BpmTaskExtDO::getTaskId); Map<String, BpmTaskExtDO> bpmTaskExtDOMap = convertMap(bpmTaskExtDOs, BpmTaskExtDO::getTaskId);
// 获得 ProcessInstance Map // 获得 ProcessInstance Map
......
package cn.iocoder.yudao.module.delivery.controller.admin; package cn.iocoder.yudao.module.delivery.controller.admin;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.delivery.entity.EcwVz; import cn.iocoder.yudao.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq; import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq;
...@@ -8,9 +9,13 @@ import cn.iocoder.yudao.module.delivery.listener.TestEvent; ...@@ -8,9 +9,13 @@ import cn.iocoder.yudao.module.delivery.listener.TestEvent;
import cn.iocoder.yudao.module.delivery.service.EcwVzService; import cn.iocoder.yudao.module.delivery.service.EcwVzService;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.delivery.service.OrderServiceExt;
import cn.iocoder.yudao.module.delivery.service.ZTestService; import cn.iocoder.yudao.module.delivery.service.ZTestService;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.service.order.OrderService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -22,6 +27,7 @@ import javax.validation.*; ...@@ -22,6 +27,7 @@ import javax.validation.*;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -44,6 +50,12 @@ public class EcwVzController { ...@@ -44,6 +50,12 @@ public class EcwVzController {
@Resource @Resource
private ZTestService zTestService; private ZTestService zTestService;
@Autowired
private OrderService orderService;
@Resource
private OrderServiceExt orderServiceExt;
@Resource @Resource
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
...@@ -144,10 +156,25 @@ public class EcwVzController { ...@@ -144,10 +156,25 @@ public class EcwVzController {
applicationContext.publishEvent(even); applicationContext.publishEvent(even);
*/ */
zTest m=new zTest();
m.setTestname("111"); zTest m = new zTest();
orderService.UpdateOrderYeJiType((long) 1, 1);
orderService.UpdateOrderVValue((long) 1, new BigDecimal(101), new Date());
ReceiveCustomerCalTypeEvent e = new ReceiveCustomerCalTypeEvent();
e.setCustomerId((long) 49345);
if (orderServiceExt.IsHavingOrder(e) == 0) {
m.setTestname("无业绩");
m.setCreatedate(new Date());
zTestService.save(m);
} else {
m.setTestname("有业绩");
m.setCreatedate(new Date()); m.setCreatedate(new Date());
zTestService.save(m); zTestService.save(m);
}
return success(true); return success(true);
} }
......
...@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.delivery.listener; ...@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.delivery.listener;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent;
import cn.iocoder.yudao.module.customer.service.customer.CustomerService; import cn.iocoder.yudao.module.customer.service.customer.CustomerService;
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.service.OrderServiceExt;
import cn.iocoder.yudao.module.delivery.service.ZTestService; import cn.iocoder.yudao.module.delivery.service.ZTestService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -26,6 +27,10 @@ public class CalculateCustomerType { ...@@ -26,6 +27,10 @@ public class CalculateCustomerType {
@Resource @Resource
private ZTestService zTestService; private ZTestService zTestService;
@Resource
private OrderServiceExt orderServiceExt;
/** /**
* 客户捞取监听事件 lanbm 2024-05-07 add * 客户捞取监听事件 lanbm 2024-05-07 add
* @param event * @param event
...@@ -34,7 +39,7 @@ public class CalculateCustomerType { ...@@ -34,7 +39,7 @@ public class CalculateCustomerType {
public void CalculateCustomerTypePushEvent( public void CalculateCustomerTypePushEvent(
CalculateCustomerTypeEvent event) { CalculateCustomerTypeEvent event) {
zTest m=new zTest(); zTest m=new zTest();
String sMsg="计算开始"; String sMsg="计算开始"+event.getCustomerId();
if (event.getNewCustomerService() == event.getOldCustomerService()) { if (event.getNewCustomerService() == event.getOldCustomerService()) {
//新客户经理和老客户经理是同一客户经理 //新客户经理和老客户经理是同一客户经理
//继续判断有无成交记录 //继续判断有无成交记录
...@@ -72,9 +77,13 @@ public class CalculateCustomerType { ...@@ -72,9 +77,13 @@ public class CalculateCustomerType {
1.线索2.意向3.成交 1.线索2.意向3.成交
*/ */
private boolean isHaving_TransactionRecords(CalculateCustomerTypeEvent event) { private boolean isHaving_TransactionRecords(CalculateCustomerTypeEvent event) {
if (event.getStatus() == 3)
return true; int c=orderServiceExt.IsHavingOrder(event);
else if (c==0)
return false; return false;
else
return true;
} }
} }
...@@ -45,7 +45,7 @@ public class CalculateOrderYeJiTypeListener { ...@@ -45,7 +45,7 @@ public class CalculateOrderYeJiTypeListener {
CalculateOrderYeJiTypeEvent event) { CalculateOrderYeJiTypeEvent event) {
zTest m=new zTest(); zTest m=new zTest();
String sMsg="计算业绩类型"; String sMsg="计算业绩类型"+event.getCustomerId();
OrderDO orderDO = orderService.getById(event.getOrderId()); OrderDO orderDO = orderService.getById(event.getOrderId());
if (orderDO == null) { if (orderDO == null) {
...@@ -74,6 +74,5 @@ public class CalculateOrderYeJiTypeListener { ...@@ -74,6 +74,5 @@ public class CalculateOrderYeJiTypeListener {
m.setCreatedate(new Date()); m.setCreatedate(new Date());
zTestService.save(m); zTestService.save(m);
} }
} }
...@@ -39,7 +39,7 @@ public class ReceiveCustomerCalTypeListener { ...@@ -39,7 +39,7 @@ public class ReceiveCustomerCalTypeListener {
//CustomerServiceImpl receiveCustomer 函数中触发,移交,系统分配,接收时判断 //CustomerServiceImpl receiveCustomer 函数中触发,移交,系统分配,接收时判断
//CustomerServiceImpl updateCustomer 函数中触发,完善客户信息 //CustomerServiceImpl updateCustomer 函数中触发,完善客户信息
zTest m=new zTest(); zTest m=new zTest();
String sMsg="接收客户"; String sMsg="接收客户"+event.getCustomerId();
if (event.getIsNew() == true) { if (event.getIsNew() == true) {
//移交接收前是新客户 //移交接收前是新客户
sMsg+=",新客户"; sMsg+=",新客户";
...@@ -67,11 +67,10 @@ public class ReceiveCustomerCalTypeListener { ...@@ -67,11 +67,10 @@ public class ReceiveCustomerCalTypeListener {
/* /*
判断客户是否有已入参订单 判断客户是否有已入参订单
select COUNT(id) from ecw_target_log where deleted = 0 and customer_id = 17442 select COUNT(id) from ecw_target_log where deleted = 0 and customer_id = 17442
需要在2个表中查询数据
*/ */
private boolean IsHavingRuCanOrder(ReceiveCustomerCalTypeEvent event) { private boolean IsHavingRuCanOrder(ReceiveCustomerCalTypeEvent event) {
//判断客户是否有已入参订单 //判断客户是否有已入参订单
//int a = orderServiceExt.IsHavingOrderConsignee(event);//收货方客户
//int b = orderServiceExt.IsHavingOrderConsignor(event);//发货方客户
int c=orderServiceExt.IsHavingOrder(event); int c=orderServiceExt.IsHavingOrder(event);
if (c==0) if (c==0)
return false; return false;
......
package cn.iocoder.yudao.module.delivery.mapper; package cn.iocoder.yudao.module.delivery.mapper;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent;
import cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt; import cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -21,4 +22,6 @@ public interface OrderExtMapper { ...@@ -21,4 +22,6 @@ public interface OrderExtMapper {
*/ */
int IsHavingOrder(ReceiveCustomerCalTypeEvent event); int IsHavingOrder(ReceiveCustomerCalTypeEvent event);
int IsHavingOrder(CalculateCustomerTypeEvent event);
} }
package cn.iocoder.yudao.module.delivery.service.Impl; package cn.iocoder.yudao.module.delivery.service.Impl;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent;
import cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt; import cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt;
import cn.iocoder.yudao.module.delivery.mapper.OrderExtMapper; import cn.iocoder.yudao.module.delivery.mapper.OrderExtMapper;
...@@ -38,4 +39,8 @@ public class OrderServiceExtImpl implements OrderServiceExt { ...@@ -38,4 +39,8 @@ public class OrderServiceExtImpl implements OrderServiceExt {
return orderExtMapper.IsHavingOrder(event); return orderExtMapper.IsHavingOrder(event);
} }
public int IsHavingOrder(CalculateCustomerTypeEvent event) {
return orderExtMapper.IsHavingOrder(event);
}
} }
package cn.iocoder.yudao.module.delivery.service; package cn.iocoder.yudao.module.delivery.service;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent;
//import cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt; //import cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt;
...@@ -24,4 +25,6 @@ public interface OrderServiceExt { ...@@ -24,4 +25,6 @@ public interface OrderServiceExt {
*/ */
int IsHavingOrder(ReceiveCustomerCalTypeEvent event); int IsHavingOrder(ReceiveCustomerCalTypeEvent event);
int IsHavingOrder(CalculateCustomerTypeEvent event);
} }
...@@ -28,10 +28,17 @@ ...@@ -28,10 +28,17 @@
<select id="IsHavingOrder" resultType="java.lang.Integer"> <select id="IsHavingOrder" resultType="java.lang.Integer">
select COUNT(id) SELECT COUNT(*)
from (
select id as id
from ecw_target_log from ecw_target_log
where deleted = 0 where deleted = 0
and customer_id = #{customerId} and customer_id = #{customerId}
UNION
SELECT order_id as id
from ecw_order
where deleted = 0
and customer_id = #{customerId}) as a
</select> </select>
......
...@@ -5,75 +5,95 @@ ...@@ -5,75 +5,95 @@
<select id="SalesReportCountAll" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportRespAll"> <select id="SalesReportCountAll" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportRespAll">
SELECT ( SELECT (
SELECT sum(if(transport_id = 1, sum_volume, sum_weight)) SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3) AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDate} AND #{eDate} AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue, ) AS curValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight)) (SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3) AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue, AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight)) (SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3) AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue, AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue,
( (
SELECT sum(sum_volume) SELECT sum(sum_volume)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 1 AND transport_id = 1
AND rucang_time BETWEEN #{sDate} AND #{eDate} AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue1, ) AS curValue1,
(SELECT sum(sum_volume) (SELECT sum(sum_volume)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 1 AND transport_id = 1
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue1, AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue1,
(SELECT round(sum(sum_volume) / (SELECT vz FROM ecw_vz WHERE fuhao = 'M3' LIMIT 1), 2) (SELECT round(sum(sum_volume) / (SELECT vz FROM ecw_vz WHERE fuhao = 'M3' LIMIT 1), 2)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 1 AND transport_id = 1
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue1, AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue1,
(SELECT round(sum(sum_weight) / (SELECT vz FROM ecw_vz WHERE fuhao = 'KG' LIMIT 1), 2) (SELECT round(sum(sum_weight) / (SELECT vz FROM ecw_vz WHERE fuhao = 'KG' LIMIT 1), 2)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 3 AND transport_id = 3
AND rucang_time BETWEEN #{sDate} AND #{eDate} AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue3, ) AS curValue3,
(SELECT sum(sum_weight) (SELECT sum(sum_weight)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 3 AND transport_id = 3
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue3, AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue3,
(SELECT sum(sum_weight) (SELECT sum(sum_weight)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 3 AND transport_id = 3
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue3 AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue3
FROM DUAL FROM DUAL
</select> </select>
<select id="SalesReportCount" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp"> <select id="SalesReportCount" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp">
SELECT ( SELECT (
SELECT sum(if(transport_id = 1, sum_volume, sum_weight)) SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3) AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDate} AND #{eDate} AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue, ) AS curValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight)) (SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3) AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue, AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight)) (SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3) AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue
FROM DUAL FROM DUAL
</select> </select>
...@@ -81,21 +101,26 @@ ...@@ -81,21 +101,26 @@
<select id="SalesReportCountSea" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp"> <select id="SalesReportCountSea" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp">
SELECT ( SELECT (
SELECT sum(sum_volume) SELECT sum(sum_volume)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 1 AND transport_id = 1
AND rucang_time BETWEEN #{sDate} AND #{eDate} AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue, ) AS curValue,
(SELECT sum(sum_volume) (SELECT sum(sum_volume)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 1 AND transport_id = 1
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue, AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue,
(SELECT sum(sum_volume) (SELECT sum(sum_volume)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 1 AND transport_id = 1
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue
FROM DUAL FROM DUAL
</select> </select>
...@@ -103,22 +128,27 @@ ...@@ -103,22 +128,27 @@
<select id="SalesReportCountAir" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp"> <select id="SalesReportCountAir" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp">
SELECT ( SELECT (
SELECT sum(sum_weight) SELECT sum(sum_weight)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 3 AND transport_id = 3
AND rucang_time BETWEEN #{sDate} AND #{eDate} AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue, ) AS curValue,
(SELECT sum(sum_weight) (SELECT sum(sum_weight)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 3 AND transport_id = 3
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue, AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue,
(SELECT sum(sum_weight) (SELECT sum(sum_weight)
FROM ecw_order FROM ecw_order c
WHERE is_del = 0 WHERE is_del = 0
AND transport_id = 3 AND transport_id = 3
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue
FROM DUAL FROM DUAL
</select> </select>
...@@ -155,7 +185,15 @@ ...@@ -155,7 +185,15 @@
</where> </where>
</select> </select>
<sql id="WherePage">
<if test="salesmanid!=null and salesmanid!=''">
and c.salesman_id= #{salesmanid}
</if>
<if test="deptid!=null and deptid!=''">
and c.salesman_id in
(SELECT id from system_user where dept_id =#{deptid} )
</if>
</sql>
</mapper> </mapper>
...@@ -6003,7 +6003,8 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -6003,7 +6003,8 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
lanbm 2024-05-13 add lanbm 2024-05-13 add
*/ */
@Update("update ecw_order set yeji_type=#{yejiType} where order_id = #{orderId}") @Update("update ecw_order set yeji_type=#{yejiType} where order_id = #{orderId}")
void UpdateOrderYeJiType(@Param("orderId") Long orderId,int yejiType); void UpdateOrderYeJiType(@Param("orderId") Long orderId,
@Param("yejiType") int yejiType);
/* /*
...@@ -6011,8 +6012,9 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -6011,8 +6012,9 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
yeji_create_date 业绩产生时间 yeji_create_date 业绩产生时间
简单的SQL语句用SQL注解来写比较方便 简单的SQL语句用SQL注解来写比较方便
*/ */
@Update("update ecw_order set cal_v_value=#{yejiType},yeji_create_date=#{yejiCreateDate} where order_id = #{orderId}") @Update("update ecw_order set cal_v_value=#{calVvalue},yeji_create_date=#{yejiCreateDate} where order_id = #{orderId}")
void UpdateOrderVValue(@Param("orderId") Long orderId,BigDecimal calVvalue,Date void UpdateOrderVValue(@Param("orderId") Long orderId,
yejiCreateDate); @Param("calVvalue") BigDecimal calVvalue,
@Param("yejiCreateDate") Date yejiCreateDate);
} }
...@@ -5,8 +5,8 @@ import cn.hutool.core.date.DateUtil; ...@@ -5,8 +5,8 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.apollo.core.dto.OrderDto; import cn.iocoder.yudao.framework.apollo.core.dto.OrderDto;
import cn.iocoder.yudao.framework.apollo.core.event.*; import cn.iocoder.yudao.framework.apollo.core.event.*;
//import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderVValueEvent; import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderVValueEvent;
//import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiTypeEvent;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.util.bigDecimal.BigDecimalUtils; import cn.iocoder.yudao.framework.common.util.bigDecimal.BigDecimalUtils;
import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
...@@ -420,11 +420,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -420,11 +420,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderBusinessService.addOrderOperateLog(order.getOrderId(), "新建订单", null); orderBusinessService.addOrderOperateLog(order.getOrderId(), "新建订单", null);
//lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型 //lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型
/*
CalculateOrderYeJiTypeEvent even = new CalculateOrderYeJiTypeEvent(); CalculateOrderYeJiTypeEvent even = new CalculateOrderYeJiTypeEvent();
even.setOrderId(order.getOrderId()); even.setOrderId(order.getOrderId());
applicationContext.publishEvent(even); applicationContext.publishEvent(even);
*/
// 返回 // 返回
return order; return order;
} }
...@@ -1667,19 +1665,16 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1667,19 +1665,16 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
"编辑订单", null); "编辑订单", null);
//lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型 //lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型
/* Long orderId = updateReqVO.getOrderId(); Long orderId = updateReqVO.getOrderId();
CalculateOrderYeJiTypeEvent even = new CalculateOrderYeJiTypeEvent(); CalculateOrderYeJiTypeEvent even = new CalculateOrderYeJiTypeEvent();
even.setOrderId(orderId); even.setOrderId(orderId);
applicationContext.publishEvent(even); applicationContext.publishEvent(even);
*/
//end lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型 //end lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型
//入仓完成,计算V值 lanbm 2024-05-13 add //入仓完成,计算V值 lanbm 2024-05-13 add
/*
CalculateOrderVValueEvent event=new CalculateOrderVValueEvent(); CalculateOrderVValueEvent event=new CalculateOrderVValueEvent();
event.setOrderId(updateObj.getOrderId()); event.setOrderId(updateObj.getOrderId());
applicationContext.publishEvent(event);*/ applicationContext.publishEvent(event);
//end 入仓完成,计算V值 lanbm 2024-05-13 add //end 入仓完成,计算V值 lanbm 2024-05-13 add
} }
...@@ -3365,7 +3360,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -3365,7 +3360,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
receivableService.verificationReceivableIsWriteOff(orderDO.getOrderId(), null); receivableService.verificationReceivableIsWriteOff(orderDO.getOrderId(), null);
List<OrderItemDO> orderItemDOList = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>().eq(OrderItemDO::getOrderId, orderDO.getOrderId())); List<OrderItemDO> orderItemDOList = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>().eq(OrderItemDO::getOrderId, orderDO.getOrderId()));
List<OrderItemInWarehouseVO> orderItemInWarehouseVOList = orderWarehouseInVO.getOrderItemInWarehouseVOList(); List<OrderItemInWarehouseVO> orderItemInWarehouseVOList =
orderWarehouseInVO.getOrderItemInWarehouseVOList();
if (CollectionUtil.isNotEmpty(orderItemInWarehouseVOList) && CollectionUtil.isNotEmpty(orderItemDOList)) { if (CollectionUtil.isNotEmpty(orderItemInWarehouseVOList) && CollectionUtil.isNotEmpty(orderItemDOList)) {
orderItemInWarehouseVOList.forEach(vo -> { orderItemInWarehouseVOList.forEach(vo -> {
......
...@@ -303,12 +303,14 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -303,12 +303,14 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean createOrderWarehouseIn(@Valid OrderWarehouseInCreateReqVO createReqVO) { public boolean createOrderWarehouseIn(@Valid OrderWarehouseInCreateReqVO
createReqVO) {
Long orderId = createReqVO.getOrderId(); Long orderId = createReqVO.getOrderId();
Long brand = createReqVO.getBrand(); Long brand = createReqVO.getBrand();
Long orderItemId = createReqVO.getOrderItemId(); Long orderItemId = createReqVO.getOrderItemId();
List<OrderWarehouseInItemDto> orderWarehouseInItemDoList = createReqVO.getOrderWarehouseInItemDoList(); List<OrderWarehouseInItemDto> orderWarehouseInItemDoList =
createReqVO.getOrderWarehouseInItemDoList();
// 非下单货物,请求中包含 // 非下单货物,请求中包含
String prodTitleZh = createReqVO.getProdTitleZh(); String prodTitleZh = createReqVO.getProdTitleZh();
...@@ -355,7 +357,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -355,7 +357,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
} }
// 若已经存在入仓纪录,则就是追加。 // 若已经存在入仓纪录,则就是追加。
List<OrderWarehouseInDO> orderWarehouseInDOS = orderWarehouseInMapper.selectList(new LambdaQueryWrapperX<OrderWarehouseInDO>() List<OrderWarehouseInDO> orderWarehouseInDOS =
orderWarehouseInMapper.selectList(new LambdaQueryWrapperX<OrderWarehouseInDO>()
.eq(OrderWarehouseInDO::getOrderId, orderId).eq(OrderWarehouseInDO::getOrderItemId, orderItemId)); .eq(OrderWarehouseInDO::getOrderId, orderId).eq(OrderWarehouseInDO::getOrderItemId, orderItemId));
boolean isAppend = CollectionUtil.isNotEmpty(orderWarehouseInDOS); boolean isAppend = CollectionUtil.isNotEmpty(orderWarehouseInDOS);
...@@ -452,8 +455,13 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -452,8 +455,13 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
* @param isUpdateWarehouseProdAttrIds * @param isUpdateWarehouseProdAttrIds
* @return 返回订单项id * @return 返回订单项id
*/ */
private Long doSaveOrUpdateOrderWarehouseInDo(OrderWarehouseInCreateReqVO createReqVO, Long orderId, Long orderItemId, OrderDO orderDO, private Long doSaveOrUpdateOrderWarehouseInDo(
List<String> pictureUrls, boolean isDeleteNotInWarehouseIn, boolean isUpdateWarehouseProdAttrIds) { OrderWarehouseInCreateReqVO createReqVO,
Long orderId, Long orderItemId, OrderDO orderDO,
List<String> pictureUrls, boolean isDeleteNotInWarehouseIn,
boolean isUpdateWarehouseProdAttrIds) {
//lanbm 2024-05-21 添加注释
boolean isAddNewOrderItem = createReqVO.getType() != 0; boolean isAddNewOrderItem = createReqVO.getType() != 0;
OrderItemDO orderItemDO; OrderItemDO orderItemDO;
...@@ -2656,7 +2664,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -2656,7 +2664,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
updateReqVO.getPictureUrls(), updateReqVO.getPictureUrls(),
false, false,
true);*/ true);*/
//对明细做修改
this.doSaveOrUpdateOrderWarehouseInDo(orderWarehouseInCreateReqVO, this.doSaveOrUpdateOrderWarehouseInDo(orderWarehouseInCreateReqVO,
orderId, orderItemId, orderDO, orderId, orderItemId, orderDO,
updateReqVO.getPictureUrls(), updateReqVO.getPictureUrls(),
......
...@@ -293,6 +293,7 @@ public class BoxPreloadGoodsController { ...@@ -293,6 +293,7 @@ public class BoxPreloadGoodsController {
@ApiOperation("下载预装单") @ApiOperation("下载预装单")
@ApiImplicitParam(name = "shipmentId", value = "出货单ID", required = true, example = "20", dataTypeClass = Long.class) @ApiImplicitParam(name = "shipmentId", value = "出货单ID", required = true, example = "20", dataTypeClass = Long.class)
public CommonResult<String> downloadPreloadGoodsList(@RequestParam("shipmentId") Long shipmentId, HttpServletResponse response) throws Exception { public CommonResult<String> downloadPreloadGoodsList(@RequestParam("shipmentId") Long shipmentId, HttpServletResponse response) throws Exception {
//预装单 lanbm 2024-05-22 处理问题
BoxDO box = boxService.getBox(shipmentId); BoxDO box = boxService.getBox(shipmentId);
FileMakeReqDTO reqDTO = new FileMakeReqDTO(); FileMakeReqDTO reqDTO = new FileMakeReqDTO();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
......
...@@ -273,6 +273,7 @@ public class DownloadLogServiceImpl extends AbstractService<DownloadLogMapper, D ...@@ -273,6 +273,7 @@ public class DownloadLogServiceImpl extends AbstractService<DownloadLogMapper, D
break; break;
// ......不同类型的文件制作 // ......不同类型的文件制作
case SHIPMENT_PRELOAD_EXCEL_EXPORT: case SHIPMENT_PRELOAD_EXCEL_EXPORT:
//预装单导出 lanbm 2024-05-22 添加注释
shipmentPreloadExcelExportPushEvent(downloadLog); shipmentPreloadExcelExportPushEvent(downloadLog);
break; break;
//异常订单导出 //异常订单导出
...@@ -339,9 +340,11 @@ public class DownloadLogServiceImpl extends AbstractService<DownloadLogMapper, D ...@@ -339,9 +340,11 @@ public class DownloadLogServiceImpl extends AbstractService<DownloadLogMapper, D
shipmentSummeryExcelExportPushEvent(downloadLog); shipmentSummeryExcelExportPushEvent(downloadLog);
break; break;
case SHIPMENT_SEA_PRELOAD_EXCEL_EXPORT: case SHIPMENT_SEA_PRELOAD_EXCEL_EXPORT:
//海运预装单导出,lanbm 2024-05-22 添加注释
shipmentSeaPreloadExcelExportPushEvent(downloadLog); shipmentSeaPreloadExcelExportPushEvent(downloadLog);
break; break;
case SHIPMENT_AIR_LOAD_EXCEL_EXPORT: case SHIPMENT_AIR_LOAD_EXCEL_EXPORT:
//空运预装单 lanbm 2024-05-22 添加注释
shipmentAirLoadExcelExportPushEvent(downloadLog); shipmentAirLoadExcelExportPushEvent(downloadLog);
break; break;
case ACHIEVEMENT_DETAIL_EXCEL_EXPORT: case ACHIEVEMENT_DETAIL_EXCEL_EXPORT:
......
...@@ -100,7 +100,9 @@ public class PayableServiceImpl extends AbstractService<PayableMapper, PayableDO ...@@ -100,7 +100,9 @@ public class PayableServiceImpl extends AbstractService<PayableMapper, PayableDO
} }
@Override @Override
public PageResult<PayableOrderBackVo> getPayablePage(PayableQueryVO query, PageVO page) { public PageResult<PayableOrderBackVo> getPayablePage(PayableQueryVO query,
PageVO page) {
List<AdminUserDO> ListUser = adminUserService.getUsersList(); List<AdminUserDO> ListUser = adminUserService.getUsersList();
Map<Long, String> userMap = Map<Long, String> userMap =
ListUser.stream().collect( ListUser.stream().collect(
...@@ -118,6 +120,48 @@ public class PayableServiceImpl extends AbstractService<PayableMapper, PayableDO ...@@ -118,6 +120,48 @@ public class PayableServiceImpl extends AbstractService<PayableMapper, PayableDO
queryWrapper.eq(StringUtils.isNotBlank(query.getTransportId()), "a.transport_id", query.getTransportId()); queryWrapper.eq(StringUtils.isNotBlank(query.getTransportId()), "a.transport_id", query.getTransportId());
queryWrapper.eq(StringUtils.isNotBlank(query.getDepartureId()), "a.start_warehouse_id", query.getDepartureId()); queryWrapper.eq(StringUtils.isNotBlank(query.getDepartureId()), "a.start_warehouse_id", query.getDepartureId());
queryWrapper.eq(StringUtils.isNotBlank(query.getObjectiveId()), "a.dest_warehouse_id", query.getObjectiveId()); queryWrapper.eq(StringUtils.isNotBlank(query.getObjectiveId()), "a.dest_warehouse_id", query.getObjectiveId());
//lanbm 2024-05-22 添加的查询条件
if (query.getBeginCreateTime() != null &&
query.getEndCreateTime() != null) {
if (query.getDateType() == 1) {
//预装时间,
queryWrapper.between("b.yz_date",
query.getBeginCreateTime(), query.getEndCreateTime());
} else if (query.getDateType() == 2) {
//装柜时间,
queryWrapper.between("b.zg_date",
query.getBeginCreateTime(), query.getEndCreateTime());
} else if (query.getDateType() == 3) {
//起运时间
queryWrapper.between("b.qy_date",
query.getBeginCreateTime(), query.getEndCreateTime());
} else if (query.getDateType() == 4) {
//到港时间
queryWrapper.between("b.dg_date",
query.getBeginCreateTime(), query.getEndCreateTime());
} else if (query.getDateType() == 5) {
//清关时间
queryWrapper.between("b.qg_date",
query.getBeginCreateTime(), query.getEndCreateTime());
} else if (query.getDateType() == 6) {
//卸柜时间
queryWrapper.between("b.th_date",
query.getBeginCreateTime(), query.getEndCreateTime());
} else if (query.getDateType() == 7) {
//费用产生时间
queryWrapper.between("a.freecsdate",
query.getBeginCreateTime(), query.getEndCreateTime());
}
}
//queryWrapper.between()
payableMapper.selectListPage(mpPage, queryWrapper); payableMapper.selectListPage(mpPage, queryWrapper);
//lanbm 2024-05-17 add //lanbm 2024-05-17 add
...@@ -129,22 +173,18 @@ public class PayableServiceImpl extends AbstractService<PayableMapper, PayableDO ...@@ -129,22 +173,18 @@ public class PayableServiceImpl extends AbstractService<PayableMapper, PayableDO
v.setTransportTypeName("专线空运"); v.setTransportTypeName("专线空运");
} }
String sCreator=""; String sCreator = "";
if(v.getCreator()==null) { if (v.getCreator() == null) {
v.setCreator(""); v.setCreator("");
} } else {
else long l = Long.parseLong(v.getCreator());
{
long l=Long.parseLong(v.getCreator());
v.setCreator(userMap.get(l)); v.setCreator(userMap.get(l));
} }
if(v.getUpdater()==null) { if (v.getUpdater() == null) {
v.setUpdater(""); v.setUpdater("");
} } else {
else long l = Long.parseLong(v.getUpdater());
{
long l=Long.parseLong(v.getUpdater());
v.setUpdater(userMap.get(l)); v.setUpdater(userMap.get(l));
} }
} }
......
...@@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat; ...@@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data @Data
...@@ -76,11 +77,11 @@ public class PayableQueryVO { ...@@ -76,11 +77,11 @@ public class PayableQueryVO {
@ApiModelProperty(value = "发票号") @ApiModelProperty(value = "发票号")
private String invoiceNumber; private String invoiceNumber;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@ApiModelProperty(value = "开始创建时间") @ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime; private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@ApiModelProperty(value = "结束创建时间") @ApiModelProperty(value = "结束创建时间")
private Date endCreateTime; private Date endCreateTime;
...@@ -100,4 +101,9 @@ public class PayableQueryVO { ...@@ -100,4 +101,9 @@ public class PayableQueryVO {
@ApiModelProperty(value = "客户名称") @ApiModelProperty(value = "客户名称")
private String customerName; private String customerName;
/*
时间节点查询类型
*/
private int dateType;
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.wealth.dal.mysql.payable.PayableMapper"> <mapper namespace="cn.iocoder.yudao.module.wealth.dal.mysql.payable.PayableMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="selectListPage" resultType="cn.iocoder.yudao.module.wealth.vo.payable.PayableOrderBackVo"> <select id="selectListPage" resultType="cn.iocoder.yudao.module.wealth.vo.payable.PayableOrderBackVo">
select a.*,b.shipment_status_air as shipmentStatusAir, select a.*,
b.shipment_status_air as shipmentStatusAir,
b.shipment_status as shipmentStatus b.shipment_status as shipmentStatus
from ecw_payable a from ecw_payable a
left join ecw_box b on a.payable_no =b.self_no and b.deleted=0 left join ecw_box b on a.payable_no = b.self_no and b.deleted = 0
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
</mapper> </mapper>
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