Commit 501f413a authored by 332784038@qq.com's avatar 332784038@qq.com

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

parents 49f0d239 9dcc4893
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> { ...@@ -419,6 +419,7 @@ public interface CustomerService extends IService<CustomerDO> {
void changeCustomerNoConsignee(CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO); void changeCustomerNoConsignee(CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO);
void changeCustomerDefaultPay(CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO); void changeCustomerDefaultPay(CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO);
void changeCustomerDefaultBilling(CustomerChangeDefaultBillingReqVO customerChangeDefaultBillingReqVO);
/** /**
* @param areaCode 区号 eg: 86 * @param areaCode 区号 eg: 86
......
...@@ -3528,6 +3528,33 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, ...@@ -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 @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void recycleUnConfirmedCustomer(CustomerUnConfirmReqVO customerUnConfirmReqVO) { 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 { ...@@ -36,14 +36,20 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "是否在公海") @ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea; 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) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "进入公海时间") @ApiModelProperty(value = "进入公海时间")
private Date enterOpenSeaTime; 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) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "预计进入公海时间") @ApiModelProperty(value = "预计进入公海时间")
private Date estimateEnterOpenSeaTime; 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) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "公海池捞取时间") @ApiModelProperty(value = "公海池捞取时间")
private Date catchTime; private Date catchTime;
...@@ -72,6 +78,8 @@ public class CustomerDetailRespVO extends CustomerBaseVO { ...@@ -72,6 +78,8 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "关联会员账号id") @ApiModelProperty(value = "关联会员账号id")
private Long memberId; private Long memberId;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
@ApiModelProperty(value = "客户生日", example = "1652017501000") @ApiModelProperty(value = "客户生日", example = "1652017501000")
private Date birthday; private Date birthday;
...@@ -99,6 +107,7 @@ public class CustomerDetailRespVO extends CustomerBaseVO { ...@@ -99,6 +107,7 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT) timezone = TIME_ZONE_DEFAULT)
private Date createTime; private Date createTime;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT) timezone = TIME_ZONE_DEFAULT)
private Date updateTime; private Date updateTime;
...@@ -193,25 +202,46 @@ public class CustomerDetailRespVO extends CustomerBaseVO { ...@@ -193,25 +202,46 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
// ======== 20240821 add start // ======== 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-否 * 默认付款,1-是,0-否
*/ */
@ApiModelProperty(value = "默认付款,1-是,0-否") @ApiModelProperty(value = "默认付款,1-是,0-否")
private Boolean defaultPay ; private Boolean defaultPay;
/** /**
* 控货无收货人,1-是,0-否 * 控货无收货人,1-是,0-否
*/ */
@ApiModelProperty(value = "控货无收货人,1-是,0-否") @ApiModelProperty(value = "控货无收货人,1-是,0-否")
private Boolean noConsignee ; private Boolean noConsignee;
/** /**
* 客户角色 * 默认开票,1-是,0-否
* <p>
* 枚举 {@link TODO customer_role 字典}
*/ */
@ApiModelProperty(value = "客户角色") @ApiModelProperty(value = "默认开票,1-是,0-否")
private String roles; private Boolean defaultBilling;
/** /**
...@@ -239,13 +269,6 @@ public class CustomerDetailRespVO extends CustomerBaseVO { ...@@ -239,13 +269,6 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "年度发货次数") @ApiModelProperty(value = "年度发货次数")
private Integer numYearly; private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
// ======== 20240821 add end // ======== 20240821 add end
......
...@@ -1126,8 +1126,7 @@ public class CustomerController { ...@@ -1126,8 +1126,7 @@ public class CustomerController {
@PutMapping("/change-customer-no-consignee") @PutMapping("/change-customer-no-consignee")
@ApiOperation("设置客户是否是默认付款无收货人") @ApiOperation("设置客户是否是默认控货无收货人")
@PreAuthorize("@ss.hasPermission('ecw:customer:noconsignee')")
@Idempotent(timeout = 5) @Idempotent(timeout = 5)
public CommonResult<Boolean> changeCustomerNoConsignee(@Valid @RequestBody CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO) { public CommonResult<Boolean> changeCustomerNoConsignee(@Valid @RequestBody CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO) {
...@@ -1137,8 +1136,7 @@ public class CustomerController { ...@@ -1137,8 +1136,7 @@ public class CustomerController {
@PutMapping("/change-customer-default-pay") @PutMapping("/change-customer-default-pay")
@ApiOperation("设置客户是否是默认侍") @ApiOperation("设置客户是否是默认付款")
@PreAuthorize("@ss.hasPermission('ecw:customer:defaultpay')")
@Idempotent(timeout = 5) @Idempotent(timeout = 5)
public CommonResult<Boolean> changeCustomerDefaultPay(@Valid @RequestBody CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO) { public CommonResult<Boolean> changeCustomerDefaultPay(@Valid @RequestBody CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO) {
...@@ -1147,6 +1145,16 @@ public class CustomerController { ...@@ -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") @PutMapping("/recycle-unconfirmed-customer")
@ApiOperation("回收已分配未接收的客户") @ApiOperation("回收已分配未接收的客户")
// @PreAuthorize("@ss.hasPermission('ecw:customer:recycle:unconfirmed')") // @PreAuthorize("@ss.hasPermission('ecw:customer:recycle:unconfirmed')")
......
...@@ -52,6 +52,8 @@ public enum CustomerOperateTypeEnum { ...@@ -52,6 +52,8 @@ public enum CustomerOperateTypeEnum {
CHANGE_NO_CONSIGNEE(22, "设置控货无收货人"), CHANGE_NO_CONSIGNEE(22, "设置控货无收货人"),
CHANGE_DEFAULT_PAY(23, "设置默认付款"), CHANGE_DEFAULT_PAY(23, "设置默认付款"),
CHANGE_DEFAULT_BILLING(24, "设置默认开票"),
DELETE(100, "删除"), DELETE(100, "删除"),
......
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