Commit ba433499 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'release-fix' into dev

parents 1df742e0 501f413a
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 (22, '22', '设置控货无收货人', 'Set Customer NoConsigee', '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 (23, '23', '设置默认付款', 'Set Customer Default Pay', '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 (24, '24', '设置默认开票', 'Set Customer Default Billing', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
......@@ -419,6 +419,7 @@ public interface CustomerService extends IService<CustomerDO> {
void changeCustomerNoConsignee(CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO);
void changeCustomerDefaultPay(CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO);
void changeCustomerDefaultBilling(CustomerChangeDefaultBillingReqVO customerChangeDefaultBillingReqVO);
/**
* @param areaCode 区号 eg: 86
......
......@@ -3528,6 +3528,33 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
}
}
@Override
public void changeCustomerDefaultBilling(CustomerChangeDefaultBillingReqVO customerChangeDefaultBillingReqVO) {
List<CustomerDO> customerDOList = customerMapper.selectBatchIds(customerChangeDefaultBillingReqVO.getCustomerIdList());
if (CollectionUtil.isNotEmpty(customerDOList)) {
Boolean defaultBilling = customerChangeDefaultBillingReqVO.getDefaultBilling();
customerDOList.stream()
.filter(t -> t.getDefaultPay() == null || !t.getDefaultPay().equals(defaultBilling))
.forEach(customerDO -> {
customerDO.setDefaultBilling(defaultBilling);
customerMapper.updateById(customerDO);
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
CustomerOperateLogCreateReqVO customerOperateLogCreateReqVO = new CustomerOperateLogCreateReqVO()
.setOperator(loginUser == null ? null : loginUser.getId())
.setOperatorName(loginUser == null ? null : loginUser.getNickname())
.setCustomerId(customerDO.getId())
.setNumber(customerDO.getNumber())
.setName(customerDO.getName())
.setOperateType(CustomerOperateTypeEnum.CHANGE_DEFAULT_PAY.getValue())
.setRemark("设置客户的默认开票为:" + (defaultBilling ? "【是】" : "【否】"));
customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO);
});
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void recycleUnConfirmedCustomer(CustomerUnConfirmReqVO customerUnConfirmReqVO) {
......
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@ApiModel("管理后台 - 默认开票切换 Request VO")
@Data
@EqualsAndHashCode
@ToString
public class CustomerChangeDefaultBillingReqVO {
@ApiModelProperty(value = "客户ID列表", required = true)
@NotEmpty(message = "客户ID列表不能为空")
private List<Long> customerIdList;
@ApiModelProperty(value = "是否默认开票", required = true)
@NotNull(message = "默认开票值不能为空")
private Boolean defaultBilling;
}
......@@ -36,14 +36,20 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "进入公海时间")
private Date enterOpenSeaTime;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "预计进入公海时间")
private Date estimateEnterOpenSeaTime;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "公海池捞取时间")
private Date catchTime;
......@@ -72,6 +78,8 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "关联会员账号id")
private Long memberId;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
@ApiModelProperty(value = "客户生日", example = "1652017501000")
private Date birthday;
......@@ -99,6 +107,7 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
private Date createTime;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
private Date updateTime;
......@@ -193,25 +202,46 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
// ======== 20240821 add start
@ApiModelProperty(value = "首次成交时间")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
private Date firstDealTime;
@ApiModelProperty(value = "获取方式")
private Integer getMethod;
@ApiModelProperty(value = "创建入口")
private Integer createFrom;
/**
* 归属时间
*/
@ApiModelProperty(value = "归属时间")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
private Date customerServiceConfirmedTime;
@ApiModelProperty(value = "客户角色")
private String roles;
/**
* 默认付款,1-是,0-否
*/
@ApiModelProperty(value = "默认付款,1-是,0-否")
private Boolean defaultPay ;
private Boolean defaultPay;
/**
* 控货无收货人,1-是,0-否
*/
@ApiModelProperty(value = "控货无收货人,1-是,0-否")
private Boolean noConsignee ;
private Boolean noConsignee;
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "客户角色")
private String roles;
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
/**
......@@ -239,13 +269,6 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "年度发货次数")
private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
// ======== 20240821 add end
......
......@@ -1126,8 +1126,7 @@ public class CustomerController {
@PutMapping("/change-customer-no-consignee")
@ApiOperation("设置客户是否是默认付款无收货人")
@PreAuthorize("@ss.hasPermission('ecw:customer:noconsignee')")
@ApiOperation("设置客户是否是默认控货无收货人")
@Idempotent(timeout = 5)
public CommonResult<Boolean> changeCustomerNoConsignee(@Valid @RequestBody CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO) {
......@@ -1137,8 +1136,7 @@ public class CustomerController {
@PutMapping("/change-customer-default-pay")
@ApiOperation("设置客户是否是默认侍")
@PreAuthorize("@ss.hasPermission('ecw:customer:defaultpay')")
@ApiOperation("设置客户是否是默认付款")
@Idempotent(timeout = 5)
public CommonResult<Boolean> changeCustomerDefaultPay(@Valid @RequestBody CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO) {
......@@ -1147,6 +1145,16 @@ public class CustomerController {
}
@PutMapping("/change-customer-default-billing")
@ApiOperation("设置客户是否是默认开票")
@Idempotent(timeout = 5)
public CommonResult<Boolean> changeCustomerDefaultBilling(@Valid @RequestBody CustomerChangeDefaultBillingReqVO customerChangeDefaultBillingReqVO) {
customerService.changeCustomerDefaultBilling(customerChangeDefaultBillingReqVO);
return success(true);
}
@PutMapping("/recycle-unconfirmed-customer")
@ApiOperation("回收已分配未接收的客户")
// @PreAuthorize("@ss.hasPermission('ecw:customer:recycle:unconfirmed')")
......
......@@ -52,6 +52,8 @@ public enum CustomerOperateTypeEnum {
CHANGE_NO_CONSIGNEE(22, "设置控货无收货人"),
CHANGE_DEFAULT_PAY(23, "设置默认付款"),
CHANGE_DEFAULT_BILLING(24, "设置默认开票"),
DELETE(100, "删除"),
......
......@@ -611,6 +611,7 @@ public class OrderQueryVO {
public void setAsStatusList(List<Integer> asStatusList) {
this.asStatusList = asStatusList;
if (CollectionUtil.isNotEmpty(this.asStatusList)) {
this.statusList = new ArrayList<>();
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
......@@ -619,6 +620,7 @@ public class OrderQueryVO {
public void setStatusList(List<Integer> statusList) {
this.asStatusList = statusList;
if (CollectionUtil.isNotEmpty(this.asStatusList)) {
this.statusList = new ArrayList<>();
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
......@@ -631,6 +633,7 @@ public class OrderQueryVO {
combinedState(this.asStatus, this.transportId);
}
if (Objects.nonNull(transportId) && CollectionUtil.isNotEmpty(this.asStatusList)) {
this.statusList = new ArrayList<>();
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
......@@ -706,9 +709,6 @@ public class OrderQueryVO {
private void combinedStateList(Integer asStatus, Integer transportId) {
switch (asStatus) {
case 12325:
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
......@@ -717,9 +717,6 @@ public class OrderQueryVO {
break;
case 10501:
// 空运待出
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
}
......@@ -737,9 +734,6 @@ public class OrderQueryVO {
break;
case 10502:
// 空运可出
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
}
......@@ -749,9 +743,6 @@ public class OrderQueryVO {
break;
case 10503:
// 空运已备货
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
}
......@@ -761,9 +752,6 @@ public class OrderQueryVO {
break;
case 10504:
// 待排单
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
}
......@@ -787,57 +775,42 @@ public class OrderQueryVO {
break;
case 132411:
// 空运已出货
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(32);
this.shipmentStateList.add(411);
this.transportId = 3; // 空运待出查询,只查空运的订单
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 132412:
// 空运已出仓
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(32);
this.shipmentStateList.add(412);
this.transportId = 3; // 空运待出查询,只查空运的订单
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 132409:
// 空运已理货
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(32);
this.shipmentStateList.add(409);
this.transportId = 3; // 空运待出查询,只查空运的订单
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 118428:
// 空运已到港
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(32);
this.shipmentStateList.add(428);
this.transportId = 3; // 空运待出查询,只查空运的订单
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
default:
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
this.statusList.add(asStatus);
}
this.statusList.add(asStatus);
}
}
......
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