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;
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.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.BpmTaskService;
import io.swagger.annotations.Api;
......@@ -21,7 +23,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Comparator;
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.web.core.util.WebFrameworkUtils.getLoginUserId;
......@@ -42,6 +46,9 @@ public class BpmTaskController {
@Resource
private BpmProcessInstanceService processInstanceService;
@Resource
private BpmTaskExtMapper taskExtMapper;
@GetMapping("todo-page")
@ApiOperation("获取 Todo 待办任务分页")
@PreAuthorize("@ss.hasPermission('bpm:task:query')")
......@@ -100,12 +107,22 @@ public class BpmTaskController {
//先校验流程是否同一类,然后批量审批
//String jsonStr = JsonUtils.toJsonString(BpmList);
//JsonUtils.SaveLog("参数为:"+jsonStr);
long id= getLoginUserId();
long id = getLoginUserId();
for (BpmTaskApproveReqVO ReqVO : BpmList) {
List<BpmTaskRespVO>taskList=
taskService.getTaskListByProcessInstanceId(ReqVO.getId());
if(taskList.size()>0) {
String sid=taskList.get(0).getId();
//查询当前用户的待办任务
List<BpmTaskExtDO> taskList1 =
taskExtMapper.selectListByProcessInstanceId(ReqVO.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);
//String jsonStr = JsonUtils.toJsonString(ReqVO);
//JsonUtils.SaveLog("参数为:"+jsonStr);
......@@ -124,13 +141,20 @@ public class BpmTaskController {
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> rejectTask2(@Valid @RequestBody List<BpmTaskRejectReqVO> BpmList) {
//先校验流程是否同一类,然后批量审批
LoginUser l=SecurityFrameworkUtils.getLoginUser();
LoginUser l = SecurityFrameworkUtils.getLoginUser();
for (BpmTaskRejectReqVO reqVO : BpmList
) {
List<BpmTaskRespVO>taskList=
taskService.getTaskListByProcessInstanceId(reqVO.getId());
if(taskList.size()>0) {
String sid=taskList.get(0).getId();
List<BpmTaskExtDO> taskList1 =
taskExtMapper.selectListByProcessInstanceId(reqVO.getId());
if (taskList1 == null || taskList1.size() == 0) continue;
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);
taskService.rejectTask(l, reqVO);
}
......@@ -144,7 +168,7 @@ public class BpmTaskController {
@Idempotent(timeout = 5)
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> rejectTask(@Valid @RequestBody
BpmTaskRejectReqVO reqVO) {
BpmTaskRejectReqVO reqVO) {
taskService.rejectTask(SecurityFrameworkUtils.getLoginUser(), reqVO);
return success(true);
}
......
......@@ -222,7 +222,8 @@ public class BpmTaskServiceImpl implements BpmTaskService {
@Override
public List<BpmTaskRespVO> getTaskListByProcessInstanceId(String processInstanceId) {
// 获得任务列表
List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery()
List<HistoricTaskInstance> tasks =
historyService.createHistoricTaskInstanceQuery()
.processInstanceId(processInstanceId)
.orderByHistoricTaskInstanceStartTime().desc() // 创建时间倒序
.list();
......@@ -231,7 +232,9 @@ public class BpmTaskServiceImpl implements BpmTaskService {
}
// 获得 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);
// 获得 ProcessInstance Map
......
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.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq;
......@@ -8,9 +9,13 @@ import cn.iocoder.yudao.module.delivery.listener.TestEvent;
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 cn.iocoder.yudao.module.delivery.service.OrderServiceExt;
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.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.*;
......@@ -22,6 +27,7 @@ import javax.validation.*;
import io.swagger.v3.oas.annotations.Operation;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -44,6 +50,12 @@ public class EcwVzController {
@Resource
private ZTestService zTestService;
@Autowired
private OrderService orderService;
@Resource
private OrderServiceExt orderServiceExt;
@Resource
private ApplicationContext applicationContext;
......@@ -144,10 +156,25 @@ public class EcwVzController {
applicationContext.publishEvent(even);
*/
zTest m=new zTest();
m.setTestname("111");
m.setCreatedate(new Date());
zTestService.save(m);
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());
zTestService.save(m);
}
return success(true);
}
......
......@@ -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.module.customer.service.customer.CustomerService;
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 lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
......@@ -26,6 +27,10 @@ public class CalculateCustomerType {
@Resource
private ZTestService zTestService;
@Resource
private OrderServiceExt orderServiceExt;
/**
* 客户捞取监听事件 lanbm 2024-05-07 add
* @param event
......@@ -34,7 +39,7 @@ public class CalculateCustomerType {
public void CalculateCustomerTypePushEvent(
CalculateCustomerTypeEvent event) {
zTest m=new zTest();
String sMsg="计算开始";
String sMsg="计算开始"+event.getCustomerId();
if (event.getNewCustomerService() == event.getOldCustomerService()) {
//新客户经理和老客户经理是同一客户经理
//继续判断有无成交记录
......@@ -72,9 +77,13 @@ public class CalculateCustomerType {
1.线索2.意向3.成交
*/
private boolean isHaving_TransactionRecords(CalculateCustomerTypeEvent event) {
if (event.getStatus() == 3)
return true;
else
int c=orderServiceExt.IsHavingOrder(event);
if (c==0)
return false;
else
return true;
}
}
......@@ -45,7 +45,7 @@ public class CalculateOrderYeJiTypeListener {
CalculateOrderYeJiTypeEvent event) {
zTest m=new zTest();
String sMsg="计算业绩类型";
String sMsg="计算业绩类型"+event.getCustomerId();
OrderDO orderDO = orderService.getById(event.getOrderId());
if (orderDO == null) {
......@@ -74,6 +74,5 @@ public class CalculateOrderYeJiTypeListener {
m.setCreatedate(new Date());
zTestService.save(m);
}
}
......@@ -39,7 +39,7 @@ public class ReceiveCustomerCalTypeListener {
//CustomerServiceImpl receiveCustomer 函数中触发,移交,系统分配,接收时判断
//CustomerServiceImpl updateCustomer 函数中触发,完善客户信息
zTest m=new zTest();
String sMsg="接收客户";
String sMsg="接收客户"+event.getCustomerId();
if (event.getIsNew() == true) {
//移交接收前是新客户
sMsg+=",新客户";
......@@ -67,11 +67,10 @@ public class ReceiveCustomerCalTypeListener {
/*
判断客户是否有已入参订单
select COUNT(id) from ecw_target_log where deleted = 0 and customer_id = 17442
需要在2个表中查询数据
*/
private boolean IsHavingRuCanOrder(ReceiveCustomerCalTypeEvent event) {
//判断客户是否有已入参订单
//int a = orderServiceExt.IsHavingOrderConsignee(event);//收货方客户
//int b = orderServiceExt.IsHavingOrderConsignor(event);//发货方客户
int c=orderServiceExt.IsHavingOrder(event);
if (c==0)
return false;
......
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.module.delivery.entity.orderdata.OrderExt;
import org.apache.ibatis.annotations.Mapper;
......@@ -21,4 +22,6 @@ public interface OrderExtMapper {
*/
int IsHavingOrder(ReceiveCustomerCalTypeEvent event);
int IsHavingOrder(CalculateCustomerTypeEvent event);
}
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.module.delivery.entity.orderdata.OrderExt;
import cn.iocoder.yudao.module.delivery.mapper.OrderExtMapper;
......@@ -38,4 +39,8 @@ public class OrderServiceExtImpl implements OrderServiceExt {
return orderExtMapper.IsHavingOrder(event);
}
public int IsHavingOrder(CalculateCustomerTypeEvent event) {
return orderExtMapper.IsHavingOrder(event);
}
}
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.module.delivery.entity.orderdata.OrderExt;
......@@ -24,4 +25,6 @@ public interface OrderServiceExt {
*/
int IsHavingOrder(ReceiveCustomerCalTypeEvent event);
int IsHavingOrder(CalculateCustomerTypeEvent event);
}
......@@ -28,10 +28,17 @@
<select id="IsHavingOrder" resultType="java.lang.Integer">
select COUNT(id)
from ecw_target_log
where deleted = 0
and customer_id = #{customerId}
SELECT COUNT(*)
from (
select id as id
from ecw_target_log
where deleted = 0
and customer_id = #{customerId}
UNION
SELECT order_id as id
from ecw_order
where deleted = 0
and customer_id = #{customerId}) as a
</select>
......
......@@ -4,121 +4,151 @@
<!--总值统计-->
<select id="SalesReportCountAll" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportRespAll">
SELECT (
SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDate} AND #{eDate}
) AS curValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue,
(
SELECT sum(sum_volume)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sDate} AND #{eDate}
) AS curValue1,
(SELECT sum(sum_volume)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue1,
(SELECT round(sum(sum_volume) / (SELECT vz FROM ecw_vz WHERE fuhao = 'M3' LIMIT 1), 2)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue1,
(SELECT round(sum(sum_weight) / (SELECT vz FROM ecw_vz WHERE fuhao = 'KG' LIMIT 1), 2)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sDate} AND #{eDate}
) AS curValue3,
(SELECT sum(sum_weight)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue3,
(SELECT sum(sum_weight)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue3
SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order c
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order c
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order c
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue,
(
SELECT sum(sum_volume)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue1,
(SELECT sum(sum_volume)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 1
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)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 1
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)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue3,
(SELECT sum(sum_weight)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue3,
(SELECT sum(sum_weight)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue3
FROM DUAL
</select>
<select id="SalesReportCount" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp">
SELECT (
SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDate} AND #{eDate}
) AS curValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue
SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order c
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order c
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue,
(SELECT sum(if(transport_id = 1, sum_volume, sum_weight))
FROM ecw_order c
WHERE is_del = 0
AND (transport_id = 1 OR transport_id = 3)
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue
FROM DUAL
</select>
<!--海运统计-->
<select id="SalesReportCountSea" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp">
SELECT (
SELECT sum(sum_volume)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sDate} AND #{eDate}
) AS curValue,
(SELECT sum(sum_volume)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue,
(SELECT sum(sum_volume)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue
SELECT sum(sum_volume)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue,
(SELECT sum(sum_volume)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue,
(SELECT sum(sum_volume)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 1
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue
FROM DUAL
</select>
<!--空运统计-->
<select id="SalesReportCountAir" resultType="cn.iocoder.yudao.module.delivery.entity.SalesReportResp">
SELECT (
SELECT sum(sum_weight)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sDate} AND #{eDate}
) AS curValue,
(SELECT sum(sum_weight)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}) AS tbValue,
SELECT sum(sum_weight)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sDate} AND #{eDate}
<include refid="WherePage"/>
) AS curValue,
(SELECT sum(sum_weight)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sDuiBiDate} AND #{eDuiBiDate}
<include refid="WherePage"/>
) AS tbValue,
(SELECT sum(sum_weight)
FROM ecw_order
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}) AS hbValue
(SELECT sum(sum_weight)
FROM ecw_order c
WHERE is_del = 0
AND transport_id = 3
AND rucang_time BETWEEN #{sHuanBiDate} AND #{eHuanBiDate}
<include refid="WherePage"/>
) AS hbValue
FROM DUAL
</select>
......@@ -155,7 +185,15 @@
</where>
</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>
......@@ -6003,7 +6003,8 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
lanbm 2024-05-13 add
*/
@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> {
yeji_create_date 业绩产生时间
简单的SQL语句用SQL注解来写比较方便
*/
@Update("update ecw_order set cal_v_value=#{yejiType},yeji_create_date=#{yejiCreateDate} where order_id = #{orderId}")
void UpdateOrderVValue(@Param("orderId") Long orderId,BigDecimal calVvalue,Date
yejiCreateDate);
@Update("update ecw_order set cal_v_value=#{calVvalue},yeji_create_date=#{yejiCreateDate} where order_id = #{orderId}")
void UpdateOrderVValue(@Param("orderId") Long orderId,
@Param("calVvalue") BigDecimal calVvalue,
@Param("yejiCreateDate") Date yejiCreateDate);
}
......@@ -5,8 +5,8 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
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.Order.CalculateOrderVValueEvent;
//import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiTypeEvent;
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.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.util.bigDecimal.BigDecimalUtils;
import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
......@@ -420,11 +420,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderBusinessService.addOrderOperateLog(order.getOrderId(), "新建订单", null);
//lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型
/*
CalculateOrderYeJiTypeEvent even = new CalculateOrderYeJiTypeEvent();
even.setOrderId(order.getOrderId());
applicationContext.publishEvent(even);
*/
// 返回
return order;
}
......@@ -1667,19 +1665,16 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
"编辑订单", null);
//lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型
/* Long orderId = updateReqVO.getOrderId();
Long orderId = updateReqVO.getOrderId();
CalculateOrderYeJiTypeEvent even = new CalculateOrderYeJiTypeEvent();
even.setOrderId(orderId);
applicationContext.publishEvent(even);
*/
//end lanbm 2024-04-13 修改,在创建完订单号,计算订单业绩类型
//入仓完成,计算V值 lanbm 2024-05-13 add
/*
CalculateOrderVValueEvent event=new CalculateOrderVValueEvent();
event.setOrderId(updateObj.getOrderId());
applicationContext.publishEvent(event);*/
applicationContext.publishEvent(event);
//end 入仓完成,计算V值 lanbm 2024-05-13 add
}
......@@ -3365,7 +3360,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
receivableService.verificationReceivableIsWriteOff(orderDO.getOrderId(), null);
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)) {
orderItemInWarehouseVOList.forEach(vo -> {
......
......@@ -303,12 +303,14 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
@Override
@Transactional(rollbackFor = Exception.class)
public boolean createOrderWarehouseIn(@Valid OrderWarehouseInCreateReqVO createReqVO) {
public boolean createOrderWarehouseIn(@Valid OrderWarehouseInCreateReqVO
createReqVO) {
Long orderId = createReqVO.getOrderId();
Long brand = createReqVO.getBrand();
Long orderItemId = createReqVO.getOrderItemId();
List<OrderWarehouseInItemDto> orderWarehouseInItemDoList = createReqVO.getOrderWarehouseInItemDoList();
List<OrderWarehouseInItemDto> orderWarehouseInItemDoList =
createReqVO.getOrderWarehouseInItemDoList();
// 非下单货物,请求中包含
String prodTitleZh = createReqVO.getProdTitleZh();
......@@ -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));
boolean isAppend = CollectionUtil.isNotEmpty(orderWarehouseInDOS);
......@@ -452,8 +455,13 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
* @param isUpdateWarehouseProdAttrIds
* @return 返回订单项id
*/
private Long doSaveOrUpdateOrderWarehouseInDo(OrderWarehouseInCreateReqVO createReqVO, Long orderId, Long orderItemId, OrderDO orderDO,
List<String> pictureUrls, boolean isDeleteNotInWarehouseIn, boolean isUpdateWarehouseProdAttrIds) {
private Long doSaveOrUpdateOrderWarehouseInDo(
OrderWarehouseInCreateReqVO createReqVO,
Long orderId, Long orderItemId, OrderDO orderDO,
List<String> pictureUrls, boolean isDeleteNotInWarehouseIn,
boolean isUpdateWarehouseProdAttrIds) {
//lanbm 2024-05-21 添加注释
boolean isAddNewOrderItem = createReqVO.getType() != 0;
OrderItemDO orderItemDO;
......@@ -2656,7 +2664,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
updateReqVO.getPictureUrls(),
false,
true);*/
//对明细做修改
this.doSaveOrUpdateOrderWarehouseInDo(orderWarehouseInCreateReqVO,
orderId, orderItemId, orderDO,
updateReqVO.getPictureUrls(),
......
......@@ -293,6 +293,7 @@ public class BoxPreloadGoodsController {
@ApiOperation("下载预装单")
@ApiImplicitParam(name = "shipmentId", value = "出货单ID", required = true, example = "20", dataTypeClass = Long.class)
public CommonResult<String> downloadPreloadGoodsList(@RequestParam("shipmentId") Long shipmentId, HttpServletResponse response) throws Exception {
//预装单 lanbm 2024-05-22 处理问题
BoxDO box = boxService.getBox(shipmentId);
FileMakeReqDTO reqDTO = new FileMakeReqDTO();
JSONObject jsonObject = new JSONObject();
......
......@@ -273,6 +273,7 @@ public class DownloadLogServiceImpl extends AbstractService<DownloadLogMapper, D
break;
// ......不同类型的文件制作
case SHIPMENT_PRELOAD_EXCEL_EXPORT:
//预装单导出 lanbm 2024-05-22 添加注释
shipmentPreloadExcelExportPushEvent(downloadLog);
break;
//异常订单导出
......@@ -339,9 +340,11 @@ public class DownloadLogServiceImpl extends AbstractService<DownloadLogMapper, D
shipmentSummeryExcelExportPushEvent(downloadLog);
break;
case SHIPMENT_SEA_PRELOAD_EXCEL_EXPORT:
//海运预装单导出,lanbm 2024-05-22 添加注释
shipmentSeaPreloadExcelExportPushEvent(downloadLog);
break;
case SHIPMENT_AIR_LOAD_EXCEL_EXPORT:
//空运预装单 lanbm 2024-05-22 添加注释
shipmentAirLoadExcelExportPushEvent(downloadLog);
break;
case ACHIEVEMENT_DETAIL_EXCEL_EXPORT:
......
......@@ -100,7 +100,9 @@ public class PayableServiceImpl extends AbstractService<PayableMapper, PayableDO
}
@Override
public PageResult<PayableOrderBackVo> getPayablePage(PayableQueryVO query, PageVO page) {
public PageResult<PayableOrderBackVo> getPayablePage(PayableQueryVO query,
PageVO page) {
List<AdminUserDO> ListUser = adminUserService.getUsersList();
Map<Long, String> userMap =
ListUser.stream().collect(
......@@ -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.getDepartureId()), "a.start_warehouse_id", query.getDepartureId());
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);
//lanbm 2024-05-17 add
......@@ -129,22 +173,18 @@ public class PayableServiceImpl extends AbstractService<PayableMapper, PayableDO
v.setTransportTypeName("专线空运");
}
String sCreator="";
if(v.getCreator()==null) {
String sCreator = "";
if (v.getCreator() == null) {
v.setCreator("");
}
else
{
long l=Long.parseLong(v.getCreator());
} else {
long l = Long.parseLong(v.getCreator());
v.setCreator(userMap.get(l));
}
if(v.getUpdater()==null) {
if (v.getUpdater() == null) {
v.setUpdater("");
}
else
{
long l=Long.parseLong(v.getUpdater());
} else {
long l = Long.parseLong(v.getUpdater());
v.setUpdater(userMap.get(l));
}
}
......
......@@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
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;
@Data
......@@ -76,11 +77,11 @@ public class PayableQueryVO {
@ApiModelProperty(value = "发票号")
private String invoiceNumber;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
......@@ -100,4 +101,9 @@ public class PayableQueryVO {
@ApiModelProperty(value = "客户名称")
private String customerName;
/*
时间节点查询类型
*/
private int dateType;
}
<?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.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 a.*,b.shipment_status_air as shipmentStatusAir,
b.shipment_status as shipmentStatus
select a.*,
b.shipment_status_air as shipmentStatusAir,
b.shipment_status as shipmentStatus
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}
</select>
</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