Commit 43eb275d authored by zhengyi's avatar zhengyi

Merge branch 'dev' into release

parents 15c7bfb7 188078d1
...@@ -35,8 +35,3 @@ alter table `ecw_customer` ...@@ -35,8 +35,3 @@ alter table `ecw_customer`
alter table `ecw_customer` alter table `ecw_customer`
change column `product_id` `product_ids` varchar(300) DEFAULT NULL COMMENT '主营产品ids'; change column `product_id` `product_ids` varchar(300) DEFAULT NULL COMMENT '主营产品ids';
-- 更新客户角色
update ecw_customer set roles = '2' where FIND_IN_SET(2, type) != 0 or FIND_IN_SET(3, type) != 0;
-- 添加字典
INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES ('客户角色', 'customer_role', 0, NULL, '1', now(), '1', 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 (0, '0', 'C0', 'CO', 'customer_role', 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 (1, '1', '工程商', 'Project contractor', 'customer_role', 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 (2, '2', '代理', 'Agent', 'customer_role', 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 (3, '3', '同行', 'Consolidated shipping', 'customer_role', 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 (6, '6', '集运', 'Competitors', 'customer_role', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES ('客户创建入口', 'customer_from', 0, NULL, '1', now(), '1', 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 (1, '1', '导入', 'Import', 'customer_from', 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 (2, '2', '后台用户创建', 'Backend', 'customer_from', 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 (3, '3', 'APP注册', 'APP', 'customer_from', 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 (4, '4', '发货人创建', 'Shipper', 'customer_from', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES ('客户获取方式', 'customer_get_method', 0, NULL, '1', now(), '1', 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 (1, '1', '自主创建', 'Independent creation', 'customer_get_method', 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 (2, '2', '分配/移交接收', 'Allot/Transfer', 'customer_get_method', 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 (3, '3', '公海捞取', 'Open Sea pick up', 'customer_get_method', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
-- 更新客户角色
update ecw_customer set roles = '2' where FIND_IN_SET(2, type) != 0;
update ecw_customer set roles = '3' where FIND_IN_SET(3, type) != 0;
update ecw_customer set roles = '2,3' where FIND_IN_SET(2, type) != 0 and FIND_IN_SET(3, type) != 0;
...@@ -383,7 +383,7 @@ public class CustomerDO extends BaseDO { ...@@ -383,7 +383,7 @@ public class CustomerDO extends BaseDO {
/** /**
* 创建入口 * 创建入口
* <p> * <p>
* 枚举 {@link TODO customer_create_from 字典} * 枚举 {@link TODO customer_from 字典}
*/ */
private Integer createFrom; private Integer createFrom;
......
...@@ -416,6 +416,10 @@ public interface CustomerService extends IService<CustomerDO> { ...@@ -416,6 +416,10 @@ public interface CustomerService extends IService<CustomerDO> {
*/ */
void changeCustomerFcl(CustomerChangeFclReqVO customerChangeFclReqVO); void changeCustomerFcl(CustomerChangeFclReqVO customerChangeFclReqVO);
void changeCustomerNoConsignee(CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO);
void changeCustomerDefaultPay(CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO);
/** /**
* @param areaCode 区号 eg: 86 * @param areaCode 区号 eg: 86
* @param phone 电话 eg: 13233334444 * @param phone 电话 eg: 13233334444
......
...@@ -3474,6 +3474,59 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, ...@@ -3474,6 +3474,59 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
} }
} }
@Override
public void changeCustomerNoConsignee(CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO) {
List<CustomerDO> customerDOList = customerMapper.selectBatchIds(customerChangeNoConsigneeReqVO.getCustomerIdList());
if (CollectionUtil.isNotEmpty(customerDOList)) {
Boolean noConsigee = customerChangeNoConsigneeReqVO.getNoConsigee();
customerDOList.stream()
.filter(t -> t.getNoConsignee() == null || !t.getNoConsignee().equals(noConsigee))
.forEach(customerDO -> {
customerDO.setNoConsignee(noConsigee);
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_NO_CONSIGNEE.getValue())
.setRemark("设置客户的控货无收货人为:" + (noConsigee ? "【是】" : "【否】"));
customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO);
});
}
}
@Override
public void changeCustomerDefaultPay(CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO) {
List<CustomerDO> customerDOList = customerMapper.selectBatchIds(customerChangeDefaultPayReqVO.getCustomerIdList());
if (CollectionUtil.isNotEmpty(customerDOList)) {
Boolean defaultPay = customerChangeDefaultPayReqVO.getDefaultPay();
customerDOList.stream()
.filter(t -> t.getDefaultPay() == null || !t.getDefaultPay().equals(defaultPay))
.forEach(customerDO -> {
customerDO.setDefaultPay(defaultPay);
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("设置客户的默认付款为:" + (defaultPay ? "【是】" : "【否】"));
customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO);
});
}
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
......
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 CustomerChangeDefaultPayReqVO {
@ApiModelProperty(value = "客户ID列表", required = true)
@NotEmpty(message = "客户ID列表不能为空")
private List<Long> customerIdList;
@ApiModelProperty(value = "是否默认付款", required = true)
@NotNull(message = "默认付款值不能为空")
private Boolean defaultPay;
}
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 CustomerChangeNoConsigneeReqVO {
@ApiModelProperty(value = "客户ID列表", required = true)
@NotEmpty(message = "客户ID列表不能为空")
private List<Long> customerIdList;
@ApiModelProperty(value = "是否控货无收货人", required = true)
@NotNull(message = "控货无收货人值不能为空")
private Boolean noConsigee;
}
...@@ -1125,6 +1125,28 @@ public class CustomerController { ...@@ -1125,6 +1125,28 @@ public class CustomerController {
} }
@PutMapping("/change-customer-no-consignee")
@ApiOperation("设置客户是否是默认付款无收货人")
@PreAuthorize("@ss.hasPermission('ecw:customer:noconsignee')")
@Idempotent(timeout = 5)
public CommonResult<Boolean> changeCustomerNoConsignee(@Valid @RequestBody CustomerChangeNoConsigneeReqVO customerChangeNoConsigneeReqVO) {
customerService.changeCustomerNoConsignee(customerChangeNoConsigneeReqVO);
return success(true);
}
@PutMapping("/change-customer-default-pay")
@ApiOperation("设置客户是否是默认侍")
@PreAuthorize("@ss.hasPermission('ecw:customer:defaultpay')")
@Idempotent(timeout = 5)
public CommonResult<Boolean> changeCustomerDefaultPay(@Valid @RequestBody CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO) {
customerService.changeCustomerDefaultPay(customerChangeDefaultPayReqVO);
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')")
......
...@@ -49,6 +49,9 @@ public enum CustomerOperateTypeEnum { ...@@ -49,6 +49,9 @@ public enum CustomerOperateTypeEnum {
UPDATE_CUSTOMER_TO_OLD_BY_CUSTOMER_SERVICE(20, "修改客户经理下成交客户的业绩类型"), UPDATE_CUSTOMER_TO_OLD_BY_CUSTOMER_SERVICE(20, "修改客户经理下成交客户的业绩类型"),
UPDATE_CUSTOMER_NEW_OR_OLD(21, "修改客户业绩类型"), UPDATE_CUSTOMER_NEW_OR_OLD(21, "修改客户业绩类型"),
CHANGE_NO_CONSIGNEE(22, "设置控货无收货人"),
CHANGE_DEFAULT_PAY(23, "设置默认付款"),
DELETE(100, "删除"), DELETE(100, "删除"),
......
...@@ -12,11 +12,12 @@ import java.util.Arrays; ...@@ -12,11 +12,12 @@ import java.util.Arrays;
@Getter @Getter
public enum CustomerRoleEnum { public enum CustomerRoleEnum {
//0、CO 1、工程商 2、代理 6、集运 //0、CO 1、工程商 2、代理 3、同行 6、集运
C0(0, "C0"), C0(0, "C0"),
CONTRACTOR(1, "工程商"), CONTRACTOR(1, "工程商"),
PROXY(2, "代理"), PROXY(2, "代理"),
COMPETITOR(3, "同行"),
CONSOLIDATOR(6, "集运"); CONSOLIDATOR(6, "集运");
; ;
......
...@@ -1184,7 +1184,7 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin ...@@ -1184,7 +1184,7 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
BigDecimal totalLeft = new BigDecimal("0"); BigDecimal totalLeft = new BigDecimal("0");
BigDecimal totalRight = new BigDecimal("0"); BigDecimal totalRight = new BigDecimal("0");
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
List<ReceivableOrderPayedFeeTypeVO> receivableYunFeiList = payedFeeTypeVOList.stream().filter(i -> i.getFeeType() == 1).collect(Collectors.toList()); List<ReceivableOrderPayedFeeTypeVO> receivableYunFeiList = payedFeeTypeVOList.stream().filter(i -> i.getFeeType() == 1 && i.getFeeSource() == 1).collect(Collectors.toList());
for (ReceivableOrderPayedFeeTypeVO i : receivableYunFeiList) { for (ReceivableOrderPayedFeeTypeVO i : receivableYunFeiList) {
if (i.getCurrencyId() != 1L) { if (i.getCurrencyId() != 1L) {
totalLeft = totalLeft.add(changeAmountToDestCurrency(i.getCurrencyId(), 1L, i.getTotalAmount())); totalLeft = totalLeft.add(changeAmountToDestCurrency(i.getCurrencyId(), 1L, i.getTotalAmount()));
......
...@@ -350,6 +350,7 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> { ...@@ -350,6 +350,7 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> {
"select ", "select ",
"a.collection_type as collection_type, ", "a.collection_type as collection_type, ",
"a.fee_type as fee_type, ", "a.fee_type as fee_type, ",
"a.fee_source as fee_source, ",
"a.currency_id as currency_id,", "a.currency_id as currency_id,",
"c.title_zh as currency,", "c.title_zh as currency,",
"p.label as collection_type_label,", "p.label as collection_type_label,",
......
...@@ -43,6 +43,9 @@ public class ReceivableOrderPayedFeeTypeVO { ...@@ -43,6 +43,9 @@ public class ReceivableOrderPayedFeeTypeVO {
@ApiModelProperty(value = "收款单id") @ApiModelProperty(value = "收款单id")
private Long receiptId; private Long receiptId;
@ApiModelProperty(value = "费用来源:1 订单计算 2 费用申请 3 特需费用")
private Integer feeSource;
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
@Component @Component
@TenantJob @TenantJob
@Slf4j @Slf4j
public class ReceiptAutoWriteOff implements JobHandler { public class ReceiptAutoWriteOffJob implements JobHandler {
@Resource @Resource
ReceiptService receiptService; ReceiptService receiptService;
......
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