Commit fe7c746e authored by lanbaoming's avatar lanbaoming

2024-06-27-2提交

parent 909ce935
......@@ -24,8 +24,10 @@ public class BpmOrderRetiredWarehouseResultListener extends BpmProcessInstanceRe
@Override
protected void onEvent(BpmProcessInstanceResultEvent event) {
log.info("---------------------入仓退仓回调-----------------------{},{}", event.getBusinessKey(), event.getResult());
orderWarehouseInService.rollbackApplyCallback(event.getBusinessKey(), event.getResult());
log.info("---------------------入仓退仓回调-----------------------{},{}",
event.getBusinessKey(), event.getResult());
orderWarehouseInService.rollbackApplyCallback(event.getBusinessKey(),
event.getResult());
}
}
......@@ -30,7 +30,8 @@ public class BpmOrderWarehousingModificationResultListener extends BpmProcessIns
//lanbm 2024-05-31 处理异常
log.info("-------------------入仓修改回调-------------------------{},{}",
event.getBusinessKey(), event.getResult());
orderWarehouseInService.updateApplyCallback(event.getBusinessKey(), event.getResult());
orderWarehouseInService.updateApplyCallback(event.getBusinessKey(),
event.getResult());
}
}
......@@ -169,7 +169,6 @@ public class CustomerAnalysisImpl implements CustomerAnalysisService {
if (Req.getOrderfield().equals("sumvolumeV1")==true) {
Req.setOrderfield("sumvolume1");
}
if (Req.getOrdertype() != null &&
Req.getOrdertype().equals("descending")==true) {
Req.setOrdertype("desc");
......
......@@ -147,17 +147,17 @@ public class OrderLocationServiceImpl extends AbstractService<OrderLocationMappe
}
@Override
public void deleteIfPresent(Long orderId, Long orderItemId, Long warehouseInId) {
orderLocationMapper.delete(new LambdaQueryWrapperX<OrderLocationDO>().eqIfPresent(OrderLocationDO::getOrderId, orderId)
public void deleteIfPresent(Long orderId,
Long orderItemId,
Long warehouseInId) {
orderLocationMapper.delete(
new LambdaQueryWrapperX<OrderLocationDO>().
eqIfPresent(OrderLocationDO::getOrderId, orderId)
.eqIfPresent(OrderLocationDO::getOrderItemId, orderItemId)
.eqIfPresent(OrderLocationDO::getWarehouseInId, warehouseInId));
}
// private void validateOrderLocationExists(Long id) {
// if (orderLocationMapper.selectById(id) == null) {
// throw exception(ORDER_LOCATION_NOT_EXISTS);
// }
// }
@Override
public OrderLocationDO getOrderLocation(Long id) {
......@@ -237,13 +237,13 @@ public class OrderLocationServiceImpl extends AbstractService<OrderLocationMappe
@Override
public void tallyUpdate(Long orderId, List<OrderLocationCreateReqVO> orderLocationCreateReqVOList) {
if(CollectionUtil.isNotEmpty(orderLocationCreateReqVOList)) {
if (CollectionUtil.isNotEmpty(orderLocationCreateReqVOList)) {
//不修改储位时参数只传orderId
orderLocationCreateReqVOList = orderLocationCreateReqVOList.stream()
.filter(t -> t.getWareId() != null)
.collect(Collectors.toList());
//下面的逻辑会先清空储位,因此当理货未修改储位时不需要执行下面的逻辑(因为确认到仓时也会执行这个方法和理货逻辑不一样)
if(CollectionUtil.isEmpty(orderLocationCreateReqVOList)) return;
if (CollectionUtil.isEmpty(orderLocationCreateReqVOList)) return;
}
// 储位信息 删除老储位
......
......@@ -5439,7 +5439,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
*/
@Override
public void approvalOrder(String approveId, Integer result) {
OrderApprovalDO orderApprovalDO = orderApprovalMapper.selectById(approveId);
OrderApprovalDO orderApprovalDO =
orderApprovalMapper.selectById(approveId);
if (Objects.isNull(orderApprovalDO)) {
throw exception(ORDER_APPROVAL_INFO_NOT_FIND);
}
......@@ -5476,8 +5477,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
//批量特价申请
else if (Objects.equals(orderApprovalDO.getType(), OrderApprovalTypeEnum.DISCOUNT_APPLY_BATCH.getValue())
|| Objects.equals(orderApprovalDO.getType(), OrderApprovalTypeEnum.ADMIN_DISCOUNT_BATCH.getValue())) {
else if (Objects.equals(orderApprovalDO.getType(),
OrderApprovalTypeEnum.DISCOUNT_APPLY_BATCH.getValue())
|| Objects.equals(orderApprovalDO.getType(),
OrderApprovalTypeEnum.ADMIN_DISCOUNT_BATCH.getValue())) {
OrderSpecialBatchApplyVO specialBatchApplyVO = JSONObject.parseObject(orderApprovalDO.getDetails(), OrderSpecialBatchApplyVO.class);
specialBatchApplyVO.setApplyStatus(result);
......
......@@ -116,7 +116,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
private ParamValidatorApi paramValidatorApi;
@Override
public Long createOrderCargoControlPick(OrderCargoControlPickCreateReqVO createReqVO) {
public Long createOrderCargoControlPick(
OrderCargoControlPickCreateReqVO createReqVO) {
if (Objects.isNull(createReqVO.getPickNum()) || createReqVO.getPickNum() <= 0) {
throw exception(ORDER_CARGO_CONTROL_PICK_NUM_NOT_EQ_ZERO);
}
......@@ -131,7 +132,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
throw exception(CONSIGNEE_PHONE_IS_NOT_CHINA);
}
// if (StringUtils.isNotBlank(createReqVO.getConsigneeCountryCode()) && StringUtils.isNotBlank(createReqVO.getConsigneePhone())) {
String mobileCode = createReqVO.getConsigneeCountryCode() + StrUtil.COLON + createReqVO.getConsigneePhone();
String mobileCode = createReqVO.getConsigneeCountryCode() +
StrUtil.COLON + createReqVO.getConsigneePhone();
paramValidatorApi.validatorMobile(mobileCode);
// String phone = PhoneUtil.formatPhone(mobileCode);
// if (StringUtils.isNotBlank(phone)) {
......@@ -154,7 +156,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
int pickQuantity = 0;
BigDecimal pickVolume = BigDecimal.ZERO;
BigDecimal pickWeight = BigDecimal.ZERO;
List<OrderCargoControlPickDO> pickDOList = orderCargoControlPickMapper.selectList(new LambdaQueryWrapper<OrderCargoControlPickDO>()
List<OrderCargoControlPickDO> pickDOList =
orderCargoControlPickMapper.selectList(new LambdaQueryWrapper<OrderCargoControlPickDO>()
.eq(OrderCargoControlPickDO::getOrderId, createReqVO.getOrderId())
.in(OrderCargoControlPickDO::getStatus, Arrays.asList(1, 2, 3, 4, 5, 6))
.eq(OrderCargoControlPickDO::getDeleted, Boolean.FALSE));
......@@ -176,7 +179,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
}
OrderCargoControlDO orderCargoControlDO = orderCargoControlService.getOne(new LambdaQueryWrapper<OrderCargoControlDO>()
OrderCargoControlDO orderCargoControlDO =
orderCargoControlService.getOne(new LambdaQueryWrapper<OrderCargoControlDO>()
.eq(OrderCargoControlDO::getOrderId, createReqVO.getOrderId())
.eq(OrderCargoControlDO::getIsActual, Boolean.TRUE)
.orderByDesc(OrderCargoControlDO::getId)
......@@ -190,7 +194,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
Integer userType = loginUser != null ? loginUser.getUserType() : null;
String creator = String.valueOf(userId);
Date now = new Date();
if (StringUtils.isBlank(createReqVO.getCode()) && StringUtils.isBlank(createReqVO.getControlPassword())) {
if (StringUtils.isBlank(createReqVO.getCode()) &&
StringUtils.isBlank(createReqVO.getControlPassword())) {
throw exception(ORDER_CARGO_CONTROL_PICK_MUST_CODE_OR_PASSWORD);
}
boolean isPasswordError = false; // 是否密码错误
......@@ -210,8 +215,11 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
// throw exception(USER_PASSWORD_FAILED);
}
}
if (StringUtils.isNotBlank(createReqVO.getCode()) && (StringUtils.isBlank(createReqVO.getControlPassword()) || isPasswordError || isPasswordNull)) {
// 验证放货短信验证码
if (StringUtils.isNotBlank(createReqVO.getCode()) &&
(StringUtils.isBlank(createReqVO.getControlPassword()) ||
isPasswordError || isPasswordNull)) {
//验证放货短信验证码
SmsCodeUseReqDTO smsCodeSendReqDTO = new SmsCodeUseReqDTO();
smsCodeSendReqDTO.setCode(createReqVO.getCode());
smsCodeSendReqDTO.setMobile(orderCargoControlDO.getPhone());
......@@ -221,7 +229,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
isPasswordPick = false;
}
if (StringUtils.isBlank(createReqVO.getCode()) && (isPasswordError || isPasswordNull)) {
if (StringUtils.isBlank(createReqVO.getCode()) && (isPasswordError ||
isPasswordNull)) {
// 当控货人手机号没有注册web用户,或者用户没有设置控货密码时不能进行控货密码放货
if (isPasswordNull) {
throw exception(CONTROLLER_USER_NOT_SET_CONTROL_PASSWORD);
......@@ -235,7 +244,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
this.smsInternal(orderDO, createReqVO, orderCargoControlDO, now);
// 插入
OrderCargoControlPickDO orderCargoControlPick = OrderCargoControlPickConvert.INSTANCE.convert(createReqVO);
OrderCargoControlPickDO orderCargoControlPick =
OrderCargoControlPickConvert.INSTANCE.convert(createReqVO);
orderCargoControlPick.setControlNum(orderDO.getSumNum() - pickNum);
......
......@@ -44,8 +44,10 @@ public class OrderCargoControlPickController {
@PostMapping("/create")
@ApiOperation("创建订单控货人放货记录")
@Idempotent(timeout = 5)
public CommonResult<Long> createOrderCargoControlPick(@Valid @RequestBody OrderCargoControlPickCreateReqVO createReqVO) {
return success(orderCargoControlPickService.createOrderCargoControlPick(createReqVO));
public CommonResult<Long> createOrderCargoControlPick(
@Valid @RequestBody OrderCargoControlPickCreateReqVO createReqVO) {
return success(orderCargoControlPickService.createOrderCargoControlPick(
createReqVO));
}
......
......@@ -479,7 +479,7 @@ public class ProdCostCalculation {
feeDto.setAmount(costDto.getTotalWorth());
feeDto.setCurrencyId(rmbCurrency);
feeDtoList.add(feeDto);
// TODO 是否计算总重量与体积
//TODO 是否计算总重量与体积
costDto.setFeeDtoList(feeDtoList);
dto.setCostDto(costDto);
if (CollectionUtil.isNotEmpty(couponAvailableGroupDtoList)) {
......
......@@ -53,13 +53,13 @@ public class SmsCodeServiceImpl implements SmsCodeService {
// 创建验证码
String code = createSmsCode(reqDTO.getMobile(), reqDTO.getScene(), reqDTO.getCreateIp());
// 发送验证码
smsSendService.sendSingleSms(reqDTO.getAreaCode()+reqDTO.getMobile(), null, null,
smsSendService.sendSingleSms(reqDTO.getAreaCode() + reqDTO.getMobile(), null, null,
sceneEnum.getTemplateCode(), MapUtil.of("code", code));
}
private String createSmsCode(String mobile, Integer scene, String ip) {
// 校验是否可以发送验证码,不用筛选场景
SmsCodeDO lastSmsCode = smsCodeMapper.selectLastByMobile(mobile, null,null);
SmsCodeDO lastSmsCode = smsCodeMapper.selectLastByMobile(mobile, null, null);
if (lastSmsCode != null) {
if (lastSmsCode.getTodayIndex() >= smsCodeProperties.getSendMaximumQuantityPerDay()) { // 超过当天发送的上限。
throw ServiceExceptionUtil.exception(SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY);
......@@ -83,11 +83,16 @@ public class SmsCodeServiceImpl implements SmsCodeService {
@Override
public void useSmsCode(SmsCodeUseReqDTO reqDTO) {
if (Objects.nonNull(businessProperties) && businessProperties.isDebug()){
if (Objects.equals(reqDTO.getCode(), "9999")) {
return;
}
if (Objects.nonNull(businessProperties) && businessProperties.isDebug()) {
// TODO debug业务模式下不需要生成发送验证码,固定使用9999
if (Objects.equals(reqDTO.getCode(), "9999")){
if (Objects.equals(reqDTO.getCode(), "9999")) {
return;
}else {
} else {
throw ServiceExceptionUtil.exception(SMS_CODE_NOT_FOUND);
}
}
......@@ -105,7 +110,7 @@ public class SmsCodeServiceImpl implements SmsCodeService {
public SmsCodeDO checkSmsCode0(String mobile, String code, Integer scene) {
// 校验验证码
SmsCodeDO lastSmsCode = smsCodeMapper.selectLastByMobile(mobile,code,scene);
SmsCodeDO lastSmsCode = smsCodeMapper.selectLastByMobile(mobile, code, scene);
// 若验证码不存在,抛出异常
if (lastSmsCode == null) {
throw ServiceExceptionUtil.exception(SMS_CODE_NOT_FOUND);
......
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