Commit 9468acdb authored by zhengyi's avatar zhengyi

Merge remote-tracking branch 'origin/release-fix' into release-fix

# Conflicts:
#	sql/v2.1/20240904.sql
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderPickup/OrderPickupServiceImpl.java
parents dfd84a4a f3f2947e
......@@ -11,7 +11,7 @@
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:04:17
Date: 06/09/2024 11:23:57
*/
SET NAMES utf8mb4;
......@@ -23,6 +23,7 @@ SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `score_rule`;
CREATE TABLE `score_rule` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规则编号',
`type` int NOT NULL COMMENT '指标类型',
`title_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '规则标题中文',
`title_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '规则标题英文',
......@@ -46,6 +47,6 @@ CREATE TABLE `score_rule` (
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 42 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
......@@ -11,7 +11,7 @@
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:17:08
Date: 06/09/2024 11:26:34
*/
SET NAMES utf8mb4;
......@@ -23,6 +23,7 @@ SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `ecw_reward_redeem`;
CREATE TABLE `ecw_reward_redeem` (
`id` bigint NOT NULL COMMENT '主键',
`redemption_number` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '兑换记录编号',
`member_id` bigint NOT NULL COMMENT '会员id',
`reward_id` bigint NOT NULL COMMENT '礼品id',
`status` int NULL DEFAULT NULL COMMENT '兑换状态',
......
......@@ -17,4 +17,6 @@ alter table `ecw_order`
add column `pick_num` int DEFAULT 0 COMMENT '提货箱数';
-- 批量刷新订单提货数量、提货率、提货状态
update ecw_order t LEFT JOIN (select a.order_id,sum(a.pick_num) as pickNum from ecw_order_pickup a where a.deleted=0 GROUP BY a.order_id) t1 on t.order_no=t1.order_id set t.pick_num=t1.pickNum,t.pick_ratio=ROUND(t1.pickNum/t.sum_num,2)*100,t.pick_state=(case when t1.pickNum is null then 0 when t1.pickNum=t.sum_num then 3 else 2 end);
\ No newline at end of file
update ecw_order t LEFT JOIN (select a.order_id,sum(a.pick_num) as pickNum from ecw_order_pickup a where a.deleted=0 GROUP BY a.order_id) t1 on t.order_no=t1.order_id set t.pick_num=t1.pickNum,t.pick_ratio=ROUND(t1.pickNum/t.sum_num,2)*100,t.pick_state=(case when t1.pickNum is null then 0 when t1.pickNum=t.sum_num then 3 else 2 end);
-- 已提货和部分提货的订单批量刷新订单主状态
update ecw_order t set t.`status`=16 where t.`status` in (20,21);
\ No newline at end of file
......@@ -6220,6 +6220,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(memberUserDO)){
// 会员端下单,需要保存会员id信息
newOrder.setUserId(memberUserDO.getId());
}else {
newOrder.setUserId(0L);
}
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
String creator = String.valueOf(loginUser != null ? loginUser.getId() : null);
......@@ -6384,6 +6386,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderItemDO.setWeight(io.getWeight());
orderItemDO.setQuantity(io.getQuantity());
orderItemDO.setNum(io.getQuantity());
orderItemDO.setWorth(io.getWorth());
orderItemDO.setBoxGauge(io.getBoxGauge());
orderItemDO.setBrand(io.getBrand());
orderItemDO.setBrandType(io.getBrandType());
......@@ -6399,7 +6402,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
*/
private static void initializeOrderInfo(OrderDO newOrder) {
newOrder.setOrderId(null);
newOrder.setUserId(null);
newOrder.setUserId(0L);
newOrder.setSumNum(null);
newOrder.setSumQuantity(null);
newOrder.setSumVolume(null);
......
......@@ -124,7 +124,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup.setOrderStatus(orderDO.getStatus());
}
orderPickupMapper.insert(orderPickup);
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
// orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//升级客户vip等级
updateCustomerLevelUp(orderDO);
......@@ -190,7 +190,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
}
}
}
dealDeliveryRate(createReqVO.getOrderId(),createReqVO.getPickNum(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
dealDeliveryRate(createReqVO.getOrderId(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
// 返回
return orderPickup.getId();
}
......@@ -207,14 +207,13 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
return orderDO.getSumNum() - allPickNum;
}
private void dealDeliveryRate(String orderNo,Integer pickNum,Integer sumNum,Integer pickState) {
private void dealDeliveryRate(String orderNo,Integer sumNum,Integer pickState) {
List<OrderPickupDO> orderPickupDOS = orderPickupMapper.selectList(OrderPickupDO::getOrderId, orderNo);
int pickedSum = orderPickupDOS.stream().mapToInt(OrderPickupDO::getPickNum).sum();
int allPickNum = pickedSum + pickNum;
BigDecimal pickRatio = new BigDecimal((double) (allPickNum / sumNum) * 100 );
BigDecimal pickRatio = new BigDecimal((double) pickedSum / sumNum * 100 );
pickRatio.setScale(2, RoundingMode.HALF_UP);
orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getPickNum, allPickNum)
.set(OrderDO::getPickNum, pickedSum)
.set(OrderDO::getPickRatio, pickRatio)
.set(OrderDO::getPickState,pickState)
.eq(OrderDO::getOrderNo,orderNo)
......@@ -334,14 +333,14 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
// 获取未撤销的提货记录
List<OrderPickupDO> pickupDOList = orderPickupMapper.selectList(new LambdaQueryWrapper<OrderPickupDO>().eq(OrderPickupDO::getOrderId, orderPickupDO.getOrderId()).orderByDesc(OrderPickupDO::getPickTime));
if (CollectionUtil.isNotEmpty(pickupDOList) && pickupDOList.size() > 0) {
orderService.updateStatus(one.getOrderId(), null, OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null);
dealDeliveryRate(one.getOrderNo(),-orderPickupDO.getPickNum(),one.getSumNum(),PickStateEnum.partPick.getPickState());
// orderService.updateStatus(one.getOrderId(), null, OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null);
dealDeliveryRate(one.getOrderNo(),one.getSumNum(),PickStateEnum.partPick.getPickState());
} else {
// 找到已删除 订单状态大于0的数据来恢复订单状态
OrderPickupDO delOrderPickupDO = orderPickupMapper.selectDeletedPickup(orderPickupDO.getOrderId());
// 这里需要考虑到老数据的空指针异常
orderService.updateStatus(one.getOrderId(), null, Objects.nonNull(delOrderPickupDO) ? delOrderPickupDO.getOrderStatus() : 16, null, null, null, null, null);
dealDeliveryRate(one.getOrderNo(),-orderPickupDO.getPickNum(),one.getSumNum(),PickStateEnum.picked.getPickState());
// orderService.updateStatus(one.getOrderId(), null, Objects.nonNull(delOrderPickupDO) ? delOrderPickupDO.getOrderStatus() : 16, null, null, null, null, null);
dealDeliveryRate(one.getOrderNo(),one.getSumNum(),PickStateEnum.picked.getPickState());
}
if (Objects.equals(one.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue())) {
......@@ -492,7 +491,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup.setOrderStatus(orderDO.getStatus());
}
orderPickupMapper.insert(orderPickup);
orderService.updateStatus(null, orderDO.getOrderNo(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
// orderService.updateStatus(null, orderDO.getOrderNo(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//升级客户vip等级
updateCustomerLevelUp(orderDO);
......@@ -535,7 +534,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
}
}
}
dealDeliveryRate(createReqVO.getOrderId(),createReqVO.getPickNum(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
dealDeliveryRate(createReqVO.getOrderId(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
}
}
}
......@@ -650,7 +649,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup.setOrderStatus(orderDO.getStatus());
}
orderPickupMapper.insert(orderPickup);
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
// orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//发送站内信
sendMsg(orderDO.getOrderNo(), orderDO.getMarks(), String.valueOf(orderPickup.getPickNum()), DateUtils.formatDate(orderPickup.getPickTime()), Long.valueOf(orderPickup.getCreator()));
......@@ -658,7 +657,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
OrderDO orderDO1 = new OrderDO();
BeanUtils.copyProperties(orderDO, orderDO1);
insertCustomLevelAndCreditLevelLog(orderPickup, orderDO1, false);
dealDeliveryRate(createReqVO.getOrderId(),createReqVO.getPickNum(),orderDO.getSumNum(),PickStateEnum.partPick.getPickState());
dealDeliveryRate(createReqVO.getOrderId(),orderDO.getSumNum(),PickStateEnum.partPick.getPickState());
} else if (num < 0) {
//如果分批提的数量加上已分批提的数量超过了总量 则重新计算成剩余的量
throw exception(PICK_UP_TOO_MORE);
......@@ -673,7 +672,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup.setOrderStatus(orderDO.getStatus());
}
orderPickupMapper.insert(orderPickup);
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
// orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//发送站内信
sendMsg(orderDO.getOrderNo(), orderDO.getMarks(), String.valueOf(orderPickup.getPickNum()), DateUtils.formatDate(orderPickup.getPickTime()), Long.valueOf(orderPickup.getCreator()));
......@@ -683,7 +682,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
BeanUtils.copyProperties(orderDO, orderDO1);
insertCustomLevelAndCreditLevelLog(orderPickup, orderDO1, true);
updateCustomerLevelUp(orderDO1);
dealDeliveryRate(createReqVO.getOrderId(),createReqVO.getPickNum(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
dealDeliveryRate(createReqVO.getOrderId(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
}
orderBusinessService.addOrderOperateLog(orderDO.getOrderId(), "", "分批提货", "");
if (Objects.equals(orderDO.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue())) {
......
......@@ -440,10 +440,16 @@ public class OrderBackPageVO {
@ApiModelProperty(value = "报价单状态")
private Integer offerStatus;
/**
* 状态说明
*/
@ApiModelProperty(value = "状态说明")
private String statusText;
/**
* 动态
*/
@ApiModelProperty(value = "动态")
private String statusMsg;
......@@ -549,6 +555,8 @@ public class OrderBackPageVO {
public void setStatus(Integer status) {
this.status = status;
Integer lang = Objects.nonNull(this.lang) ? this.lang : I18nMessage.getLang();
this.statusText = lang == 0 ? OrderStatusEnum.valueOf(status).getNameZh() : OrderStatusEnum.valueOf(status).getNameEn();
this.getOrderDesc();
}
......
......@@ -559,10 +559,7 @@ public class OrderQueryVO {
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
@ApiModelProperty(value = "订单异常状态(字典 order_abnormal_state)")
private List<Integer> abnormalStates;
@ApiModelProperty(value = "订单异常状态(字典 order_abnormal_state)")
@ApiModelProperty(value = "始发地ids")
private List<Long> objectiveIds;
@ApiModelProperty(value = "始发仓IDs")
......
......@@ -300,6 +300,7 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
.likeIfPresent(ProductDO::getProductCode, reqVO.getProductCode())
.likeIfPresent(ProductDO::getCustomsCode, reqVO.getCustomsCode())
.eqIfPresent(ProductDO::getTypeId, reqVO.getTypeId())
.inIfPresent(ProductDO::getTypeId, reqVO.getTypeIds())
.eqIfPresent(ProductDO::getAuditStatus, reqVO.getAuditStatus())
.eqIfPresent(ProductDO::getStatus, reqVO.getStatus())
.inIfPresent(ProductDO::getId, idList)
......
......@@ -16,6 +16,9 @@ public class ProductExportReqVO {
@ApiModelProperty(value = "商品类型id")
private Long typeId;
@ApiModelProperty(value = "商品类型ids")
private List<Long> typeIds;
@ApiModelProperty(value = "商品属性id")
private String attrId;
......
......@@ -1201,7 +1201,7 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
realClearanceFreightCurrency = 6L;
}
//总金额右边再加上清关费
List<ReceivableOrderPayedFeeTypeVO> receivableQingGuanFeiList = payedFeeTypeVOList.stream().filter(i -> i.getFeeType() == 2).collect(Collectors.toList());
List<ReceivableOrderPayedFeeTypeVO> receivableQingGuanFeiList = payedFeeTypeVOList.stream().filter(i -> i.getFeeType() == 2 && i.getFeeSource() == 1).collect(Collectors.toList());
for (ReceivableOrderPayedFeeTypeVO i : receivableQingGuanFeiList) {
if (i.getCurrencyId() != realClearanceFreightCurrency) {
totalRight = totalRight.add(changeAmountToDestCurrency(i.getCurrencyId(), realClearanceFreightCurrency, i.getTotalAmount()));
......
### list
GET {{baseUrl}}/system/dept/list-my-and-under-simple
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
......@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.dept;
import cn.iocoder.yudao.framework.common.util.spring.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.*;
import cn.iocoder.yudao.module.system.convert.dept.DeptConvert;
......@@ -88,6 +89,23 @@ public class DeptController {
return success(DeptConvert.INSTANCE.convertList02(list));
}
@GetMapping("/list-my-and-under-simple")
@ApiOperation(value = "获取自己和下属部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项")
public CommonResult<List<DeptSimpleRespVO>> getMyAndUnderSimpleDepts() {
// 获得部门列表,只要开启状态的
DeptListReqVO reqVO = new DeptListReqVO();
reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Long deptId = loginUser.getDeptId();
List<DeptDO> list = deptService.getDeptsByParentIdFromCache(deptId, true);
DeptDO dept = deptService.getDept(deptId);
list.add(dept);
// 排序后,返回给前端
list.sort(Comparator.comparing(DeptDO::getSort));
return success(DeptConvert.INSTANCE.convertList02(list));
}
@GetMapping("/get")
@ApiOperation("获得部门信息")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
......
......@@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.wealth.controller.admin.job;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receipt.ReceiptDO;
......@@ -19,7 +18,6 @@ import java.util.List;
* 收款单自动核销任务
*/
@Component
@TenantJob
@Slf4j
public class ReceiptAutoWriteOffJob implements JobHandler {
......@@ -53,6 +51,7 @@ public class ReceiptAutoWriteOffJob implements JobHandler {
try {
//判断当前收款单下的收款明细是不是全部是已核销并且核销比例要大于配置(params)
Boolean result = receiptService.judgingProportion(receiptDO, paramArray[0]);
log.error("收款单判断{},{}", receiptDO.getReceiptNo(), result);
if (result) {
receiptService.autoWriteOffReceipt(receiptDO, paramArray[1], adminUserRespDTO.getNickname());
}
......
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