Commit 7badfe68 authored by zhengyi's avatar zhengyi

已入仓订单修改审批时检查是否需要重新匹配优惠活动

parent 214a0d72
...@@ -4,13 +4,13 @@ import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalT ...@@ -4,13 +4,13 @@ import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalT
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;
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.listener.TestEvent; 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.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.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.service.order.OrderService; import cn.iocoder.yudao.module.order.service.order.OrderService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -47,9 +47,9 @@ public class EcwVzController { ...@@ -47,9 +47,9 @@ public class EcwVzController {
*/ */
@Resource @Resource
private EcwVzService ecwVzService; private EcwVzService ecwVzService;
//
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@Autowired @Autowired
private OrderService orderService; private OrderService orderService;
...@@ -160,7 +160,7 @@ public class EcwVzController { ...@@ -160,7 +160,7 @@ public class EcwVzController {
*/ */
zTest m = new zTest(); // zTest m = new zTest();
orderService.UpdateOrderYeJiType((long) 1, 1); orderService.UpdateOrderYeJiType((long) 1, 1);
...@@ -168,15 +168,15 @@ public class EcwVzController { ...@@ -168,15 +168,15 @@ public class EcwVzController {
ReceiveCustomerCalTypeEvent e = new ReceiveCustomerCalTypeEvent(); ReceiveCustomerCalTypeEvent e = new ReceiveCustomerCalTypeEvent();
e.setCustomerId((long) 49345); e.setCustomerId((long) 49345);
if (orderServiceExt.IsHavingOrder(e) == 0) { // if (orderServiceExt.IsHavingOrder(e) == 0) {
m.setTestname("无业绩"); // m.setTestname("无业绩");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} else { // } else {
m.setTestname("有业绩"); // m.setTestname("有业绩");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} // }
return success(true); return success(true);
} }
......
package cn.iocoder.yudao.module.delivery.entity.deptex; //package cn.iocoder.yudao.module.delivery.entity.deptex;
//
import com.baomidou.mybatisplus.annotation.TableName; //import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; //import lombok.Data;
import lombok.EqualsAndHashCode; //import lombok.EqualsAndHashCode;
//
import java.util.Date; //import java.util.Date;
//
@TableName("z_test") //@TableName("z_test")
@Data //@Data
public class zTest { //public class zTest {
//
private Long id; // private Long id;
private String testname; // private String testname;
//
private Date createdate; // private Date createdate;
} //}
...@@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.delivery.listener; ...@@ -2,9 +2,9 @@ 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.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;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
...@@ -23,8 +23,8 @@ public class CalculateCustomerType { ...@@ -23,8 +23,8 @@ public class CalculateCustomerType {
@Resource @Resource
private CustomerService customerService; private CustomerService customerService;
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@Resource @Resource
...@@ -37,7 +37,7 @@ public class CalculateCustomerType { ...@@ -37,7 +37,7 @@ public class CalculateCustomerType {
@EventListener(CalculateCustomerTypeEvent.class) @EventListener(CalculateCustomerTypeEvent.class)
public void CalculateCustomerTypePushEvent( public void CalculateCustomerTypePushEvent(
CalculateCustomerTypeEvent event) { CalculateCustomerTypeEvent event) {
zTest m=new zTest(); // zTest m=new zTest();
String sMsg="计算开始"+event.getCustomerId(); String sMsg="计算开始"+event.getCustomerId();
if (event.getNewCustomerService() == event.getOldCustomerService()) { if (event.getNewCustomerService() == event.getOldCustomerService()) {
//新客户经理和老客户经理是同一客户经理 //新客户经理和老客户经理是同一客户经理
...@@ -66,9 +66,9 @@ public class CalculateCustomerType { ...@@ -66,9 +66,9 @@ public class CalculateCustomerType {
sMsg+=",新老不一致"; sMsg+=",新老不一致";
customerService.updateCustomerNewOrOld(event.getCustomerId(), true); customerService.updateCustomerNewOrOld(event.getCustomerId(), true);
} }
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} }
/* /*
......
...@@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.delivery.listener; ...@@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.delivery.listener;
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.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.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.service.EcwVzService; import cn.iocoder.yudao.module.delivery.service.EcwVzService;
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.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.service.order.OrderService; import cn.iocoder.yudao.module.order.service.order.OrderService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -35,26 +35,26 @@ public class CalculateOrderVValueListener { ...@@ -35,26 +35,26 @@ public class CalculateOrderVValueListener {
@Autowired @Autowired
private EcwVzService ecwVzService; private EcwVzService ecwVzService;
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@EventListener(CalculateOrderVValueEvent.class) @EventListener(CalculateOrderVValueEvent.class)
public void CalculateOrderVValuePushEvent( public void CalculateOrderVValuePushEvent(
CalculateOrderVValueEvent event) { CalculateOrderVValueEvent event) {
zTest m = new zTest(); // zTest m = new zTest();
String sMsg = "计算V值"; String sMsg = "计算V值";
OrderDO orderDO = orderService.getById(event.getOrderId()); OrderDO orderDO = orderService.getById(event.getOrderId());
if (orderDO == null) { if (orderDO == null) {
throw exception(ORDER_NOT_EXISTS); throw exception(ORDER_NOT_EXISTS);
} }
if (orderDO.getRucangTime() == null) { // if (orderDO.getRucangTime() == null) {
sMsg += ",订单入仓时间为空,暂不处理。"; // sMsg += ",订单入仓时间为空,暂不处理。";
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
return; // return;
} // }
//订单状态为已入仓之后的状态,其他状态是否排除,后续和客户确认,先按此逻辑处理 //订单状态为已入仓之后的状态,其他状态是否排除,后续和客户确认,先按此逻辑处理
int nS = orderDO.getStatus(); int nS = orderDO.getStatus();
...@@ -103,9 +103,9 @@ public class CalculateOrderVValueListener { ...@@ -103,9 +103,9 @@ public class CalculateOrderVValueListener {
sMsg += ",未入仓"; sMsg += ",未入仓";
} }
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} }
} }
...@@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTy ...@@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTy
import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiTypeEvent;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
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.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.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.service.order.OrderService; import cn.iocoder.yudao.module.order.service.order.OrderService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -35,15 +35,15 @@ public class CalculateOrderYeJiTypeListener { ...@@ -35,15 +35,15 @@ public class CalculateOrderYeJiTypeListener {
@Autowired @Autowired
private CustomerService customerService; private CustomerService customerService;
//
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@EventListener(CalculateOrderYeJiTypeEvent.class) @EventListener(CalculateOrderYeJiTypeEvent.class)
public void CalculateOrderYeJiTypePushEvent( public void CalculateOrderYeJiTypePushEvent(
CalculateOrderYeJiTypeEvent event) { CalculateOrderYeJiTypeEvent event) {
zTest m=new zTest(); // zTest m=new zTest();
String sMsg="计算业绩类型"+event.getCustomerId(); String sMsg="计算业绩类型"+event.getCustomerId();
OrderDO orderDO = orderService.getById(event.getOrderId()); OrderDO orderDO = orderService.getById(event.getOrderId());
...@@ -55,10 +55,10 @@ public class CalculateOrderYeJiTypeListener { ...@@ -55,10 +55,10 @@ public class CalculateOrderYeJiTypeListener {
CustomerDO customerDO = customerService.getById(event.getCustomerId()); CustomerDO customerDO = customerService.getById(event.getCustomerId());
if (customerDO == null) { if (customerDO == null) {
//throw exception(CUSTOMER_NOT_EXISTS); //throw exception(CUSTOMER_NOT_EXISTS);
sMsg+=",客户不存在先不计算业绩类型"; // sMsg+=",客户不存在先不计算业绩类型";
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
return; return;
} }
...@@ -74,9 +74,9 @@ public class CalculateOrderYeJiTypeListener { ...@@ -74,9 +74,9 @@ public class CalculateOrderYeJiTypeListener {
orderService.UpdateOrderYeJiType(event.getOrderId(), isNew); orderService.UpdateOrderYeJiType(event.getOrderId(), isNew);
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} }
} }
...@@ -2,10 +2,10 @@ package cn.iocoder.yudao.module.delivery.listener; ...@@ -2,10 +2,10 @@ package cn.iocoder.yudao.module.delivery.listener;
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.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.Impl.OrderServiceExtImpl; import cn.iocoder.yudao.module.delivery.service.Impl.OrderServiceExtImpl;
import cn.iocoder.yudao.module.delivery.service.OrderServiceExt; 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;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
...@@ -28,8 +28,8 @@ public class ReceiveCustomerCalTypeListener { ...@@ -28,8 +28,8 @@ public class ReceiveCustomerCalTypeListener {
@Resource @Resource
private OrderServiceExt orderServiceExt; private OrderServiceExt orderServiceExt;
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@EventListener(ReceiveCustomerCalTypeEvent.class) @EventListener(ReceiveCustomerCalTypeEvent.class)
public void CalculateCustomerTypePushEvent( public void CalculateCustomerTypePushEvent(
...@@ -37,7 +37,7 @@ public class ReceiveCustomerCalTypeListener { ...@@ -37,7 +37,7 @@ public class ReceiveCustomerCalTypeListener {
//CustomerServiceImpl confirmCustomer 函数中触发事件 客户经理直接确认接收 //CustomerServiceImpl confirmCustomer 函数中触发事件 客户经理直接确认接收
//CustomerServiceImpl receiveCustomer 函数中触发,移交,系统分配,接收时判断 //CustomerServiceImpl receiveCustomer 函数中触发,移交,系统分配,接收时判断
//CustomerServiceImpl updateCustomer 函数中触发,完善客户信息 //CustomerServiceImpl updateCustomer 函数中触发,完善客户信息
zTest m=new zTest(); // zTest m=new zTest();
String sMsg="接收客户"+event.getCustomerId(); String sMsg="接收客户"+event.getCustomerId();
if (event.getIsNew() == true) { if (event.getIsNew() == true) {
//移交接收前是新客户 //移交接收前是新客户
...@@ -58,9 +58,9 @@ public class ReceiveCustomerCalTypeListener { ...@@ -58,9 +58,9 @@ public class ReceiveCustomerCalTypeListener {
//维持老客户不变,可不做任何逻辑操作 //维持老客户不变,可不做任何逻辑操作
sMsg+=",老客户"; sMsg+=",老客户";
} }
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} }
/* /*
......
package cn.iocoder.yudao.module.delivery.mapper; //package cn.iocoder.yudao.module.delivery.mapper;
//
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import org.apache.ibatis.annotations.Insert; //import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options; //import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select; //import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; //import org.apache.ibatis.annotations.Update;
//
import java.util.List; //import java.util.List;
//
/* ///*
用注解实现简单的功能 // 用注解实现简单的功能
*/ // */
public interface MyTest { //public interface MyTest {
// 查询所有商品类型 // // 查询所有商品类型
@Select("select * from z_test") // @Select("select * from z_test")
public List<zTest> selectAll(); // public List<zTest> selectAll();
//
// 根据类型编号查询商品类型 // // 根据类型编号查询商品类型
@Select("select * from z_test where id = #{id}") // @Select("select * from z_test where id = #{id}")
zTest selectById(int id); // zTest selectById(int id);
//
// 添加商品类型 // // 添加商品类型
@Insert("insert into z_test(name) values(#{name})") // @Insert("insert into z_test(name) values(#{name})")
@Options(useGeneratedKeys = true, keyProperty = "id") // @Options(useGeneratedKeys = true, keyProperty = "id")
public int add(zTest type); // public int add(zTest type);
//
// 更新商品类型 // // 更新商品类型
@Update("update z_test set name = #{name} where id = #{id}") // @Update("update z_test set name = #{name} where id = #{id}")
public int update(zTest type); // public int update(zTest type);
} //}
package cn.iocoder.yudao.module.delivery.mapper; //package cn.iocoder.yudao.module.delivery.mapper;
//
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; //import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; //import org.apache.ibatis.annotations.Mapper;
//
@Mapper //@Mapper
public interface ZTestMapper extends BaseMapper<zTest> { //public interface ZTestMapper extends BaseMapper<zTest> {
} //}
package cn.iocoder.yudao.module.delivery.service.Impl; //package cn.iocoder.yudao.module.delivery.service.Impl;
//
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; ////import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.mapper.ZTestMapper; //import cn.iocoder.yudao.module.delivery.mapper.ZTestMapper;
import cn.iocoder.yudao.module.delivery.service.ZTestService; ////import cn.iocoder.yudao.module.delivery.service.ZTestService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; //import org.springframework.stereotype.Service;
//
@Service("ZTestService") //@Service("ZTestService")
public class ZTestImpl extends ServiceImpl<ZTestMapper, zTest> implements ZTestService { //public class ZTestImpl extends ServiceImpl<ZTestMapper, zTest> implements ZTestService {
//
//
} //}
package cn.iocoder.yudao.module.delivery.service; //package cn.iocoder.yudao.module.delivery.service;
//
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import com.baomidou.mybatisplus.extension.service.IService; //import com.baomidou.mybatisplus.extension.service.IService;
//
public interface ZTestService extends IService<zTest> { //public interface ZTestService extends IService<zTest> {
} //}
<?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.ZTestMapper">
</mapper>
...@@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.order.service.order.OrderBusinessService; ...@@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.order.service.order.OrderBusinessService;
import cn.iocoder.yudao.module.order.service.order.OrderQueryService; import cn.iocoder.yudao.module.order.service.order.OrderQueryService;
import cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService; import cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService;
import cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionResultHandlerVo; import cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionResultHandlerVo;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3; //import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import cn.iocoder.yudao.module.product.dal.dataobject.product.ProductPriceDO; import cn.iocoder.yudao.module.product.dal.dataobject.product.ProductPriceDO;
import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3; //import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3;
import cn.iocoder.yudao.module.product.vo.productPrice.ClearancePriceEvent; import cn.iocoder.yudao.module.product.vo.productPrice.ClearancePriceEvent;
import cn.iocoder.yudao.module.product.vo.productPrice.HandleData; import cn.iocoder.yudao.module.product.vo.productPrice.HandleData;
import cn.iocoder.yudao.module.product.vo.productPrice.HandleExceptionEvent; import cn.iocoder.yudao.module.product.vo.productPrice.HandleExceptionEvent;
...@@ -44,8 +44,8 @@ public class ProductPriceExceptionHandleListener { ...@@ -44,8 +44,8 @@ public class ProductPriceExceptionHandleListener {
private final OrderExceptionService orderExceptionService; private final OrderExceptionService orderExceptionService;
private final OrderBusinessService orderBusinessService; private final OrderBusinessService orderBusinessService;
@Resource // @Resource
private ZTestMapper3 zTestMapper; // private ZTestMapper3 zTestMapper;
@EventListener(HandleExceptionEvent.class) @EventListener(HandleExceptionEvent.class)
@Async @Async
...@@ -65,10 +65,10 @@ public class ProductPriceExceptionHandleListener { ...@@ -65,10 +65,10 @@ public class ProductPriceExceptionHandleListener {
public void orderOtherFeeEvent(HandleData event) { public void orderOtherFeeEvent(HandleData event) {
List<ProductPriceDO> priceList = event.getNeedHandleList(); List<ProductPriceDO> priceList = event.getNeedHandleList();
zTest3 m=new zTest3(); // zTest3 m=new zTest3();
m.setTestname("开始处理价格异常。"); // m.setTestname("开始处理价格异常。");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper.insert(m); // zTestMapper.insert(m);
//ecw_product_price //ecw_product_price
//找出符合条件的订单 //找出符合条件的订单
...@@ -125,10 +125,10 @@ public class ProductPriceExceptionHandleListener { ...@@ -125,10 +125,10 @@ public class ProductPriceExceptionHandleListener {
} }
else else
{ {
m=new zTest3(); // m=new zTest3();
m.setTestname("exceptionDOList 为空"); // m.setTestname("exceptionDOList 为空");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper.insert(m); // zTestMapper.insert(m);
} }
//只要有价格就处理清关费未报价异常 //只要有价格就处理清关费未报价异常
......
...@@ -77,6 +77,7 @@ import cn.iocoder.yudao.module.product.enums.FeeTypeEnum; ...@@ -77,6 +77,7 @@ import cn.iocoder.yudao.module.product.enums.FeeTypeEnum;
import cn.iocoder.yudao.module.product.param.ProdConditionParam; import cn.iocoder.yudao.module.product.param.ProdConditionParam;
import cn.iocoder.yudao.module.product.service.product.ProductAttrService; import cn.iocoder.yudao.module.product.service.product.ProductAttrService;
import cn.iocoder.yudao.module.product.service.product.ProductService; import cn.iocoder.yudao.module.product.service.product.ProductService;
import cn.iocoder.yudao.module.product.vo.coupon.CouponInfoVO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO; import cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO;
...@@ -2307,9 +2308,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -2307,9 +2308,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1")); OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
this.costCalculation(userId, orderDO, this.costCalculation(userId, orderDO,
orderConsignorDO.getCustomerId(), orderConsignorDO.getCustomerId(),
Objects.isNull(orderConsigneeDO)? 0L : orderConsigneeDO.getCustomerId(), Objects.isNull(orderConsigneeDO) ? 0L : orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(), orderConsignorDO.getCustomerContactsId(),
Objects.isNull(orderConsigneeDO)? 0L : orderConsigneeDO.getCustomerContactsId(), Objects.isNull(orderConsigneeDO) ? 0L : orderConsigneeDO.getCustomerContactsId(),
orderItemDOList, 50); orderItemDOList, 50);
this.addOrderOperateLog(orderDO.getOrderId(), this.addOrderOperateLog(orderDO.getOrderId(),
"有活动更新订单计价", null); "有活动更新订单计价", null);
...@@ -3448,6 +3449,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -3448,6 +3449,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
* 20 强制重订价格 30 空运订单每日定时更新价格 * 20 强制重订价格 30 空运订单每日定时更新价格
* 40 订单异常处理完成更新计价 * 40 订单异常处理完成更新计价
* 50 更新订单优惠信息 * 50 更新订单优惠信息
* 51 检查订单优惠信息,并在当前优惠信息不满足条件后匹配新的优惠信息
* @return 该运输方式下的报价商品列表信息 * @return 该运输方式下的报价商品列表信息
*/ */
private CalculationItemFeeDto insertOrderItemDOList(String userId, private CalculationItemFeeDto insertOrderItemDOList(String userId,
...@@ -3730,7 +3732,15 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -3730,7 +3732,15 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
param.setOrgClearanceFeePrice(orderItemDO.getOriginalClearanceFreight()); param.setOrgClearanceFeePrice(orderItemDO.getOriginalClearanceFreight());
param.setClearanceFeeCurrency(Objects.isNull(orderItemDO.getClearanceFreightCurrency()) ? null : Integer.valueOf(String.valueOf(orderItemDO.getClearanceFreightCurrency()))); param.setClearanceFeeCurrency(Objects.isNull(orderItemDO.getClearanceFreightCurrency()) ? null : Integer.valueOf(String.valueOf(orderItemDO.getClearanceFreightCurrency())));
param.setClearanceFeeVolume(orderItemDO.getClearanceFreightVolume()); param.setClearanceFeeVolume(orderItemDO.getClearanceFreightVolume());
if (type == 50) { if (type == 51) {
param.setCalculationType(7);
if (StringUtils.isNotBlank(orderItemDO.getCouponInfo())) {
List<CouponInfoVO> couponInfoVOList = JSONObject.parseArray(orderItemDO.getCouponInfo(), CouponInfoVO.class);
if (CollectionUtil.isNotEmpty(couponInfoVOList)) {
param.setCouponInfoVOList(JSONObject.parseArray(orderItemDO.getCouponInfo(), CouponInfoVO.class));
}
}
} else if (type == 50) {
param.setCalculationType(6); param.setCalculationType(6);
} else if (type == 14) { } else if (type == 14) {
// 批量加价 // 批量加价
...@@ -3749,23 +3759,30 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -3749,23 +3759,30 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
!Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) { !Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
isWarehouseIn = true; isWarehouseIn = true;
} }
List<ProdConditionParam> prodConditionParams = null;
// 定单价费用 // 定单价费用
List<ProdConditionParam> prodConditionParams = if (type != 51) {
prodCostCalculation.obtainProdLineOnePrice( prodConditionParams =
prodConditionParamList, prodCostCalculation.obtainProdLineOnePrice(
orderDO.getOrderNo(), prodConditionParamList,
orderDO.getCustomsType(), orderDO.getOrderNo(),
orderDO.getCustomerId(), orderDO.getCustomsType(),
orderDO.getTransportId(), orderDO.getCustomerId(),
orderDO.getLineId(), orderDO.getTransportId(),
orderDO.getChannelId(), isWarehouseIn); orderDO.getLineId(),
// 对订单品名的收费数据进行误差补全,单价最低的品名加上误差值 orderDO.getChannelId(), isWarehouseIn);
if (type != 1 && type != 2 && !Objects.equals(orderDO.getStatus(),
OrderStatusEnum.ORDER_PLACED.getValue()) && !Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) { // 对订单品名的收费数据进行误差补全,单价最低的品名加上误差值
// 只要不是草稿和待入仓订单,都会对此进行计算, 对误差值进行调整 if (type != 1 && type != 2 && !Objects.equals(orderDO.getStatus(),
errorValueAdjustment(orderItemDOList, OrderStatusEnum.ORDER_PLACED.getValue()) && !Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
orderDO, // 只要不是草稿和待入仓订单,都会对此进行计算, 对误差值进行调整
prodConditionParams); errorValueAdjustment(orderItemDOList,
orderDO,
prodConditionParams);
}
} else {
prodConditionParams = new ArrayList<>();
prodConditionParams.addAll(prodConditionParamList);
} }
// 计算小计费用 // 计算小计费用
CalculationCostResultDto resultDto = CalculationCostResultDto resultDto =
......
...@@ -2669,6 +2669,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2669,6 +2669,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
infoVO.setOrgValue(vo.getIsCargoControl() ? "是/yes" : "否/no"); infoVO.setOrgValue(vo.getIsCargoControl() ? "是/yes" : "否/no");
infoVO.setNewValue(updateReqVO.getIsCargoControl() ? "是/yes" : "否/no"); infoVO.setNewValue(updateReqVO.getIsCargoControl() ? "是/yes" : "否/no");
vo.setIsCargoControl(updateReqVO.getIsCargoControl()); vo.setIsCargoControl(updateReqVO.getIsCargoControl());
vo.setIsCheckCoupon(Boolean.TRUE);
applyInfoList.add(infoVO); applyInfoList.add(infoVO);
} }
Map<Integer, CurrencyRespDTO> currencyMap = currencyApi.getAllCurrency(); Map<Integer, CurrencyRespDTO> currencyMap = currencyApi.getAllCurrency();
...@@ -2715,6 +2716,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2715,6 +2716,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
infoVO.setOrgValue(vo.getCustomsType() == 1 ? "我司全代/Our full representative" : (vo.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration")); infoVO.setOrgValue(vo.getCustomsType() == 1 ? "我司全代/Our full representative" : (vo.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration"));
infoVO.setNewValue(updateReqVO.getCustomsType() == 1 ? "我司全代/Our full representative" : (updateReqVO.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration")); infoVO.setNewValue(updateReqVO.getCustomsType() == 1 ? "我司全代/Our full representative" : (updateReqVO.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration"));
vo.setCustomsType(updateReqVO.getCustomsType()); vo.setCustomsType(updateReqVO.getCustomsType());
vo.setIsCheckCoupon(Boolean.TRUE);
applyInfoList.add(infoVO); applyInfoList.add(infoVO);
} }
// 出单方式 // 出单方式
...@@ -5556,38 +5558,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -5556,38 +5558,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
descZh, descEn); descZh, descEn);
orderExceptionService.createOrderException(orderExceptionCreateReqVO); orderExceptionService.createOrderException(orderExceptionCreateReqVO);
} }
// TODO 业绩变动逻辑判断已经放入申请时进行判断,此处业务后面删除
// Date expireTime = DateUtil.offsetDay(warehouseInDO.getInTime(), 3);
// if (expireTime.compareTo(new Date()) >= 0) {
// int customerType = 1; // 发货人 1 收货人 2
// if (Objects.nonNull(orderDO.getType()) && orderDO.getType().contains("2")) {
// // 海外仓归属发货人
// orderDO.setCustomerId(consignorDO.getCustomerId());
// } else {
// // 控货订单归属发货人 / 非控货订单归属收货人
// if (orderDO.getIsCargoControl()) {
// orderDO.setCustomerId(consignorDO.getCustomerId());
// } else {
// customerType = 2;
// orderDO.setCustomerId(consigneeDO.getCustomerId());
// }
// }
// // 拆单子订单不执行客户经理分配规则,以原单为主
// if (Objects.isNull(orderDO.getParentOrderId()) || orderDO.getParentOrderId() == 0) {
// // 更新所属客户经理(业务员)
//// if (Objects.nonNull(orderDO.getCustomerId()) && orderDO.getCustomerId() > 0) {
// addOrderCustomerService(orderDO, customerType);
//// }
// }
// }
// 判断是否需要生成单证异常
// if (!Objects.equals(oldOrder.getCustomsType(), orderDO.getCustomsType())) {
// if ((orderDO.getCustomsType().equals(2) || orderDO.getCustomsType().equals(3)) && StringUtils.isEmpty(orderDO.getDocumentsFile())) {
// OrderExceptionCreateReqVO orderExceptionCreateReqVO = this.genOrderException(orderDO.getOrderId(), orderDO, null, null, OrderExceptionEnum.ORDER_DOC_EXCEPTION,
// OrderExceptionEnum.ORDER_DOC_EXCEPTION.getZhValueDesc(), OrderExceptionEnum.ORDER_DOC_EXCEPTION.getEnValueDesc());
// orderExceptionService.createOrderException(orderExceptionCreateReqVO);
// }
// }
// 这里可能因为修改内容不触发计价业务,而提交审批内容的同时,提交了不用审批的修改货值,导致费用清单变更,所以这里需要同步当前数据库的费用清单 // 这里可能因为修改内容不触发计价业务,而提交审批内容的同时,提交了不用审批的修改货值,导致费用清单变更,所以这里需要同步当前数据库的费用清单
orderDO.setCost(oldOrder.getCost()); orderDO.setCost(oldOrder.getCost());
// 在这中间可能有订单的入仓子状态变更,例如调仓等操作,需要同步当前数据库订单状态,因为订单审批同时只能有一个,所以审批状态肯定是实时的,只需要同步其他状态 // 在这中间可能有订单的入仓子状态变更,例如调仓等操作,需要同步当前数据库订单状态,因为订单审批同时只能有一个,所以审批状态肯定是实时的,只需要同步其他状态
...@@ -5624,6 +5594,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -5624,6 +5594,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 强制重新定价, 则需要将特价属性都重置 // 强制重新定价, 则需要将特价属性都重置
orderBusinessService.costCalculation(String.valueOf(userId), orderDO, consignorDO.getCustomerId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerId(), orderBusinessService.costCalculation(String.valueOf(userId), orderDO, consignorDO.getCustomerId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerId(),
consignorDO.getCustomerContactsId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerContactsId(), orderItemDOList, 10); consignorDO.getCustomerContactsId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerContactsId(), orderItemDOList, 10);
}else if (orderBackVO.getIsCheckCoupon()){
// 如果没有重新计价,这里就需要对订单优惠活动进行检查,是否需要重新匹配新的优惠
List<OrderItemDO> orderItemDOList = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>().eq(OrderItemDO::getOrderId, orderDO.getOrderId()));
// 是否需要检查优惠卷(如果满足当前优惠卷,则继续使用(即使过期也可以),如果不满足则匹配最新的优惠(排除过期))
orderBusinessService.costCalculation(String.valueOf(userId), orderDO, consignorDO.getCustomerId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerId(),
consignorDO.getCustomerContactsId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerContactsId(), orderItemDOList, 51);
} }
orderBusinessService.addOrderTimeLog(orderDO.getStatus(), orderDO, 7, now, now); orderBusinessService.addOrderTimeLog(orderDO.getStatus(), orderDO, 7, now, now);
// 空运相关订单处理业务 // 空运相关订单处理业务
......
...@@ -544,6 +544,9 @@ public class OrderBackVO { ...@@ -544,6 +544,9 @@ public class OrderBackVO {
@ApiModelProperty(value = "是否需要重新计价") @ApiModelProperty(value = "是否需要重新计价")
private Boolean isResetPrice = Boolean.FALSE; private Boolean isResetPrice = Boolean.FALSE;
@ApiModelProperty(value = "是否需要检查优惠卷(如果满足当前优惠卷,则继续使用(即使过期也可以),如果不满足则匹配最新的优惠(排除过期))")
private Boolean isCheckCoupon = Boolean.FALSE;
// 物流信息 // 物流信息
@ApiModelProperty(value = "物流信息相关") @ApiModelProperty(value = "物流信息相关")
......
...@@ -22,10 +22,11 @@ import cn.iocoder.yudao.module.ecw.dal.dataobject.currency.CurrencyDO; ...@@ -22,10 +22,11 @@ import cn.iocoder.yudao.module.ecw.dal.dataobject.currency.CurrencyDO;
import cn.iocoder.yudao.module.customer.dto.CustomerCommissionDto; import cn.iocoder.yudao.module.customer.dto.CustomerCommissionDto;
import cn.iocoder.yudao.module.customer.dto.CustomerCommissionQueryDto; import cn.iocoder.yudao.module.customer.dto.CustomerCommissionQueryDto;
import cn.iocoder.yudao.module.customer.service.customer.commission.CustomerCommissionInfoService; import cn.iocoder.yudao.module.customer.service.customer.commission.CustomerCommissionInfoService;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3; //import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.CouponDO;
import cn.iocoder.yudao.module.product.dal.dataobject.product.*; import cn.iocoder.yudao.module.product.dal.dataobject.product.*;
import cn.iocoder.yudao.module.ecw.dal.dataobject.unit.UnitDO; import cn.iocoder.yudao.module.ecw.dal.dataobject.unit.UnitDO;
import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3; //import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3;
import cn.iocoder.yudao.module.product.dal.mysql.product.ProductAttrMapper; import cn.iocoder.yudao.module.product.dal.mysql.product.ProductAttrMapper;
import cn.iocoder.yudao.module.ecw.service.currency.CurrencyService; import cn.iocoder.yudao.module.ecw.service.currency.CurrencyService;
import cn.iocoder.yudao.module.product.dal.mysql.product.ProductPricePackagingMapper; import cn.iocoder.yudao.module.product.dal.mysql.product.ProductPricePackagingMapper;
...@@ -88,8 +89,8 @@ public class ProdCostCalculation { ...@@ -88,8 +89,8 @@ public class ProdCostCalculation {
lineChannelPriceStepClearanceMapper; lineChannelPriceStepClearanceMapper;
// //
@Resource // @Resource
private ZTestMapper3 zTestMapper; // private ZTestMapper3 zTestMapper;
public List<ProdConditionParam> obtainProdLineOnePrice( public List<ProdConditionParam> obtainProdLineOnePrice(
...@@ -297,10 +298,47 @@ public class ProdCostCalculation { ...@@ -297,10 +298,47 @@ public class ProdCostCalculation {
rmbCurrency, unitDOMap); rmbCurrency, unitDOMap);
// 计算订单费用 // 计算订单费用
for (ProdConditionParam prodParam : prodConditionParamList) { for (ProdConditionParam prodParam : prodConditionParamList) {
// 默认去匹配优惠活动
Boolean isRestCoupon = Boolean.TRUE;
if (prodParam.getCalculationType() == 7 && CollectionUtil.isNotEmpty(prodParam.getCouponInfoVOList())) {
// 根据优惠id检查优惠活动是否匹配,忽略优惠活动是否过期,如果匹配则继续沿用,不匹配则不再使用,需要重新检查优惠
// 初始化优惠活动数量
int couponCount = prodParam.getCouponInfoVOList().size();
for (CouponInfoVO couponInfoVO : prodParam.getCouponInfoVOList()) {
CouponDO couponDO = couponService.getCoupon(couponInfoVO.getCouponId());
if (couponDO == null) {
// TODO 如果优惠被删除了如何处理
couponCount = couponCount - 1;
} else {
// 检查是否匹配报关方式
if (StringUtils.isNotBlank(couponDO.getDocumentDeclaration())) {
List<Integer> customsTypes = Arrays.stream(couponDO.getDocumentDeclaration().split(",")).map(Integer::valueOf).collect(Collectors.toList());
if (!customsTypes.contains(prodParam.getCustomsType())) {
couponCount = couponCount - 1;
continue;
}
}
// 检查是否匹配控货模式
if (StringUtils.isNotBlank(couponDO.getIsCargoControl())) {
List<Boolean> cargoControls = Arrays.stream(couponDO.getIsCargoControl().split(",")).map(Integer::valueOf).map(b -> b == 1).collect(Collectors.toList());
if (!cargoControls.contains(prodParam.getIsControl())) {
couponCount = couponCount - 1;
continue;
}
}
}
}
if (prodParam.getCouponInfoVOList().size() == couponCount) {
// 如果优惠活动数量未减少,说明不需要重新匹配优惠
isRestCoupon = Boolean.FALSE;
}
}
// 优惠金额:优惠活动减免 // 优惠金额:优惠活动减免
// 优惠计算 // 优惠计算
CouponAvailableGroupDto groupDto = prodParam.getGroupDto(); CouponAvailableGroupDto groupDto = prodParam.getGroupDto();
this.discountCalculation(prodParam, groupDto); if (isRestCoupon) {
this.discountCalculation(prodParam, groupDto);
}
if (StringUtils.isNotBlank(prodParam.getBoxGauge())) { if (StringUtils.isNotBlank(prodParam.getBoxGauge())) {
String[] prodBox = prodParam.getBoxGauge().split("\\*"); String[] prodBox = prodParam.getBoxGauge().split("\\*");
if (prodBox.length == 3) { if (prodBox.length == 3) {
...@@ -790,23 +828,23 @@ public class ProdCostCalculation { ...@@ -790,23 +828,23 @@ public class ProdCostCalculation {
this.stepSelect(unitDOMap, prodParam, productPriceDO); this.stepSelect(unitDOMap, prodParam, productPriceDO);
} else { } else {
//专线空运 //专线空运
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
String s = "1开始计算空运清关价 airStepSelect,lineId=" + lineId + // String s = "1开始计算空运清关价 airStepSelect,lineId=" + lineId +
" 渠道channelId=" + channelId; // " 渠道channelId=" + channelId;
z.setTestname(s); // z.setTestname(s);
zTestMapper.insert(z); // zTestMapper.insert(z);
//空运阶梯价计算 //空运阶梯价计算
this.airStepSelect(unitDOMap, prodParam, this.airStepSelect(unitDOMap, prodParam,
productPriceDO, lineId, channelId); productPriceDO, lineId, channelId);
} }
} else { } else {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
String s = "不是阶梯价 airStepSelect,lineId=" + lineId + // String s = "不是阶梯价 airStepSelect,lineId=" + lineId +
" 渠道channelId=" + channelId; // " 渠道channelId=" + channelId;
z.setTestname(s); // z.setTestname(s);
zTestMapper.insert(z); // zTestMapper.insert(z);
} }
prodParam.setIsPayAdvance(productPriceDO.getNeedPay()); prodParam.setIsPayAdvance(productPriceDO.getNeedPay());
...@@ -1005,11 +1043,11 @@ public class ProdCostCalculation { ...@@ -1005,11 +1043,11 @@ public class ProdCostCalculation {
} }
} else { } else {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
String s = "产品线路价格为空"; // String s = "产品线路价格为空";
z.setTestname(s); // z.setTestname(s);
zTestMapper.insert(z); // zTestMapper.insert(z);
if (!prodParam.getSpecialPriceType()) { if (!prodParam.getSpecialPriceType()) {
prodParam.setOneFreight(transportPrice); prodParam.setOneFreight(transportPrice);
...@@ -1040,11 +1078,11 @@ public class ProdCostCalculation { ...@@ -1040,11 +1078,11 @@ public class ProdCostCalculation {
prodParam.setHiddenCommission(BigDecimal.ZERO); prodParam.setHiddenCommission(BigDecimal.ZERO);
} }
} else { } else {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
String s = "不符合定价条件"; // String s = "不符合定价条件";
z.setTestname(s); // z.setTestname(s);
zTestMapper.insert(z); // zTestMapper.insert(z);
} }
} }
...@@ -1115,20 +1153,20 @@ public class ProdCostCalculation { ...@@ -1115,20 +1153,20 @@ public class ProdCostCalculation {
stepPackagingDOList = priceStepPackagingMapper.selectList( stepPackagingDOList = priceStepPackagingMapper.selectList(
new LambdaQueryWrapper<ProductPriceStepPackagingDO>() new LambdaQueryWrapper<ProductPriceStepPackagingDO>()
.eq(ProductPriceStepPackagingDO::getProductPriceStepId, .eq(ProductPriceStepPackagingDO::getProductPriceStepId,
productPriceDO.getAllStepPriceId())); productPriceDO.getAllStepPriceId()));
} else { } else {
stepPackagingDOList = priceStepPackagingMapper.selectList( stepPackagingDOList = priceStepPackagingMapper.selectList(
new LambdaQueryWrapper<ProductPriceStepPackagingDO>() new LambdaQueryWrapper<ProductPriceStepPackagingDO>()
.eq(ProductPriceStepPackagingDO::getProductPriceStepId, .eq(ProductPriceStepPackagingDO::getProductPriceStepId,
productPriceDO.getTransportStepPriceId())); productPriceDO.getTransportStepPriceId()));
if (Objects.nonNull(productPriceDO.getClearanceStepPriceId())) { if (Objects.nonNull(productPriceDO.getClearanceStepPriceId())) {
clearanceStepPackagingDOList = clearanceStepPackagingDOList =
priceStepPackagingMapper.selectList( priceStepPackagingMapper.selectList(
new LambdaQueryWrapper<ProductPriceStepPackagingDO>() new LambdaQueryWrapper<ProductPriceStepPackagingDO>()
.eq(ProductPriceStepPackagingDO::getProductPriceStepId, .eq(ProductPriceStepPackagingDO::getProductPriceStepId,
productPriceDO.getClearanceStepPriceId())); productPriceDO.getClearanceStepPriceId()));
} }
} }
...@@ -1140,8 +1178,8 @@ public class ProdCostCalculation { ...@@ -1140,8 +1178,8 @@ public class ProdCostCalculation {
// 比较最大值 // 比较最大值
ProductPriceStepPackagingDO stepPackagingDO = ProductPriceStepPackagingDO stepPackagingDO =
stepPackagingDOList.stream().filter( stepPackagingDOList.stream().filter(
step -> StringUtils.isNotBlank(step.getPackagingTypes()) && step -> StringUtils.isNotBlank(step.getPackagingTypes()) &&
packagingTypeVerify(step.getPackagingTypes().split(StrUtil.COMMA),prodParam.getPackages())). packagingTypeVerify(step.getPackagingTypes().split(StrUtil.COMMA), prodParam.getPackages())).
max(Comparator.comparing(ProductPriceStepPackagingDO::getPackagingPrice)).orElse(null); max(Comparator.comparing(ProductPriceStepPackagingDO::getPackagingPrice)).orElse(null);
if (Objects.nonNull(stepPackagingDO)) { if (Objects.nonNull(stepPackagingDO)) {
prodParam.setPackagingFreightPrice( prodParam.setPackagingFreightPrice(
...@@ -1329,11 +1367,11 @@ public class ProdCostCalculation { ...@@ -1329,11 +1367,11 @@ public class ProdCostCalculation {
} else { } else {
productPriceDO.setAllPrice(BigDecimal.ZERO); productPriceDO.setAllPrice(BigDecimal.ZERO);
} }
//
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("2运费计量单位 为空"); // z.setTestname("2运费计量单位 为空");
zTestMapper.insert(z); // zTestMapper.insert(z);
return; return;
} }
...@@ -1345,10 +1383,10 @@ public class ProdCostCalculation { ...@@ -1345,10 +1383,10 @@ public class ProdCostCalculation {
// 添加的逻辑 // 添加的逻辑
if (productPriceDO.getPriceType() == null) { if (productPriceDO.getPriceType() == null) {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("3价格类型 为空"); // z.setTestname("3价格类型 为空");
zTestMapper.insert(z); // zTestMapper.insert(z);
return; return;
} }
...@@ -1368,10 +1406,10 @@ public class ProdCostCalculation { ...@@ -1368,10 +1406,10 @@ public class ProdCostCalculation {
productPriceDO.setNeedPay(null); productPriceDO.setNeedPay(null);
productPriceDO.setAllPrice(BigDecimal.ZERO); productPriceDO.setAllPrice(BigDecimal.ZERO);
} }
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("4价格类型 为全包价,无需计算清关费"); // z.setTestname("4价格类型 为全包价,无需计算清关费");
zTestMapper.insert(z); // zTestMapper.insert(z);
return; return;
} }
...@@ -1391,21 +1429,21 @@ public class ProdCostCalculation { ...@@ -1391,21 +1429,21 @@ public class ProdCostCalculation {
productPriceDO.setNeedPay(null); productPriceDO.setNeedPay(null);
productPriceDO.setTransportPrice(BigDecimal.ZERO); productPriceDO.setTransportPrice(BigDecimal.ZERO);
String s = "5线路无牌无液无电运费阶梯价不存在【" + num + // String s = "5线路无牌无液无电运费阶梯价不存在【" + num +
prodParam.getUnitDO().getFuhao() + "】该档次"; // prodParam.getUnitDO().getFuhao() + "】该档次";
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname(s); // z.setTestname(s);
zTestMapper.insert(z); // zTestMapper.insert(z);
} }
if (prodParam.getClearanceUnitDO() == null) { if (prodParam.getClearanceUnitDO() == null) {
//清关费单位为空,设置清关费为0 //清关费单位为空,设置清关费为0
productPriceDO.setClearancePrice(BigDecimal.ZERO); productPriceDO.setClearancePrice(BigDecimal.ZERO);
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("6清关费单位为空"); // z.setTestname("6清关费单位为空");
zTestMapper.insert(z); // zTestMapper.insert(z);
return; return;
} }
...@@ -1437,25 +1475,25 @@ public class ProdCostCalculation { ...@@ -1437,25 +1475,25 @@ public class ProdCostCalculation {
&& productPriceDO.getClearancePrice().compareTo(BigDecimal.ZERO) > 0) { && productPriceDO.getClearancePrice().compareTo(BigDecimal.ZERO) > 0) {
if (CollectionUtil.isNotEmpty(prodParam.getPackages())) { // if (CollectionUtil.isNotEmpty(prodParam.getPackages())) {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("7产品包装类型list为:" + // z.setTestname("7产品包装类型list为:" +
prodParam.getPackages().toString()); // prodParam.getPackages().toString());
zTestMapper.insert(z); // zTestMapper.insert(z);
} else { // } else {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
String s = "8产品包装类型List为空"; // String s = "8产品包装类型List为空";
if (prodParam.getPackaging() == null) { // if (prodParam.getPackaging() == null) {
s += ",包装类型也为空"; // s += ",包装类型也为空";
} else { // } else {
s += ",包装类型" + prodParam.getPackaging(); // s += ",包装类型" + prodParam.getPackaging();
} // }
//
z.setTestname(s); // z.setTestname(s);
zTestMapper.insert(z); // zTestMapper.insert(z);
} // }
//TODO 获取线路设置的空运清关费 //TODO 获取线路设置的空运清关费
//PACKAGING_TYPE 包装要求 数据字典中的数据 //PACKAGING_TYPE 包装要求 数据字典中的数据
// 1箱,2编织袋,3木架,4木箱,5托,6航空箱,7桶,8压缩包,9铁架 // 1箱,2编织袋,3木架,4木箱,5托,6航空箱,7桶,8压缩包,9铁架
...@@ -1497,12 +1535,12 @@ public class ProdCostCalculation { ...@@ -1497,12 +1535,12 @@ public class ProdCostCalculation {
this.calculationUnitAsValue(prodParam, this.calculationUnitAsValue(prodParam,
productPriceDO, lineClearanceUnitDO, 1); productPriceDO, lineClearanceUnitDO, 1);
if (lineClearanceNum != null) { // if (lineClearanceNum != null) {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("99lineClearanceNum=" + lineClearanceNum); // z.setTestname("99lineClearanceNum=" + lineClearanceNum);
zTestMapper.insert(z); // zTestMapper.insert(z);
} // }
//ecw_line_channel_price_step_clearance //ecw_line_channel_price_step_clearance
//线路渠道清关费阶梯价格 //线路渠道清关费阶梯价格
List<LineChannelPriceStepClearanceDO> List<LineChannelPriceStepClearanceDO>
...@@ -1560,12 +1598,12 @@ public class ProdCostCalculation { ...@@ -1560,12 +1598,12 @@ public class ProdCostCalculation {
} }
} else { } else {
//线路渠道清关费阶梯价格 为空 //线路渠道清关费阶梯价格 为空
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("9线路渠道清关费阶梯价格 为空lineId=" // z.setTestname("9线路渠道清关费阶梯价格 为空lineId="
+ lineId + "channelId=" + channelId + "lineClearanceNum=" + // + lineId + "channelId=" + channelId + "lineClearanceNum=" +
lineClearanceNum); // lineClearanceNum);
zTestMapper.insert(z); // zTestMapper.insert(z);
} }
} }
...@@ -1603,20 +1641,20 @@ public class ProdCostCalculation { ...@@ -1603,20 +1641,20 @@ public class ProdCostCalculation {
clearancePrice = clearanceBasePrice; clearancePrice = clearanceBasePrice;
} }
} else { } else {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("10线路渠道包装类型为空lineId=" // z.setTestname("10线路渠道包装类型为空lineId="
+ lineId + "channelId=" + channelId); // + lineId + "channelId=" + channelId);
zTestMapper.insert(z); // zTestMapper.insert(z);
//产品阶梯价的清关价 //产品阶梯价的清关价
clearancePrice = clearanceBasePrice; clearancePrice = clearanceBasePrice;
} }
//设置清关价 //设置清关价
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("计算出的清关价为:" + // z.setTestname("计算出的清关价为:" +
clearancePrice.getClearancePrice()); // clearancePrice.getClearancePrice());
zTestMapper.insert(z); // zTestMapper.insert(z);
productPriceDO.setClearancePrice( productPriceDO.setClearancePrice(
clearancePrice.getClearancePrice()); clearancePrice.getClearancePrice());
...@@ -1633,14 +1671,14 @@ public class ProdCostCalculation { ...@@ -1633,14 +1671,14 @@ public class ProdCostCalculation {
} else { } else {
zTest3 z = new zTest3(); // zTest3 z = new zTest3();
z.setCreatedate(new Date()); // z.setCreatedate(new Date());
z.setTestname("线路无牌无液无电清关费阶梯价不存在,不符合逻辑条件【" // z.setTestname("线路无牌无液无电清关费阶梯价不存在,不符合逻辑条件【"
+ num + // + num +
prodParam.getClearanceUnitDO().getFuhao() + "】该档次" // prodParam.getClearanceUnitDO().getFuhao() + "】该档次"
); // );
//
zTestMapper.insert(z); // zTestMapper.insert(z);
productPriceDO.setClearancePrice(BigDecimal.ZERO); productPriceDO.setClearancePrice(BigDecimal.ZERO);
} }
} }
......
package cn.iocoder.yudao.module.product.dal.dataobject.coupon; //package cn.iocoder.yudao.module.product.dal.dataobject.coupon;
//
import com.baomidou.mybatisplus.annotation.TableName; //import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; //import lombok.Data;
//
import java.util.Date; //import java.util.Date;
//
@TableName("z_test") //@TableName("z_test")
@Data //@Data
public class zTest3 { //public class zTest3 {
//
private Long id; // private Long id;
private String testname; // private String testname;
private Date createdate; // private Date createdate;
} //}
package cn.iocoder.yudao.module.product.dal.mysql.coupon; //package cn.iocoder.yudao.module.product.dal.mysql.coupon;
//
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper; //import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3; ////import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import org.apache.ibatis.annotations.Mapper; //import org.apache.ibatis.annotations.Mapper;
//
@Mapper //@Mapper
public interface ZTestMapper3 extends AbstractMapper<zTest3> { //public interface ZTestMapper3 extends AbstractMapper<zTest3> {
} //}
//
...@@ -322,7 +322,7 @@ public class ProdConditionParam { ...@@ -322,7 +322,7 @@ public class ProdConditionParam {
@ApiModelProperty(value = "货值货币id") @ApiModelProperty(value = "货值货币id")
private Integer worthCurrency; private Integer worthCurrency;
@ApiModelProperty(value = "类型:1 正常计算 2 特价申请已传入的商品单价计算 3 指定重泡货标准计算 4 佣金设置 5 批量加价 6 订单优惠更新") @ApiModelProperty(value = "类型:1 正常计算 2 特价申请已传入的商品单价计算 3 指定重泡货标准计算 4 佣金设置 5 批量加价 6 订单优惠更新 7 检查优惠(如果满足当前优惠卷,则继续使用(即使过期也可以),如果不满足则匹配最新的优惠(排除过期))")
private Integer calculationType = 1; private Integer calculationType = 1;
@ApiModelProperty(value = "上次计价使用的优惠信息") @ApiModelProperty(value = "上次计价使用的优惠信息")
......
...@@ -24,10 +24,10 @@ import cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO; ...@@ -24,10 +24,10 @@ import cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO;
import cn.iocoder.yudao.module.ecw.api.internalMessage.InternalMessageApi; import cn.iocoder.yudao.module.ecw.api.internalMessage.InternalMessageApi;
import cn.iocoder.yudao.module.ecw.api.internalMessage.dto.InternalMessageCreateDto; import cn.iocoder.yudao.module.ecw.api.internalMessage.dto.InternalMessageCreateDto;
import cn.iocoder.yudao.module.product.convert.product.ProductPriceConvert; import cn.iocoder.yudao.module.product.convert.product.ProductPriceConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3; //import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import cn.iocoder.yudao.module.product.dal.dataobject.product.*; import cn.iocoder.yudao.module.product.dal.dataobject.product.*;
import cn.iocoder.yudao.module.product.dal.dataobject.productPriceSnapshot.ProductPriceSnapshotDO; import cn.iocoder.yudao.module.product.dal.dataobject.productPriceSnapshot.ProductPriceSnapshotDO;
import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3; //import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3;
import cn.iocoder.yudao.module.product.dal.mysql.product.*; import cn.iocoder.yudao.module.product.dal.mysql.product.*;
import cn.iocoder.yudao.module.product.dal.mysql.productPriceSnapshot.ProductPriceSnapshotMapper; import cn.iocoder.yudao.module.product.dal.mysql.productPriceSnapshot.ProductPriceSnapshotMapper;
import cn.iocoder.yudao.module.product.dto.AirClearancePriceResultDto; import cn.iocoder.yudao.module.product.dto.AirClearancePriceResultDto;
...@@ -129,8 +129,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper, ...@@ -129,8 +129,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
@Resource @Resource
private ProductPriceStepClearanceService productPriceStepClearanceService; private ProductPriceStepClearanceService productPriceStepClearanceService;
@Resource // @Resource
private ZTestMapper3 zTestMapper; // private ZTestMapper3 zTestMapper;
private static final String PREFIX = "price_batch_update_"; private static final String PREFIX = "price_batch_update_";
...@@ -1259,10 +1259,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper, ...@@ -1259,10 +1259,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//没有价格信息不继续后面的处理 //没有价格信息不继续后面的处理
if (!hasPrice) { if (!hasPrice) {
zTest3 m = new zTest3(); // zTest3 m = new zTest3();
m.setTestname("没有价格信息,不后续处理"); // m.setTestname("没有价格信息,不后续处理");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper.insert(m); // zTestMapper.insert(m);
continue; continue;
} }
...@@ -1298,10 +1298,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper, ...@@ -1298,10 +1298,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
handleData.setNeedHandleList(needHandleList); handleData.setNeedHandleList(needHandleList);
applicationContext.publishEvent(handleData); applicationContext.publishEvent(handleData);
} else { } else {
zTest3 m = new zTest3(); // zTest3 m = new zTest3();
m.setTestname("needHandleList 为空"); // m.setTestname("needHandleList 为空");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper.insert(m); // zTestMapper.insert(m);
} }
} }
......
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