Commit 6d7488d5 by 叶立庆

Merge branch 'v5.7.1' into 'master'

上线合并

See merge request !15
2 parents 3c773c94 87ac1035
Showing 138 changed files with 3257 additions and 188 deletions
# IntelliJ / IDEA
*.iml
.idea/
out/
# Maven 构建物
target/
# Maven Flatten 插件的产物
.flattened-pom.xml
\ No newline at end of file
......@@ -12,7 +12,7 @@
<name>rpc-dj-smartcarlife-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.dj.smartcarlife.remote</deploy.scanPackage>
<smartcarlife.api.version>5.7.0.1-SNAPSHOT</smartcarlife.api.version>
<smartcarlife.api.version>5.7.1-SNAPSHOT</smartcarlife.api.version>
<shopamll.api.version>5.6.4-SNAPSHOT</shopamll.api.version>
</properties>
<dependencies>
......
......@@ -23,6 +23,7 @@ public class CreateBusinessApproveDTO extends CreateBusinessApprove {
* 嘀加上架审批流量方信息
*/
private static final long serialVersionUID = -3598394628468594036L;
/** 导入的有效商户信息 **/
private List<CreateBusinessApproveMerchantDTO> merchantList;
/**
......
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.MerchantExpenseCategoryRuleLevelDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsTypeGroupReconciliationRule;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -46,4 +47,7 @@ public class MerchantGoodsTypeGroupReconciliationRuleDTO extends MerchantGoodsTy
//用于嘀加上架,上架规则前该品类规则的唯一标志
private String uuid;
@ApiModelProperty(notes = "信息是否填写完整(Y:是,N:否)")
private String integrity;
}
package cn.com.glsx.dj.smartcarlife.dto;
import java.util.List;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.ExpenseCategoryRuleTargetTypeGroupDTO;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.MerchantExpenseCategoryRuleLevelDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantExpenseCategoryRule;
......@@ -11,8 +13,6 @@ import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
......@@ -42,4 +42,10 @@ public class MerchantGoodsTypeGroupSettleRuleDTO extends MerchantGoodsTypeGroupS
private List<Integer> goodsTypes;
private Boolean saveDraft;
@ApiModelProperty(notes = "信息是否填写完整(Y:是,N:否)")
private String integrity;
@ApiModelProperty(notes="分账规则id")
private Integer divisionRuleId;
}
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.smartcarlife.dto;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.MerchantGoodsTypeGroupReconciliationRuleCTDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantReconciliationRule;
import cn.com.glsx.dj.smartcarlife.remote.MerchantReconciliationRuleStepRemote.SubmitRule;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -13,6 +14,8 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.NotEmpty;
/**
* @author chenx
......@@ -35,7 +38,8 @@ public class MerchantReconciliationRuleDTO extends MerchantReconciliationRule im
public List<MerchantGoodsTypeGroupReconciliationRuleCTDTO> goodsTypeGroupReconciliationRuleCTs;
private List<Integer> merchantIdList;
@NotEmpty(groups = {SubmitRule.class})
private String oprByName;
@ApiModelProperty(notes="规则生效时间,不传则表示立即生效")
......
......@@ -4,6 +4,7 @@ import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.DivisionRuleAutoDTO;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.MerchantGoodsTypeGroupSettleDivisionRuleCTDTO;
import cn.com.glsx.dj.smartcarlife.model.ServiceMerchant;
import cn.com.glsx.dj.smartcarlife.remote.MerchantSettleDistributeRuleRemote;
import cn.com.glsx.dj.smartcarlife.remote.MerchantSettleDistributeRuleStepRemote.SaveSingleGoodsTypeRule;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -24,14 +25,14 @@ import java.util.List;
@Data
public class MerchantSettleDistributeRuleDTO implements Serializable {
private static final long serialVersionUID = 1629629488887188637L;
@NotNull(groups = {MerchantSettleDistributeRuleRemote.SaveRule.class})
@NotNull(groups = {MerchantSettleDistributeRuleRemote.SaveRule.class,SaveSingleGoodsTypeRule.class})
private Integer merchantId;
/**
* 场景(0:1.0;1:1.1;2:1.2;3:1.3)
*/
@NotNull(groups = {MerchantSettleDistributeRuleRemote.SaveRule.class})
@NotNull(groups = {MerchantSettleDistributeRuleRemote.SaveRule.class,SaveSingleGoodsTypeRule.class})
private Byte sceneType;
@NotEmpty(groups = {MerchantSettleDistributeRuleRemote.SaveRule.class})
......@@ -83,12 +84,15 @@ public class MerchantSettleDistributeRuleDTO implements Serializable {
@ApiModelProperty(notes="规则生效时间,不传则表示立即生效")
private Date effectStartDate;
@ApiModelProperty(notes="财务规则id")
@ApiModelProperty(notes="财务规则id,修改时必传")
private Integer settleRuleId;
@ApiModelProperty(notes="分账规则id")
@ApiModelProperty(notes="分账规则id,修改时必传")
private Integer divisionRuleId;
@ApiModelProperty(notes="财务品类规则id,修改时必传")
private Integer goodsTypeGroupRuleId;
private MerchantSettleAccountRuleDTO merchantSettleAccountRule;
private MerchantDivisionRuleDTO merchantDivisionRule;
......
package cn.com.glsx.dj.smartcarlife.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author antigravity
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MerchantStaffDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "4S商户号")
private Integer merchantId;
@ApiModelProperty(notes = "4S商户名称")
private String merchantName;
@ApiModelProperty(notes = "园区店商户号")
private Integer yqMerchantId;
@ApiModelProperty(notes = "园区店商户名称")
private String yqMerchantName;
@ApiModelProperty(notes = "员工UUID")
private String staffUuid;
@ApiModelProperty(notes = "员工姓名")
private String staffName;
}
......@@ -168,4 +168,7 @@ public class UpgradeGoodsDTO extends UpgradeGoods {
*/
@ApiModelProperty(name = "accessoryType", notes = "配件性质:1-原厂件 2-品牌件")
private Integer accessoryType;
@ApiModelProperty(notes = "排除一级品类列表")
private List<Integer> excludeGoodsTypeList;
}
package cn.com.glsx.dj.smartcarlife.dto.carcondition;
import lombok.Data;
import java.io.Serializable;
@Data
public class CarConditionRespDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 业务Id
*/
private String businessId;
/**
* 异步请求是否完成
*/
private boolean taskFinished;
/**
* 是否成功
*/
private boolean success;
/**
* 返回编码
*/
private int code;
/**
* 响应内容
*/
private String message;
/**
* 失败错误描述
*/
private String error;
}
package cn.com.glsx.dj.smartcarlife.dto.createBusiness;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* 全部导入模板字段
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@ToString(callSuper = true)
public class CreateBusinessApproveAllImportVo implements Serializable {
private static final long serialVersionUID = -3052350335110395528L;
/** 流量方ID 会员权益、精品升级场景用到**/
private String shopMerchantId;
/** 业务模式 会员权益场景用到**/
private String businessMode;
/** 签约主体(关联平台) 会员权益、精品升级场景用到**/
private String contractingMerchantName;
/** 预估流量 会员权益、精品升级场景用到**/
private String estimatedFlow;
/** 预估转化率 会员权益、精品升级场景用到**/
private String estimatedUpgradeRate;
/** 运营模式 会员权益场景用到**/
private String operationMode;
/** 上级服务商 会员权益场景用到**/
private String parentPartnerMerchantName;
/** 服务商 会员权益场景用到**/
private String partnerMerchantName;
/** 服务商2 会员权益场景用到**/
private String partnerMerchantName2;
/** 园区店 会员权益、精品升级场景用到**/
private String yqMerchantName;
/** 业务线 会员权益场景用到**/
private String businessLine;
/** 结算方式 会员权益、精品升级场景用到**/
private String settlementType;
/** 套餐 会员权益、精品升级场景用到**/
private String packageName;
/** 商品ID 会员权益、精品升级场景用到**/
private String upgradeCommodityCode;
/** 商品别名 会员权益、精品升级场景用到**/
private String upgradeGoodsNameAlias;
/** 售价 会员权益、精品升级场景用到**/
private String sellPrice;
/** 最低价 会员权益、精品升级场景用到**/
private String minSellPrice;
/** 嘀加成本 会员权益场景用到**/
private String djCost;
/** 第三方成本 会员权益场景用到**/
private String thirdPartyCost;
/** 销售占比 会员权益场景、精品升级用到**/
private String saleRatio;
/** 流量方是否线上自动分账 会员权益场景、精品升级用到**/
private String shopMerchantAutoDivide;
/** 线上分账对象 会员权益、精品升级场景用到**/
private String shopMerchantDivideTarget;
/** 流量方分润类型 会员权益、精品升级场景用到**/
private String shopMerchantDivideType;
/** 第三方产品成本归属 会员权益场景用到**/
private String thirdPartyCostTarget;
/** 流量方比例 会员权益、精品升级场景用到**/
private String shopMerchantDivideValue;
/** 服务商是否线上自动分账 会员权益场景用到**/
private String partnerMerchantAutoDivide;
/** 线上分账对象 会员权益场景用到**/
private String partnerMerchantDivideTarget;
/** 服务商分润类型 会员权益场景导入,精品升级自动查询**/
private String partnerMerchantDivideType;
/** 服务商比例 会员权益场景导入,精品升级自动查询**/
private String partnerMerchantDivideValue;
/** 服务商2是否线上自动分账 会员权益场景用到**/
private String partnerMerchant2AutoDivide;
/** 服务商2线上分账对象 会员权益场景用到**/
private String partnerMerchant2DivideTarget;
/** 服务商2分润类型 会员权益场景用到**/
private String partnerMerchant2DivideType;
/** 服务商2比例 会员权益场景用到**/
private String partnerMerchant2DivideValue;
/** 其他费用分润类型 会员权益、精品升级场景用到**/
private String otherFeeDivideType;
/** 其他费用比例 会员权益、精品升级场景用到**/
private String otherFeeDivideValue;
/** 其他费用归属 会员权益、精品升级场景用到**/
private String otherFeeTarget;
/** 管理层市场费1计算方式 会员权益、精品升级场景用到**/
private String managerMarket1CalType;
/** 管理层市场费1 会员权益、精品升级场景用到**/
private String managerMarket1CalTypeFee;
/** 管理层市场费2计算方式 会员权益场、精品升级景用到**/
private String managerMarket2CalType;
/** 管理层市场费2 会员权益、精品升级场景用到**/
private String managerMarket2CalTypeFee;
/** 一线阳光是否开启线上积分 会员权益、精品升级场景用到**/
private String firstLineSunshineOnlinePointsFlag;
/** 一线阳光计算模式 会员权益、精品升级场景用到**/
private String firstLineSunshineIncentiveFeeCalMode;
/** 一线阳光计算方式 会员权益、精品升级场景用到**/
private String firstLineSunshineIncentiveFeeCalType;
/** 一线阳光激励费 会员权益、精品升级场景用到**/
private String firstLineSunshineIncentiveFee;
/** 一线阳光2是否开启线上积分 会员权益、精品升级场景用到**/
private String firstLineSunshine2OnlinePointsFlag;
/** 一线阳光2计算模式 会员权益、精品升级场景用到**/
private String firstLineSunshine2IncentiveFeeCalMode;
/** 一线阳光2计算方式 会员权益、精品升级场景用到**/
private String firstLineSunshine2IncentiveFeeCalType;
/** 一线阳光2激励费 会员权益、精品升级场景用到**/
private String firstLineSunshine2IncentiveFee;
/** 流量费结算模式 精品升级场景用到**/
private String trafficFeeSettleMode;
/** 预估平均客单价 精品升级场景用到**/
private String estimatedCustomerUnitPrice;
/** 产值预估 精品升级场景用到**/
private String estimatedOutputValue;
/** 上架部位 精品升级场景用到**/
private String position;
/** 升级成本 精品升级场景用到**/
private String upgradeProductCost;
/** 回收成本 精品升级场景用到**/
private String recoveryCost;
/** 赠送成本 精品升级场景用到**/
private String giftCost;
/** 商品渗透率要求 精品升级场景用到**/
private String penetrationRate;
/** 升级产品成本归属 精品升级场景用到**/
private String upgradeProductCostTarget;
/** 回收成本归属 精品升级场景用到**/
private String recoveryCostTarget;
/**
* 流量方线上分账对象商户号
*/
private Integer shopMerchantTargetMerchantId;
/**
* 流量方线上分账对象商户号
*/
private String shopMerchantTargetMerchantName;
}
\ No newline at end of file
package cn.com.glsx.dj.smartcarlife.dto.createBusiness;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
/**
* 批量导入模板
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@ToString(callSuper = true)
public class CreateBusinessApproveImportBatchScene0Vo extends MergeExcelImportVo implements Serializable {
private static final long serialVersionUID = 3428234707556846690L;
@ExcelProperty(index = 0,value = "*流量方ID")
private String shopMerchantId;
@ExcelProperty(index = 1,value = "*业务模式")
private String businessMode;
@ExcelProperty(index = 2,value = "*签约主体(关联平台)")
private String contractingMerchantName;
@ExcelProperty(index = 3,value = "*预估流量")
private String estimatedFlow;
@ExcelProperty(index = 4,value = "预估转化率")
private String estimatedUpgradeRate;
@ExcelProperty(index = 5,value = "*运营模式")
private String operationMode;
@ExcelProperty(index = 6,value = "上级服务商")
private String parentPartnerMerchantName;
@ExcelProperty(index = 7,value = "*服务商")
private String partnerMerchantName;
@ExcelProperty(index = 8,value = "服务商2")
private String partnerMerchantName2;
@ExcelProperty(index = 9,value = "*园区店")
private String yqMerchantName;
@ExcelProperty(index = 10,value = "*业务线")
private String businessLine;
@ExcelProperty(index = 11,value = "*结算方式")
private String settlementType;
@ExcelProperty(index = 12,value = "*套餐")
private String packageName;
@ExcelProperty(index = 13,value = "*商品ID")
private String upgradeCommodityCode;
@ExcelProperty(index = 14,value = "商品别名")
private String upgradeGoodsNameAlias;
@ExcelProperty(index = 15,value = "*售价")
private String sellPrice;
@ExcelProperty(index = 16,value = "*最低价")
private String minSellPrice;
@ExcelProperty(index = 17,value = "嘀加成本")
private String djCost;
@ExcelProperty(index = 18,value = "*第三方成本")
private String thirdPartyCost;
@ExcelProperty(index = 19,value = "*销售占比")
private String saleRatio;
@ExcelProperty(index = 20,value = "*流量方是否线上自动分账")
private String shopMerchantAutoDivide;
@ExcelProperty(index = 21,value = "*线上分账对象")
private String shopMerchantDivideTarget;
@ExcelProperty(index = 22,value = "*流量方分润类型")
private String shopMerchantDivideType;
@ExcelProperty(index = 23,value = "*第三方产品成本归属")
private String thirdPartyCostTarget;
@ExcelProperty(index = 24,value = "*流量方比例")
private String shopMerchantDivideValue;
@ExcelProperty(index = 25,value = "*服务商是否线上自动分账")
private String partnerMerchantAutoDivide;
@ExcelProperty(index = 26,value = "*线上分账对象")
private String partnerMerchantDivideTarget;
@ExcelProperty(index = 27,value = "*服务商分润类型")
private String partnerMerchantDivideType;
@ExcelProperty(index = 28,value = "*服务商比例")
private String partnerMerchantDivideValue;
@ExcelProperty(index = 29,value = "*服务商2是否线上自动分账")
private String partnerMerchant2AutoDivide;
@ExcelProperty(index = 30,value = "*线上分账对象")
private String partnerMerchant2DivideTarget;
@ExcelProperty(index = 31,value = "*服务商2分润类型")
private String partnerMerchant2DivideType;
@ExcelProperty(index = 32,value = "*服务商2比例")
private String partnerMerchant2DivideValue;
@ExcelProperty(index = 33,value = "*其他费用分润类型")
private String otherFeeDivideType;
@ExcelProperty(index = 34,value = "*其他费用比例")
private String otherFeeDivideValue;
@ExcelProperty(index = 35,value = "*其他费用归属")
private String otherFeeTarget;
@ExcelProperty(index = 36, value = "*管理层市场费1计算方式")
private String managerMarket1CalType;
@ExcelProperty(index = 37, value = "*管理层市场费1")
private String managerMarket1CalTypeFee;
@ExcelProperty(index = 38, value = "*管理层市场费2计算方式")
private String managerMarket2CalType;
@ExcelProperty(index = 39, value = "*管理层市场费2")
private String managerMarket2CalTypeFee;
@ExcelProperty(index = 40, value = "*一线阳光是否开启线上积分")
private String firstLineSunshineOnlinePointsFlag;
@ExcelProperty(index = 41, value = "*一线阳光计算模式")
private String firstLineSunshineIncentiveFeeCalMode;
@ExcelProperty(index = 42, value = "*一线阳光计算方式")
private String firstLineSunshineIncentiveFeeCalType;
@ExcelProperty(index = 43, value = "*一线阳光激励费")
private String firstLineSunshineIncentiveFee;
@ExcelProperty(index = 44, value = "*一线阳光2是否开启线上积分")
private String firstLineSunshine2OnlinePointsFlag;
@ExcelProperty(index = 45, value = "*一线阳光2计算模式")
private String firstLineSunshine2IncentiveFeeCalMode;
@ExcelProperty(index = 46, value = "*一线阳光2计算方式")
private String firstLineSunshine2IncentiveFeeCalType;
@ExcelProperty(index = 47, value = "*一线阳光2激励费")
private String firstLineSunshine2IncentiveFee;
/**
* 流量方线上分账对象商户号
*/
private Integer shopMerchantTargetMerchantId;
/**
* 流量方线上分账对象商户号
*/
private String shopMerchantTargetMerchantName;
}
\ No newline at end of file
package cn.com.glsx.dj.smartcarlife.dto.createBusiness;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
/**
* 精品升级场景单商户导入模板
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@ToString(callSuper = true)
public class CreateBusinessApproveImportBatchScene1Vo extends MergeExcelImportVo implements Serializable {
private static final long serialVersionUID = -6254936013661397830L;
@ExcelProperty(index = 0,value = "*流量方ID")
private String shopMerchantId;
@ExcelProperty(index = 1,value = "*签约主体")
private String contractingMerchantName;
@ExcelProperty(index = 2,value = "*流量费结算模式")
private String trafficFeeSettleMode;
@ExcelProperty(index = 3,value = "*预估流量")
private String estimatedFlow;
@ExcelProperty(index = 4,value = "预估转化率")
private String estimatedUpgradeRate;
@ExcelProperty(index = 5,value = "预估平均客单价")
private String estimatedCustomerUnitPrice;
@ExcelProperty(index = 6,value = "产值预估")
private String estimatedOutputValue;
@ExcelProperty(index = 7,value = "*园区店")
private String yqMerchantName;
@ExcelProperty(index = 8,value = "*结算方式")
private String settlementType;
@ExcelProperty(index = 9,value = "*套餐")
private String packageName;
@ExcelProperty(index = 10,value = "*商品ID")
private String upgradeCommodityCode;
@ExcelProperty(index = 11,value = "商品别名")
private String upgradeGoodsNameAlias;
@ExcelProperty(index = 12,value = "上架部位")
private String position;
@ExcelProperty(index = 13,value = "*售价")
private String sellPrice;
@ExcelProperty(index = 14,value = "*最低价")
private String minSellPrice;
@ExcelProperty(index = 15,value = "*升级成本")
private String upgradeProductCost;
@ExcelProperty(index = 16,value = "*回收成本")
private String recoveryCost;
@ExcelProperty(index = 17,value = "赠送成本")
private String giftCost;
@ExcelProperty(index = 18,value = "*销售占比")
private String saleRatio;
@ExcelProperty(index = 19,value = "*商品渗透率要求")
private String penetrationRate;
@ExcelProperty(index = 20,value = "*流量方是否线上自动分账")
private String shopMerchantAutoDivide;
@ExcelProperty(index = 21,value = "*线上分账对象")
private String shopMerchantDivideTarget;
@ExcelProperty(index = 22,value = "*流量方分润类型")
private String shopMerchantDivideType;
@ExcelProperty(index = 23,value = "*流量方比例")
private String shopMerchantDivideValue;
@ExcelProperty(index = 24,value = "*升级产品成本归属")
private String upgradeProductCostTarget;
@ExcelProperty(index = 25,value = "*回收成本归属")
private String recoveryCostTarget;
@ExcelProperty(index = 26,value = "*其他费用分润类型")
private String otherFeeDivideType;
@ExcelProperty(index = 27,value = "*其他费用分润比例")
private String otherFeeDivideValue;
@ExcelProperty(index = 28,value = "*线上分账对象")
private String otherFeeTarget;
@ExcelProperty(index = 29, value = "*管理层市场费1计算方式")
private String managerMarket1CalType;
@ExcelProperty(index = 30, value = "*管理层市场费1")
private String managerMarket1CalTypeFee;
@ExcelProperty(index = 31, value = "*管理层市场费2计算方式")
private String managerMarket2CalType;
@ExcelProperty(index = 32, value = "*管理层市场费2")
private String managerMarket2CalTypeFee;
@ExcelProperty(index = 33, value = "*一线阳光是否开启线上积分")
private String firstLineSunshineOnlinePointsFlag;
@ExcelProperty(index = 34, value = "*一线阳光计算模式")
private String firstLineSunshineIncentiveFeeCalMode;
@ExcelProperty(index = 35, value = "*一线阳光计算方式")
private String firstLineSunshineIncentiveFeeCalType;
@ExcelProperty(index = 36, value = "*一线阳光激励费")
private String firstLineSunshineIncentiveFee;
@ExcelProperty(index = 37, value = "*一线阳光2是否开启线上积分")
private String firstLineSunshine2OnlinePointsFlag;
@ExcelProperty(index = 38, value = "*一线阳光2计算模式")
private String firstLineSunshine2IncentiveFeeCalMode;
@ExcelProperty(index = 39, value = "*一线阳光2计算方式")
private String firstLineSunshine2IncentiveFeeCalType;
@ExcelProperty(index = 40, value = "*一线阳光2激励费")
private String firstLineSunshine2IncentiveFee;
/**
* 流量方线上分账对象商户号
*/
private Integer shopMerchantTargetMerchantId;
/**
* 流量方线上分账对象商户号
*/
private String shopMerchantTargetMerchantName;
}
\ No newline at end of file
package cn.com.glsx.dj.smartcarlife.dto.createBusiness;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import com.google.common.collect.Lists;
import cn.com.glsx.dj.smartcarlife.dto.MerchantDivisionRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantReconciliationRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantRuleMergeDiffDTO;
......@@ -9,21 +20,18 @@ import cn.com.glsx.dj.smartcarlife.dto.UpgradeGoodsDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantPackageGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.DivisionRuleAutoDTO;
import cn.com.glsx.dj.smartcarlife.model.PaymentChannel;
import cn.com.glsx.dj.smartcarlife.model.YqMerchantServiceDetails;
import cn.com.glsx.dj.smartcarlife.response.FeeCategoryPageResponse;
import com.google.common.collect.Lists;
import cn.com.glsx.scrm.proxy.model.merchant.MerchantRopResponse;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@AllArgsConstructor
@NoArgsConstructor
......@@ -35,7 +43,7 @@ public class CreateBusinessApproveImportExcelContext implements Serializable {
private static final long serialVersionUID = 9178648767668487306L;
//导入excel的行
private List<CreateBusinessApproveImportVo> list;
private List<CreateBusinessApproveAllImportVo> list;
//首行数据存储分账对账的全局数据
private SettleReconciliationRuleDTO ruleContext;
......@@ -49,7 +57,7 @@ public class CreateBusinessApproveImportExcelContext implements Serializable {
//套餐存在合并的对账规则索引列表
private List<List<Integer>> packageReconcilationRuleIndexList = new ArrayList<>();
//根据嘀加上架表中的升级商品名称查询到的商品记录
//根据嘀加上架表中的升级商品名称查询到的商品记录,过滤了场景限制的品类
private List<UpgradeGoodsDTO> existUpgradeGoodsList = new ArrayList<>();
////根据嘀加上架表中的升级商品名称查询到的商品记录,且价格信息合法的记录
......@@ -75,7 +83,8 @@ public class CreateBusinessApproveImportExcelContext implements Serializable {
private Integer reconciliationRuleId;*/
//导入失败错误信息
private List<String> errorList = new ArrayList<>();
@Builder.Default
private List<StringBuilder> errorList = new ArrayList<>();
//线上自动分账
private String autoFlag;
......@@ -104,11 +113,19 @@ public class CreateBusinessApproveImportExcelContext implements Serializable {
private FeeCategoryPageResponse shopMerchantCategoryFeeResponse;
//服务商分润
private FeeCategoryPageResponse partnerMerchantCategoryResponse;
//服务商2分润
private FeeCategoryPageResponse partnerMerchant2CategoryResponse;
//其他费用
private FeeCategoryPageResponse otherFeeCategoryResponse;
//第三方成本
private FeeCategoryPageResponse thirdPartyCostCategoryResponse;
//手续费
private FeeCategoryPageResponse serviceChargeCategoryResponse;
//产品成本
private FeeCategoryPageResponse upgradeProductCostCategoryResponse;
//回收成本
private FeeCategoryPageResponse recoveryCostCategoryResponse;
//管理层市场费1
private FeeCategoryPageResponse managerMarket1CategoryFeeResponse;
//管理层市场费2
......@@ -141,4 +158,41 @@ public class CreateBusinessApproveImportExcelContext implements Serializable {
@ApiModelProperty(notes="支付渠道开启自动分账与分账时间设置")
private List<DivisionRuleAutoDTO> divisionRuleAutos;
@ApiModelProperty(notes = "业务场景:0-会员权益/升级;1-精品升级")
private Byte sceneType;
@ApiModelProperty(notes = "园区店服务明细")
private List<YqMerchantServiceDetails> yqMerchantServiceDetailsList;
@ApiModelProperty(notes = "流量方商户号商户信息映射map")
@Builder.Default
private Map<Integer,MerchantRopResponse> merchantMap = new HashMap<>();
@ApiModelProperty(notes = "流量方上级商户号商户信息映射map")
@Builder.Default
private Map<Integer,Optional<MerchantRopResponse>> merchantParentMap = new HashMap<>();
@ApiModelProperty(notes = "签约主体商户名商户号映射map")
@Builder.Default
private Map<String,Integer> contractingMerchantMap = new HashMap<>();
@ApiModelProperty(notes = "服务商商户名商户号映射map")
@Builder.Default
private Map<String,Integer> partnerMerchantMap = new HashMap<>();
@ApiModelProperty(notes = "园区店商户名商户号映射map")
@Builder.Default
private Map<String,Integer> yqMerchantMap = new HashMap<>();
@ApiModelProperty(notes = "支付渠道列表")
private List<PaymentChannel> paymentChannelList;
@ApiModelProperty(notes = "园区店商户名与预估人员成本占比映射map,仅精品升级")
@Builder.Default
private Map<Integer,BigDecimal> yqEstimatedPersonnelCostRateMap = new HashMap<>();
@ApiModelProperty(notes = "是否存在服务商2")
private Boolean hasPartner2;
}
\ No newline at end of file
......@@ -13,6 +13,8 @@ import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
/**
* 对账规则和商品信息
* @author chenx
......@@ -118,6 +120,9 @@ public class CreateBusinessApproveImportReconciliationRuleDTO implements Seriali
@ExcelProperty(index = 30, value = "*一线阳光是否开启线上积分")
private String firstLineSunshineOnlinePointsFlag;
/** 一线阳光计算模式 会员权益、精品升级场景用到**/
private String firstLineSunshineIncentiveFeeCalMode;
@ExcelProperty(index = 31, value = "*一线阳光计算方式")
private String firstLineSunshineIncentiveFeeCalType;
......@@ -127,6 +132,9 @@ public class CreateBusinessApproveImportReconciliationRuleDTO implements Seriali
@ExcelProperty(index = 33, value = "*一线阳光2是否开启线上积分")
private String firstLineSunshine2OnlinePointsFlag;
/** 一线阳光2计算模式 会员权益、精品升级场景用到**/
private String firstLineSunshine2IncentiveFeeCalMode;
@ExcelProperty(index = 34, value = "*一线阳光2计算方式")
private String firstLineSunshine2IncentiveFeeCalType;
......@@ -152,7 +160,7 @@ public class CreateBusinessApproveImportReconciliationRuleDTO implements Seriali
*/
private BigDecimal laborCost;
public CreateBusinessApproveImportReconciliationRuleDTO(CreateBusinessApproveImportVo item, String businessLine, Integer index, MerchantGoodsInfoDTO merchantGoodsInfoDTO, BigDecimal laborCost) {
public CreateBusinessApproveImportReconciliationRuleDTO(CreateBusinessApproveAllImportVo item, String businessLine, Integer index, MerchantGoodsInfoDTO merchantGoodsInfoDTO, BigDecimal laborCost) {
setCreateBusinessApproveImportSettleRuleDTO(item, this);
this.index = index;
this.businessLine = businessLine;
......@@ -160,7 +168,7 @@ public class CreateBusinessApproveImportReconciliationRuleDTO implements Seriali
this.laborCost = laborCost;
}
public CreateBusinessApproveImportReconciliationRuleDTO(CreateBusinessApproveImportVo item, Integer index, MerchantPackageGoodsInfoDTO packageGoodsInfoDTO, BigDecimal laborCost) {
public CreateBusinessApproveImportReconciliationRuleDTO(CreateBusinessApproveAllImportVo item, Integer index, MerchantPackageGoodsInfoDTO packageGoodsInfoDTO, BigDecimal laborCost) {
setCreateBusinessApproveImportSettleRuleDTO(item, this);
this.index = index;
this.merchantPackageGoodsInfoDTO = packageGoodsInfoDTO;
......@@ -178,21 +186,78 @@ public class CreateBusinessApproveImportReconciliationRuleDTO implements Seriali
return false;
}
CreateBusinessApproveImportReconciliationRuleDTO that = (CreateBusinessApproveImportReconciliationRuleDTO) o;
return Objects.equals(this.managerMarket1CalType, that.getManagerMarket1CalType()) && Objects.equals(this.managerMarket1CalTypeFee, that.getManagerMarket1CalTypeFee()) &&
Objects.equals(this.managerMarket2CalType, that.getManagerMarket2CalType()) && Objects.equals(this.managerMarket2CalTypeFee, that.getManagerMarket2CalTypeFee())
&& Objects.equals(this.firstLineSunshineIncentiveFeeCalType, that.getFirstLineSunshineIncentiveFeeCalType()) && Objects.equals(this.firstLineSunshineIncentiveFee, that.getFirstLineSunshineIncentiveFee())
&& Objects.equals(this.firstLineSunshine2IncentiveFeeCalType, that.getFirstLineSunshine2IncentiveFeeCalType()) && Objects.equals(this.firstLineSunshine2IncentiveFee, that.getFirstLineSunshine2IncentiveFee())
&& ((Objects.isNull(this.laborCost) && Objects.isNull(that.getLaborCost())) || this.laborCost.compareTo(that.getLaborCost()) == 0);
return Objects.equals(this.managerMarket1CalType, that.getManagerMarket1CalType()) && isSameNumericString(this.managerMarket1CalTypeFee, that.getManagerMarket1CalTypeFee()) &&
Objects.equals(this.managerMarket2CalType, that.getManagerMarket2CalType()) && isSameNumericString(this.managerMarket2CalTypeFee, that.getManagerMarket2CalTypeFee())
&& Objects.equals(this.firstLineSunshineIncentiveFeeCalType, that.getFirstLineSunshineIncentiveFeeCalType()) && isSameNumericString(this.firstLineSunshineIncentiveFee, that.getFirstLineSunshineIncentiveFee())
&& Objects.equals(this.firstLineSunshineIncentiveFeeCalMode, that.getFirstLineSunshineIncentiveFeeCalMode())
&& Objects.equals(this.firstLineSunshine2IncentiveFeeCalType, that.getFirstLineSunshine2IncentiveFeeCalType()) && isSameNumericString(this.firstLineSunshine2IncentiveFee, that.getFirstLineSunshine2IncentiveFee())
&& Objects.equals(this.firstLineSunshine2IncentiveFeeCalMode, that.getFirstLineSunshine2IncentiveFeeCalMode())
&& isLaborCostSame(that);
}
public boolean isLaborCostSame(CreateBusinessApproveImportReconciliationRuleDTO that) {
if(Objects.isNull(this.laborCost) && Objects.isNull(that.getLaborCost())){
return true;
}
if(this.laborCost != null && that.getLaborCost() != null && this.laborCost.compareTo(that.getLaborCost()) == 0) {
return true;
}
return false;
}
@Override
public int hashCode() {
return Objects.hash(managerMarket1CalType, managerMarket1CalTypeFee, managerMarket2CalType, managerMarket2CalTypeFee, firstLineSunshineIncentiveFeeCalType, firstLineSunshineIncentiveFee, firstLineSunshine2IncentiveFeeCalType);
return Objects.hash(managerMarket1CalType, normalizeNumericString(managerMarket1CalTypeFee), managerMarket2CalType, normalizeNumericString(managerMarket2CalTypeFee), firstLineSunshineIncentiveFeeCalType, normalizeNumericString(firstLineSunshineIncentiveFee), firstLineSunshine2IncentiveFeeCalType,
firstLineSunshineIncentiveFeeCalMode, firstLineSunshine2IncentiveFeeCalMode, normalizeBigDecimal(laborCost));
}
private boolean isSameNumericString(String source, String target) {
if (source == null || target == null) {
return Objects.equals(source, target);
}
try {
return parseDecimal(source.trim()).compareTo(parseDecimal(target.trim())) == 0;
} catch (Exception e) {
return Objects.equals(source, target);
}
}
private String normalizeNumericString(String value) {
if (value == null) {
return null;
}
try {
return parseDecimal(value.trim()).stripTrailingZeros().toPlainString();
} catch (Exception e) {
return value;
}
}
private String normalizeBigDecimal(BigDecimal value) {
return value == null ? null : value.stripTrailingZeros().toPlainString();
}
public BigDecimal parseDecimal(String str) {
str = removeThousandsSeparator(str);
if (StringUtils.isBlank(str)) {
return null;
}
str = str.replace("%", "");
try {
return new BigDecimal(str);
} catch (Exception e) {
return null;
}
}
public String removeThousandsSeparator(String money) {
if (StringUtils.isNotBlank(money)) {
money = money.replaceAll(",", "");
}
return money;
}
public void setCreateBusinessApproveImportSettleRuleDTO(CreateBusinessApproveImportVo item, CreateBusinessApproveImportReconciliationRuleDTO createBusinessApproveImportSettleRuleDTO) {
public void setCreateBusinessApproveImportSettleRuleDTO(CreateBusinessApproveAllImportVo item, CreateBusinessApproveImportReconciliationRuleDTO createBusinessApproveImportSettleRuleDTO) {
createBusinessApproveImportSettleRuleDTO.setBusinessMode(item.getBusinessMode());
createBusinessApproveImportSettleRuleDTO.setContractingMerchantName(item.getContractingMerchantName());
createBusinessApproveImportSettleRuleDTO.setEstimatedFlow(item.getEstimatedFlow());
......@@ -224,9 +289,11 @@ public class CreateBusinessApproveImportReconciliationRuleDTO implements Seriali
createBusinessApproveImportSettleRuleDTO.setManagerMarket2CalType(item.getManagerMarket2CalType());
createBusinessApproveImportSettleRuleDTO.setManagerMarket2CalTypeFee(item.getManagerMarket2CalTypeFee());
createBusinessApproveImportSettleRuleDTO.setFirstLineSunshineOnlinePointsFlag(item.getFirstLineSunshineOnlinePointsFlag());
createBusinessApproveImportSettleRuleDTO.setFirstLineSunshineIncentiveFeeCalMode(item.getFirstLineSunshineIncentiveFeeCalMode());
createBusinessApproveImportSettleRuleDTO.setFirstLineSunshineIncentiveFeeCalType(item.getFirstLineSunshineIncentiveFeeCalType());
createBusinessApproveImportSettleRuleDTO.setFirstLineSunshineIncentiveFee(item.getFirstLineSunshineIncentiveFee());
createBusinessApproveImportSettleRuleDTO.setFirstLineSunshine2OnlinePointsFlag(item.getFirstLineSunshine2OnlinePointsFlag());
createBusinessApproveImportSettleRuleDTO.setFirstLineSunshine2IncentiveFeeCalMode(item.getFirstLineSunshine2IncentiveFeeCalMode());
createBusinessApproveImportSettleRuleDTO.setFirstLineSunshine2IncentiveFeeCalType(item.getFirstLineSunshine2IncentiveFeeCalType());
createBusinessApproveImportSettleRuleDTO.setFirstLineSunshine2IncentiveFee(item.getFirstLineSunshine2IncentiveFee());
}
......
......@@ -10,14 +10,14 @@ import lombok.ToString;
import java.io.Serializable;
/**
* 单商户导入模板
* 会员权益场景单商户导入模板
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@ToString(callSuper = true)
public class CreateBusinessApproveImportSingleVo extends MergeExcelImportVo implements Serializable {
public class CreateBusinessApproveImportSingleScene0Vo extends MergeExcelImportVo implements Serializable {
private static final long serialVersionUID = 3814948742763967472L;
@ExcelProperty(index = 0,value = "*业务模式")
......@@ -41,94 +41,124 @@ public class CreateBusinessApproveImportSingleVo extends MergeExcelImportVo impl
@ExcelProperty(index = 6,value = "*服务商")
private String partnerMerchantName;
@ExcelProperty(index = 7,value = "*园区店")
@ExcelProperty(index = 7,value = "服务商2")
private String partnerMerchantName2;
@ExcelProperty(index = 8,value = "*园区店")
private String yqMerchantName;
@ExcelProperty(index = 8,value = "*业务线")
@ExcelProperty(index = 9,value = "*业务线")
private String businessLine;
@ExcelProperty(index = 9,value = "*结算方式")
@ExcelProperty(index = 10,value = "*结算方式")
private String settlementType;
@ExcelProperty(index = 10,value = "*套餐")
@ExcelProperty(index = 11,value = "*套餐")
private String packageName;
@ExcelProperty(index = 11,value = "*商品ID")
@ExcelProperty(index = 12,value = "*商品ID")
private String upgradeCommodityCode;
@ExcelProperty(index = 12,value = "商品别名")
@ExcelProperty(index = 13,value = "商品别名")
private String upgradeGoodsNameAlias;
@ExcelProperty(index = 13,value = "*售价")
@ExcelProperty(index = 14,value = "*售价")
private String sellPrice;
@ExcelProperty(index = 14,value = "*最低价")
@ExcelProperty(index = 15,value = "*最低价")
private String minSellPrice;
@ExcelProperty(index = 15,value = "嘀加成本")
@ExcelProperty(index = 16,value = "嘀加成本")
private String djCost;
@ExcelProperty(index = 16,value = "*第三方成本")
@ExcelProperty(index = 17,value = "*第三方成本")
private String thirdPartyCost;
@ExcelProperty(index = 17,value = "*销售占比")
@ExcelProperty(index = 18,value = "*销售占比")
private String saleRatio;
@ExcelProperty(index = 18,value = "*流量方是否线上自动分账")
@ExcelProperty(index = 19,value = "*流量方是否线上自动分账")
private String shopMerchantAutoDivide;
@ExcelProperty(index = 19,value = "*线上分账对象")
@ExcelProperty(index = 20,value = "*线上分账对象")
private String shopMerchantDivideTarget;
@ExcelProperty(index = 20,value = "*流量方分润类型")
@ExcelProperty(index = 21,value = "*流量方分润类型")
private String shopMerchantDivideType;
@ExcelProperty(index = 21,value = "*第三方产品成本归属")
@ExcelProperty(index = 22,value = "*第三方产品成本归属")
private String thirdPartyCostTarget;
@ExcelProperty(index = 22,value = "*流量方比例")
@ExcelProperty(index = 23,value = "*流量方比例")
private String shopMerchantDivideValue;
@ExcelProperty(index = 23,value = "*服务商是否线上自动分账")
@ExcelProperty(index = 24,value = "*服务商是否线上自动分账")
private String partnerMerchantAutoDivide;
@ExcelProperty(index = 24,value = "*线上分账对象")
@ExcelProperty(index = 25,value = "*线上分账对象")
private String partnerMerchantDivideTarget;
@ExcelProperty(index = 25,value = "*服务商分润类型")
@ExcelProperty(index = 26,value = "*服务商分润类型")
private String partnerMerchantDivideType;
@ExcelProperty(index = 26,value = "*服务商比例")
@ExcelProperty(index = 27,value = "*服务商比例")
private String partnerMerchantDivideValue;
@ExcelProperty(index = 27, value = "*管理层市场费1计算方式")
@ExcelProperty(index = 28,value = "*服务商2是否线上自动分账")
private String partnerMerchant2AutoDivide;
@ExcelProperty(index = 29,value = "*线上分账对象")
private String partnerMerchant2DivideTarget;
@ExcelProperty(index = 30,value = "*服务商2分润类型")
private String partnerMerchant2DivideType;
@ExcelProperty(index = 31,value = "*服务商2比例")
private String partnerMerchant2DivideValue;
@ExcelProperty(index = 32,value = "*其他费用分润类型")
private String otherFeeDivideType;
@ExcelProperty(index = 33,value = "*其他费用比例")
private String otherFeeDivideValue;
@ExcelProperty(index = 34,value = "*其他费用归属")
private String otherFeeTarget;
@ExcelProperty(index = 35, value = "*管理层市场费1计算方式")
private String managerMarket1CalType;
@ExcelProperty(index = 28, value = "*管理层市场费1")
@ExcelProperty(index = 36, value = "*管理层市场费1")
private String managerMarket1CalTypeFee;
@ExcelProperty(index = 29, value = "*管理层市场费2计算方式")
@ExcelProperty(index = 37, value = "*管理层市场费2计算方式")
private String managerMarket2CalType;
@ExcelProperty(index = 30, value = "*管理层市场费2")
@ExcelProperty(index = 38, value = "*管理层市场费2")
private String managerMarket2CalTypeFee;
@ExcelProperty(index = 31, value = "*一线阳光是否开启线上积分")
@ExcelProperty(index = 39, value = "*一线阳光是否开启线上积分")
private String firstLineSunshineOnlinePointsFlag;
@ExcelProperty(index = 32, value = "*一线阳光计算方式")
@ExcelProperty(index = 40, value = "*一线阳光计算模式")
private String firstLineSunshineIncentiveFeeCalMode;
@ExcelProperty(index = 41, value = "*一线阳光计算方式")
private String firstLineSunshineIncentiveFeeCalType;
@ExcelProperty(index = 33, value = "*一线阳光激励费")
@ExcelProperty(index = 42, value = "*一线阳光激励费")
private String firstLineSunshineIncentiveFee;
@ExcelProperty(index = 34, value = "*一线阳光2是否开启线上积分")
@ExcelProperty(index = 43, value = "*一线阳光2是否开启线上积分")
private String firstLineSunshine2OnlinePointsFlag;
@ExcelProperty(index = 35, value = "*一线阳光2计算方式")
@ExcelProperty(index = 44, value = "*一线阳光2计算模式")
private String firstLineSunshine2IncentiveFeeCalMode;
@ExcelProperty(index = 45, value = "*一线阳光2计算方式")
private String firstLineSunshine2IncentiveFeeCalType;
@ExcelProperty(index = 36, value = "*一线阳光2激励费")
@ExcelProperty(index = 46, value = "*一线阳光2激励费")
private String firstLineSunshine2IncentiveFee;
/**
......
package cn.com.glsx.dj.smartcarlife.dto.createBusiness;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
/**
* 精品升级场景单商户导入模板
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@ToString(callSuper = true)
public class CreateBusinessApproveImportSingleScene1Vo extends MergeExcelImportVo implements Serializable {
private static final long serialVersionUID = -8303881467179181920L;
@ExcelProperty(index = 0,value = "*签约主体")
private String contractingMerchantName;
@ExcelProperty(index = 1,value = "*流量费结算模式")
private String trafficFeeSettleMode;
@ExcelProperty(index = 2,value = "*预估流量")
private String estimatedFlow;
@ExcelProperty(index = 3,value = "预估转化率")
private String estimatedUpgradeRate;
@ExcelProperty(index = 4,value = "预估平均客单价")
private String estimatedCustomerUnitPrice;
@ExcelProperty(index = 5,value = "产值预估")
private String estimatedOutputValue;
@ExcelProperty(index = 6,value = "*园区店")
private String yqMerchantName;
@ExcelProperty(index = 7,value = "*结算方式")
private String settlementType;
@ExcelProperty(index = 8,value = "*套餐")
private String packageName;
@ExcelProperty(index = 9,value = "*商品ID")
private String upgradeCommodityCode;
@ExcelProperty(index = 10,value = "商品别名")
private String upgradeGoodsNameAlias;
@ExcelProperty(index = 11,value = "上架部位")
private String position;
@ExcelProperty(index = 12,value = "*售价")
private String sellPrice;
@ExcelProperty(index = 13,value = "*最低价")
private String minSellPrice;
@ExcelProperty(index = 14,value = "*升级成本")
private String upgradeProductCost;
@ExcelProperty(index = 15,value = "*回收成本")
private String recoveryCost;
@ExcelProperty(index = 16,value = "赠送成本")
private String giftCost;
@ExcelProperty(index = 17,value = "*销售占比")
private String saleRatio;
@ExcelProperty(index = 18,value = "*商品渗透率要求")
private String penetrationRate;
@ExcelProperty(index = 19,value = "*流量方是否线上自动分账")
private String shopMerchantAutoDivide;
@ExcelProperty(index = 20,value = "*线上分账对象")
private String shopMerchantDivideTarget;
@ExcelProperty(index = 21,value = "*流量方分润类型")
private String shopMerchantDivideType;
@ExcelProperty(index = 22,value = "*流量方比例")
private String shopMerchantDivideValue;
@ExcelProperty(index = 23,value = "*升级产品成本归属")
private String upgradeProductCostTarget;
@ExcelProperty(index = 24,value = "*回收成本归属")
private String recoveryCostTarget;
@ExcelProperty(index = 25,value = "*其他费用分润类型")
private String otherFeeDivideType;
@ExcelProperty(index = 26,value = "*其他费用分润比例")
private String otherFeeDivideValue;
@ExcelProperty(index = 27,value = "*线上分账对象")
private String otherFeeTarget;
@ExcelProperty(index = 28, value = "*管理层市场费1计算方式")
private String managerMarket1CalType;
@ExcelProperty(index = 29, value = "*管理层市场费1")
private String managerMarket1CalTypeFee;
@ExcelProperty(index = 30, value = "*管理层市场费2计算方式")
private String managerMarket2CalType;
@ExcelProperty(index = 31, value = "*管理层市场费2")
private String managerMarket2CalTypeFee;
@ExcelProperty(index = 32, value = "*一线阳光是否开启线上积分")
private String firstLineSunshineOnlinePointsFlag;
@ExcelProperty(index = 33, value = "*一线阳光计算模式")
private String firstLineSunshineIncentiveFeeCalMode;
@ExcelProperty(index = 34, value = "*一线阳光计算方式")
private String firstLineSunshineIncentiveFeeCalType;
@ExcelProperty(index = 35, value = "*一线阳光激励费")
private String firstLineSunshineIncentiveFee;
@ExcelProperty(index = 36, value = "*一线阳光2是否开启线上积分")
private String firstLineSunshine2OnlinePointsFlag;
@ExcelProperty(index = 37, value = "*一线阳光2计算模式")
private String firstLineSunshine2IncentiveFeeCalMode;
@ExcelProperty(index = 38, value = "*一线阳光2计算方式")
private String firstLineSunshine2IncentiveFeeCalType;
@ExcelProperty(index = 39, value = "*一线阳光2激励费")
private String firstLineSunshine2IncentiveFee;
/**
* 流量方线上分账对象商户号
*/
private Integer shopMerchantTargetMerchantId;
/**
* 流量方线上分账对象商户号
*/
private String shopMerchantTargetMerchantName;
}
\ No newline at end of file
......@@ -44,5 +44,8 @@ public class CreateBusinessApproveOperationConfirmDTO extends CreateBusinessAppr
private String oprByName;
private String oprByUserId;
@ApiModelProperty(notes = "是否下一步,否则就是上一步")
private Boolean nextStep = true;
}
......@@ -7,6 +7,7 @@ import cn.com.glsx.dj.smartcarlife.dto.OrderExpenseCategoryCalculatedDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantPackageGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.model.CreateBusinessProduct;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -38,4 +39,9 @@ public class CreateBusinessProductDTO extends CreateBusinessProduct {
private List<CreateBusinessApproveMerchantDTO> merchants;
private CreateBusinessApproveDTO createBusinessApproveDTO;
private List<Integer> idList;
@ApiModelProperty(notes = "商品/套餐名称")
private String productName;
}
......@@ -57,4 +57,6 @@ public class OADJOnShelvesDTO implements Serializable {
@ExcelMergeRow(columIndex = 30)
@ExcelProperty(value = "上架说明备注")
private String remark;
private Byte sceneType;
}
......@@ -27,7 +27,7 @@ public class OADJOnShelvesProductDTO implements Serializable {
private Byte productType;
@ExcelMergeRow(columIndex = 4)
@ExcelValueReplace(replace={"权益_1","延保_2"},repeatValue=true)
@ExcelValueReplace(replace={"轻改_0","权益_1","延保_2"},repeatValue=true)
@ExcelProperty(value = "合作项目", converter= ReplaceByteToStringConvert.class)
private Byte businessLine;
......
......@@ -32,7 +32,7 @@ public class OADJOnShelvesProductSettleDistributeRuleDTO implements Serializable
private BigDecimal shopProfitRateBD;
@ExcelMergeRow(columIndex = 12)
@ExcelValueReplace(replace={"毛利_1","收入_2","固定金额_3","园区店总金额_4","园区店毛利园区店毛利_5","园区店毛利_6","收入-自定义其他费用_8","收入-其他费用_9","固定金额*购买数量_10"},repeatValue=true)
@ExcelValueReplace(replace={"毛利_1","收入_2","固定金额_3","园区店总金额_4","园区店毛利(不扣除产品成本)_5","园区店毛利_6","收入-自定义其他费用_8","收入-其他费用_9","固定金额*购买数量_10"},repeatValue=true)
@ExcelProperty(value = "服务商分润类型", converter = ReplaceByteToStringConvert.class)
private Byte serviceProfitType;
......
......@@ -102,6 +102,67 @@ public class SettleReconciliationRuleDTO implements Serializable {
/**
* 服务商2分账商户号
*/
private Integer partnerMerchant2TargetMerchantId;
/**
* 服务商2分账商户号
*/
private String partnerMerchant2TargetMerchantName;
/**
* 服务商2分润分账商户类型
*/
private Byte partnerMerchant2TargetMerchantType;
/**
* 服务商2分润归属商户号
*/
private Integer partnerMerchant2OwningMerchantId;
/**
* 服务商2分润归属商户号
*/
private String partnerMerchant2OwningMerchantName;
/**
* 服务商2分润归属商户类型
*/
private Byte partnerMerchant2OwningMerchantType;
/**
* 其他费用分账商户号
*/
private Integer otherFeeTargetMerchantId;
/**
* 其他费用分账商户号
*/
private String otherFeeTargetMerchantName;
/**
* 其他费用分润分账商户类型
*/
private Byte otherFeeTargetMerchantType;
/**
* 其他费用分润归属商户号
*/
private Integer otherFeeOwningMerchantId;
/**
* 服务商2分润归属商户号
*/
private String otherFeeOwningMerchantName;
/**
* 服务商2分润归属商户类型
*/
private Byte otherFeeOwningMerchantType;
}
package cn.com.glsx.dj.smartcarlife.dto.goods;
import java.math.BigDecimal;
import java.util.List;
import javax.validation.constraints.NotEmpty;
import cn.com.glsx.dj.smartcarlife.dto.UpgradeGoodsDTO;
import cn.com.glsx.dj.smartcarlife.model.*;
import cn.com.glsx.dj.smartcarlife.model.BaseGoods;
import cn.com.glsx.dj.smartcarlife.model.CreateBusinessProduct;
import cn.com.glsx.dj.smartcarlife.model.GoodsInfo;
import cn.com.glsx.dj.smartcarlife.model.GoodsReviewLog;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsInfo;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsRef;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsVoucher;
import cn.com.glsx.dj.smartcarlife.model.ServiceMerchant;
import cn.com.glsx.dj.smartcarlife.remote.MerchantGoodsInfoRemote.InsertOrUpdate;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -9,10 +21,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
......@@ -227,10 +235,12 @@ public class MerchantGoodsInfoDTO extends MerchantGoodsInfo {
*/
private Integer filterSellPriceValid;
@ApiModelProperty(notes = "各商户库存管控模式列表(套餐子商品专用,保存套餐时传入)")
private List<MerchantGoodsInventoryTypeRefDTO> merchantInventoryTypeList;
@ApiModelProperty(notes = "上架商品id列表")
private List<Integer> idList;
@ApiModelProperty(notes = "商品渗透率要求,精品升级时展示")
private BigDecimal penetrationRate;
}
......@@ -26,6 +26,12 @@ public class MerchantGoodsInventoryTypeRefDTO extends MerchantGoodsInventoryType
@ApiModelProperty(notes = "商户商品编码")
private String merchantGoodsCode;
@ApiModelProperty(notes = "商户名称")
private String merchantName;
@ApiModelProperty(notes = "商品名称(dj_car_life_upgrade_goods.upgrade_goods_name)")
private String upgradeGoodsName;
@ApiModelProperty(notes = "ID列表(批量操作时使用)")
private List<Integer> ids;
}
......@@ -39,8 +39,21 @@ public class MerchantGoodsRefDTO extends MerchantGoodsRef {
private List<Integer> ids;
/**
* 对应园区店名称(与merchantId一一对应,导出专用)
*/
@ApiModelProperty(notes = "对应园区店名称")
private String yqMerchantName;
/**
* 库存类型 1-虚拟、2-实物
*/
@ApiModelProperty(notes = "库存类型 1-虚拟、2-实物")
private Byte inventoryType;
/**
* 套餐库存管控模式列表:该门店下套餐各子商品的库存管控配置
* 详情接口返回时填充;保存套餐时由前端传入
*/
@ApiModelProperty(notes = "套餐各子商品库存管控模式列表(套餐专用)")
private List<MerchantGoodsInventoryTypeRefDTO> inventoryTypeRefList;
}
package cn.com.glsx.dj.smartcarlife.dto.goods;
import cn.com.glsx.dj.smartcarlife.model.*;
import java.math.BigDecimal;
import java.util.List;
import javax.validation.constraints.NotEmpty;
import cn.com.glsx.dj.smartcarlife.model.CreateBusinessProduct;
import cn.com.glsx.dj.smartcarlife.model.GoodsReviewLog;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsRef;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsVoucher;
import cn.com.glsx.dj.smartcarlife.model.MerchantPackageGoodsInfo;
import cn.com.glsx.dj.smartcarlife.model.ServiceMerchant;
import cn.com.glsx.dj.smartcarlife.remote.MerchantPackageGoodsInfoRemote;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -9,10 +19,6 @@ import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
......@@ -106,4 +112,13 @@ public class MerchantPackageGoodsInfoDTO extends MerchantPackageGoodsInfo{
* 升级商品id字符串拼接,按照id升序排列,逗号分隔 eg. 99,100
*/
private String upgradeGoodsIdStr;
@ApiModelProperty(notes = "商品渗透率要求,精品升级时展示")
private BigDecimal penetrationRate;
@ApiModelProperty(notes = "库存管控模式 1-虚拟、2-实物(批量修改套餐库存模式专用)")
private Byte inventoryType;
@ApiModelProperty(notes = "应用范围(是否绑定所有商户)true / false(批量修改套餐库存模式专用)")
private Boolean bindAllMerchant;
}
......@@ -39,6 +39,9 @@ public class StaffStudyDetailInfoDTO implements Serializable {
private String merchantIds;
@JsonIgnore
private Integer merchantId;
@ApiModelProperty(notes = "业务类型")
private String businessSceneTypeNames;
......
package cn.com.glsx.dj.smartcarlife.enums;
import java.util.Objects;
public enum CalculateModeEnum {
/**
* 按照品类计算
* 按品类计算
*/
BY_GOODS_TYPE((byte)1,"按照品类计算"),
BY_GOODS_TYPE((byte)1,"按品类计算"),
/**
* 按整单计算
*/
......@@ -36,4 +38,15 @@ public enum CalculateModeEnum {
}
return null;
}
public static Byte getValueByDisplayName(String displayName){
if (displayName != null) {
for (CalculateModeEnum calculateModeEnum : CalculateModeEnum.values()) {
if (Objects.equals(calculateModeEnum.getDisplayName() ,displayName)) {
return calculateModeEnum.getValue();
}
}
}
return null;
}
}
......@@ -30,8 +30,12 @@ public enum FeeCategoryEnum {
THIRD_PARTY_COST(701, "第三方成本"),
SUNSHINE_INCENTIVE_FEE(704, "阳光激励费"),
/** 废弃了**/
OTHER_FEE(705, "其他费用"),
/** 分账类目-其他费用**/
SETTLE_OTHER_FEE(1300, "其他"),
/**
* 对账类目-管理层市场费1
......@@ -62,6 +66,12 @@ public enum FeeCategoryEnum {
* 分账类目类目-资源费
*/
SETTLE_RESOURCE_FEE(302, "资源费"),
/**
* 分账类目类目-服务商-资源费(服务商2)
*/
PARTNER_SETTLE_RESOURCE_FEE(1301, "资源费"),
/**
* 对账类目-平台方-资源费
*/
......
......@@ -17,6 +17,10 @@ public enum MerchantDistributionRuleTargetMerchantTypeEnum {
* 子商户
*/
SUB_MERCHANT((byte)4,"子商户"),
/**
* 服务商2
*/
PARTNER2((byte)5,"服务商2"),
;
private byte value;
......
package cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove;
public enum ConfirmStepEnum {
/**
* 1.基础信息
*/
BASE_INFO((byte)1,"基础信息"),
/**
* 2.上架商品
*/
GOODS((byte)2,"上架商品"),
/**
* 3.分账配置
*/
SETTLE((byte)3,"分账配置"),
/**
* 4.对账配置
*/
RECONCILIATION((byte)4,"对账配置"),
/**
* 5.预估利润率
*/
ESTIMATED((byte)5,"预估利润率")
;
private byte value;
private String displayName;
ConfirmStepEnum(Byte value, String displayName) {
this.value = value;
this.displayName = displayName;
}
public byte getValue() {
return value;
}
public String getDisplayName() {
return displayName;
}
public static ConfirmStepEnum getByValue(Byte value){
if (value != null) {
for (ConfirmStepEnum temp : ConfirmStepEnum.values()) {
if (temp.getValue() == value.byteValue()) {
return temp;
}
}
}
return null;
}
}
\ No newline at end of file
package cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove;
import java.util.Arrays;
/**
* @Author: chenx
* @Description: 商户分润类型
......@@ -21,7 +23,37 @@ public enum MerchantDivideTypeEnum {
/**
* 按固定金额
*/
FIXED_AMOUNT((byte)3,"固定");
FIXED_AMOUNT((byte)3,"固定"),
/**
* 园区店总金额
*/
EXCLUDE_SHOPPROFIT_PROPORTION((byte)4,"园区店总金额"),
/**
* 园区店毛利(不扣除产品成本)
*/
EXCLUDE_SHOPPROFIT_COMMONCOST_INCLUDE_COST_PROPORTION((byte)5,"园区店毛利(不扣除产品成本)"),
/**
* 园区店毛利
*/
EXCLUDE_SHOPPROFIT_COMMONCOST_PROPORTION((byte)6,"园区店毛利"),
/**
* 收入-自定义其他费用
*/
INCOME_SUBTRACT_CUSTOM_COMMON_COST_PROPORTION((byte)8,"收入-自定义其他费用"),
/**
* 收入-其他费用
*/
INCOME_SUBTRACT_COMMON_COST_PROPORTION((byte)9,"收入-其他费用"),
/**
* 固定*购买数量
*/
FIX_AMOUNT_WITH_PURCHASE_NUM((byte)10,"固定*购买数量");
private byte value;
private String displayName;
......@@ -60,4 +92,88 @@ public enum MerchantDivideTypeEnum {
}
return null;
}
public static Byte getValueByShopDisplayName(String displayName){
if (displayName != null) {
for (MerchantDivideTypeEnum e : Arrays.asList(
GROSS_RATIO,
INCOME_PROPORTION,
FIXED_AMOUNT,
INCOME_SUBTRACT_CUSTOM_COMMON_COST_PROPORTION,
INCOME_SUBTRACT_COMMON_COST_PROPORTION,
FIX_AMOUNT_WITH_PURCHASE_NUM
)) {
if (e.getDisplayName().equals(displayName)) {
return e.getValue();
}
}
}
return null;
}
public static Byte getValueByPartnerDisplayName(String displayName){
if (displayName != null) {
for (MerchantDivideTypeEnum e : Arrays.asList(
GROSS_RATIO,
INCOME_PROPORTION,
FIXED_AMOUNT,
EXCLUDE_SHOPPROFIT_PROPORTION,
EXCLUDE_SHOPPROFIT_COMMONCOST_INCLUDE_COST_PROPORTION,
EXCLUDE_SHOPPROFIT_COMMONCOST_PROPORTION,
INCOME_SUBTRACT_CUSTOM_COMMON_COST_PROPORTION,
INCOME_SUBTRACT_COMMON_COST_PROPORTION,
FIX_AMOUNT_WITH_PURCHASE_NUM
)) {
if (e.getDisplayName().equals(displayName)) {
return e.getValue();
}
}
}
return null;
}
public static Byte getValueByOtherFeeDisplayName(String displayName){
if (displayName != null) {
for (MerchantDivideTypeEnum e : Arrays.asList(
GROSS_RATIO,
INCOME_PROPORTION,
FIXED_AMOUNT,
FIX_AMOUNT_WITH_PURCHASE_NUM
)) {
if (e.getDisplayName().equals(displayName)) {
return e.getValue();
}
}
}
return null;
}
//dj_car_life_yq_merchant_service_details.profit_mode_type 园区店服务信息 ,两边值定义不一致才做此转换
public static MerchantDivideTypeEnum convertByProfitModeType(Byte profitModeType) {
if(profitModeType == null) {
return null;
}
switch(profitModeType) {
case 1://按收入比例
return INCOME_PROPORTION;
case 2://按毛利比例
return GROSS_RATIO;
case 3://按固定金额
return FIXED_AMOUNT;
case 4://按固定金额*购买数量
return FIX_AMOUNT_WITH_PURCHASE_NUM;
case 5://按园区店总金额比例
return EXCLUDE_SHOPPROFIT_PROPORTION;
case 6://按园区店毛利(不扣除产品成本)比例
return EXCLUDE_SHOPPROFIT_COMMONCOST_INCLUDE_COST_PROPORTION;
case 7://按园区店毛利比例
return EXCLUDE_SHOPPROFIT_COMMONCOST_PROPORTION;
case 8://按(收入-自定义其他费用)比例
return INCOME_SUBTRACT_CUSTOM_COMMON_COST_PROPORTION;
case 9://按(收入-其他费用)比例
return INCOME_SUBTRACT_COMMON_COST_PROPORTION;
default:
}
return null;
}
}
package cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove;
/**
*
* @Description:流量费结算模式
* @author zhoulm
*/
public enum TrafficFeeSettleModeEnum {
/**
* 按信息量
*/
BY_INFORMATION((byte)1,"按信息量"),
/**
* 按有效流量
*/
BY_VALID_TRAFFIC((byte)2,"按有效流量"),
/**
* 按销售额
*/
BT_SALES((byte)3,"按销售额"),
;
private byte value;
private String displayName;
TrafficFeeSettleModeEnum(Byte value, String displayName) {
this.value = value;
this.displayName = displayName;
}
public byte getValue() {
return value;
}
public String getDisplayName() {
return displayName;
}
public static TrafficFeeSettleModeEnum getByValue(Byte value){
if (value != null) {
for (TrafficFeeSettleModeEnum e : TrafficFeeSettleModeEnum.values()) {
if (e.getValue() == value.byteValue()) {
return e;
}
}
}
return null;
}
public static Byte getValueByDisplayName(String displayName){
if (displayName != null) {
for (TrafficFeeSettleModeEnum e : TrafficFeeSettleModeEnum.values()) {
if (e.getDisplayName().equals(displayName)) {
return e.getValue();
}
}
}
return null;
}
}
package cn.com.glsx.dj.smartcarlife.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import cn.com.glsx.dj.smartcarlife.remote.CreateBusinessApproveOperatorConfirmRemote.UpdateConfirmStep;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
......@@ -29,6 +36,7 @@ public class CreateBusinessApprove implements Serializable {
* 单据编号
*/
@ApiModelProperty(notes = "单据编号")
@NotBlank(groups = {UpdateConfirmStep.class})
@Column(name = "business_code")
private String businessCode;
......@@ -124,6 +132,17 @@ public class CreateBusinessApprove implements Serializable {
@Column(name = "reconciliation_rule_diff_json")
private String reconciliationRuleDiffJson;
@ApiModelProperty(notes = "业务场景:0-会员权益/升级;1-精品升级")
@Column(name = "scene_type")
private Byte sceneType;
/**
* 确认步骤:1.基础信息,2.上架商品;3.分账配置;4.对账配置;5.预估利润率
*/
@ApiModelProperty(notes = "确认步骤:1.基础信息,2.上架商品;3.分账配置;4.对账配置;5.预估利润率")
@Column(name = "confirm_step")
private Byte confirmStep;
/**
* 创建人
*/
......@@ -139,6 +158,7 @@ public class CreateBusinessApprove implements Serializable {
/**
* 修改人
*/
@NotBlank(groups = {UpdateConfirmStep.class})
@Column(name = "updated_by")
private String updatedBy;
......
......@@ -182,6 +182,44 @@ public class CreateBusinessApproveMerchant implements Serializable {
private String firstLineSunshine2OnlinePointsFlag;
/**
* 流量费结算模式(1:按信息量,2:按有效流量,3:按销售额),精品升级时展示
*/
@ApiModelProperty(notes = "流量费结算模式(1:按信息量,2:按有效流量,3:按销售额),精品升级时展示")
@Column(name = "traffic_fee_settle_mode")
private Byte trafficFeeSettleMode;
/**
* 预估客单价,精品升级时展示
*/
@ApiModelProperty(notes = "预估客单价,精品升级时展示")
@Column(name = "estimated_customer_unit_price")
private Integer estimatedCustomerUnitPrice;
/**
* 预估产值,精品升级时展示
*/
@ApiModelProperty(notes = "预估产值,精品升级时展示")
@Column(name = "estimated_output_value")
private Integer estimatedOutputValue;
/**
* 服务商2商户号
*/
@ApiModelProperty(notes = "服务商2商户号")
@Column(name = "partner_merchant_id2")
private Integer partnerMerchantId2;
/**
* 服务商2商户名称
*/
@ApiModelProperty(notes = "服务商2")
@Column(name = "partner_merchant_name2")
private String partnerMerchantName2;
@ApiModelProperty(notes = "信息是否填写完整(Y:是,N:否)")
@Column(name = "integrity")
private String integrity;
/**
* 创建人
*/
@Column(name = "created_by")
......
......@@ -156,6 +156,20 @@ public class CreateBusinessProduct implements Serializable {
private Byte settlementType;
/**
* 商品渗透率要求,精品升级时展示
*/
@ApiModelProperty(notes = "商品渗透率要求,精品升级时展示")
@Column(name = "penetration_rate")
private BigDecimal penetrationRate;
/**
* 信息是否填写完整(Y:是,N:否)
*/
@ApiModelProperty(notes = "信息是否填写完整(Y:是,N:否)")
@Column(name = "integrity")
private String integrity;
/**
* 创建人
*/
@Column(name = "created_by")
......
......@@ -49,7 +49,14 @@ public class MerchantDivisionRule implements Serializable {
@ApiModelProperty(notes="生效标识(Y已生效,N未生效)-放弃维护,通过dj_car_life_division_rule_effect_record判断是否生效", dataType="string")
@Column(name = "enable_flag")
private String enableFlag;
/**
* 提交标识(Y已提交,N未提交)
*/
@ApiModelProperty(notes = "提交标识(Y已提交,N未提交)")
@Column(name = "submit_flag")
private String submitFlag;
/**
* 分账方式(1线下对账,2线上分账)
*/
......
package cn.com.glsx.dj.smartcarlife.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -27,6 +28,7 @@ public class MerchantGoodsInventoryTypeRef implements Serializable {
/**
* 商户商品ID
*/
@ApiModelProperty(notes = "套餐商品id")
@Column(name = "merchant_goods_id")
private Integer merchantGoodsId;
......@@ -39,12 +41,14 @@ public class MerchantGoodsInventoryTypeRef implements Serializable {
/**
* 库存模式 1-虚拟、2-实物
*/
@ApiModelProperty(notes = "库存模式 1-虚拟、2-实物")
@Column(name = "inventory_type")
private Byte inventoryType;
/**
* 商户ID
*/
@ApiModelProperty(notes = "商户id")
@Column(name = "merchant_id")
private Integer merchantId;
......
......@@ -7,6 +7,12 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.remote.MerchantReconciliationRuleStepRemote.SaveSingleReconciliationGoodsTypeRule;
import cn.com.glsx.dj.smartcarlife.remote.MerchantReconciliationRuleStepRemote.SubmitRule;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
......@@ -24,6 +30,7 @@ public class MerchantReconciliationRule implements Serializable {
/**
* 主键ID
*/
@NotNull(groups = {SubmitRule.class})
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
......@@ -37,12 +44,14 @@ public class MerchantReconciliationRule implements Serializable {
/**
* 4s店商户号
*/
@NotNull(groups = {SaveSingleReconciliationGoodsTypeRule.class})
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 业务场景 0-业务场景1.0 1-业务场景1.1 2-业务场景1.2 3-业务场景1.3
*/
@NotNull(groups = {SaveSingleReconciliationGoodsTypeRule.class})
@Column(name = "scene_type")
private Byte sceneType;
......@@ -50,6 +59,7 @@ public class MerchantReconciliationRule implements Serializable {
/**
* 流量方总对账费用计算方法 1-按毛利比例 2-按收入比例 3-按固定金额
*/
@Deprecated
@Column(name = "shop_merchant_total_fee_calculate_type")
@ApiModelProperty(notes = "流量方总对账费用计算方法 1-按毛利比例 2-按收入比例 3-按固定金额")
private Byte shopMerchantTotalFeeCalculateType;
......@@ -57,6 +67,7 @@ public class MerchantReconciliationRule implements Serializable {
/**
* 流量方总对账费用类目计算值(%)
*/
@Deprecated
@Column(name = "shop_merchant_expense_category_value")
@ApiModelProperty(notes = "流量方总对账费用类目计算值(%)")
private BigDecimal shopMerchantExpenseCategoryValue;
......@@ -64,6 +75,7 @@ public class MerchantReconciliationRule implements Serializable {
/**
* 服务商总对账费用计算方法 1-按毛利比例 2-按收入比例 3-按固定金额 4-按园区店总金额比例 5-按园区店毛利(不包含产品成本)比例 6-按园区店毛利比例
*/
@Deprecated
@Column(name = "partner_merchant_total_fee_calculate_type")
@ApiModelProperty(notes = "服务商总对账费用计算方法 1-按毛利比例 2-按收入比例 3-按固定金额 4-按园区店总金额比例 5-按园区店毛利(不包含产品成本)比例 6-按园区店毛利比例")
private Byte partnerMerchantTotalFeeCalculateType;
......@@ -71,6 +83,7 @@ public class MerchantReconciliationRule implements Serializable {
/**
* 服务商总对账费用类目计算值(%)
*/
@Deprecated
@Column(name = "partner_merchant_expense_category_value")
@ApiModelProperty(notes = "服务商总对账费用类目计算值(%)")
private BigDecimal partnerMerchantExpenseCategoryValue;
......@@ -78,8 +91,16 @@ public class MerchantReconciliationRule implements Serializable {
/**
* 生效标识(Y已生效,N未生效)-放弃维护,通过dj_car_life_division_rule_effect_record判断是否生效
*/
@Deprecated
@Column(name = "enable_flag")
private String enableFlag;
/**
* 提交标识(Y已提交,N未提交)
*/
@ApiModelProperty(notes = "提交标识(Y已提交,N未提交)")
@Column(name = "submit_flag")
private String submitFlag;
/**
* 创建人
......@@ -96,6 +117,7 @@ public class MerchantReconciliationRule implements Serializable {
/**
* 修改人
*/
@NotEmpty(groups = {SubmitRule.class})
@Column(name = "updated_by")
private String updatedBy;
......
......@@ -55,6 +55,12 @@ public class MerchantSettleAccountRule implements Serializable {
private String enableFlag;
/**
* 提交标识(Y已提交,N未提交)
*/
@Column(name = "submit_flag")
private String submitFlag;
/**
* 创建人
*/
@Column(name = "created_by")
......
package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.carcondition.CarConditionRespDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value = "ai压价话术接口", owner = "cyf")
public interface CarConditionAIReportRemote {
@ApiMethod("生成ai压价话术任务id")
@ApiParam(name="condition",notes="生成ai压价话术任务id条件",dataType= ApiParam.DataTypeEnum.STRING,required=true)
@ApiResponse("返回生成ai压价话术任务id")
RpcResponse<CarConditionRespDTO> generateAiTaskId(String aiRequestJson);
@ApiMethod("根据任务id查询ai压价话术json")
@ApiParam(name="condition",notes="生成ai压价话术json任务id",dataType= ApiParam.DataTypeEnum.STRING,required=true)
@ApiResponse("返回生成ai压价话术任务json")
RpcResponse<CarConditionRespDTO> queryAiJsonResultByTaskId(String aiTaskId);
}
package cn.com.glsx.dj.smartcarlife.remote;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.CreateBusinessApproveDTO;
import cn.com.glsx.dj.smartcarlife.dto.CreateBusinessApproveMerchantDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value="智享车生活-嘀加上架流量方信息",owner="zhoulm")
public interface CreateBusinessApproveMerchantRemote {
@ApiMethod("嘀加上架流量方信息")
@ApiParams({
@ApiParam(name="businessCode",notes="审批单据编号",dataType= ApiParam.DataTypeEnum.STRING,required=true),
@ApiParam(name="merchantId",notes="商户号",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
})
@ApiResponse("嘀加上架流量方信息")
RpcResponse<CreateBusinessApproveMerchantDTO> get(@NotBlank String businessCode,@NotNull Integer merchantId);
@ApiMethod("保存嘀加上架流量方信息")
@ApiParam(name="dto",notes="上架流量方信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("嘀加上架流量方信息")
RpcResponse<CreateBusinessApproveMerchantDTO> saveCreateBusinessApproveMerchant(@NotNull CreateBusinessApproveMerchantDTO dto);
@ApiMethod("嘀加上架流量方分页查询")
@ApiParam(name="pagination",notes="分页信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("嘀加上架流量方分页信息")
RpcResponse<RpcPagination<CreateBusinessApproveMerchantDTO>> listWithPage(@NotNull RpcPagination<CreateBusinessApproveMerchantDTO> rpcPagination);
@ApiMethod("获取第一个保存规则的流量方信息")
@ApiParams({
@ApiParam(name="businessCode",notes="审批单据编号",dataType= ApiParam.DataTypeEnum.STRING,required=true)
})
@ApiResponse("保存规则的流量方信息")
RpcResponse<CreateBusinessApproveMerchantDTO> getSaveRuleMerchant(@NotBlank String businessCode);
}
package cn.com.glsx.dj.smartcarlife.remote;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessApproveOperationConfirmDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
......@@ -18,5 +20,11 @@ public interface CreateBusinessApproveOperatorConfirmRemote {
@ApiParam(name="dto",notes="嘀加上架信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("是否成功")
RpcResponse<Integer> operationConfirmAsync(CreateBusinessApproveOperationConfirmDTO dto);
@interface UpdateConfirmStep{}
@ApiMethod("确认步骤修改")
@ApiParam(name="dto",notes="嘀加上架信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("是否成功")
RpcResponse<Boolean> updateConfirmStep(@NotNull CreateBusinessApproveOperationConfirmDTO dto);
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupReconciliationRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantReconciliationRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessApproveOperationConfirmDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value="嘀加上架-对账规则",owner="zhoulm")
public interface CreateBusinessApproveReconciliationRuleRemote {
@ApiMethod("获取基础对账规则信息")
@ApiParam(name="businessCode",notes="审批单据",dataType= ApiParam.DataTypeEnum.STRING,required=true)
@ApiResponse("基础对账规则信息")
RpcResponse<List<MerchantGoodsTypeGroupReconciliationRuleDTO>> listGoodsTypeGroup(@NotBlank String businessCode);
@ApiMethod("获取单品类对账规则信息")
@ApiParams({
@ApiParam(name="businessCode",notes="审批单据",dataType= ApiParam.DataTypeEnum.STRING,required=true),
@ApiParam(name="goodsTypeGroupRuleId",notes="品类分账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
})
@ApiResponse("单品类对账规则信息")
RpcResponse<MerchantReconciliationRuleDTO> getGoodsTypeGroupRuleDetail(@NotBlank String businessCode, @NotNull Integer goodsTypeGroupRuleId);
@ApiMethod("保存单品类对账规则信息")
@ApiParam(name="dto",notes="单品类对账规则信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("单品类对账规则信息")
RpcResponse<MerchantReconciliationRuleDTO> saveCreateBusinessRule(@NotNull CreateBusinessApproveOperationConfirmDTO dto);
@ApiMethod("查询同审核单号下其他同品类组的商品关系,前端用于排除已选项,禁用不可选项")
@ApiParams({
@ApiParam(name="businessCode",notes="审批单据",dataType= ApiParam.DataTypeEnum.STRING,required=true),
@ApiParam(name="goodsTypeGroupRuleId",notes="品类对账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER),
@ApiParam(name="categoryType",notes="分类品类",dataType= ApiParam.DataTypeEnum.INTEGER)
})
@ApiResponse("同审核单号下其他同品类组的商品关系列表")
RpcResponse<List<GoodsTypeGroupRelationDTO>> listOtherGoodsTypeItem(@NotBlank String businessCode, Integer goodsTypeGroupRuleId,Byte categoryType);
}
......@@ -34,11 +34,11 @@ public interface CreateBusinessApproveRemote {
@ApiResponse("嘀加上架驳回结果")
RpcResponse<String> saveBusinessApprove(CreateBusinessApproveDTO createBusinessApproveDTO);
@ApiMethod("嘀加上架id")
@ApiMethod("嘀加上架基本数据,关联流量方仅返回商户ID和名称")
@ApiParam(name="id",notes="操作记录",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("嘀加上架详情")
RpcResponse<CreateBusinessApproveDetailDTO> businessApproveDetail(Integer id);
@ApiResponse("嘀加上架基本数据")
RpcResponse<CreateBusinessApproveDetailDTO> businessApproveBase(Integer id);
@ApiMethod("嘀加上架id")
@ApiParam(name="id",notes="操作记录",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("嘀加上架商品详情")
......
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantDivisionRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupSettleRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleDistributeRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessApproveOperationConfirmDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value="嘀加上架-分账规则",owner="zhoulm")
public interface CreateBusinessApproveSettleRuleRemote {
@ApiMethod("获取基础分账规则信息")
@ApiParam(name="businessCode",notes="单据编号",dataType= ApiParam.DataTypeEnum.STRING,required=true)
@ApiResponse("基础分账规则信息")
RpcResponse<List<MerchantGoodsTypeGroupSettleRuleDTO>> listGoodsTypeGroup(@NotBlank String businessCode);
@ApiMethod("获取单品类分账规则信息")
@ApiParams({
@ApiParam(name="businessCode",notes="审批单据",dataType= ApiParam.DataTypeEnum.STRING,required=true),
@ApiParam(name="goodsTypeGroupRuleId",notes="品类分账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
})
@ApiResponse("查询单品类分账规则信息")
RpcResponse<MerchantSettleDistributeRuleDTO> getGoodsTypeGroupRuleDetail(@NotBlank String businessCode, @NotNull Integer goodsTypeGroupRuleId);
@ApiMethod("保存单品类分账规则信息")
@ApiParam(name="dto",notes="单品类分账规则信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("单品类分账规则信息")
RpcResponse<MerchantSettleDistributeRuleDTO> saveCreateBusinessSettleRule(@NotNull CreateBusinessApproveOperationConfirmDTO dto);
@ApiMethod("查询同审核单号下其他同品类组的商品关系,前端用于排除已选项,禁用不可选项")
@ApiParams({
@ApiParam(name="businessCode",notes="审批单据",dataType= ApiParam.DataTypeEnum.STRING,required=true),
@ApiParam(name="goodsTypeGroupRuleId",notes="品类分账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER),
@ApiParam(name="categoryType",notes="分类品类",dataType= ApiParam.DataTypeEnum.INTEGER)
})
@ApiResponse("同审核单号下其他同品类组的商品关系列表")
RpcResponse<List<GoodsTypeGroupRelationDTO>> listOtherGoodsTypeItem(@NotBlank String businessCode, Integer goodsTypeGroupRuleId,Byte categoryType);
@ApiMethod("保存分账规则自动分账配置")
@ApiParams({
@ApiParam(name="businessCode",notes="审批单据",dataType= ApiParam.DataTypeEnum.STRING,required=true),
@ApiParam(name="record",notes="分账规则自动分账配置信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
})
@ApiResponse("分账规则自动分账配置")
RpcResponse<MerchantDivisionRuleDTO> saveDivisionRuleAuto(@NotBlank String businessCode,@NotNull MerchantDivisionRuleDTO record);
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessProductDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value="智享车生活-嘀加上架商品/套餐信息表",owner="zhoulm")
public interface CreateBusinessProductRemote {
@ApiMethod("查询嘀加上架商品/套餐信息")
@ApiParam(name="ID",notes="主键ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("嘀加上架商品/套餐信息")
RpcResponse<CreateBusinessProductDTO> getDetailById(@NotNull Integer id);
@ApiMethod("保存嘀加上架单个商品/套餐信息")
@ApiParam(name="dto",notes="商品/套餐信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("嘀加上架商品/套餐信息")
RpcResponse<CreateBusinessProductDTO> saveCreateBusinessProduct(@NotNull CreateBusinessProductDTO dto);
@ApiMethod("删除嘀加上架商品/套餐信息")
@ApiParam(name="dto",notes="商品/套餐信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("操作结果")
RpcResponse<Boolean> deleteCreateBusinessProduct(@NotNull CreateBusinessProductDTO dto);
@ApiMethod("嘀加上架商品/套餐信息分页查询")
@ApiParam(name="pagination",notes="分页信息",dataType= ApiParam.DataTypeEnum.OBJECT,required=true)
@ApiResponse("嘀加上架商品/套餐信息分页信息")
RpcResponse<RpcPagination<CreateBusinessProductDTO>> listBaseWithPage(@NotNull RpcPagination<CreateBusinessProductDTO> rpcPagination);
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.DivisionRuleAutoDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value="智享车生活-自动分账规则",owner="zhoulm")
public interface DivisionRuleAutoRemote {
@ApiMethod("获取自动分账规则列表")
@ApiParam(name="divisionRuleId",notes="分账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("返回自动分账规则列表")
RpcResponse<List<DivisionRuleAutoDTO>> listDivisionRuleAutoByDivisionRuleId(@NotNull Integer divisionRuleId);
}
package cn.com.glsx.dj.smartcarlife.remote;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.MerchantDivisionRuleDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantDivisionRule;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
......@@ -25,4 +28,9 @@ public interface MerchantDivisionRuleRemote {
@ApiParams({@ApiParam(name="merchantId",notes="商户号",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)})
@ApiResponse("返回商户分账规则")
RpcResponse<MerchantDivisionRuleDTO> getLatestByMerchantId(Integer merchantId, Byte sceneType);
@ApiMethod("获取当前商户分账规则")
@ApiParams({@ApiParam(name="divisionRuleId",notes="分账规则id",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)})
@ApiResponse("返回商户分账规则")
RpcResponse<MerchantDivisionRule> getBaseById(@NotNull Integer divisionRuleId);
}
......@@ -5,7 +5,9 @@ import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantGoodsInventoryTypeRefDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantPackageGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsRef;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
......@@ -73,4 +75,24 @@ public interface MerchantPackageGoodsInfoRemote {
@ApiParam(name = "updatedBy", notes = "操作人", dataType = ApiParam.DataTypeEnum.STRING, required = true)})
@ApiResponse("失效套餐结果")
RpcResponse<Boolean> invalidPackageByPackageCodeList(@NotNull List<String> packageCodeList, String updatedBy);
@ApiMethod("根据套餐ID列表查询套餐下商品信息(每个套餐含套餐商品列表)")
@ApiParam(name = "idList", notes = "套餐ID列表", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("返回套餐列表(每项含商品列表)")
RpcResponse<List<MerchantPackageGoodsInfoDTO>> getGoodsByPackageIdList(@NotNull List<Integer> idList);
@ApiMethod("根据套餐ID列表查询套餐关联的商户列表(合并去重)")
@ApiParam(name = "idList", notes = "套餐ID列表", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("返回套餐关联商户列表")
RpcResponse<List<MerchantGoodsRef>> queryRelatedMerchantByPackageIdList(@NotNull List<Integer> idList);
@ApiMethod("批量修改套餐库存管控模式(按子商品维度,每个子商品独立配置,支持多套餐)")
@ApiParam(name = "packageList", notes = "套餐库存管控模式修改参数列表", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("返回操作结果")
RpcResponse<Boolean> batchEditInventoryTypeByPackageId(@NotNull List<MerchantPackageGoodsInfoDTO> packageList);
@ApiMethod("按套餐编码列表批量查询库存管控记录")
@ApiParam(name = "packageCodes", notes = "套餐编码列表", dataType = ApiParam.DataTypeEnum.LIST, required = true)
@ApiResponse("返回库存管控记录列表")
RpcResponse<List<MerchantGoodsInventoryTypeRefDTO>> listInventoryTypeRefByPackageCodes(@NotNull List<String> packageCodes);
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupReconciliationRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantReconciliationRuleDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value = "清分2.0-分步保存商户对账规则", owner = "zhoulm", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface MerchantReconciliationRuleStepRemote {
@interface SaveSingleReconciliationGoodsTypeRule{}
@ApiMethod("保存单个对账品类规则")
@ApiParam(name = "merchantReconciliationRuleDTO", notes = "对账品类规则", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("返回保存结果")
RpcResponse<MerchantReconciliationRuleDTO> saveSingleReconciliationGoodsTypeRule(@NotNull MerchantReconciliationRuleDTO merchantReconciliationRuleDTO);
@interface SubmitRule{}
@ApiMethod("提交对账品类规则")
@ApiParam(name = "merchantReconciliationRuleDTO", notes = "对账品类规则", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("返回保存结果")
RpcResponse<MerchantReconciliationRuleDTO> submitRule(@NotNull MerchantReconciliationRuleDTO merchantReconciliationRuleDTO);
@ApiMethod("删除单个对账品类规则")
@ApiParam(name = "merchantReconciliationRuleDTO", notes = "对账品类规则", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("返回保存结果")
RpcResponse<Boolean> deleteSingleReconciliationGoodsTypeRule(@NotNull Integer goodsTypeGroupRuleId,@NotBlank String updatedBy);
@ApiMethod("查询最新可修改的对账规则")
@ApiParams({
@ApiParam(name = "merchantId", notes = "商户id", dataType = ApiParam.DataTypeEnum.INTEGER, required = false),
@ApiParam(name = "sceneType", notes = "场景值", dataType = ApiParam.DataTypeEnum.BYTE, required = true)
})
@ApiResponse("返回生效中的对账规则详情")
RpcResponse<MerchantReconciliationRuleDTO> getReconciliationRule(@NotNull Integer merchantId, @NotNull Byte sceneType);
@ApiMethod("获取单个对账品类规则")
@ApiParam(name = "goodsTypeGroupRuleId", notes = "对账品类规则ID", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
@ApiResponse("返回保存结果")
RpcResponse<MerchantReconciliationRuleDTO> getSingleReconciliationGoodsTypeRule(@NotNull Integer goodsTypeGroupRuleId);
@ApiMethod("查询同对账规则下其他同品类组的商品关系,前端用于排除已选项,禁用不可选项")
@ApiParams({
@ApiParam(name="reconciliationRuleId",notes="对账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true),
@ApiParam(name="goodsTypeGroupRuleId",notes="品类对账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER),
@ApiParam(name="categoryType",notes="分类品类",dataType= ApiParam.DataTypeEnum.INTEGER)
})
@ApiResponse("同对账规则下其他同品类组的商品关系列表")
RpcResponse<List<GoodsTypeGroupRelationDTO>> listOtherGoodsTypeItem(@NotNull Integer reconciliationRuleId, Integer goodsTypeGroupRuleId,Byte categoryType);
@ApiMethod("获取对账规则品类列表信息")
@ApiParam(name="reconciliationRuleId",notes="对账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER,required=true)
@ApiResponse("基础对账规则品类列表信息")
RpcResponse<List<MerchantGoodsTypeGroupReconciliationRuleDTO>> listGoodsTypeGroup(@NotNull Integer reconciliationRuleId);
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupSettleRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleDistributeRuleDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value = "清分2.0-商户财务分账规则接口", owner = "zhoulm", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface MerchantSettleDistributeRuleStepRemote {
@interface SaveSingleGoodsTypeRule{}
@ApiMethod("清分2.0-商户财务单品类分账规则保存")
@ApiParam(name = "", notes = "要保存的财务单品类分账规则内容", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("是否保存成功")
RpcResponse<Boolean> saveSingleGoodsTypeRule(@NotNull MerchantSettleDistributeRuleDTO merchantSettleDistributeRuleDTO);
@ApiMethod("清分2.0-商户财务单品类分账规则删除")
@ApiParam(name = "", notes = "要保存的财务单品类分账规则内容", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("是否保存成功")
RpcResponse<Boolean> deleteSingleGoodsTypeRule(@NotNull MerchantSettleDistributeRuleDTO merchantSettleDistributeRuleDTO);
@ApiMethod("查询最新待提交的的财务分账规则,如没有则复制一份最新的")
@ApiParams({
@ApiParam(name = "merchantId", notes = "商户号", dataType = ApiParam.DataTypeEnum.INT, required = true),
@ApiParam(name = "sceneType", notes = "场景(0:1.0;1:1.1;2:1.2;3:1.3)", dataType = ApiParam.DataTypeEnum.BYTE, required = true),
@ApiParam(name = "expenseCategroyRulsBuildType", notes = "组织费用类目规则的方式:1 费用类目平铺 2 按照商户分组", dataType = ApiParam.DataTypeEnum.BYTE, required = true)
})
@ApiResponse("商户最新的财务分账规则")
RpcResponse<MerchantSettleDistributeRuleDTO> getLastRule(@NotNull Integer merchantId, @NotNull Byte sceneType, @NotNull Byte expenseCategroyRulesBuildType);
@ApiResponse("商户财务单品类分账规则")
RpcResponse<MerchantSettleDistributeRuleDTO> getSignleGoodsTypeRule(@NotNull Integer settleRuleId, @NotNull Integer divisionRuleId,
@NotNull Integer goodsTypeGroupRuleId);
@ApiMethod("清分2.0-商户财务分账规则提交")
@ApiParam(name = "", notes = "要提交的财务分账规则内容", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("是否保存成功")
RpcResponse<Boolean> submitRule(@NotNull MerchantSettleDistributeRuleDTO merchantSettleDistributeRuleDTO);
@ApiMethod("获取分账品类列表")
@ApiParam(name="settleRuleId",notes="财务规则ID",dataType= ApiParam.DataTypeEnum.STRING,required=true)
@ApiResponse("分账品类列表")
RpcResponse<List<MerchantGoodsTypeGroupSettleRuleDTO>> listGoodsTypeGroup(@NotNull Integer settleRuleId);
@ApiMethod("查询同规则下其他同品类组的商品关系,前端用于排除已选项,禁用不可选项")
@ApiParams({
@ApiParam(name="settleRuleId",notes="财务规则ID",dataType= ApiParam.DataTypeEnum.STRING,required=true),
@ApiParam(name="goodsTypeGroupRuleId",notes="品类分账规则ID",dataType= ApiParam.DataTypeEnum.INTEGER),
@ApiParam(name="categoryType",notes="分类品类",dataType= ApiParam.DataTypeEnum.INTEGER)
})
@ApiResponse("同规则下其他同品类组的商品关系列表")
RpcResponse<List<GoodsTypeGroupRelationDTO>> listOtherGoodsTypeItem(@NotNull Integer settleRuleId, Integer goodsTypeGroupRuleId,Byte categoryType);
}
package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.MerchantStaffDTO;
import cn.com.glsx.dj.smartcarlife.dto.StaffInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.StaffUniquePhoneDTO;
import cn.com.glsx.dj.smartcarlife.dto.staff.StaffWechatBindingDTO;
......@@ -98,4 +99,12 @@ public interface StaffInfoRemote {
@ApiMethod("禁用员工")
RpcResponse<Boolean> updateStaffStatus(StaffInfoDTO staffInfoDTO);
@ApiMethod("根据4s店商户号查询关联的园区店下所有驻店员工信息")
@ApiParams({
@ApiParam(name = "mainMerchantId", notes = "4S商户号", dataType = ApiParam.DataTypeEnum.INTEGER, required = true),
@ApiParam(name = "sceneType", notes = "场景值", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
})
@ApiResponse("员工信息列表")
RpcResponse<List<MerchantStaffDTO>> listStaffByMainMerchantIdAndScene(@NotNull Integer mainMerchantId, @NotNull Integer sceneType);
}
# IntelliJ / IDEA
*.iml
.idea/
out/
# Maven 构建物
target/
# Maven Flatten 插件的产物
.flattened-pom.xml
\ No newline at end of file
......@@ -15,7 +15,7 @@
<skipTests>true</skipTests>
<shopmall.api.version>5.6.4-SNAPSHOT</shopmall.api.version>
<stoassistant.api.version>5.6.4-SNAPSHOT</stoassistant.api.version>
<smartcarlife.api.version>5.7.0.1-SNAPSHOT</smartcarlife.api.version>
<smartcarlife.api.version>5.7.1-SNAPSHOT</smartcarlife.api.version>
</properties>
<dependencies>
<dependency>
......
......@@ -81,6 +81,34 @@ public interface SmartCarLifeConstants {
FeeCategoryEnum.THIRD_PARTY_COST.getValue()
);
List<Integer> ARPROVE_SYSTEM_COMMON_COST_EXPENSECATEGORY_IDS = Arrays.asList(
FeeCategoryEnum.HANDLING_FEE.getValue(),
FeeCategoryEnum.PRODUCT_COST.getValue(),
FeeCategoryEnum.VIRTUAL_ACCOUNT_COST.getValue(),
FeeCategoryEnum.RECOVERY_COST.getValue(),
FeeCategoryEnum.DJ_COST.getValue(),
FeeCategoryEnum.THIRD_PARTY_COST.getValue(),
FeeCategoryEnum.SETTLE_OTHER_FEE.getValue()
);
//嘀加上架精品升级需要的费用类目
List<Integer> ARPROVE_SCENE1_EXPENSECATEGORY_IDS = Arrays.asList(
FeeCategoryEnum.TRAFFIC_FEE.getValue(),
FeeCategoryEnum.SERVICE_PROVIDER_PROFIT_SHARING.getValue(),
FeeCategoryEnum.PRODUCT_COST.getValue(),
FeeCategoryEnum.HANDLING_FEE.getValue(),
FeeCategoryEnum.RECOVERY_COST.getValue(),
FeeCategoryEnum.SETTLE_OTHER_FEE.getValue()
);
//嘀加上架会员权益需要的费用类目
List<Integer> ARPROVE_SCENE0_EXPENSECATEGORY_IDS = Arrays.asList(
FeeCategoryEnum.TRAFFIC_FEE.getValue(),
FeeCategoryEnum.SERVICE_PROVIDER_PROFIT_SHARING.getValue(),
FeeCategoryEnum.HANDLING_FEE.getValue(),
FeeCategoryEnum.THIRD_PARTY_COST.getValue(),
FeeCategoryEnum.SETTLE_OTHER_FEE.getValue(),
FeeCategoryEnum.PARTNER_SETTLE_RESOURCE_FEE.getValue()
);
// 公共费用类目存在整单,流量方、服务商费用类目不能有按品类的如下计算方式
List<ExpenseCategoryCalculateTypeEnum> CONFLICT_WITH_COMMON_BY_ORDER_ENUM = Arrays.asList(
ExpenseCategoryCalculateTypeEnum.INCOME_SUBTRACT_COMMON_COST_PROPORTION,
......
......@@ -4,6 +4,7 @@ import cn.com.glsx.dj.smartcarlife.converter.MerchantGoodsInfoDTOConvert;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessProductDTO;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.OADJOnShelvesGoodsDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove.ProductTypeEnum;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
......@@ -117,12 +118,35 @@ public class CreateBusinessProductDTOConvertHelper {
return null;
}
if (Objects.equals(dto.getProductType(), ProductTypeEnum.GOODS.getValue()) && dto.getMerchantGoodsInfoDTO() != null) {
return dto.getMerchantGoodsInfoDTO().getThirdPartyCost();
MerchantGoodsInfoDTO merchantGoodsInfoDTO = dto.getMerchantGoodsInfoDTO();
if(Objects.equals(merchantGoodsInfoDTO.getSceneType(), SceneTypeEnum.SCENE1_1.getValue())) {
BigDecimal thirdPartyCost = BigDecimal.ZERO;
if(merchantGoodsInfoDTO.getUpgradeProductCost() != null) {
thirdPartyCost = thirdPartyCost.add(merchantGoodsInfoDTO.getUpgradeProductCost());
}
if(merchantGoodsInfoDTO.getRecoveryCost() != null) {
thirdPartyCost = thirdPartyCost.add(merchantGoodsInfoDTO.getRecoveryCost());
}
return thirdPartyCost;
}
return merchantGoodsInfoDTO.getThirdPartyCost();
}
if (Objects.equals(dto.getProductType(), ProductTypeEnum.PACKAGE.getValue()) && CollectionUtils
.isNotEmpty(dto.getMerchantPackageGoodsInfoDTO().getMerchantGoodsInfoList())) {
return dto.getMerchantPackageGoodsInfoDTO().getMerchantGoodsInfoList().stream()
.filter(Objects::nonNull).map(MerchantGoodsInfoDTO::getThirdPartyCost)
.filter(Objects::nonNull).map(item ->{
if(Objects.equals(item.getSceneType(), SceneTypeEnum.SCENE1_1.getValue())) {
BigDecimal thirdPartyCost = BigDecimal.ZERO;
if(item.getUpgradeProductCost() != null) {
thirdPartyCost = thirdPartyCost.add(item.getUpgradeProductCost());
}
if(item.getRecoveryCost() != null) {
thirdPartyCost = thirdPartyCost.add(item.getRecoveryCost());
}
return thirdPartyCost;
}
return item.getThirdPartyCost();
})
.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
}
return null;
......
......@@ -12,6 +12,10 @@ import java.util.List;
public interface CreateBusinessApproveMerchantMapper extends OreMapper<CreateBusinessApproveMerchant> {
List<CreateBusinessApproveMerchantDTO> list(CreateBusinessApproveMerchantDTO condition);
CreateBusinessApproveMerchantDTO getSaveRuleMerchant(CreateBusinessApproveMerchantDTO condition);
List<CreateBusinessApproveMerchantDTO> listMerchantInfo(CreateBusinessApproveMerchantDTO condition);
void removeByBusinessCode(@Param("businessCode") String businessCode, @Param("updatedBy") String updatedBy);
}
\ No newline at end of file
......@@ -13,7 +13,9 @@ import java.util.List;
public interface CreateBusinessProductMapper extends OreMapper<CreateBusinessProduct> {
List<CreateBusinessProductDTO> list(CreateBusinessProductDTO dto);
List<CreateBusinessProduct> listSimple(CreateBusinessProductDTO dto);
List<CreateBusinessProductDTO> listBase(CreateBusinessProductDTO dto);
List<CreateBusinessProductDTO> listSimple(CreateBusinessProductDTO dto);
List<CreateBusinessProductDTO> listPackageDetail(CreateBusinessProductDTO dto);
......
......@@ -18,4 +18,6 @@ public interface MerchantDistributionRuleMapper extends OreMapper<MerchantDistri
List<MerchantDistributionRuleDTO> selectByRuleType1(Integer goodsTypeGroupRuleId);
List<MerchantDistributionRuleDTO> selectByRuleType2(Integer goodsTypeGroupRuleId);
int updateShopInfo(MerchantDistributionRuleDTO dto);
}
\ No newline at end of file
......@@ -13,6 +13,8 @@ public interface MerchantDivisionRuleMapper extends OreMapper<MerchantDivisionRu
List<MerchantDivisionRule> list(MerchantDivisionRule record);
MerchantDivisionRule getLatest(MerchantDivisionRule record);
void syncShopMerchant(@Param("merchantId")Integer merchantId, @Param("updatedBy")String updatedBy);
void syncDjzhySubMerchant(@Param("merchantId")Integer merchantId, @Param("updatedBy")String updatedBy);
......@@ -25,7 +27,9 @@ public interface MerchantDivisionRuleMapper extends OreMapper<MerchantDivisionRu
int invalidDivisionRuleListDeletedFlag(@Param("idList") List<Integer> idList, @Param("updatedBy")String updatedBy);
int validDivisionRuleDeletedFlag(@Param("id") Integer id, @Param("updatedBy")String updatedBy);
int validDivisionRuleDeletedFlag(@Param("id") Integer id, @Param("updatedBy")String updatedBy,@Param("submitFlag")String submitFlag);
int updateDivisionType(@Param("id") Integer id, @Param("divisionType") Byte divisionType, @Param("updatedBy") String updatedBy);
int updateDivisionRule(MerchantDivisionRule record);
}
\ No newline at end of file
package cn.com.glsx.dj.smartcarlife.mapper;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantGoodsInventoryTypeRefDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsInventoryTypeRef;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -27,10 +28,10 @@ public interface MerchantGoodsInventoryTypeRefMapper extends OreMapper<MerchantG
/**
* 按 upgradeGoodsId 和 merchantId 查询已上架商品的库存类型记录(排除指定商户商品ID)
*
* @param upgradeGoodsId 升级商品ID
* @param merchantId 商户ID
* @param upgradeGoodsId 升级商品ID
* @param merchantId 商户ID
* @param excludeMerchantGoodsId 排除的商户商品ID(即当前商品)
* @param excludePackageGoods 是否过滤套餐商品(受配置开关控制)
* @param excludePackageGoods 是否过滤套餐商品(受配置开关控制)
*/
List<MerchantGoodsInventoryTypeRef> findOnShelfByUpgradeGoodsIdAndMerchantId(
@Param("upgradeGoodsId") Integer upgradeGoodsId,
......@@ -41,10 +42,10 @@ public interface MerchantGoodsInventoryTypeRefMapper extends OreMapper<MerchantG
/**
* 按 type 和 merchantId 查询已上架商品的库存类型记录(排除指定商户商品ID)
*
* @param type 升级商品型号/编码
* @param merchantId 商户ID
* @param type 升级商品型号/编码
* @param merchantId 商户ID
* @param excludeMerchantGoodsId 排除的商户商品ID
* @param excludePackageGoods 是否过滤套餐商品
* @param excludePackageGoods 是否过滤套餐商品
*/
List<MerchantGoodsInventoryTypeRef> findOnShelfByTypeAndMerchantId(
@Param("type") String type,
......@@ -69,10 +70,14 @@ public interface MerchantGoodsInventoryTypeRefMapper extends OreMapper<MerchantG
@Param("updatedBy") String updatedBy);
/**
* 按 packageCode 查询所有有效库存管控记录(包含 merchantGoodsId + merchantId + inventoryType)
* 按 packageCode 查询所有有效库存管控记录(包含 merchantGoodsId + merchantId + inventoryType + upgradeGoodsName)
*/
List<MerchantGoodsInventoryTypeRef> findByPackageCode(
@Param("packageCode") String packageCode);
List<MerchantGoodsInventoryTypeRefDTO> findByPackageCode(@Param("packageCode") String packageCode);
/**
* 按 packageCode 列表批量查询库存管控记录(IN 查询,用于分页列表批量回填 inventoryType)
*/
List<MerchantGoodsInventoryTypeRefDTO> findByPackageCodes(@Param("packageCodes") List<String> packageCodes);
/**
* 根据 merchantGoodsCode 查询商品的 upgradeGoodsId(用于套餐子商品 type 维度降级判断)
......@@ -85,8 +90,8 @@ public interface MerchantGoodsInventoryTypeRefMapper extends OreMapper<MerchantG
* 当维度为 type 时,按照升级商品 type 字段匹配;当维度为 upgrade_goods_id 时,按升级商品ID匹配。
* 查询结果排除套餐商品,取第一条。
*
* @param merchantId 商户ID
* @param merchantGoodsCode 商户商品编码(套餐子商品)
* @param merchantId 商户ID
* @param merchantGoodsCode 商户商品编码(套餐子商品)
* @param inventoryTypeDimension 库存维度("type" 或 "upgrade_goods_id")
* @return 第一条匹配的非套餐已上架商品库存管控记录,无则返回 null
*/
......
......@@ -15,7 +15,12 @@ public interface MerchantGoodsRefMapper extends OreMapper<MerchantGoodsRef> {
Integer removeByIds(MerchantGoodsRefDTO updatedRecord);
/**
* 按商品ID列表查询关联的商户(去重),按最新更新时间倒序排列
* 按商品ID列表查询关联商户(去重),按最新更新时间倒序排列
*/
List<MerchantGoodsRef> queryRelatedMerchantsByGoodsIds(@Param("goodsIds") List<Integer> goodsIds);
/**
* 按 packageCode 列表批量查询关联商户
*/
List<MerchantGoodsRef> listByPackageCodes(@Param("packageCodes") List<String> packageCodes);
}
\ No newline at end of file
......@@ -12,4 +12,6 @@ import java.util.List;
public interface MerchantGoodsTypeGroupReconciliationRuleMapper extends OreMapper<MerchantGoodsTypeGroupReconciliationRule> {
List<MerchantGoodsTypeGroupReconciliationRuleDTO> list(MerchantGoodsTypeGroupReconciliationRuleDTO condition);
List<MerchantGoodsTypeGroupReconciliationRuleDTO> listBaseInfo(MerchantGoodsTypeGroupReconciliationRuleDTO condition);
}
......@@ -10,4 +10,6 @@ import java.util.List;
@Mapper
public interface MerchantGoodsTypeGroupSettleRuleMapper extends OreMapper<MerchantGoodsTypeGroupSettleRule> {
List<MerchantGoodsTypeGroupSettleRuleDTO> list(MerchantGoodsTypeGroupSettleRuleDTO dto);
List<MerchantGoodsTypeGroupSettleRuleDTO> listSimpleBase(MerchantGoodsTypeGroupSettleRuleDTO dto);
}
......@@ -12,9 +12,11 @@ public interface MerchantReconciliationRuleMapper extends OreMapper<MerchantReco
List<MerchantReconciliationRule> list(MerchantReconciliationRule record);
MerchantReconciliationRule getLatestByMerchantId(MerchantReconciliationRule record);
void invalidReconciliationRuleDeletedFlag(@Param("id") Integer id, @Param("updatedBy")String updatedBy);
void invalidReconciliationRuleListDeletedFlag(@Param("idList") List<Integer> idList, @Param("updatedBy")String updatedBy);
void validReconciliationRuleDeletedFlag(@Param("id") Integer id, @Param("updatedBy")String updatedBy);
void validReconciliationRuleDeletedFlag(@Param("id") Integer id, @Param("updatedBy")String updatedBy, @Param("submitFlag")String submitFlag);
}
package cn.com.glsx.dj.smartcarlife.mapper;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleAccountRuleDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantSettleAccountRule;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleAccountRuleDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantSettleAccountRule;
@Mapper
public interface MerchantSettleAccountRuleMapper extends OreMapper<MerchantSettleAccountRule> {
......@@ -18,5 +19,8 @@ public interface MerchantSettleAccountRuleMapper extends OreMapper<MerchantSettl
int invalidSettleAccountRuleListDeletedFlag(@Param("idList") List<Integer> idList, @Param("updatedBy") String updatedBy);
int validSettleAccountRuleDeletedFlag(@Param("id") Integer id, @Param("updatedBy") String updatedBy);
int validSettleAccountRuleDeletedFlag(@Param("id") Integer id, @Param("updatedBy") String updatedBy,@Param("submitFlag")String submitFlag);
MerchantSettleAccountRule getLatestByMerchantId(MerchantSettleAccountRule record);
}
\ No newline at end of file
package cn.com.glsx.dj.smartcarlife.mapper;
import cn.com.glsx.dj.smartcarlife.dto.MerchantDiJiaStaffInfoRespDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantStaffDTO;
import cn.com.glsx.dj.smartcarlife.dto.StaffInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.StaffUniquePhoneDTO;
import cn.com.glsx.dj.smartcarlife.dto.study.StaffStudyDetailInfoDTO;
......@@ -50,6 +51,27 @@ public interface StaffInfoMapper extends OreMapper<StaffInfo> {
List<StaffStudyDetailInfoDTO> findByStaffStudy(StaffStudyDetailInfoDTO dto);
/**
* 查询员工的业务场景类型(近30天订单)
* @param staffPhones 员工手机号列表
* @return 员工业务场景类型信息
*/
List<StaffStudyDetailInfoDTO> findStaffBusinessSceneTypes(@Param("staffPhones") List<String> staffPhones);
/**
* 查询员工关联的门店信息
* @param staffPhones 员工手机号列表
* @return 员工门店信息
*/
List<StaffStudyDetailInfoDTO> findStaffMerchantInfo(@Param("staffPhones") List<String> staffPhones);
/**
* 查询门店的区域运营(上级)信息
* @param merchantIds 门店ID列表
* @return 门店上级信息
*/
List<StaffStudyDetailInfoDTO> findMerchantSuperiors(@Param("merchantIds") List<Integer> merchantIds);
StaffInfo getLatestOrderStaff(@Param("staffPhone") String staffPhone,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime,
......@@ -57,4 +79,6 @@ public interface StaffInfoMapper extends OreMapper<StaffInfo> {
@Param("sceneType") Integer sceneType);
List<MerchantDiJiaStaffInfoRespDTO> getStaffPhoneByYqMerchantIds(@Param("yqMerchantIds") List<String> yqMerchantIds);
List<MerchantStaffDTO> listStaffByMainMerchantIdAndScene(@Param("mainMerchantId") Integer mainMerchantId, @Param("sceneType") Integer sceneType);
}
\ No newline at end of file
package cn.com.glsx.dj.smartcarlife.remote;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.CreateBusinessApproveMerchantDTO;
import cn.com.glsx.dj.smartcarlife.service.CreateBusinessApproveMerchantService;
import cn.com.glsx.dj.smartcarlife.util.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@DubboService(validation = "true", version = "1.0.0")
public class CreateBusinessApproveMerchantRemoteImpl implements CreateBusinessApproveMerchantRemote {
@Autowired
private CreateBusinessApproveMerchantService createBusinessApproveMerchantService;
@Override
public RpcResponse<CreateBusinessApproveMerchantDTO> get(@NotBlank String businessCode,
@NotNull Integer merchantId) {
try {
return RpcResponse.success(CommonUtil.getFirst(createBusinessApproveMerchantService.list(CreateBusinessApproveMerchantDTO.builder()
.businessCode(businessCode).merchantId(merchantId).build())));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<CreateBusinessApproveMerchantDTO> saveCreateBusinessApproveMerchant(
@NotNull CreateBusinessApproveMerchantDTO dto) {
try {
return RpcResponse.success(createBusinessApproveMerchantService.updateMerchantPublicAttribute(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<CreateBusinessApproveMerchantDTO>> listWithPage(
@NotNull RpcPagination<CreateBusinessApproveMerchantDTO> rpcPagination) {
try {
return RpcResponse.success(RpcPagination.copyPage(createBusinessApproveMerchantService.listWithPage(rpcPagination)));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<CreateBusinessApproveMerchantDTO> getSaveRuleMerchant(@NotBlank String businessCode) {
try {
return RpcResponse.success(createBusinessApproveMerchantService.getSaveRuleMerchant(businessCode));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
......@@ -7,6 +7,7 @@ import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessApproveOpera
import cn.com.glsx.dj.smartcarlife.enums.RpcErrorEnum;
import cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove.AsyncEventTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove.AsyncProcessStatusEnum;
import cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove.ConfirmStepEnum;
import cn.com.glsx.dj.smartcarlife.enums.createBusinessApprove.SystemStatusEnum;
import cn.com.glsx.dj.smartcarlife.model.CreateBusinessAsync;
import cn.com.glsx.dj.smartcarlife.queue.CreateBusinessAsyncMsg;
......@@ -27,6 +28,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Objects;
import javax.validation.constraints.NotNull;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class CreateBusinessApproveOperatorConfirmRemoteImpl implements CreateBusinessApproveOperatorConfirmRemote{
......@@ -60,6 +63,7 @@ public class CreateBusinessApproveOperatorConfirmRemoteImpl implements CreateBus
if (record == null) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "不存在的审批单信息, businessCode:"+dto.getBusinessCode());
}
RpcAssert.assertIsTrue(Objects.equals(record.getConfirmStep(), ConfirmStepEnum.ESTIMATED.getValue()), RpcErrorEnum.DATA_INVALID_WITH_SPECIFIC_MSG, "操作步骤未完成,不支持提交");
if (!Objects.equals(dto.getSaveDraft(), Boolean.TRUE)
&& !Objects.equals(record.getSystemStatus(), SystemStatusEnum.OPERATOR_CONFIRMING.getValue())) {
throw new RpcServiceException(RpcErrorEnum.DATA_INVALID_WITH_SPECIFIC_MSG, "审批单状态已更新,目前状态不支持运营确认");
......@@ -79,4 +83,14 @@ public class CreateBusinessApproveOperatorConfirmRemoteImpl implements CreateBus
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> updateConfirmStep(@NotNull CreateBusinessApproveOperationConfirmDTO dto) {
try{
return RpcResponse.success(createBusinessApproveService.updateConfirmStep(dto));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupReconciliationRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantReconciliationRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessApproveOperationConfirmDTO;
import cn.com.glsx.dj.smartcarlife.service.createBusiness.CreateBusinessApproveReconciliationRuleService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@DubboService(validation = "true", version = "1.0.0")
public class CreateBusinessApproveReconciliationRuleRemoteImpl
implements CreateBusinessApproveReconciliationRuleRemote {
@Autowired
private CreateBusinessApproveReconciliationRuleService createBusinessApproveReconciliationRuleService;
@Override
public RpcResponse<List<MerchantGoodsTypeGroupReconciliationRuleDTO>> listGoodsTypeGroup(@NotBlank String businessCode) {
try {
return RpcResponse.success(createBusinessApproveReconciliationRuleService.listGoodsTypeGroup(businessCode));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantReconciliationRuleDTO> getGoodsTypeGroupRuleDetail(@NotBlank String businessCode,
@NotNull Integer goodsTypeGroupRuleId) {
try {
return RpcResponse.success(createBusinessApproveReconciliationRuleService.getGoodsTypeGroupRuleDetail(businessCode,goodsTypeGroupRuleId));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantReconciliationRuleDTO> saveCreateBusinessRule(
@NotNull CreateBusinessApproveOperationConfirmDTO dto) {
try {
return RpcResponse.success(createBusinessApproveReconciliationRuleService.saveCreateBusinessRule(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<GoodsTypeGroupRelationDTO>> listOtherGoodsTypeItem(@NotBlank String businessCode,
Integer goodsTypeGroupRuleId, Byte categoryType) {
try {
return RpcResponse.success(createBusinessApproveReconciliationRuleService.listOtherGoodsTypeItem(businessCode,
goodsTypeGroupRuleId,categoryType));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
......@@ -66,16 +66,6 @@ public class CreateBusinessApproveRemoteImpl implements CreateBusinessApproveRem
}
@Override
public RpcResponse<CreateBusinessApproveDetailDTO> businessApproveDetail(Integer id) {
try {
return RpcResponse.success(createBusinessApproveService.businessApproveDetail(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<CreateBusinessApproveDetailDTO> businessApproveDetailGoods(Integer id) {
try {
return RpcResponse.success(createBusinessApproveService.businessApproveDetailGoods(id));
......@@ -158,4 +148,14 @@ public class CreateBusinessApproveRemoteImpl implements CreateBusinessApproveRem
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<CreateBusinessApproveDetailDTO> businessApproveBase(Integer id) {
try {
return RpcResponse.success(createBusinessApproveService.businessApproveBase(id));
} catch (RpcServiceException e) {
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.CreateBusinessApproveDetailDTO;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantDivisionRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupSettleRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleDistributeRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessApproveOperationConfirmDTO;
import cn.com.glsx.dj.smartcarlife.service.createBusiness.CreateBusinessApproveSettleRuleService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@DubboService(validation = "true", version = "1.0.0")
public class CreateBusinessApproveSettleRuleRemoteImpl implements CreateBusinessApproveSettleRuleRemote {
@Autowired
private CreateBusinessApproveSettleRuleService createBusinessApproveSettleRuleService;
@Override
public RpcResponse<List<MerchantGoodsTypeGroupSettleRuleDTO>> listGoodsTypeGroup(@NotBlank String businessCode) {
try {
return RpcResponse.success(createBusinessApproveSettleRuleService.listGoodsTypeGroup(businessCode));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantSettleDistributeRuleDTO> getGoodsTypeGroupRuleDetail(@NotBlank String businessCode,
@NotNull Integer goodsTypeGroupRuleId) {
try {
return RpcResponse.success(createBusinessApproveSettleRuleService.getGoodsTypeGroupRuleDetail(businessCode,goodsTypeGroupRuleId));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantSettleDistributeRuleDTO> saveCreateBusinessSettleRule(
@NotNull CreateBusinessApproveOperationConfirmDTO dto) {
try {
return RpcResponse.success(createBusinessApproveSettleRuleService.saveCreateBusinessSettleRule(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<GoodsTypeGroupRelationDTO>> listOtherGoodsTypeItem(@NotBlank String businessCode,
Integer goodsTypeGroupRuleId,Byte categoryType) {
try {
return RpcResponse.success(createBusinessApproveSettleRuleService.listOtherGoodsTypeItem(businessCode,goodsTypeGroupRuleId,categoryType));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantDivisionRuleDTO> saveDivisionRuleAuto(@NotBlank String businessCode,@NotNull MerchantDivisionRuleDTO record) {
try {
return RpcResponse.success(createBusinessApproveSettleRuleService.saveDivisionRuleAuto(businessCode,record));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.createBusiness.CreateBusinessProductDTO;
import cn.com.glsx.dj.smartcarlife.service.createBusiness.CreateBusinessProductService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@DubboService(validation = "true", version = "1.0.0")
public class CreateBusinessProductRemoteImpl implements CreateBusinessProductRemote {
@Autowired
private CreateBusinessProductService createBusinessProductService;
@Override
public RpcResponse<CreateBusinessProductDTO> getDetailById(@NotBlank Integer id) {
try {
return RpcResponse.success(createBusinessProductService.getDetailById(id));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<CreateBusinessProductDTO> saveCreateBusinessProduct(@NotNull CreateBusinessProductDTO dto) {
try {
return RpcResponse.success(createBusinessProductService.saveCreateBusinessProduct(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> deleteCreateBusinessProduct(@NotNull CreateBusinessProductDTO dto) {
try {
return RpcResponse.success(createBusinessProductService.deleteCreateBusinessProduct(dto));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<CreateBusinessProductDTO>> listBaseWithPage(
@NotNull RpcPagination<CreateBusinessProductDTO> rpcPagination) {
try {
return RpcResponse.success(RpcPagination.copyPage(createBusinessProductService.listBaseWithPage(rpcPagination)));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.DivisionRuleAutoDTO;
import cn.com.glsx.dj.smartcarlife.service.merchantSettleDistribution.DivisionRuleAutoService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
@DubboService(version = "1.0.0",validation = "true")
@Slf4j
public class DivisionRuleAutoRemoteImpl implements DivisionRuleAutoRemote {
@Autowired
private DivisionRuleAutoService divisionRuleAutoService;
@Override
public RpcResponse<List<DivisionRuleAutoDTO>> listDivisionRuleAutoByDivisionRuleId(
@NotNull Integer divisionRuleId) {
try{
return RpcResponse.success(divisionRuleAutoService.listDivisionRuleAutoByDivisionRuleId(divisionRuleId));
}catch(RpcServiceException e){
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.MerchantDivisionRuleDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantDivisionRule;
import cn.com.glsx.dj.smartcarlife.service.merchantSettleDistribution.MerchantDivisionRuleService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -35,4 +39,14 @@ public class MerchantDivisionRuleRemoteImpl implements MerchantDivisionRuleRemot
}
}
@Override
public RpcResponse<MerchantDivisionRule> getBaseById(@NotNull Integer divisionRuleId) {
try{
return RpcResponse.success(merchantDivisionRuleService.getBaseById(divisionRuleId));
}catch(RpcServiceException e){
logger.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
......@@ -9,7 +9,10 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantGoodsInventoryTypeRefDTO;
import cn.com.glsx.dj.smartcarlife.dto.goods.MerchantPackageGoodsInfoDTO;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsRef;
import cn.com.glsx.dj.smartcarlife.service.goods.MerchantGoodsInventoryTypeRefService;
import cn.com.glsx.dj.smartcarlife.service.goods.MerchantPackageGoodsInfoService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
......@@ -23,6 +26,8 @@ import lombok.extern.slf4j.Slf4j;
public class MerchantPackageGoodsInfoRemoteImpl implements MerchantPackageGoodsInfoRemote {
@Autowired
private MerchantPackageGoodsInfoService merchantPackageGoodsInfoService;
@Autowired
private MerchantGoodsInventoryTypeRefService merchantGoodsInventoryTypeRefService;
@Override
public RpcResponse<MerchantPackageGoodsInfoDTO> insertOrUpdate(@NotNull MerchantPackageGoodsInfoDTO record) {
......@@ -138,4 +143,44 @@ public class MerchantPackageGoodsInfoRemoteImpl implements MerchantPackageGoodsI
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<MerchantPackageGoodsInfoDTO>> getGoodsByPackageIdList(@NotNull List<Integer> idList) {
try {
return RpcResponse.success(merchantPackageGoodsInfoService.getGoodsByPackageIdList(idList));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<MerchantGoodsRef>> queryRelatedMerchantByPackageIdList(@NotNull List<Integer> idList) {
try {
return RpcResponse.success(merchantPackageGoodsInfoService.queryRelatedMerchantByPackageIdList(idList));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> batchEditInventoryTypeByPackageId(@NotNull List<MerchantPackageGoodsInfoDTO> packageList) {
try {
return RpcResponse.success(merchantPackageGoodsInfoService.batchEditInventoryTypeByPackageId(packageList));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<MerchantGoodsInventoryTypeRefDTO>> listInventoryTypeRefByPackageCodes(@NotNull List<String> packageCodes) {
try {
return RpcResponse.success(merchantGoodsInventoryTypeRefService.listByPackageCodes(packageCodes));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupReconciliationRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantReconciliationRuleDTO;
import cn.com.glsx.dj.smartcarlife.service.MerchantReconciliationRuleStepService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@DubboService(version = "1.0.0")
public class MerchantReconciliationRuleStepRemoteImpl implements MerchantReconciliationRuleStepRemote {
@Autowired
private MerchantReconciliationRuleStepService merchantReconciliationRuleStepService;
@Override
public RpcResponse<MerchantReconciliationRuleDTO> getReconciliationRule(Integer merchantId, Byte sceneType) {
try {
return RpcResponse.success(merchantReconciliationRuleStepService.getReconciliationRule(merchantId, sceneType));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantReconciliationRuleDTO> saveSingleReconciliationGoodsTypeRule(
MerchantReconciliationRuleDTO merchantReconciliationRuleDTO) {
try {
return RpcResponse.success(merchantReconciliationRuleStepService.saveSingleReconciliationGoodsTypeRule(merchantReconciliationRuleDTO));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantReconciliationRuleDTO> submitRule(
MerchantReconciliationRuleDTO merchantReconciliationRuleDTO) {
try {
return RpcResponse.success(merchantReconciliationRuleStepService.submitRule(merchantReconciliationRuleDTO));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> deleteSingleReconciliationGoodsTypeRule(@NotNull Integer goodsTypeGroupRuleId,
@NotBlank String updatedBy) {
try {
return RpcResponse.success(merchantReconciliationRuleStepService.deleteSingleReconciliationGoodsTypeRule(goodsTypeGroupRuleId,updatedBy));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantReconciliationRuleDTO> getSingleReconciliationGoodsTypeRule(
@NotNull Integer goodsTypeGroupRuleId) {
try {
return RpcResponse.success(merchantReconciliationRuleStepService.getSingleReconciliationGoodsTypeRule(goodsTypeGroupRuleId));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<GoodsTypeGroupRelationDTO>> listOtherGoodsTypeItem(@NotNull Integer reconciliationRuleId,
Integer goodsTypeGroupRuleId, Byte categoryType) {
try {
return RpcResponse.success(merchantReconciliationRuleStepService.listOtherGoodsTypeItem(reconciliationRuleId,goodsTypeGroupRuleId,categoryType));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<MerchantGoodsTypeGroupReconciliationRuleDTO>> listGoodsTypeGroup(@NotNull Integer reconciliationRuleId) {
try {
return RpcResponse.success(merchantReconciliationRuleStepService.listGoodsTypeGroup(reconciliationRuleId));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupSettleRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleDistributeRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleDistributeRuleTestRuleDTO;
import cn.com.glsx.dj.smartcarlife.service.MerchantSettleDistributeRuleStepService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class MerchantSettleDistributeRuleStepRemoteImpl implements MerchantSettleDistributeRuleStepRemote{
@Autowired
private MerchantSettleDistributeRuleStepService merchantSettleDistributeRuleStepService;
@Override
public RpcResponse<Boolean> saveSingleGoodsTypeRule(MerchantSettleDistributeRuleDTO record) {
try{
merchantSettleDistributeRuleStepService.saveSingleGoodsTypeRule(record);
return RpcResponse.success(true);
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantSettleDistributeRuleDTO> getLastRule(Integer merchantId, Byte sceneType, Byte expenseCategroyRulesBuildType) {
try{
return RpcResponse.success(merchantSettleDistributeRuleStepService.getLastRule(merchantId, sceneType, expenseCategroyRulesBuildType));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> deleteSingleGoodsTypeRule(
@NotNull MerchantSettleDistributeRuleDTO record) {
try{
merchantSettleDistributeRuleStepService.deleteSingleGoodsTypeRule(record);
return RpcResponse.success(true);
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<MerchantSettleDistributeRuleDTO> getSignleGoodsTypeRule(@NotNull Integer settleRuleId,
@NotNull Integer divisionRuleId, @NotNull Integer goodsTypeGroupRuleId) {
try{
return RpcResponse.success(merchantSettleDistributeRuleStepService.getSignleGoodsTypeRule(settleRuleId,divisionRuleId,goodsTypeGroupRuleId));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> submitRule(@NotNull MerchantSettleDistributeRuleDTO merchantSettleDistributeRuleDTO) {
try{
merchantSettleDistributeRuleStepService.submitRule(merchantSettleDistributeRuleDTO);
return RpcResponse.success(true);
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<MerchantGoodsTypeGroupSettleRuleDTO>> listGoodsTypeGroup(@NotNull Integer settleRuleId) {
try{
return RpcResponse.success(merchantSettleDistributeRuleStepService.listGoodsTypeGroup(settleRuleId));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<GoodsTypeGroupRelationDTO>> listOtherGoodsTypeItem(@NotNull Integer settleRuleId,
Integer goodsTypeGroupRuleId, Byte categoryType) {
try{
return RpcResponse.success(merchantSettleDistributeRuleStepService.listOtherGoodsTypeItem(settleRuleId,goodsTypeGroupRuleId,categoryType));
}catch(RpcServiceException e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote;
import cn.com.glsx.dj.smartcarlife.dto.MerchantStaffDTO;
import cn.com.glsx.dj.smartcarlife.dto.StaffInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.StaffUniquePhoneDTO;
import cn.com.glsx.dj.smartcarlife.dto.staff.StaffWechatBindingDTO;
......@@ -176,4 +177,14 @@ public class StaffInfoRemoteImpl implements StaffInfoRemote {
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<MerchantStaffDTO>> listStaffByMainMerchantIdAndScene(@NotNull Integer mainMerchantId, @NotNull Integer sceneType) {
try {
return RpcResponse.success(staffInfoService.listStaffByMainMerchantIdAndScene(mainMerchantId, sceneType));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.smartcarlife.remote.carcondition;
import cn.com.glsx.dj.smartcarlife.dto.carcondition.CarConditionRespDTO;
import cn.com.glsx.dj.smartcarlife.remote.CarConditionAIReportRemote;
import cn.com.glsx.dj.smartcarlife.service.carcondition.CarConditionAIService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@DubboService
public class CarConditionAIReportRemoteImpl implements CarConditionAIReportRemote {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private CarConditionAIService carConditionAIService;
@Override
public RpcResponse<CarConditionRespDTO> generateAiTaskId(String aiRequestJson) {
try{
return RpcResponse.success(carConditionAIService.generateAiTaskId(aiRequestJson));
}catch(RpcServiceException e){
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<CarConditionRespDTO> queryAiJsonResultByTaskId(String aiTaskId) {
try{
return RpcResponse.success(carConditionAIService.queryAiJsonResultByTaskId(aiTaskId));
}catch(RpcServiceException e){
logger.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
......@@ -2,13 +2,19 @@ package cn.com.glsx.dj.smartcarlife.service;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.enums.GoodsGroupCategoryTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.RuleTypeEnum;
import cn.com.glsx.dj.smartcarlife.mapper.GoodsTypeGroupRelationMapper;
import cn.com.glsx.dj.smartcarlife.model.GoodsTypeGroupRelation;
import cn.com.glsx.dj.smartcarlife.model.MerchantExpenseCategoryRule;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import lombok.extern.slf4j.Slf4j;
import tk.mybatis.mapper.entity.Example;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
......@@ -68,6 +74,7 @@ public class GoodsTypeGroupRelationService {
record.setCreatedDate(now);
record.setUpdatedDate(now);
record.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
record.setId(null);
try{
goodsTypeGroupRelationMapper.insertUseGeneratedKeys(record);
} catch (Exception e) {
......@@ -96,4 +103,49 @@ public class GoodsTypeGroupRelationService {
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void deleteByGoodsTypeGroupRuleId(Integer goodsTypeGroupRuleId,RuleTypeEnum ruleType,String updatedBy){
RpcAssert.assertNotNull(goodsTypeGroupRuleId, DefaultErrorEnum.DATA_NULL, "goodsTypeGroupRuleId is null");
RpcAssert.assertNotNull(ruleType, DefaultErrorEnum.DATA_NULL, "ruleType is null");
RpcAssert.assertNotEmpty(updatedBy, DefaultErrorEnum.DATA_NULL, "updatedBy is null");
try{
GoodsTypeGroupRelation d = new GoodsTypeGroupRelation();
d.setDeletedFlag(BaseModel.DeletedFlagEnum.D.name());
d.setUpdatedBy(updatedBy);
d.setUpdatedDate(new Date());
Example example = new Example(GoodsTypeGroupRelation.class);
example.createCriteria()
.andEqualTo("goodsTypeGroupRuleId", goodsTypeGroupRuleId)
.andEqualTo("ruleType", ruleType.getValue())
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
goodsTypeGroupRelationMapper.updateByExampleSelective(d, example);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void copyData(RuleTypeEnum ruleType,Integer oldGoodsTypeGroupRuleId,Integer newGoodsTypeGroupRuleId) {
RpcAssert.assertNotNull(ruleType, DefaultErrorEnum.DATA_NULL, "ruleType must not be null");
RpcAssert.assertNotNull(oldGoodsTypeGroupRuleId, DefaultErrorEnum.DATA_NULL, "oldGoodsTypeGroupRuleId must not be null");
RpcAssert.assertNotNull(newGoodsTypeGroupRuleId, DefaultErrorEnum.DATA_NULL, "newGoodsTypeGroupRuleId must not be null");
try {
List<GoodsTypeGroupRelation> list = goodsTypeGroupRelationMapper
.select(GoodsTypeGroupRelation.builder()
.ruleType(ruleType.getValue()).deletedFlag(DeletedFlagEnum.N.name())
.goodsTypeGroupRuleId(oldGoodsTypeGroupRuleId).build());
if(CollectionUtils.isNotEmpty(list)) {
list.stream().forEach(item -> {
item.setId(null);
item.setGoodsTypeGroupRuleId(newGoodsTypeGroupRuleId);
});
goodsTypeGroupRelationMapper.insertList(list);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.smartcarlife.service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.smartcarlife.converter.GoodsTypeGroupRelationDTOConvert;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupDTO;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.enums.GoodsSourceEnum;
import cn.com.glsx.dj.smartcarlife.enums.GoodsTypeGroupUseTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.RuleTypeEnum;
import cn.com.glsx.dj.smartcarlife.mapper.GoodsTypeGroupMapper;
import cn.com.glsx.dj.smartcarlife.model.GoodsTypeGroup;
import cn.com.glsx.dj.smartcarlife.model.GoodsTypeGroupRelation;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import tk.mybatis.mapper.entity.Example;
@Slf4j
@Service
......@@ -36,6 +41,22 @@ public class GoodsTypeGroupService {
@Autowired
private GoodsTypeGroupRelationService goodsTypeGroupRelationService;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public GoodsTypeGroup copyData(Integer oldId) {
RpcAssert.assertNotNull(oldId, DefaultErrorEnum.DATA_NULL, "oldId must not be null");
try {
GoodsTypeGroup goodsTypeGroupDTO = goodsTypeGroupMapper.selectByPrimaryKey(oldId);
goodsTypeGroupDTO.setId(null);
goodsTypeGroupDTO.setDeletedFlag(DeletedFlagEnum.N.name());
goodsTypeGroupMapper.insertSelective(goodsTypeGroupDTO);
goodsTypeGroupRelationService.copyData(RuleTypeEnum.SETTLE_ACCOUNT_RULE, oldId, goodsTypeGroupDTO.getId());
return goodsTypeGroupDTO;
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void saveRecord(GoodsTypeGroupDTO record){
try{
......@@ -66,6 +87,7 @@ public class GoodsTypeGroupService {
record.setCreatedDate(now);
record.setUpdatedDate(now);
record.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
record.setId(null);
try{
goodsTypeGroupMapper.insertUseGeneratedKeys(record);
} catch (Exception e) {
......@@ -86,4 +108,27 @@ public class GoodsTypeGroupService {
}
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void deleteById(Integer id,GoodsTypeGroupUseTypeEnum useType,String updatedBy){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id is null");
RpcAssert.assertNotNull(useType, DefaultErrorEnum.DATA_NULL, "useType is null");
RpcAssert.assertNotEmpty(updatedBy, DefaultErrorEnum.DATA_NULL, "updatedBy is null");
try{
GoodsTypeGroup d = new GoodsTypeGroup();
d.setDeletedFlag(BaseModel.DeletedFlagEnum.D.name());
d.setUpdatedBy(updatedBy);
d.setUpdatedDate(new Date());
Example example = new Example(GoodsTypeGroup.class);
example.createCriteria()
.andEqualTo("id", id)
.andEqualTo("useType", useType.getValue())
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
goodsTypeGroupMapper.updateByExampleSelective(d, example);
goodsTypeGroupRelationService.deleteByGoodsTypeGroupRuleId(id, RuleTypeEnum.SETTLE_ACCOUNT_RULE, updatedBy);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
}
......@@ -9,12 +9,16 @@ import cn.com.glsx.dj.smartcarlife.enums.*;
import cn.com.glsx.dj.smartcarlife.mapper.MerchantExpenseCategoryRuleMapper;
import cn.com.glsx.dj.smartcarlife.model.GoodsTypeGroupRelation;
import cn.com.glsx.dj.smartcarlife.model.MerchantExpenseCategoryRule;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsTypeGroupReconciliationRule;
import cn.com.glsx.dj.smartcarlife.model.ServiceMerchant;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import lombok.extern.slf4j.Slf4j;
import tk.mybatis.mapper.entity.Example;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -214,6 +218,7 @@ public class MerchantExpenseCategoryRuleService {
record.setCreatedDate(now);
record.setUpdatedDate(now);
record.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
record.setId(null);
try{
merchantExpenseCategoryRuleMapper.insertSelective(record);
} catch (Exception e) {
......@@ -1271,6 +1276,51 @@ public class MerchantExpenseCategoryRuleService {
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void deleteByGoodsTypeGroupRuleId(Integer goodsTypeGroupRuleId,RuleTypeEnum ruleType,String updatedBy){
RpcAssert.assertNotNull(goodsTypeGroupRuleId, DefaultErrorEnum.DATA_NULL, "goodsTypeGroupRuleId is null");
RpcAssert.assertNotNull(ruleType, DefaultErrorEnum.DATA_NULL, "ruleType is null");
RpcAssert.assertNotEmpty(updatedBy, DefaultErrorEnum.DATA_NULL, "updatedBy is null");
try{
MerchantExpenseCategoryRule d = new MerchantExpenseCategoryRule();
d.setDeletedFlag(BaseModel.DeletedFlagEnum.D.name());
d.setUpdatedBy(updatedBy);
d.setUpdatedDate(new Date());
Example example = new Example(MerchantExpenseCategoryRule.class);
example.createCriteria()
.andEqualTo("goodsTypeGroupRuleId", goodsTypeGroupRuleId)
.andEqualTo("ruleType", ruleType.getValue())
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
merchantExpenseCategoryRuleMapper.updateByExampleSelective(d, example);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void copyData(RuleTypeEnum ruleType,Integer oldGoodsTypeGroupRuleId,Integer newGoodsTypeGroupRuleId) {
RpcAssert.assertNotNull(ruleType, DefaultErrorEnum.DATA_NULL, "ruleType must not be null");
RpcAssert.assertNotNull(oldGoodsTypeGroupRuleId, DefaultErrorEnum.DATA_NULL, "oldGoodsTypeGroupRuleId must not be null");
RpcAssert.assertNotNull(newGoodsTypeGroupRuleId, DefaultErrorEnum.DATA_NULL, "newGoodsTypeGroupRuleId must not be null");
try {
List<MerchantExpenseCategoryRule> list = merchantExpenseCategoryRuleMapper
.select(MerchantExpenseCategoryRule.builder()
.ruleType(ruleType.getValue()).deletedFlag(DeletedFlagEnum.N.name())
.goodsTypeGroupRuleId(oldGoodsTypeGroupRuleId).build());
if(CollectionUtils.isNotEmpty(list)) {
list.stream().forEach(item -> {
item.setId(null);
item.setGoodsTypeGroupRuleId(newGoodsTypeGroupRuleId);
});
merchantExpenseCategoryRuleMapper.insertList(list);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
/**
* 遍历匹配的费用类目,分离拓展类目最后子节点的费用类目规则
*
......
package cn.com.glsx.dj.smartcarlife.service;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.smartcarlife.converter.GoodsTypeGroupRelationDTOConvert;
import cn.com.glsx.dj.smartcarlife.dto.GoodsTypeGroupRelationDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantExpenseCategoryRuleDTO;
......@@ -10,28 +26,18 @@ import cn.com.glsx.dj.smartcarlife.enums.GoodsTypeGroupTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.RpcErrorEnum;
import cn.com.glsx.dj.smartcarlife.enums.RuleTypeEnum;
import cn.com.glsx.dj.smartcarlife.mapper.MerchantGoodsTypeGroupReconciliationRuleMapper;
import cn.com.glsx.dj.smartcarlife.model.BaseGoodsMerchantRef;
import cn.com.glsx.dj.smartcarlife.model.GoodsTypeGroupRelation;
import cn.com.glsx.dj.smartcarlife.model.MerchantExpenseCategoryRule;
import cn.com.glsx.dj.smartcarlife.model.MerchantGoodsTypeGroupReconciliationRule;
import cn.com.glsx.dj.smartcarlife.model.MerchantReconciliationRule;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.hutool.core.collection.CollectionUtil;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import tk.mybatis.mapper.entity.Example;
@Service
......@@ -95,12 +101,16 @@ public class MerchantGoodsTypeGroupReconciliationRuleService {
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void saveRule(MerchantGoodsTypeGroupReconciliationRuleDTO record) {
Date now = new Date();
Date now = new Date();
record.setCreatedBy(record.getUpdatedBy());
record.setCreatedDate(now);
record.setUpdatedDate(now);
record.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
merchantGoodsTypeGroupReconciliationRuleMapper.insertUseGeneratedKeys(record);
if(record.getId() != null) {
merchantGoodsTypeGroupReconciliationRuleMapper.updateByPrimaryKeySelective(record);
}else {
merchantGoodsTypeGroupReconciliationRuleMapper.insertUseGeneratedKeys(record);
}
}
/**
......@@ -108,10 +118,11 @@ public class MerchantGoodsTypeGroupReconciliationRuleService {
* @param reconciliationRuleId
* @return
*/
public List<MerchantGoodsTypeGroupReconciliationRuleDTO> getByReconciliationRuleId(Integer reconciliationRuleId){
public List<MerchantGoodsTypeGroupReconciliationRuleDTO> getByReconciliationRuleId(Integer reconciliationRuleId,Integer goodsTypeGroupRuleId){
RpcAssert.assertNotNull(reconciliationRuleId, DefaultErrorEnum.DATA_NULL,"reconciliationRuleId not be null");
MerchantGoodsTypeGroupReconciliationRuleDTO goodsTypeGroupReconciliationRuleDTO = new MerchantGoodsTypeGroupReconciliationRuleDTO();
goodsTypeGroupReconciliationRuleDTO.setReconciliationRuleId(reconciliationRuleId);
goodsTypeGroupReconciliationRuleDTO.setId(goodsTypeGroupRuleId);
List<MerchantGoodsTypeGroupReconciliationRuleDTO> list = list(goodsTypeGroupReconciliationRuleDTO);
if (CollectionUtils.isNotEmpty(list)) {
for (MerchantGoodsTypeGroupReconciliationRuleDTO groupReconciliationRuleDTO : list) {
......@@ -131,4 +142,74 @@ public class MerchantGoodsTypeGroupReconciliationRuleService {
public List<MerchantGoodsTypeGroupReconciliationRuleDTO> list(MerchantGoodsTypeGroupReconciliationRuleDTO dto){
return merchantGoodsTypeGroupReconciliationRuleMapper.list(dto);
}
public List<MerchantGoodsTypeGroupReconciliationRuleDTO> listBaseInfo(Integer reconciliationRuleId){
RpcAssert.assertNotNull(reconciliationRuleId, DefaultErrorEnum.DATA_NULL, "reconciliationRuleId is null");
MerchantGoodsTypeGroupReconciliationRuleDTO goodsTypeGroupReconciliationRuleDTO = new MerchantGoodsTypeGroupReconciliationRuleDTO();
goodsTypeGroupReconciliationRuleDTO.setReconciliationRuleId(reconciliationRuleId);
return merchantGoodsTypeGroupReconciliationRuleMapper.listBaseInfo(goodsTypeGroupReconciliationRuleDTO);
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void deleteById(Integer id,RuleTypeEnum ruleType,String updatedBy,boolean deleteRelation){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id is null");
RpcAssert.assertNotNull(ruleType, DefaultErrorEnum.DATA_NULL, "ruleType is null");
RpcAssert.assertNotEmpty(updatedBy, DefaultErrorEnum.DATA_NULL, "updatedBy is null");
try{
if(!deleteRelation) {
MerchantGoodsTypeGroupReconciliationRule d = new MerchantGoodsTypeGroupReconciliationRule();
d.setDeletedFlag(BaseModel.DeletedFlagEnum.D.name());
d.setUpdatedBy(updatedBy);
d.setUpdatedDate(new Date());
Example example = new Example(MerchantGoodsTypeGroupReconciliationRule.class);
example.createCriteria()
.andEqualTo("id", id)
.andEqualTo("ruleType", ruleType.getValue())
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
merchantGoodsTypeGroupReconciliationRuleMapper.updateByExampleSelective(d, example);
}
merchantExpenseCategoryRuleService.deleteByGoodsTypeGroupRuleId(id,ruleType,updatedBy);
goodsTypeGroupRelationService.deleteByGoodsTypeGroupRuleId(id, ruleType, updatedBy);
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public MerchantGoodsTypeGroupReconciliationRule getBaseById(Integer id){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "id is null");
try{
return merchantGoodsTypeGroupReconciliationRuleMapper.selectByPrimaryKey(id);
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void copyData(RuleTypeEnum ruleType,Integer oldReconciliationRuleId,Integer newReconciliationRuleId) {
RpcAssert.assertNotNull(ruleType, DefaultErrorEnum.DATA_NULL, "ruleType must not be null");
RpcAssert.assertNotNull(oldReconciliationRuleId, DefaultErrorEnum.DATA_NULL, "oldReconciliationRuleId must not be null");
RpcAssert.assertNotNull(newReconciliationRuleId, DefaultErrorEnum.DATA_NULL, "newReconciliationRuleId must not be null");
try {
List<MerchantGoodsTypeGroupReconciliationRule> list = merchantGoodsTypeGroupReconciliationRuleMapper
.select(MerchantGoodsTypeGroupReconciliationRule.builder()
.ruleType(ruleType.getValue()).deletedFlag(DeletedFlagEnum.N.name())
.reconciliationRuleId(oldReconciliationRuleId).build());
if(CollectionUtils.isNotEmpty(list)) {
list.stream().forEach(item ->{
Integer oldGoodsTypeGroupRuleId = item.getId();
item.setId(null);
item.setReconciliationRuleId(newReconciliationRuleId);
merchantGoodsTypeGroupReconciliationRuleMapper.insertUseGeneratedKeys(item);
merchantExpenseCategoryRuleService.copyData(ruleType, oldGoodsTypeGroupRuleId, item.getId());
goodsTypeGroupRelationService.copyData(ruleType, oldGoodsTypeGroupRuleId, item.getId());
});
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
......@@ -97,6 +97,7 @@ public class MerchantReconciliationRuleService {
//参数校验
paramValidation(record);
//插入对账规则
record.setSubmitFlag(!Objects.equals(RuleSourceTypeEnum.DJ_ON_SHELVE.getValue(), record.getSource()) ? StatusEnum.YES.getValue():StatusEnum.NO.getValue());
thiz.insertMerchantReconciliationRule(record);
//插入对账规则分组记录及商品品类、费用类目信息
thiz.insertMerchantGoodsTypeGroupSettleRule(record);
......@@ -148,7 +149,7 @@ public class MerchantReconciliationRuleService {
MerchantReconciliationRuleDTO reconciliationRuleDTO = MerchantReconciliationRuleConverter.INSTANCE
.fromMerchantReconciliationRule(list.get(0));
if (needCompile) {
return compileDetail(reconciliationRuleDTO);
return compileDetail(reconciliationRuleDTO,null);
}
return reconciliationRuleDTO;
} catch (Exception e) {
......@@ -176,7 +177,7 @@ public class MerchantReconciliationRuleService {
MerchantReconciliationRuleDTO reconciliationRuleDTO = MerchantReconciliationRuleConverter.INSTANCE
.fromMerchantReconciliationRule(list.get(0));
if (needCompile) {
return compileDetail(reconciliationRuleDTO);
return compileDetail(reconciliationRuleDTO,null);
}
return reconciliationRuleDTO;
} catch (Exception e) {
......@@ -192,7 +193,7 @@ public class MerchantReconciliationRuleService {
* @param sceneType
* @return
*/
public MerchantReconciliationRuleDTO getByIdDeletedFlag(Integer id, Byte sceneType, String deletedFlag, boolean needCompile) {
public MerchantReconciliationRuleDTO getByIdDeletedFlag(Integer id, Byte sceneType, String deletedFlag, boolean needCompile,Integer goodsTypeGroupRuleId) {
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL, "merchantId must not be null");
RpcAssert.assertNotNull(sceneType, DefaultErrorEnum.DATA_NULL, "sceneType must not be null");
try {
......@@ -204,7 +205,7 @@ public class MerchantReconciliationRuleService {
MerchantReconciliationRuleDTO reconciliationRuleDTO = MerchantReconciliationRuleConverter.INSTANCE
.fromMerchantReconciliationRule(list.get(0));
if (needCompile) {
return compileDetail(reconciliationRuleDTO);
return compileDetail(reconciliationRuleDTO,goodsTypeGroupRuleId);
}
return reconciliationRuleDTO;
} catch (Exception e) {
......@@ -219,9 +220,9 @@ public class MerchantReconciliationRuleService {
* @param merchantReconciliationRuleDTO 对账规则dto
* @return
*/
public MerchantReconciliationRuleDTO compileDetail(MerchantReconciliationRuleDTO merchantReconciliationRuleDTO) {
public MerchantReconciliationRuleDTO compileDetail(MerchantReconciliationRuleDTO merchantReconciliationRuleDTO,Integer goodsTypeGroupRuleId) {
List<MerchantGoodsTypeGroupReconciliationRuleDTO> goodsTypeGroupReconciliationRules =
merchantGoodsTypeGroupReconciliationRuleService.getByReconciliationRuleId(merchantReconciliationRuleDTO.getId());
merchantGoodsTypeGroupReconciliationRuleService.getByReconciliationRuleId(merchantReconciliationRuleDTO.getId(),goodsTypeGroupRuleId);
merchantReconciliationRuleDTO.setGoodsTypeGroupReconciliationRules(goodsTypeGroupReconciliationRules);
return merchantReconciliationRuleDTO;
}
......@@ -332,6 +333,7 @@ public class MerchantReconciliationRuleService {
record.setCreatedDate(date);
record.setUpdatedDate(date);
record.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
record.setId(null);
try {
merchantReconciliationRuleMapper.insertSelective(record);
} catch (Exception e) {
......@@ -384,7 +386,7 @@ public class MerchantReconciliationRuleService {
*
* @param record
*/
private void paramValidation(MerchantReconciliationRuleDTO record) {
public void paramValidation(MerchantReconciliationRuleDTO record) {
if (!Objects.equals(RuleSourceTypeEnum.DJ_ON_SHELVE.getValue(), record.getSource())) {
ServiceMerchant serviceMerchant = serviceMerchantService.getBaseByMerchantId(record.getMerchantId());
if (Objects.isNull(serviceMerchant)) {
......@@ -572,7 +574,7 @@ public class MerchantReconciliationRuleService {
MerchantReconciliationRuleDTO reconciliationRuleDTO = MerchantReconciliationRuleConverter.INSTANCE
.fromMerchantReconciliationRule(r);
if (needCompile) {
return compileDetail(reconciliationRuleDTO);
return compileDetail(reconciliationRuleDTO,null);
}
return reconciliationRuleDTO;
} catch (Exception e) {
......@@ -798,7 +800,7 @@ public class MerchantReconciliationRuleService {
BigDecimal marketingCost = BigDecimal.ZERO;
BigDecimal rewardAndPenaltyCost = BigDecimal.ZERO;
BigDecimal sunshineIncentiveFee = BigDecimal.ZERO;
BigDecimal otherFee = BigDecimal.ZERO;
//BigDecimal otherFee = BigDecimal.ZERO;
for (OrderExpenseCategoryCalculatedDTO r : results) {
Integer expenseCategoryId = r.getExpenseCategoryId();
if (r.getExpenseCategoryResult() == null) {
......@@ -816,9 +818,9 @@ public class MerchantReconciliationRuleService {
if (Objects.equals(expenseCategoryId, FeeCategoryEnum.SUNSHINE_INCENTIVE_FEE.getValue())) {
sunshineIncentiveFee = sunshineIncentiveFee.add(r.getExpenseCategoryResult());
}
if (Objects.equals(expenseCategoryId, FeeCategoryEnum.OTHER_FEE.getValue())) {
otherFee = otherFee.add(r.getExpenseCategoryResult());
}
// if (Objects.equals(expenseCategoryId, FeeCategoryEnum.OTHER_FEE.getValue())) {
// otherFee = otherFee.add(r.getExpenseCategoryResult());
// }
}
GoodsOrderProfitAllocation updatedRecord = GoodsOrderProfitAllocation.builder().id(masterOrderProfit.getId()).build();
if (masterOrderProfit.getInstallCost() == null) {
......@@ -890,7 +892,12 @@ public class MerchantReconciliationRuleService {
return new ExpenseCategoryCalFunc() {
@Override
public ExpenseCategoryCalculateContext getOrderContext(GoodsOrderDTO orderDTO, List<OrderExpenseCategoryCalculatedDTO> contextCategoryCalculateds, MerchantExpenseCategoryRuleDTO expenseCategoryRule) {
GoodsOrderProfitAllocationDTO masterOrderProfit = goodsOrderProfitAllocationService.getMasterOrder(GoodsOrderProfitAllocationDTO.builder().orderCode(orderDTO.getOrderCode()).build());
GoodsOrderProfitAllocationDTO masterOrderProfit = null;
if(Objects.equals(orderDTO.getOrderType(),CarLifeEnum.OrderType.CREATE_BUSINESS_PRODUCT_CALCULATION.getValue())){
masterOrderProfit = orderDTO.getMainOrderProfit();
}else {
masterOrderProfit = goodsOrderProfitAllocationService.getMasterOrder(GoodsOrderProfitAllocationDTO.builder().orderCode(orderDTO.getOrderCode()).build());
}
if (masterOrderProfit == null) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "不存在的主订单粒度财务记录信息,orderCode:" + orderDTO.getOrderCode());
}
......@@ -1060,7 +1067,7 @@ public class MerchantReconciliationRuleService {
}
List<MerchantGoodsTypeGroupSettleRuleDTO> merchantGoodsTypeGroupSettleRuleList = accountRule.getGoodsTypeGroupSettleRules();
if (CollectionUtils.isEmpty(merchantGoodsTypeGroupSettleRuleList)) {
merchantGoodsTypeGroupSettleRuleList = merchantGoodsTypeGroupSettleRuleService.listBySettleRuleId(accountRule.getId());
merchantGoodsTypeGroupSettleRuleList = merchantGoodsTypeGroupSettleRuleService.listBySettleRuleId(accountRule.getId(),null,null);
}
if (CollectionUtils.isEmpty(merchantGoodsTypeGroupSettleRuleList)) {
log.error("对账计算,查询订单支付时间的财务规则品类信息记录为空, orderCode:{}", orderDTO.getOrderCode());
......@@ -1334,9 +1341,9 @@ public class MerchantReconciliationRuleService {
}
}
public void validReconciliationRuleDeletedFlag(Integer id, String updatedBy) {
public void validReconciliationRuleDeletedFlag(Integer id, String updatedBy,String submitFlag) {
try{
merchantReconciliationRuleMapper.validReconciliationRuleDeletedFlag(id, updatedBy);
merchantReconciliationRuleMapper.validReconciliationRuleDeletedFlag(id, updatedBy,submitFlag);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
......
......@@ -5,15 +5,18 @@ import cn.com.glsx.dj.smartcarlife.dto.DivisionRuleEffectRecordDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantExpenseCategoryRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantGoodsTypeGroupSettleRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleAccountRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.MerchantSettleDistributeRuleDTO;
import cn.com.glsx.dj.smartcarlife.dto.settleDistribution.MerchantExpenseCategoryRuleLevelDTO;
import cn.com.glsx.dj.smartcarlife.enums.*;
import cn.com.glsx.dj.smartcarlife.mapper.MerchantSettleAccountRuleMapper;
import cn.com.glsx.dj.smartcarlife.model.MerchantExpenseCategoryRule;
import cn.com.glsx.dj.smartcarlife.model.MerchantReconciliationRule;
import cn.com.glsx.dj.smartcarlife.model.MerchantSettleAccountRule;
import cn.com.glsx.dj.smartcarlife.service.merchantSettleDistribution.MerchantGoodsTypeGroupSettleRuleService;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.alibaba.fastjson.JSON;
......@@ -64,7 +67,9 @@ public class MerchantSettleAccountRuleService {
public void saveRule(MerchantSettleAccountRuleDTO record) {
try {
checkForSaveRule(record);
thiz.saveRule2DB(record);
if(record.getId() == null) {
thiz.saveRule2DB(record);
}
for (MerchantGoodsTypeGroupSettleRuleDTO goodsTypeGroupSettleRuleDTO:record.getGoodsTypeGroupSettleRules()){
goodsTypeGroupSettleRuleDTO.setSaveDraft(record.getSaveDraft());
goodsTypeGroupSettleRuleDTO.setMerchantId(record.getMerchantId());
......@@ -116,7 +121,7 @@ public class MerchantSettleAccountRuleService {
}
private void checkForSaveRule(MerchantSettleAccountRuleDTO record) {
public void checkForSaveRule(MerchantSettleAccountRuleDTO record) {
RpcAssert.assertNotEmpty(record.getUpdatedBy(), DefaultErrorEnum.DATA_NULL,"record.getUpdatedBy() not be empty");
int allGoodsTypeGroupNums = 0;
for (MerchantGoodsTypeGroupSettleRuleDTO goodsTypeGroupSettleRule:record.getGoodsTypeGroupSettleRules()){
......@@ -260,7 +265,7 @@ public class MerchantSettleAccountRuleService {
if(r == null){
return null;
}
MerchantSettleAccountRuleDTO dto = compileDetail(r, expenseCategroyRulsBuildType);
MerchantSettleAccountRuleDTO dto = compileDetail(r,null,null, expenseCategroyRulsBuildType);
return dto;
}catch(Exception e){
log.error(e.getMessage(),e);
......@@ -275,7 +280,7 @@ public class MerchantSettleAccountRuleService {
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public MerchantSettleAccountRuleDTO compileDetail(MerchantSettleAccountRule record) {
try{
return thiz.compileDetail(record, (byte)1);
return thiz.compileDetail(record,null,null, (byte)1);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
......@@ -293,7 +298,7 @@ public class MerchantSettleAccountRuleService {
* @date 2022年12月01日 17:08:41
*/
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public MerchantSettleAccountRuleDTO compileDetail(MerchantSettleAccountRule record, Byte expenseCategroyRulesBuildType) {
public MerchantSettleAccountRuleDTO compileDetail(MerchantSettleAccountRule record,Byte groupType,Integer goodsTypeGroupId, Byte expenseCategroyRulesBuildType) {
if (record != null) {
RpcAssert.assertNotNull(record.getId(), DefaultErrorEnum.DATA_NULL,"merchantSettleAccountRule.getId() not be null");
MerchantSettleAccountRuleDTO dto = new MerchantSettleAccountRuleDTO();
......@@ -301,9 +306,9 @@ public class MerchantSettleAccountRuleService {
BeanUtils.copyProperties(record, dto);
if (expenseCategroyRulesBuildType != null
&& ExpenseCategroyRulsBuildTypeEnum.TARGET_TYPE_GROUP.getValue() == expenseCategroyRulesBuildType.byteValue()) {
dto.setGoodsTypeGroupSettleRules(merchantGoodsTypeGroupSettleRuleService.listWithTargetTypeGroupExpenseCategoryRules(record.getId()));
dto.setGoodsTypeGroupSettleRules(merchantGoodsTypeGroupSettleRuleService.listWithTargetTypeGroupExpenseCategoryRules(record.getId(),groupType,goodsTypeGroupId));
}else{
dto.setGoodsTypeGroupSettleRules(merchantGoodsTypeGroupSettleRuleService.listBySettleRuleId(record.getId()));
dto.setGoodsTypeGroupSettleRules(merchantGoodsTypeGroupSettleRuleService.listBySettleRuleId(record.getId(),groupType,goodsTypeGroupId));
}
return dto;
} catch (Exception e) {
......@@ -313,7 +318,24 @@ public class MerchantSettleAccountRuleService {
}
return null;
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public MerchantSettleAccountRuleDTO compileDetailValid(MerchantSettleAccountRule record) {
if (record != null) {
RpcAssert.assertNotNull(record.getId(), DefaultErrorEnum.DATA_NULL,"merchantSettleAccountRule.getId() not be null");
MerchantSettleAccountRuleDTO dto = new MerchantSettleAccountRuleDTO();
try{
BeanUtils.copyProperties(record, dto);
dto.setGoodsTypeGroupSettleRules(merchantGoodsTypeGroupSettleRuleService.listValidBySettleRuleId(record.getId()));
return dto;
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
return null;
}
public MerchantSettleAccountRuleDTO getEnabledByMerchantId(Integer merchantId, Byte sceneType){
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL,"merchantId must not be null");
......@@ -346,11 +368,11 @@ public class MerchantSettleAccountRuleService {
try{
MerchantSettleAccountRule condition = MerchantSettleAccountRule.builder().merchantId(merchantId)
.sceneType(sceneType).build();
List<MerchantSettleAccountRule> list = merchantSettleAccountRuleMapper.list(condition);
if(CollectionUtils.isEmpty(list)){
MerchantSettleAccountRule data = merchantSettleAccountRuleMapper.getLatestByMerchantId(condition);
if(data == null){
return null;
}
return compileDetail(list.get(0), expenseCategroyRulesBuildType);
return compileDetail(data,null,null, expenseCategroyRulesBuildType);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
......@@ -358,7 +380,8 @@ public class MerchantSettleAccountRuleService {
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public MerchantSettleAccountRuleDTO getByIdDeletedFlag(Integer id, Byte sceneType, String deletedFlag, Byte expenseCategroyRulesBuildType){
public MerchantSettleAccountRuleDTO getByIdDeletedFlag(Integer id, Byte sceneType, String deletedFlag, Byte expenseCategroyRulesBuildType,
Byte groupType,Integer goodsTypeGroupId){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"id must not be null");
RpcAssert.assertNotNull(sceneType, DefaultErrorEnum.DATA_NULL,"sceneType must not be null");
RpcAssert.assertNotNull(expenseCategroyRulesBuildType, DefaultErrorEnum.DATA_NULL,"expenseCategroyRulsBuildType not be null");
......@@ -369,13 +392,30 @@ public class MerchantSettleAccountRuleService {
if(CollectionUtils.isEmpty(list)){
return null;
}
return compileDetail(list.get(0), expenseCategroyRulesBuildType);
return compileDetail(list.get(0),groupType,goodsTypeGroupId, expenseCategroyRulesBuildType);
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public MerchantSettleAccountRuleDTO getValidByIdDeletedFlag(Integer id, Byte sceneType, String deletedFlag){
RpcAssert.assertNotNull(id, DefaultErrorEnum.DATA_NULL,"id must not be null");
RpcAssert.assertNotNull(sceneType, DefaultErrorEnum.DATA_NULL,"sceneType must not be null");
try{
MerchantSettleAccountRule condition = MerchantSettleAccountRule.builder().id(id).deletedFlag(deletedFlag)
.sceneType(sceneType).build();
List<MerchantSettleAccountRule> list = merchantSettleAccountRuleMapper.list(condition);
if(CollectionUtils.isEmpty(list)){
return null;
}
return compileDetailValid(list.get(0));
}catch(Exception e){
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
public Page<MerchantSettleAccountRule> listWithPage(RpcPagination<MerchantSettleAccountRule> pagination) {
RpcAssert.assertNotNull(pagination, DefaultErrorEnum.DATA_NULL,"RpcPagination not be null");
......@@ -580,12 +620,29 @@ public class MerchantSettleAccountRuleService {
}
}
public void validSettleAccountRuleDeletedFlag(Integer settleRuleId, String updatedBy) {
public void validSettleAccountRuleDeletedFlag(Integer settleRuleId, String updatedBy,String submitFlag) {
try{
merchantSettleAccountRuleMapper.validSettleAccountRuleDeletedFlag(settleRuleId, updatedBy);
merchantSettleAccountRuleMapper.validSettleAccountRuleDeletedFlag(settleRuleId, updatedBy,submitFlag);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public MerchantSettleAccountRule copySettleRule(Integer oldSettleRuleId,Map<Integer, Integer> goodsTypeGroupMap) {
RpcAssert.assertNotNull(oldSettleRuleId, DefaultErrorEnum.DATA_NULL, "oldSettleRuleId must not be null");
RpcAssert.assertNotNull(goodsTypeGroupMap, DefaultErrorEnum.DATA_NULL, "goodsTypeGroupMap must not be null");
try {
MerchantSettleAccountRule merchantSettleAccountRule = merchantSettleAccountRuleMapper.selectByPrimaryKey(oldSettleRuleId);
merchantSettleAccountRule.setId(null);
merchantSettleAccountRule.setSubmitFlag(StatusEnum.NO.getValue());
merchantSettleAccountRuleMapper.insertUseGeneratedKeys(merchantSettleAccountRule);
merchantGoodsTypeGroupSettleRuleService.copyData(oldSettleRuleId, merchantSettleAccountRule.getId(),goodsTypeGroupMap);
return merchantSettleAccountRule;
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
......@@ -14,6 +14,7 @@ import cn.com.glsx.dj.smartcarlife.enums.*;
import cn.com.glsx.dj.smartcarlife.model.*;
import cn.com.glsx.dj.smartcarlife.service.merchantSettleDistribution.*;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.enums.StatusEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import com.alibaba.fastjson.JSON;
......@@ -103,11 +104,13 @@ public class MerchantSettleDistributeRuleService {
}
MerchantSettleAccountRuleDTO accountRuleDTO = MerchantSettleDistributeRuleDTOConvert.INSTANCE.toMerchantSettleAccountRuleDTO(record);
accountRuleDTO.setUpdatedBy(record.getOprBy());
accountRuleDTO.setSubmitFlag(needAudit ? StatusEnum.YES.getValue():StatusEnum.NO.getValue());
merchantSettleAccountRuleService.saveRule(accountRuleDTO);
record.setSettleRuleId(accountRuleDTO.getId());
MerchantDivisionRuleDTO merchantDivisionRuleDTO = MerchantSettleDistributeRuleDTOConvert.INSTANCE.toMerchantDivisionRuleDTO(record);
merchantDivisionRuleDTO.setUpdatedBy(record.getOprBy());
merchantDivisionRuleService.saveRule(merchantDivisionRuleDTO);
merchantDivisionRuleDTO.setSubmitFlag(needAudit ? StatusEnum.YES.getValue():StatusEnum.NO.getValue());
merchantDivisionRuleService.saveRule(merchantDivisionRuleDTO,false);
record.setDivisionRuleId(merchantDivisionRuleDTO.getId());
// 添加规则待审核记录
byte effectDateType = record.getEffectStartDate() == null ? EffectDateTypeEnum.IMMEDIATELY.getValue() : EffectDateTypeEnum.SPECIFIED_DATE.getValue();
......@@ -173,7 +176,7 @@ public class MerchantSettleDistributeRuleService {
settleRuleExpenseIds.sort(Integer::compareTo);
List<Integer> distributionExpenseIds = goodsTypeGroupRule.getMerchantDistributionRules().stream().filter(Objects::nonNull).map(MerchantDistributionRuleDTO::getExpenseCategoryId).sorted(Integer::compareTo).collect(Collectors.toList());
if (!JSON.toJSONString(settleRuleExpenseIds).equals(JSON.toJSONString(distributionExpenseIds))) {
log.error("费用类目配置与分配不一致, settleRuleExpenseIds:{}, distributionExpenseIds:{}", settleRuleExpenseIds, distributionExpenseIds);
log.error("费用类目配置与分配不一致, groupSettleRuleId:{},settleRuleExpenseIds:{}, distributionExpenseIds:{}",goodsTypeGroupRule.getGroupSettleRuleId(),settleRuleExpenseIds, distributionExpenseIds);
throw new RpcServiceException(DefaultErrorEnum.DATA_INVALID, "实际分账类目配置与分配不一致");
}
List<Integer> owningDistributionExpenseIds = goodsTypeGroupRule.getOwningMerchantDistributionRules().stream().filter(Objects::nonNull).map(MerchantDistributionRuleDTO::getExpenseCategoryId).sorted(Integer::compareTo).collect(Collectors.toList());
......@@ -242,17 +245,29 @@ public class MerchantSettleDistributeRuleService {
}
}
public MerchantSettleDistributeRuleDTO getRuleByIdDeletedFlag(Integer settleRuleId, Integer divisionRuleId, Byte sceneType, Byte expenseCategroyRulesBuildType){
public MerchantSettleDistributeRuleDTO getRuleByIdDeletedFlag(Integer settleRuleId, Integer divisionRuleId, Byte sceneType, Byte expenseCategroyRulesBuildType,
Byte groupType,Integer goodsTypeGroupId){
try{
MerchantSettleAccountRuleDTO settleAccountRule = merchantSettleAccountRuleService.getByIdDeletedFlag(settleRuleId, sceneType, StaffStatusEnum.VISIBLE.getName(), expenseCategroyRulesBuildType);
MerchantDivisionRuleDTO divisionRule = merchantDivisionRuleService.getByIdDeletedFlag(divisionRuleId, StaffStatusEnum.VISIBLE.getName(), sceneType);
MerchantSettleAccountRuleDTO settleAccountRule = merchantSettleAccountRuleService.getByIdDeletedFlag(settleRuleId, sceneType, StaffStatusEnum.VISIBLE.getName(), expenseCategroyRulesBuildType,groupType,goodsTypeGroupId);
MerchantDivisionRuleDTO divisionRule = merchantDivisionRuleService.getByIdDeletedFlag(divisionRuleId, StaffStatusEnum.VISIBLE.getName(), sceneType,groupType,goodsTypeGroupId);
return thiz.getDetail(settleAccountRule, divisionRule);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
//用于校验
public MerchantSettleDistributeRuleDTO getValidRuleByIdDeletedFlag(Integer settleRuleId, Integer divisionRuleId, Byte sceneType){
try{
MerchantSettleAccountRuleDTO settleAccountRule = merchantSettleAccountRuleService.getValidByIdDeletedFlag(settleRuleId, sceneType, StaffStatusEnum.VISIBLE.getName());
MerchantDivisionRuleDTO divisionRule = merchantDivisionRuleService.getValidByIdDeletedFlag(divisionRuleId, StaffStatusEnum.VISIBLE.getName(), sceneType);
return thiz.getValidDetail(settleAccountRule, divisionRule);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public MerchantSettleDistributeRuleDTO getDetail(Integer settleRuleId, Integer divisionRuleId){
......@@ -299,6 +314,28 @@ public class MerchantSettleDistributeRuleService {
return dto;
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public MerchantSettleDistributeRuleDTO getValidDetail(MerchantSettleAccountRuleDTO settleAccountRuleDTO, MerchantDivisionRuleDTO divisionRuleDTO){
if (settleAccountRuleDTO == null) {
return null;
}
MerchantSettleDistributeRuleDTO dto = MerchantSettleDistributeRuleDTOConvert.INSTANCE.fromSettleDivisionRule(settleAccountRuleDTO, divisionRuleDTO);
// 按照商品品类分组id组织获取商品品类分组的总体规则
final Map<Integer, MerchantGoodsTypeGroupDivisionRuleDTO> goodsTypeGroupDivisionRuleMap;
if (divisionRuleDTO != null) {
goodsTypeGroupDivisionRuleMap = divisionRuleDTO.getGoodsTypeGroupDivisionRules().stream()
.collect(Collectors.toMap(MerchantGoodsTypeGroupDivisionRuleDTO::getGoodsTypeGroupId, o -> o, (o1, o2) -> o2));
}else{
goodsTypeGroupDivisionRuleMap = new HashMap<>();
}
List<MerchantGoodsTypeGroupSettleDivisionRuleDTO> goodsTypeGroupRules = settleAccountRuleDTO.getGoodsTypeGroupSettleRules().stream()
.map(goodsTypeGroupSettleRule -> {
MerchantGoodsTypeGroupDivisionRuleDTO goodsTypeGroupDivisionRule = goodsTypeGroupDivisionRuleMap.get(goodsTypeGroupSettleRule.getGoodsTypeGroupId());
return MerchantGoodsTypeGroupSettleDivisionRuleDTOConvert.INSTANCE.fromGroupSettleDivisionRule(goodsTypeGroupSettleRule, goodsTypeGroupDivisionRule);
}).sorted(Comparator.comparing(MerchantGoodsTypeGroupSettleDivisionRuleDTO::getGroupType)).collect(Collectors.toList());
dto.setGoodsTypeGroupRules(goodsTypeGroupRules);
return dto;
}
public MerchantSettleDistributeRuleTestRuleDTO testRule(MerchantSettleDistributeRuleTestRuleDTO dto, Boolean includeOwning){
try{
......
......@@ -2225,7 +2225,7 @@ public class PurchaseOrderDeliveryService {
RpcAssert.assertNotEmpty(dto.getUpdatedBy(), DefaultErrorEnum.DATA_NULL,"dto.getUpdatedBy() not be empty");
RpcAssert.assertNotEmpty(dto.getSignFileUrl(), DefaultErrorEnum.DATA_NULL,"dto.getSignFileUrl() not be empty");
RpcAssert.assertNotEmpty(dto.getSignName(), DefaultErrorEnum.DATA_NULL,"dto.getSignName() not be empty");
RpcAssert.assertNotNull(dto.getUploadFileUrl(), DefaultErrorEnum.DATA_NULL,"dto.getUploadFileUrl() not be empty");
//RpcAssert.assertNotNull(dto.getUploadFileUrl(), DefaultErrorEnum.DATA_NULL,"dto.getUploadFileUrl() not be empty");
PurchaseOrderDelivery record = getById(dto.getId());
if (record == null) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "不存在的发货单信息");
......
......@@ -451,6 +451,7 @@ public class ServiceMerchantService {
try{
ServiceMerchant exsitInfo = getBaseByMerchantId(record.getMerchantId());
log.info("exsitInfo:{},record:{}",exsitInfo,record);
if (exsitInfo != null
&& exsitInfo.getMerchantType() != null
&& record.getMerchantType() != null
......
......@@ -3,6 +3,7 @@ package cn.com.glsx.dj.smartcarlife.service;
import cn.com.glsx.dj.smartcarlife.constant.CommonConstants;
import cn.com.glsx.dj.smartcarlife.converter.StaffConver;
import cn.com.glsx.dj.smartcarlife.dto.*;
import cn.com.glsx.dj.smartcarlife.dto.MerchantStaffDTO;
import cn.com.glsx.dj.smartcarlife.dto.staff.StaffWechatBindingDTO;
import cn.com.glsx.dj.smartcarlife.enums.StaffStatusEnum;
import cn.com.glsx.dj.smartcarlife.manager.StaffManager;
......@@ -618,4 +619,15 @@ public class StaffInfoService {
return true;
}
public List<MerchantStaffDTO> listStaffByMainMerchantIdAndScene(Integer mainMerchantId, Integer sceneType) {
RpcAssert.assertNotNull(mainMerchantId, DefaultErrorEnum.DATA_NULL, "mainMerchantId not be null");
RpcAssert.assertNotNull(sceneType, DefaultErrorEnum.DATA_NULL, "sceneType not be null");
try {
return staffInfoMapper.listStaffByMainMerchantIdAndScene(mainMerchantId, sceneType);
} catch (Exception e) {
log.info(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, e.getMessage());
}
}
}
......@@ -523,6 +523,18 @@ public class YqMerchantConfigService {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
public YqMerchantInfoDTO getInfoByMerchantId(Integer merchantId) {
RpcAssert.assertNotNull(merchantId, DefaultErrorEnum.DATA_NULL,"merchantId not be null");
try{
YqMerchantInfoDTO condition = new YqMerchantInfoDTO();
condition.setMerchantId(merchantId);
return CommonUtil.getFirst(yqMerchantInfoMapper.list(condition));
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public Boolean yqMerchantInfoCommit(YqMerchantInfoDTO request){
......
package cn.com.glsx.dj.smartcarlife.service;
import cn.com.glsx.dj.smartcarlife.mapper.YqMerchantServiceDetailsMapper;
import cn.com.glsx.dj.smartcarlife.model.YqMerchantServiceDetails;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import lombok.extern.slf4j.Slf4j;
import tk.mybatis.mapper.entity.Example;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import javax.annotation.Resource;
......@@ -22,5 +31,20 @@ public class YqMerchantServiceDetailsService {
public void test(String test) {
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public List<YqMerchantServiceDetails> list(YqMerchantServiceDetails condition) {
RpcAssert.assertNotNull(condition,DefaultErrorEnum.DATA_NULL,"condition is null");
try{
condition.setDeletedFlag(DeletedFlagEnum.N.name());
return yqMerchantServiceDetailsMapper.select(condition);
}catch(Exception e) {
log.error(e.getMessage(),e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR,e);
}
}
}
package cn.com.glsx.dj.smartcarlife.service.carcondition;
import cn.com.glsk.omni.ai.dto.BusinessRequest;
import cn.com.glsk.omni.ai.dto.BusinessResponse;
import cn.com.glsk.omni.ai.remote.AgiRemote;
import cn.com.glsx.dj.smartcarlife.dto.carcondition.CarConditionRespDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class CarConditionAIService {
@Autowired
private AgiRemote agiRemote;
public final Integer CAR_CONDITION_AI_TASK_ID_KEY = 6001;
public CarConditionRespDTO generateAiTaskId(String aiRequestJson) {
log.info("生成ai压价话术任务id入参aiRequestJson={}", aiRequestJson);
BusinessRequest req = new BusinessRequest();
req.setBusinessType(CAR_CONDITION_AI_TASK_ID_KEY);
req.setRequestType(2);
req.setContent(aiRequestJson);
RpcResponse<BusinessResponse> rpcResponse = agiRemote.launchTask(req);
if (rpcResponse == null || !rpcResponse.isSuccess()) {
String errorMsg = rpcResponse != null ? rpcResponse.getMessage() : "响应为空";
log.warn("调用大模型发起 AI 分析失败,aiRequestJson={},error={}", aiRequestJson, errorMsg);
return null;
}
BusinessResponse businessResponse = rpcResponse.getResult();
if (businessResponse == null) {
log.warn("大模型返回结果为空,aiRequestJson={}", aiRequestJson);
return null;
}
log.info("生成ai压价话术任务创建成功,aiRequestJson={},aiTaskId={}",aiRequestJson, businessResponse.getBusinessId());
CarConditionRespDTO carConditionRespDTO = new CarConditionRespDTO();
BeanUtils.copyProperties(businessResponse, carConditionRespDTO);
return carConditionRespDTO;
}
public CarConditionRespDTO queryAiJsonResultByTaskId(String aiTaskId) {
log.info("开始查询ai压价话术json,aiTaskId={}", aiTaskId);
RpcResponse<BusinessResponse> rpcResponse = agiRemote.queryTaskResult(aiTaskId);
if (rpcResponse == null || !rpcResponse.isSuccess()) {
String errorMsg = rpcResponse != null ? rpcResponse.getMessage() : "响应为空";
log.warn("查询ai压价话术json结果失败,aiTaskId={},error={}", aiTaskId, errorMsg);
return null;
}
BusinessResponse businessResponse = rpcResponse.getResult();
if (businessResponse == null) {
log.warn("查询ai压价话术json为空,aiTaskId={}", aiTaskId);
return null;
}
if (!businessResponse.isTaskFinished()) {
// 任务尚未完成,等待下次轮询
log.info("查询ai压价话术json任务尚未完成,继续等待,aiTaskId={}", aiTaskId);
return JSON.parseObject(JSON.toJSONString(businessResponse), CarConditionRespDTO.class);
}
if (!businessResponse.isSuccess()) {
// 任务完成但失败
log.warn("查询ai压价话术json任务执行失败,aiTaskId={},error={}", aiTaskId, businessResponse.getError());
return JSON.parseObject(JSON.toJSONString(businessResponse), CarConditionRespDTO.class);
}
log.info("查询ai压价话术json任务执行成功,aiTaskId={},businessResponse={}", aiTaskId, JSON.toJSONString(businessResponse));
CarConditionRespDTO carConditionRespDTO = new CarConditionRespDTO();
BeanUtils.copyProperties(businessResponse, carConditionRespDTO);
return carConditionRespDTO;
}
}
  • @wangxw1
    commented
    Master

    一、关键问题与优化建议,如果必要,给出代码示例(仅限 Top 3)

    1. 健壮性与异常流控制问题:利用异常处理空指针(NullPointerException)

    • 问题描述:在 CreateBusinessApproveImportReconciliationRuleDTO 和 CreateBusinessApproveImportSettleRuleDTO 的 isSameNumericString 方法中,当 parseDecimal 遇到无法解析的字符串时会返回 null。此时 parseDecimal(source.trim()).compareTo(...) 会触发 NullPointerException,代码利用外层的 catch (Exception e) 来捕获该异常并执行降级逻辑。
    • 影响分析:利用异常来控制正常业务流程(特别是隐式利用 NPE)是严重的反模式。这不仅会带来不必要的性能开销(异常栈追踪的生成成本极高),还会掩盖潜在的真实错误,增加排查问题的难度。
    • 优化建议:显式进行空值判断,避免触发异常。 java private boolean isSameNumericString(String source, String target) { if (source == null || target == null) { return Objects.equals(source, target); } BigDecimal sourceDecimal = parseDecimal(source.trim()); BigDecimal targetDecimal = parseDecimal(target.trim()); if (sourceDecimal != null && targetDecimal != null) { return sourceDecimal.compareTo(targetDecimal) == 0; } return Objects.equals(source, target); }

    2. 性能与资源利用:枚举方法中频繁创建临时对象

    • 问题描述:在 MerchantDivideTypeEnum 类的 getValueByShopDisplayName、getValueByPartnerDisplayName 和 getValueByOtherFeeDisplayName 方法中,每次调用时都会使用 Arrays.asList(...) 来构造列表。
    • 影响分析:如果这些方法在导入 Excel 或批量处理时被频繁调用,每次调用都会在堆上分配新的数组和 List 对象,导致不必要的内存消耗和更频繁的垃圾回收(GC),影响系统性能。
    • 优化建议:将这些固定的枚举集合提升为静态常量(static final List 或数组)。 ```java private static final List SHOP_DIVIDE_TYPES = Arrays.asList( GROSS_RATIO, INCOME_PROPORTION, FIXED_AMOUNT, INCOME_SUBTRACT_CUSTOM_COMMON_COST_PROPORTION, INCOME_SUBTRACT_COMMON_COST_PROPORTION, FIX_AMOUNT_WITH_PURCHASE_NUM );

    public static Byte getValueByShopDisplayName(String displayName){ if (displayName != null) { for (MerchantDivideTypeEnum e : SHOP_DIVIDE_TYPES) { if (e.getDisplayName().equals(displayName)) { return e.getValue(); } } } return null; }

    
    **3. 最佳实践与可维护性:违反 DRY 原则与 DTO 职责不清**
    - **问题描述**:`parseDecimal`、`removeThousandsSeparator`、`normalizeNumericString` 和 `isSameNumericString` 等字符串/数字处理的辅助方法,被完全复制粘贴到了 `CreateBusinessApproveImportReconciliationRuleDTO` 和 `CreateBusinessApproveImportSettleRuleDTO` 两个类中。
    - **影响分析**:存在大量重复代码,违反了 DRY(Don't Repeat Yourself)原则。一旦解析逻辑需要修改,必须在多个地方同步更新,极易产生遗漏。此外,DTO(数据传输对象)应当是贫血模型,不应包含复杂的字符串解析和数字格式化业务逻辑。
    - **优化建议**:将这些公共的解析和比较方法抽取到一个独立的工具类中(例如 `DecimalFormatUtil`),供各个 DTO 或业务层统一调用。
    
    #### 二、评分明细
    
    - **功能实现的正确性与健壮性(35/40分)**:整体功能逻辑覆盖较全,但在数字字符串解析比较时,依赖捕获空指针异常来控制代码执行流,健壮性设计存在瑕疵。
    - **安全性与潜在风险(30/30分)**:未发现明显的 SQL 注入、XSS、越权或敏感信息泄露等安全隐患。
    - **最佳实践与可维护性(15/20分)**:代码存在明显的复制粘贴现象,DTO 类中混入了过多的工具类逻辑,导致类体积过大,职责不够单一。
    - **性能与资源利用(3/5分)**:在枚举类的匹配方法中动态创建集合对象,在数据导入等批量处理场景下会带来不必要的 GC 压力。
    - **提交信息质量(3/5分)**:部分 commit 信息比较规范(如 `refactor(staff): ...`),但存在大量如 "还原"、"日志文件太大 取消打印" 等缺乏上下文和详细说明的提交,质量参差不齐。
    
    总分:86分
    
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!