Commit 90e1c543 authored by Administrator's avatar Administrator

Merge branch 'release' into 'jd_dev'

Release最新代码合并入捷道研发分支20241115

See merge request !35
parents f73c47c2 dc53642f
-- 产品价格相关数据decimal字段长度修改
alter table ecw_product_price
modify COLUMN `transport_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '运费';
alter table ecw_product_price
modify COLUMN `clearance_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '清关费用';
alter table ecw_product_price
modify COLUMN `all_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '全包价金额';
alter table ecw_product_price
modify COLUMN `min_weight` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '最小计费重量';
alter table ecw_product_price
modify COLUMN `square` decimal(10,2) DEFAULT NULL COMMENT '方数要求';
alter table ecw_product_price
modify COLUMN `day_limit` decimal(10,2) DEFAULT NULL COMMENT '每日入仓上限,立方米';
alter table ecw_product_price
modify COLUMN `weight_limit` decimal(10,2) DEFAULT '0.00' COMMENT '路线重量上限';
alter table ecw_product_price_packaging
modify COLUMN `packaging_price` decimal(15,2) DEFAULT NULL COMMENT '包装单位收费';
alter table ecw_product_price_special
modify COLUMN `transport_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '运费';
alter table ecw_product_price_special
modify COLUMN `clearance_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '清关费用';
alter table ecw_product_price_special
modify COLUMN `all_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '全包价格';
alter table ecw_product_price_step
modify COLUMN `start_num` decimal(10,2) NOT NULL COMMENT '起始数量';
alter table ecw_product_price_step
modify COLUMN `end_num` decimal(15,2) DEFAULT NULL COMMENT '结束数量';
alter table ecw_product_price_step
modify COLUMN `transport_price` decimal(15,2) DEFAULT NULL COMMENT '运费';
alter table ecw_product_price_step
modify COLUMN `clearance_price` decimal(15,2) DEFAULT NULL COMMENT '清关费用';
alter table ecw_product_price_step
modify COLUMN `all_price` decimal(15,2) DEFAULT NULL COMMENT '全包价格';
alter table ecw_product_price_step_clearance
modify COLUMN `start_num` decimal(10,2) NOT NULL COMMENT '起始数量';
alter table ecw_product_price_step_clearance
modify COLUMN `end_num` decimal(15,2) DEFAULT NULL COMMENT '结束数量';
alter table ecw_product_price_step_clearance
modify COLUMN `clearance_price` decimal(15,2) DEFAULT NULL COMMENT '清关费用';
alter table ecw_product_price_step_packaging
modify COLUMN `packaging_price` decimal(15,2) DEFAULT NULL COMMENT '包装单位收费';
alter table ecw_product_price_step_special
modify COLUMN `transport_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '运费';
alter table ecw_product_price_step_special
modify COLUMN `clearance_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '清关费用';
alter table ecw_product_price_step_special
modify COLUMN `all_price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '全包价格';
......@@ -11,7 +11,7 @@ VALUES (25, '25', '新增跟进纪录', 'Create Customer Followup', 'customer_op
INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES (26, '26', '编辑跟进纪录', 'Update Customer Followup', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES (27, '27', '提交跟进纪录', 'Commit Customer Followup', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
VALUES (27, '27', '修改跟进状态', 'Commit Customer Followup', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
......
-- 修改费用申请记录表批量审批流程id字段类型
alter table ecw_order_fee_application
modify COLUMN `batch_bpm_business_id` varchar(64) DEFAULT NULL COMMENT '批量费用审核时流程ID';
\ No newline at end of file
-- 出货阶段订单修改、入仓修改、入仓补充按钮菜单权限
INSERT INTO `system_menu`( `name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ( '出货阶段入仓补充', 'ecw:order:shipment:warehouse_replenish', 3, 1, 1852, '', '', '', 0, '119', '2024-11-12 23:34:53', '119', '2024-11-12 23:34:53', b'0', b'1', '出货阶段入仓补充', b'0', NULL, NULL);
INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('出货阶段入仓修改', 'ecw:order:shipment:warehouse_update', 3, 1, 1852, '', '', '', 0, '119', '2024-11-12 23:34:28', '119', '2024-11-12 23:34:28', b'0', b'1', '出货阶段入仓修改', b'0', NULL, NULL);
INSERT INTO `system_menu`( `name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('出货订单编辑', 'ecw:order:shipment:update', 3, 0, 1852, '', '', '', 0, '119', '2024-10-23 23:10:39', '119', '2024-10-23 23:10:39', b'0', b'1', 'ShipmentOrderEdit', b'0', NULL, NULL);
package cn.iocoder.yudao.framework.apollo.core.event.box;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.Date;
/**
* 出货中入仓修改 Event
*
* @author yanghao
*/
@Data
@AllArgsConstructor
public class BoxOrderShipmentWarehouseInEvent {
/**
* 订单ID
*/
private Long orderId;
}
package cn.iocoder.yudao.module.customer.service.customerFollowup;
import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderNumberLogEvent;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.code.CodeUtils;
......@@ -16,14 +17,12 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.Customer
import cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper;
import cn.iocoder.yudao.module.customer.dal.mysql.customerContacts.CustomerContactsMapper;
import cn.iocoder.yudao.module.customer.dal.mysql.customerFollowup.CustomerFollowupMapper;
import cn.iocoder.yudao.module.customer.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService;
import cn.iocoder.yudao.module.customer.vo.customerFollowup.*;
import cn.iocoder.yudao.module.customer.vo.customerOperateLog.CustomerOperateLogCreateReqVO;
import cn.iocoder.yudao.module.ecw.enums.CustomerFollowupStatusEnum;
import cn.iocoder.yudao.module.ecw.enums.CustomerOperateTypeEnum;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -31,6 +30,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
......@@ -93,7 +93,7 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
// 更新编号,内部会判断冲突
//OrderNumberLogListener
OrderNumberLogEvent event = new OrderNumberLogEvent();
event.setType(3);
event.setType(6);
event.setNumberKey(FOLLOWUP_NEW_NUMBER);
applicationContext.publishEvent(event);
String newNumber = CodeUtils.getOddFollowupNumbers(event.getNumber());
......@@ -206,11 +206,16 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
// throw exception(FOLLOWUP_ALREADY_SUBMITTED);
// }
}
Date now = DateUtil.date();
Long userId = SecurityFrameworkUtils.getLoginUser().getId();
for (Long id : ids) {
CustomerFollowupDO customerFollowupDO = followupMapper.selectById(id);
Integer statusOld = customerFollowupDO.getStatus();
customerFollowupDO.setStatus(updateStatusReqVO.getStatus());
customerFollowupDO.setUpdater(String.valueOf(userId));
customerFollowupDO.setUpdateTime(now);
followupMapper.updateById(customerFollowupDO);
......@@ -231,8 +236,8 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
.setOldCustomerService(customer.getCustomerService())
.setOldEstimateEnterOpenSeaTime(customer.getEstimateEnterOpenSeaTime())
.setNewEstimateEnterOpenSeaTime(customer.getEstimateEnterOpenSeaTime())
.setOperateType(CustomerOperateTypeEnum.FOLLOWUP_COMMIT.getValue())
.setRemark("提交跟进纪录");
.setOperateType(CustomerOperateTypeEnum.FOLLOWUP_UPDATE_STATUS.getValue())
.setRemark(String.format("由【%s】修改为【%s】", statusOld == 1 ? "已提交" : "未提交", updateStatusReqVO.getStatus() == 1 ? "已提交" : "未提交"));
customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO);
}
}
......
......@@ -11,3 +11,11 @@ GET {{baseUrl}}/customer/followup/page?pageNo=1&pageSize=10&followMethods[0]=1&f
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
### 客户跟进修改状态
PUT {{baseUrl}}//customer/followup/update-status
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
{"ids":[513,512],"status":1}
\ No newline at end of file
......@@ -11,12 +11,21 @@ public class WarehouseLineSearchVO {
private String transportType;
/**始发地城市*/
private Long startCityId;
/**目的地城市*/
private Long destCityId;
/**目的地城市*/
private Long destCountryId;
/**目的仓*/
private Long destWarehouseId;
/**目的地城市*/
private List<Long> destCityIds;
/**目的地城市*/
private List<Long> destCountryIds;
/**目的仓*/
private List<Long> destWarehouseIds;
/**渠道id*/
private Long channelId;
......@@ -25,4 +34,6 @@ public class WarehouseLineSearchVO {
/** 线路id列表 */
private List<Long> lineIdList;
}
......@@ -46,6 +46,7 @@
<if test="params.startCityId != null and params.startCityId != 0">
and ew_start.shi = #{params.startCityId}
</if>
<if test="params.destCityId != null and params.destCityId != 0">
and ew_dest.shi = #{params.destCityId}
</if>
......@@ -55,6 +56,29 @@
<if test="params.destWarehouseId != null and params.destWarehouseId != 0">
and ewl.dest_warehouse_id = #{params.destWarehouseId}
</if>
<!--目的地-->
<if test="params.destCityIds != null and params.destCityIds.size()>0 ">
and ew_dest.`shi` in
<foreach item='destCity' index='index' collection='params.destCityIds' open='(' separator=',' close=')'>
#{destCity}
</foreach>
</if>
<!--目的国-->
<if test="params.destCountryIds != null and params.destCountryIds.size()>0 ">
and ew_dest.`guojia` in
<foreach item='destCountry' index='index' collection='params.destCountryIds' open='(' separator=',' close=')'>
#{destCountry}
</foreach>
</if>
<!--目的仓-->
<if test="params.destWarehouseIds != null and params.destWarehouseIds.size()>0 ">
and ewl.dest_warehouse_id in
<foreach item='destWarehouse' index='index' collection='params.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouse}
</foreach>
</if>
<if test="params.lineId != null and params.lineId != 0">
and ewl.id = #{params.lineId}
</if>
......
......@@ -217,10 +217,15 @@ public class WarehouseController {
channelInfoEvent.setChannelId(requestVO.getChannelId());
applicationContext.publishEvent(channelInfoEvent);
if (Objects.nonNull(channelInfoEvent.getCountryId()) && channelInfoEvent.getCountryId() > 0L){
if (Objects.nonNull(requestVO.getDestCountryId()) && requestVO.getDestCountryId() > 0L && !Objects.equals(requestVO.getDestCountryId(),channelInfoEvent.getCountryId())) {
if (Objects.nonNull(requestVO.getDestCountryIds()) && requestVO.getDestCountryIds().size() > 0 ) {
List<Long> destCountryIds = requestVO.getDestCountryIds();
for(Long countryid:destCountryIds) {
if(!Objects.equals(countryid,channelInfoEvent.getCountryId())) {
return error(400,"目的国与渠道不匹配");
}
requestVO.setDestCountryId(channelInfoEvent.getCountryId());
}
}
//requestVO.setDestCountryId(channelInfoEvent.getCountryId());
}
}
List<WarehouseLineDO> list = warehouseService.openedRouterList(requestVO);
......
......@@ -56,7 +56,7 @@ public enum CustomerOperateTypeEnum {
FOLLOWUP_CREATE(25, "新增跟进纪录"),
FOLLOWUP_UPDATE(26, "编辑跟进纪录"),
FOLLOWUP_COMMIT(27, "提交跟进纪录"),
FOLLOWUP_UPDATE_STATUS(27, "修改跟进状态"),
......
package cn.iocoder.yudao.module.order.dal.dataobject.orderFeeApplication;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
......@@ -101,4 +102,8 @@ public class OrderFeeApplicationDO extends BaseDO {
*/
private String batchBpmBusinessId;
@TableField(exist = false)
@ApiModelProperty(value = "是否有修改的状态")
private boolean editMode;
}
......@@ -106,12 +106,6 @@ public class OrderWarehouseInDO extends BaseDO {
private String remark;
/**
* 出货后新添加的商品
*/
private Boolean isShipmentNewIn = false;
/**
* 入仓纪录明细VO
*/
......
......@@ -2753,7 +2753,7 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
"and eo.status in (5,8,9) ",
"and eo.transport_id in (1,2,4)",
"and eo.abnormal_state=0 ",
"and eo.audit_type not in(1,2,3,4,5,12,31,32) ",
"and eo.audit_type not in(6,11,13,14,22,23) ",
"<when test = 'query.rucangTimeStart != null'>",
"AND eo.`rucang_time` &gt;= #{query.rucangTimeStart}",
"</when>",
......
......@@ -31,7 +31,7 @@ public interface OrderFeeApplicationService extends IService<OrderFeeApplication
* @param createReqVO 创建信息
* @return 编号
*/
void createFeeBatchApplication(@Valid OrderFeeBatchApplicationCreateReqVO createReqVO) throws Exception;
void createFeeBatchApplication(@Valid OrderFeeBatchApplicationUpdateReqVO updateReqVO) throws Exception;
/**
* 更新订单费用申请
......
......@@ -216,13 +216,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
dto -> "create_order_phone_limit".equals(dto.getLabel())).findFirst().
orElse(null);
if ((Objects.isNull(createReqVO.getIsCargoControl()) ||
!createReqVO.getIsCargoControl()) &&
if (createReqVO.getHasConsignee() && Objects.nonNull(createReqVO.getIsCargoControl()) &&
createReqVO.getIsCargoControl() &&
Objects.nonNull(dictDataRespDTO) &&
StringUtils.equals(dictDataRespDTO.getValue(), "11")
&& StringUtils.isNotBlank(createReqVO.getCountryCode())
&& StringUtils.equals("86", createReqVO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
LogisticsInfoDto logisticsInfoDto =
......@@ -657,7 +656,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (StringUtils.isBlank(orderConsigneeDO.getName())) {
throw exception(ORDER_CONSIGNEE_NAME_NOT_COMPLETE);
}
if ((Objects.isNull(createReqVO.getIsCargoControl()) || !createReqVO.getIsCargoControl()) && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
if (createReqVO.getHasConsignee() && Objects.nonNull(createReqVO.getIsCargoControl()) && createReqVO.getIsCargoControl() && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals(dictDataRespDTO.getValue(), "11") && StringUtils.equals("86", orderConsigneeDO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......@@ -937,7 +936,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
throw exception(ORDER_CONSIGNEE_PHONE_INCORRECT_FORMAT);
}
}
if ((Objects.isNull(createReqVO.getIsCargoControl()) || !createReqVO.getIsCargoControl()) && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
if (createReqVO.getHasConsignee() && Objects.nonNull(createReqVO.getIsCargoControl()) && createReqVO.getIsCargoControl() && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals(dictDataRespDTO.getValue(), "11") && StringUtils.equals("86", orderConsigneeDO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......@@ -1509,15 +1508,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
updateReqVO.setCustomsClearCert(false);
updateReqVO.setAirlineCompany(0L);
}
OrderDO updateObj = OrderConvert.INSTANCE.convert(updateReqVO);
// 获取功能开关
List<DictDataRespDTO> dictList = dictDataApi.getDictDatas("part_function_switch");
// 智慧预装功能开关
DictDataRespDTO dictDataRespDTO = dictList.stream().filter(dto -> "create_order_phone_limit".equals(dto.getLabel())).findFirst().orElse(null);
if ((Objects.isNull(updateReqVO.getIsCargoControl()) || !updateReqVO.getIsCargoControl()) &&
if (updateReqVO.getHasConsignee() && Objects.nonNull(updateReqVO.getIsCargoControl()) &&
updateReqVO.getIsCargoControl() &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals(dictDataRespDTO.getValue(), "11") && StringUtils.isNotBlank(updateReqVO.getCountryCode()) && StringUtils.equals("86", updateReqVO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
OrderDO updateObj = OrderConvert.INSTANCE.convert(updateReqVO);
LogisticsInfoDto logisticsInfoDto = warehouseLineMapper.getStartInfoAndDestInfoByLineId(updateReqVO.getLineId());
if (Objects.isNull(logisticsInfoDto)) {
throw exception(ORDER_LINE_NOT_EXIST);
......@@ -2714,7 +2715,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (!Objects.equals(orderConsigneeBackVO.getCustomerContactsId(), consigneeContactsDO.getId())) {
// 收货人电话
if (!StringUtils.equals(orderConsigneeBackVO.getPhone(), consigneeContactsDO.getPhoneNew()) || !StringUtils.equals(orderConsigneeBackVO.getCountryCode(), consigneeContactsDO.getAreaCode())) {
if ((Objects.isNull(updateReqVO.getIsCargoControl()) || !updateReqVO.getIsCargoControl()) && StringUtils.isNotBlank(consigneeContactsDO.getAreaCode()) &&
if (updateReqVO.getHasConsignee() && Objects.nonNull(updateReqVO.getIsCargoControl()) && updateReqVO.getIsCargoControl() && StringUtils.isNotBlank(consigneeContactsDO.getAreaCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals(dictDataRespDTO.getValue(), "11") && StringUtils.equals("86", consigneeContactsDO.getAreaCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......@@ -3290,7 +3291,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (StringUtils.isBlank(orderConsigneeDO.getName())) {
throw exception(ORDER_CONSIGNEE_NAME_NOT_COMPLETE);
}
if ((Objects.isNull(updateReqVO.getIsCargoControl()) || !updateReqVO.getIsCargoControl()) && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
if (updateReqVO.getHasConsignee() && Objects.nonNull(updateReqVO.getIsCargoControl()) && updateReqVO.getIsCargoControl() && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals("11", dictDataRespDTO.getValue()) && StringUtils.equals("86", orderConsigneeDO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......@@ -3541,7 +3542,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO.setEmail(updateReqVO.getConsigneeEmail());
orderConsigneeDO.setPhone(updateReqVO.getConsigneePhone());
}
if ((Objects.isNull(updateReqVO.getIsCargoControl()) || !updateReqVO.getIsCargoControl()) && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
if (updateReqVO.getHasConsignee() && Objects.nonNull(updateReqVO.getIsCargoControl()) && updateReqVO.getIsCargoControl() && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals("11", dictDataRespDTO.getValue()) && StringUtils.equals("86", orderConsigneeDO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......
......@@ -18,4 +18,8 @@ public class OrderFeeApplicationUpdateReqVO extends OrderFeeApplicationBaseVO {
@ApiModelProperty(value = "抄送人userId")
String[] copyUserId;
@ApiModelProperty(value = "是否有修改的状态")
private boolean editMode;
}
......@@ -11,7 +11,7 @@ import java.util.List;
@Data
@ToString(callSuper = true)
@ApiModel("管理后台 - 批量费用申请创建 Request VO")
@ApiModel("管理后台 - 批量费用申请创建或更新 Request VO")
public class OrderFeeBatchApplicationCreateReqVO {
@ApiModelProperty(value = "订单id", required = true)
@NotNull(message = "订单id不能为空")
......@@ -20,5 +20,5 @@ public class OrderFeeBatchApplicationCreateReqVO {
String[] copyUserId;
@ApiModelProperty(value = "批量费用")
@NotEmpty(message = "费用列表不能为空")
List<OrderFeeApplicationCreateReqVO> orderFeeApplicationCreateReqVOList;
List<OrderFeeApplicationUpdateReqVO> orderFeeApplicationCreateReqVOList;
}
package cn.iocoder.yudao.module.order.vo.orderFeeApplication;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@ToString(callSuper = true)
@ApiModel("管理后台 - 批量费用申请创建 Request VO")
public class OrderFeeBatchApplicationUpdateReqVO {
@ApiModelProperty(value = "订单id", required = true)
@NotNull(message = "订单id不能为空")
private Long orderId;
@ApiModelProperty(value = "抄送人userId")
String[] copyUserId;
@ApiModelProperty(value = "批量费用")
@NotEmpty(message = "费用列表不能为空")
List<OrderFeeApplicationUpdateReqVO> orderFeeApplicationCreateReqVOList;
}
......@@ -15,10 +15,7 @@ import cn.iocoder.yudao.module.order.enums.ApprovalResultStatusEnum;
import cn.iocoder.yudao.module.order.service.approval.OrderApprovalService;
import cn.iocoder.yudao.module.order.service.order.OrderFeeApplicationService;
import cn.iocoder.yudao.module.order.service.order.OrderService;
import cn.iocoder.yudao.module.order.vo.orderFeeApplication.OrderFeeApplicationBackVO;
import cn.iocoder.yudao.module.order.vo.orderFeeApplication.OrderFeeApplicationQueryVO;
import cn.iocoder.yudao.module.order.vo.orderFeeApplication.OrderFeeApplicationUpdateReqVO;
import cn.iocoder.yudao.module.order.vo.orderFeeApplication.OrderFeeBatchApplicationCreateReqVO;
import cn.iocoder.yudao.module.order.vo.orderFeeApplication.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -85,7 +82,7 @@ public class OrderFeeApplicationController {
@PostMapping("/create/batch")
@ApiOperation("批量创建订单费用申请")
@Idempotent(timeout = 10)
public CommonResult<Boolean> createFeeBatchApplication(@Valid @RequestBody OrderFeeBatchApplicationCreateReqVO createReqVO) throws Exception {
public CommonResult<Boolean> createFeeBatchApplication(@Valid @RequestBody OrderFeeBatchApplicationUpdateReqVO createReqVO) throws Exception {
String redisKey = MessageFormat.format(ORDER_FEE_APPLICATION_KEY, createReqVO.getOrderId().toString());
Long count = redisHelper.incrBy(redisKey, 1);
if (count > 1){
......
......@@ -93,6 +93,15 @@ Content-Type: application/json
{"table":[{"id":46775,"cartonsNum":100,"quantityAll":100,"specificationType":"1","unit":"1","boxGauge":"150*34*44","volume":22.44,"weight":30,"expressNo":"df123123","remark":null,"inTime":1698722752000,"heavyNumber":null,"lightNumber":3747.5,"orderLocationBackVOList":[{"id":49330,"orderId":19698,"wareId":1,"areaId":3,"locationId":8,"orderItemId":28123,"warehouseInId":46775,"adminId":0,"createTime":1698722752000,"warehouseName":"广州仓A","areaName":"B","locationName":"3-1"}],"createTime":1698722752000,"updateTime":1698722752000,"orderLocationStr4Merge":"B3-1","orderWarehouseInDetailsVOList":[{"unit":"2","brand":441,"prodId":395,"volume":"0.11","weight":30,"boxGauge":"141*23*33","usageIds":"","expressNo":"sf12312312","cartonsNum":null,"createTime":null,"prodAttrIds":"2,2","quantityAll":"222","specificationType":null}],"boxGauge1":"150","boxGauge2":"34","boxGauge3":"44"}],"brandType":0,"orderId":19698,"orderNo":"A2300278NG","brand":325,"inTime":null,"material":null,"orderItemId":28123,"warehouseInProdAttrIds":"2","prodId":3314,"prodTitleEn":"kifdasdasd","prodTitleZh":"kif头戴式耳机","prodType":1,"feeType":0,"recordMode":0,"pictureUrls":["https://static.jd.jdshangmen.com/2023/10/31/654073bfe4b09171582d5638.png"],"usageIds":"","num":100,"volume":"2.12","weight":"30.00","orderWarehouseInUpdateItemDoList":[{"id":46775,"cartonsNum":100,"quantityAll":100,"specificationType":"1","unit":"1","boxGauge":"150*34*44","volume":22.44,"weight":30,"expressNo":"df123123","remark":null,"inTime":1698722752000,"heavyNumber":null,"lightNumber":3747.5,"orderLocationBackVOList":[{"id":49330,"orderId":19698,"wareId":1,"areaId":3,"locationId":8,"orderItemId":28123,"warehouseInId":46775,"adminId":0,"createTime":1698722752000,"warehouseName":"广州仓A","areaName":"B","locationName":"3-1"}],"createTime":1698722752000,"updateTime":1698722752000,"orderLocationStr4Merge":"B3-1","orderWarehouseInDetailsVOList":[{"unit":"2","brand":441,"prodId":395,"volume":"0.11","weight":30,"boxGauge":"141*23*33","usageIds":"","expressNo":"sf123112","cartonsNum":null,"createTime":null,"prodAttrIds":"2,2","quantityAll":"222","specificationType":null}],"boxGauge1":"150","boxGauge2":"34","boxGauge3":"44","orderLocationCreateReqVOList":[{"id":49330,"orderId":19698,"wareId":1,"areaId":3,"locationId":8,"orderItemId":28123,"warehouseInId":46775,"adminId":0,"createTime":1698722752000,"warehouseName":"广州仓A","areaName":"B","locationName":"3-1"}]}]}
### 出货阶段 - 入仓/追加申请
POST {{baseUrl}}/order/order-warehouse-in/append-apply-when-shipment
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
{"table":[{"boxGauge1":"2","boxGauge2":"2","boxGauge3":"2","cartonsNum":"2","expressNo":"","unit":"1","volume":"0.01","weight":"2","specificationType":"1","table":[],"orderLocationBackVOList":[]}],"brandType":0,"orderId":83529,"orderNo":"NG2424546L","brand":2635,"material":"1","warehouseInProdAttrIds":"2","prodId":3842,"prodTitleEn":"TV screen","prodTitleZh":"电视屏幕","type":1,"feeType":2,"recordMode":1,"pictureUrls":["https://static2.groupage.cn/2024/11/15/67362cdee4b0afc77d38d646.png"],"usageIds":"","orderWarehouseInItemDoList":[{"boxGauge1":"2","boxGauge2":"2","boxGauge3":"2","cartonsNum":"2","expressNo":"","unit":"1","volume":"0.01","weight":"2","specificationType":"1","table":[],"orderLocationBackVOList":[],"boxGauge":"2*2*2","orderLocationCreateReqVOList":[]}]}
### 调仓申请
......@@ -154,7 +163,7 @@ Content-Type: application/json
#### 入仓修改回调
GET {{baseUrl}}/order/order-warehouse-in/update-apply-callback?formId=201&result=2
GET {{baseUrl}}/order/order-warehouse-in/update-apply-callback?formId=12128&result=2
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
......
......@@ -367,7 +367,7 @@ public interface CouponMapper extends BaseMapperX<CouponDO> {
"AND c.start_time between #{reqVO.beginStartTime} and #{reqVO.endStartTime} ",
"</when>",
"<when test = 'reqVO.beginEndTime != null and reqVO.endEndTime != null'>",
"AND DATE_FORMAT(c.end_time,'%Y-%m-%d 23:59:59') between #{reqVO.beginEndTime} and #{reqVO.endEndTime} ",
"AND <![CDATA[ ( (DATE_FORMAT(c.end_time,'%Y-%m-%d 23:59:59') between #{reqVO.beginEndTime} and #{reqVO.endEndTime}) or (now() <= #{reqVO.endEndTime} and c.end_time is null) ) ]]> ",
"</when>",
" <when test='reqVO.beginCreateTime != null' >",
......
......@@ -5,6 +5,7 @@ import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.order.dto.OrderBackInfoDto;
import cn.iocoder.yudao.module.sale.dal.dataobject.offer.OfferDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.sale.vo.offer.*;
......@@ -419,4 +420,24 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"</script>"
})
List<OfferRespVO> getOrderAssociationOfferList(@Param("queryVO") OrderAssociationOfferQueryVO queryVO, @Param("lang") Integer lang);
@ResultType(OfferRespVO.class)
@Select({
"<script>",
"SELECT",
"o.*,",
"d.name as dept_name,",
"u.nickname as business_manager_name,",
"if(#{lang} = 0, c.name_zh, c.name_en) as channel_name, ",
"c.attr_id as channel_attr_id ",
"FROM",
"ecw_offer o ",
"LEFT JOIN ecw_channel c on o.channel_id = c.channel_id",
"LEFT JOIN system_dept d on o.dept_id = d.id",
"LEFT JOIN system_user u on o.salesman_id = u.id",
"WHERE",
"o.offer_id = #{offerId}",
"</script>"
})
OfferRespVO info(@Param("offerId") Long offerId, @Param("lang") Integer lang);
}
......@@ -188,7 +188,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
}
}
if (Objects.nonNull(createReqVO.getConsigneeId()) && createReqVO.getConsigneeId() > 0) {
if (Objects.isNull(createReqVO.getControl()) || !createReqVO.getControl()) {
if (Objects.nonNull(createReqVO.getControl()) && createReqVO.getControl()) {
// 获取功能开关
List<DictDataRespDTO> dictList = dictDataApi.getDictDatas("part_function_switch");
// 智慧预装功能开关
......@@ -516,7 +516,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
}
}
if (Objects.nonNull(updateReqVO.getConsigneeId()) && updateReqVO.getConsigneeId() > 0) {
if (Objects.isNull(updateReqVO.getControl()) || !updateReqVO.getControl()) {
if (Objects.nonNull(updateReqVO.getControl()) && updateReqVO.getControl()) {
// 获取功能开关
List<DictDataRespDTO> dictList = dictDataApi.getDictDatas("part_function_switch");
// 智慧预装功能开关
......@@ -647,7 +647,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
throw exception(OFFER_NOT_EXISTS);
}
OfferRespVO respVO = OfferConvert.INSTANCE.convert(offerDO);
OfferRespVO respVO = offerMapper.info(offerId, I18nMessage.getLang());
EstCostVO estCostVO = JSONObject.parseObject(offerDO.getEstCost(), EstCostVO.class);
if (Objects.nonNull(estCostVO)) {
List<FeeDto> feeDtoList = estCostVO.getFeeDtoList();
......
......@@ -78,9 +78,15 @@ public class OfferRespVO extends OfferBaseVO {
@ApiModelProperty(value = "渠道名称")
private String channelName;
@ApiModelProperty(value = "渠道特性id")
private String channelAttrId;
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ApiModelProperty(value = "客户经理所属部门")
private String deptName;
@ApiModelProperty(value = "业务员名称-客户经理")
private String businessManagerName;
......
......@@ -43,7 +43,7 @@ public class BoxOrderRevokeWarehouseCheckListener {
// 跟新卸柜/到仓箱标数据表未真实卸柜的箱标到仓时间为null
boxLoadInfoService.update(new LambdaUpdateWrapper<BoxLoadInfoDO>()
.set(BoxLoadInfoDO::getUnloadTime, null)
.eq(BoxLoadInfoDO::getIsUnload, 0)
.set(BoxLoadInfoDO::getIsUnload, 0)
.eq(BoxLoadInfoDO::getOrderId, event.getOrderId()));
}
......
package cn.iocoder.yudao.module.shipment.listener;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.apollo.core.event.box.BoxOrderShipmentWarehouseInEvent;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderLocation.OrderLocationDO;
import cn.iocoder.yudao.module.order.service.order.OrderItemService;
import cn.iocoder.yudao.module.order.service.order.OrderLocationService;
import cn.iocoder.yudao.module.order.service.order.OrderService;
import cn.iocoder.yudao.module.order.vo.orderLocation.OrderLocationCreateReqVO;
import cn.iocoder.yudao.module.shipment.convert.BoxPreloadGoodsConvert;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxPreloadGoodsDO;
import cn.iocoder.yudao.module.shipment.enums.LdStatusEnum;
import cn.iocoder.yudao.module.shipment.enums.TyStatueEnum;
import cn.iocoder.yudao.module.shipment.service.box.BoxService;
import cn.iocoder.yudao.module.shipment.service.boxLoadInfo.BoxLoadInfoService;
import cn.iocoder.yudao.module.shipment.service.boxPreloadGoods.BoxPreloadGoodsService;
import cn.iocoder.yudao.module.shipment.vo.boxLoadInfo.BoxLoadInfoCreateReqVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.BoxPreloadGoodsCreateReqVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.BoxPreloadGoodsQueryVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_NOT_EXISTS;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.BOX_NOT_EXISTS;
/**
* 出货中订单入仓修改业务
*
* @author yanghao
*/
@Component("BoxOrderShipmentWarehouseInListener")
@AllArgsConstructor
@Slf4j
public class BoxOrderShipmentWarehouseInListener {
@Resource
private BoxLoadInfoService boxLoadInfoService;
@Resource
private BoxPreloadGoodsService boxPreloadGoodsService;
@Resource
private BoxService boxService;
@Resource
private OrderService orderService;
@Resource
private OrderItemService orderItemService;
@Resource
private OrderLocationService orderLocationService;
/**
* 订单强制到仓业务执行
*
* @param event 订单信息
*/
@EventListener(BoxOrderShipmentWarehouseInEvent.class)
public void boxOrderShipmentWarehouseIn(BoxOrderShipmentWarehouseInEvent event) {
Long orderId = event.getOrderId();
OrderDO orderDO = orderService.getById(orderId);
if (Objects.isNull(orderDO)) {
throw exception(ORDER_NOT_EXISTS);
}
String containerNumber = orderDO.getContainerNumber();
if (StringUtils.isEmpty(containerNumber)) {
log.info("订单号:{},没有箱号,不需要处理", orderDO.getOrderNo());
return;
}
BoxDO boxDO = boxService.getOne(new LambdaQueryWrapper<BoxDO>().eq(BoxDO::getSelfNo, containerNumber));
if (boxDO == null) {
throw exception(BOX_NOT_EXISTS);
}
// 针对新添加的品名 生成预装单 并设置提单
boxPreloadInsert(orderId, boxDO);
// 若理货完成,则自动修改储位。
batchOrderLocationUpdate(orderId, boxDO);
// 若装柜完成,则自动装柜。
if (boxDO.getLdStatus() != null && boxDO.getLdStatus() >= LdStatusEnum.INSTALLED_TO_BE_SEALED.getLdStatus()) {
// 海运
BoxLoadInfoCreateReqVO boxLoadInfoCreateReqVO = new BoxLoadInfoCreateReqVO();
boxLoadInfoCreateReqVO.setOrderId(orderId);
boxLoadInfoCreateReqVO.setOrderNo(orderDO.getOrderNo());
boxLoadInfoCreateReqVO.setShipmentId(boxDO.getId());
if (orderDO.getTransportId() == 1 || orderDO.getTransportId() == 2) {
boxLoadInfoService.batchCreate(boxLoadInfoCreateReqVO);
} else {
// 空运
boxLoadInfoService.batchAirCreate(boxLoadInfoCreateReqVO);
}
}
}
private void boxPreloadInsert(Long orderId, BoxDO boxDO) {
// 1、查看此订单下的预装信息
BoxPreloadGoodsQueryVO query = new BoxPreloadGoodsQueryVO();
query.setOrderId(orderId);
query.setShipmentId(boxDO.getId());
List<BoxPreloadGoodsDO> boxPreloadGoodsList = boxPreloadGoodsService.getBoxPreloadGoodsList(query);
if (CollectionUtil.isNotEmpty(boxPreloadGoodsList)) {
// 得到所有的orderItem
List<Long> orderItemIdListOld = boxPreloadGoodsList.stream().map(BoxPreloadGoodsDO::getOrderItemId).collect(Collectors.toList());
// 根据orderId查询OrderItemList,然后找出新增的OrderItemList
List<OrderItemDO> orderItemListNew = orderItemService.getOrderItemsByOrderId(Arrays.asList(orderId));
// 找出新增的OrderItemId
List<Long> newOrderItemIdList = orderItemListNew.stream().map(OrderItemDO::getOrderItemId)
.filter(t -> !orderItemIdListOld.contains(t)).collect(Collectors.toList());
// 添加预装
BoxPreloadGoodsDO boxPreloadGoodsDO = boxPreloadGoodsList.stream().findFirst().get();
// 转换为BoxPreloadGoodsCreateReqVO
BoxPreloadGoodsCreateReqVO createReqVO = new BoxPreloadGoodsCreateReqVO();
BeanUtils.copyProperties(boxPreloadGoodsDO, createReqVO);
// 预装入库
List<BoxPreloadGoodsDO> preloadGoodsDOList = new ArrayList<>();
for (Long orderItemId : newOrderItemIdList) {
BoxPreloadGoodsDO boxPreloadGoods = BoxPreloadGoodsConvert.INSTANCE.convert(createReqVO);
boxPreloadGoods.setOrderItemId(orderItemId);
if (createReqVO.getIsCover() != null) {
boxPreloadGoods.setIsCover(createReqVO.getIsCover());
}
preloadGoodsDOList.add(boxPreloadGoods);
}
// 插入
boxPreloadGoodsService.insertBatch(preloadGoodsDOList);
}
}
private void batchOrderLocationUpdate(Long orderId, BoxDO boxDO) {
if (boxDO.getTyStatus() != null && boxDO.getTyStatus().equals(TyStatueEnum.HAS_TALLY.getTyStatus())) {
List<OrderLocationDO> orderLocationDOList = orderLocationService.getOrderLocationListByOrderId(orderId);
if (CollectionUtil.isNotEmpty(orderLocationDOList)) {
// 将orderLocationDOList按orderItemId分组后,获取到第一个OrderItemId的所有储位数据
Map<Long, List<OrderLocationDO>> groupedByOrderItemId = orderLocationDOList.stream()
.collect(Collectors.groupingBy(OrderLocationDO::getOrderItemId));
// 获取第一个OrderItemId的所有储位数据
if (!groupedByOrderItemId.isEmpty()) {
Long firstOrderItemId = groupedByOrderItemId.keySet().iterator().next();
List<OrderLocationDO> firstOrderItemIdLocations = groupedByOrderItemId.get(firstOrderItemId);
// 得到所有储位 并去重。
List<OrderLocationCreateReqVO> orderLocationCreateReqVOList = new ArrayList<>();
for (OrderLocationDO location : firstOrderItemIdLocations) {
boolean noneMatch = orderLocationCreateReqVOList.stream().noneMatch(t -> t.getOrderId().equals(orderId)
&& Objects.equals(t.getWareId(), location.getWareId())
&& Objects.equals(t.getAreaId(), location.getAreaId())
&& Objects.equals(t.getLocationId(), location.getLocationId()));
if (noneMatch) {
OrderLocationCreateReqVO orderLocationCreateReqVO = new OrderLocationCreateReqVO();
orderLocationCreateReqVO.setOrderId(orderId);
orderLocationCreateReqVO.setWareId(location.getWareId());
orderLocationCreateReqVO.setAreaId(location.getAreaId());
orderLocationCreateReqVO.setLocationId(location.getLocationId());
orderLocationCreateReqVOList.add(orderLocationCreateReqVO);
}
}
// 批量修改储位
orderLocationService.tallyUpdate(orderId, orderLocationCreateReqVOList);
}
}
}
}
}
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