提交价格套餐功能
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户套餐 prc_customer_price_set
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcCustomerPriceSet extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long customerPricesetId;
|
||||
private Long priceSetId;
|
||||
private Long customerId;
|
||||
private String customerName;
|
||||
/** 优先级,数字越小越优先 */
|
||||
private Integer bindPriority;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date prBegindate;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date prEnddate;
|
||||
private String priceSetNote;
|
||||
|
||||
public Long getCustomerPricesetId() { return customerPricesetId; }
|
||||
public void setCustomerPricesetId(Long customerPricesetId) { this.customerPricesetId = customerPricesetId; }
|
||||
public Long getPriceSetId() { return priceSetId; }
|
||||
public void setPriceSetId(Long priceSetId) { this.priceSetId = priceSetId; }
|
||||
public Long getCustomerId() { return customerId; }
|
||||
public void setCustomerId(Long customerId) { this.customerId = customerId; }
|
||||
public String getCustomerName() { return customerName; }
|
||||
public void setCustomerName(String customerName) { this.customerName = customerName; }
|
||||
public Integer getBindPriority() { return bindPriority; }
|
||||
public void setBindPriority(Integer bindPriority) { this.bindPriority = bindPriority; }
|
||||
public Date getPrBegindate() { return prBegindate; }
|
||||
public void setPrBegindate(Date prBegindate) { this.prBegindate = prBegindate; }
|
||||
public Date getPrEnddate() { return prEnddate; }
|
||||
public void setPrEnddate(Date prEnddate) { this.prEnddate = prEnddate; }
|
||||
public String getPriceSetNote() { return priceSetNote; }
|
||||
public void setPriceSetNote(String priceSetNote) { this.priceSetNote = priceSetNote; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("customerPricesetId", getCustomerPricesetId())
|
||||
.append("priceSetId", getPriceSetId())
|
||||
.append("customerId", getCustomerId())
|
||||
.append("bindPriority", getBindPriority())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 价格套餐 prc_price_set
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcPriceSet extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 价格套餐id */
|
||||
private Long priceSetId;
|
||||
/** 套餐编码 */
|
||||
private String priceSetCode;
|
||||
/** 套餐名称 */
|
||||
private String priceSetName;
|
||||
/** 备注 */
|
||||
private String priceSetNote;
|
||||
/** 计价类型 FIXED / DISCOUNT */
|
||||
private String setType;
|
||||
/** 默认折扣百分数 */
|
||||
private BigDecimal defaultDiscount;
|
||||
/** 默认套餐 Y */
|
||||
private String defaultType;
|
||||
/** 试算标记 Y */
|
||||
private String calculateSign;
|
||||
/** 生效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date effectiveDate;
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date expireDate;
|
||||
/** 状态 D/A/E/R/S */
|
||||
private String status;
|
||||
/** 租户ID */
|
||||
private Long tmsId;
|
||||
|
||||
/** 产品数(列表) */
|
||||
private Integer productCount;
|
||||
/** 客户数(列表) */
|
||||
private Integer customerCount;
|
||||
/** 是否已过期(计算字段) */
|
||||
private Boolean expired;
|
||||
/** 列表搜索关键字 */
|
||||
private String keyword;
|
||||
/** 保存后是否提交审核 Y */
|
||||
private String submitFlag;
|
||||
|
||||
/** 套餐明细(向导保存) */
|
||||
private List<PrcPriceSetDetail> details;
|
||||
/** 绑定客户(向导保存) */
|
||||
private List<PrcCustomerPriceSet> customers;
|
||||
|
||||
public Long getPriceSetId() { return priceSetId; }
|
||||
public void setPriceSetId(Long priceSetId) { this.priceSetId = priceSetId; }
|
||||
public String getPriceSetCode() { return priceSetCode; }
|
||||
public void setPriceSetCode(String priceSetCode) { this.priceSetCode = priceSetCode; }
|
||||
public String getPriceSetName() { return priceSetName; }
|
||||
public void setPriceSetName(String priceSetName) { this.priceSetName = priceSetName; }
|
||||
public String getPriceSetNote() { return priceSetNote; }
|
||||
public void setPriceSetNote(String priceSetNote) { this.priceSetNote = priceSetNote; }
|
||||
public String getSetType() { return setType; }
|
||||
public void setSetType(String setType) { this.setType = setType; }
|
||||
public BigDecimal getDefaultDiscount() { return defaultDiscount; }
|
||||
public void setDefaultDiscount(BigDecimal defaultDiscount) { this.defaultDiscount = defaultDiscount; }
|
||||
public String getDefaultType() { return defaultType; }
|
||||
public void setDefaultType(String defaultType) { this.defaultType = defaultType; }
|
||||
public String getCalculateSign() { return calculateSign; }
|
||||
public void setCalculateSign(String calculateSign) { this.calculateSign = calculateSign; }
|
||||
public Date getEffectiveDate() { return effectiveDate; }
|
||||
public void setEffectiveDate(Date effectiveDate) { this.effectiveDate = effectiveDate; }
|
||||
public Date getExpireDate() { return expireDate; }
|
||||
public void setExpireDate(Date expireDate) { this.expireDate = expireDate; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Long getTmsId() { return tmsId; }
|
||||
public void setTmsId(Long tmsId) { this.tmsId = tmsId; }
|
||||
public Integer getProductCount() { return productCount; }
|
||||
public void setProductCount(Integer productCount) { this.productCount = productCount; }
|
||||
public Integer getCustomerCount() { return customerCount; }
|
||||
public void setCustomerCount(Integer customerCount) { this.customerCount = customerCount; }
|
||||
public Boolean getExpired() { return expired; }
|
||||
public void setExpired(Boolean expired) { this.expired = expired; }
|
||||
public String getKeyword() { return keyword; }
|
||||
public void setKeyword(String keyword) { this.keyword = keyword; }
|
||||
public String getSubmitFlag() { return submitFlag; }
|
||||
public void setSubmitFlag(String submitFlag) { this.submitFlag = submitFlag; }
|
||||
public List<PrcPriceSetDetail> getDetails() { return details; }
|
||||
public void setDetails(List<PrcPriceSetDetail> details) { this.details = details; }
|
||||
public List<PrcCustomerPriceSet> getCustomers() { return customers; }
|
||||
public void setCustomers(List<PrcCustomerPriceSet> customers) { this.customers = customers; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("priceSetId", getPriceSetId())
|
||||
.append("priceSetCode", getPriceSetCode())
|
||||
.append("priceSetName", getPriceSetName())
|
||||
.append("setType", getSetType())
|
||||
.append("status", getStatus())
|
||||
.append("effectiveDate", getEffectiveDate())
|
||||
.append("expireDate", getExpireDate())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
/**
|
||||
* 套餐校验项
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcPriceSetCheckItem
|
||||
{
|
||||
/** 校验项名称 */
|
||||
private String item;
|
||||
/** PASS / WARN / FAIL / INFO */
|
||||
private String result;
|
||||
/** 说明 */
|
||||
private String message;
|
||||
|
||||
public PrcPriceSetCheckItem()
|
||||
{
|
||||
}
|
||||
|
||||
public PrcPriceSetCheckItem(String item, String result, String message)
|
||||
{
|
||||
this.item = item;
|
||||
this.result = result;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getItem() { return item; }
|
||||
public void setItem(String item) { this.item = item; }
|
||||
public String getResult() { return result; }
|
||||
public void setResult(String result) { this.result = result; }
|
||||
public String getMessage() { return message; }
|
||||
public void setMessage(String message) { this.message = message; }
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 价格套餐明细 prc_price_set_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcPriceSetDetail implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long psdId;
|
||||
private Long priceSetId;
|
||||
private String productCode;
|
||||
private String productName;
|
||||
private String countryCode;
|
||||
private String countryName;
|
||||
private Long zdId;
|
||||
private Long wsdId;
|
||||
private String weightLabel;
|
||||
private BigDecimal fvValue;
|
||||
private BigDecimal fvRegistrationFee;
|
||||
private BigDecimal discountValue;
|
||||
private Integer prId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
public Long getPsdId() { return psdId; }
|
||||
public void setPsdId(Long psdId) { this.psdId = psdId; }
|
||||
public Long getPriceSetId() { return priceSetId; }
|
||||
public void setPriceSetId(Long priceSetId) { this.priceSetId = priceSetId; }
|
||||
public String getProductCode() { return productCode; }
|
||||
public void setProductCode(String productCode) { this.productCode = productCode; }
|
||||
public String getProductName() { return productName; }
|
||||
public void setProductName(String productName) { this.productName = productName; }
|
||||
public String getCountryCode() { return countryCode; }
|
||||
public void setCountryCode(String countryCode) { this.countryCode = countryCode; }
|
||||
public String getCountryName() { return countryName; }
|
||||
public void setCountryName(String countryName) { this.countryName = countryName; }
|
||||
public Long getZdId() { return zdId; }
|
||||
public void setZdId(Long zdId) { this.zdId = zdId; }
|
||||
public Long getWsdId() { return wsdId; }
|
||||
public void setWsdId(Long wsdId) { this.wsdId = wsdId; }
|
||||
public String getWeightLabel() { return weightLabel; }
|
||||
public void setWeightLabel(String weightLabel) { this.weightLabel = weightLabel; }
|
||||
public BigDecimal getFvValue() { return fvValue; }
|
||||
public void setFvValue(BigDecimal fvValue) { this.fvValue = fvValue; }
|
||||
public BigDecimal getFvRegistrationFee() { return fvRegistrationFee; }
|
||||
public void setFvRegistrationFee(BigDecimal fvRegistrationFee) { this.fvRegistrationFee = fvRegistrationFee; }
|
||||
public BigDecimal getDiscountValue() { return discountValue; }
|
||||
public void setDiscountValue(BigDecimal discountValue) { this.discountValue = discountValue; }
|
||||
public Integer getPrId() { return prId; }
|
||||
public void setPrId(Integer prId) { this.prId = prId; }
|
||||
public Date getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
|
||||
public Date getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("psdId", getPsdId())
|
||||
.append("priceSetId", getPriceSetId())
|
||||
.append("productCode", getProductCode())
|
||||
.append("countryCode", getCountryCode())
|
||||
.append("wsdId", getWsdId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 重量段明细 prc_weight_section_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcWeightSectionDetail implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 重量段明细ID */
|
||||
private Long wsdId;
|
||||
/** 重量段模板ID */
|
||||
private Long wstId;
|
||||
/** 段标题 */
|
||||
private String wlTitle;
|
||||
/** 起始重量 */
|
||||
private BigDecimal wlStartweight;
|
||||
/** 结束重量 */
|
||||
private BigDecimal wlEndweight;
|
||||
/** 计费方式代码 */
|
||||
private String weightBillingCode;
|
||||
/** 单位重量 */
|
||||
private BigDecimal fvUnitweight;
|
||||
/** 生效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date effectiveDate;
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date expireDate;
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
public Long getWsdId() { return wsdId; }
|
||||
public void setWsdId(Long wsdId) { this.wsdId = wsdId; }
|
||||
public Long getWstId() { return wstId; }
|
||||
public void setWstId(Long wstId) { this.wstId = wstId; }
|
||||
public String getWlTitle() { return wlTitle; }
|
||||
public void setWlTitle(String wlTitle) { this.wlTitle = wlTitle; }
|
||||
public BigDecimal getWlStartweight() { return wlStartweight; }
|
||||
public void setWlStartweight(BigDecimal wlStartweight) { this.wlStartweight = wlStartweight; }
|
||||
public BigDecimal getWlEndweight() { return wlEndweight; }
|
||||
public void setWlEndweight(BigDecimal wlEndweight) { this.wlEndweight = wlEndweight; }
|
||||
public String getWeightBillingCode() { return weightBillingCode; }
|
||||
public void setWeightBillingCode(String weightBillingCode) { this.weightBillingCode = weightBillingCode; }
|
||||
public BigDecimal getFvUnitweight() { return fvUnitweight; }
|
||||
public void setFvUnitweight(BigDecimal fvUnitweight) { this.fvUnitweight = fvUnitweight; }
|
||||
public Date getEffectiveDate() { return effectiveDate; }
|
||||
public void setEffectiveDate(Date effectiveDate) { this.effectiveDate = effectiveDate; }
|
||||
public Date getExpireDate() { return expireDate; }
|
||||
public void setExpireDate(Date expireDate) { this.expireDate = expireDate; }
|
||||
public Date getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
|
||||
public Date getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("wsdId", getWsdId())
|
||||
.append("wstId", getWstId())
|
||||
.append("wlTitle", getWlTitle())
|
||||
.append("wlStartweight", getWlStartweight())
|
||||
.append("wlEndweight", getWlEndweight())
|
||||
.append("weightBillingCode", getWeightBillingCode())
|
||||
.append("fvUnitweight", getFvUnitweight())
|
||||
.append("effectiveDate", getEffectiveDate())
|
||||
.append("expireDate", getExpireDate())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 重量段模板 prc_weight_section_template
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcWeightSectionTemplate extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 重量段模板ID */
|
||||
private Long wstId;
|
||||
/** 模板名称 */
|
||||
private String wstName;
|
||||
/** 状态码(on/off) */
|
||||
private String ssCode;
|
||||
/** 产品组代码 */
|
||||
private String pgCode;
|
||||
/** 服务渠道ID */
|
||||
private Long snId;
|
||||
/** 货物类型代码 */
|
||||
private String ctCode;
|
||||
/** 付款方式代码 */
|
||||
private String pmCode;
|
||||
/** 备注 */
|
||||
private String wstNote;
|
||||
/** 租户ID */
|
||||
private Long tmsId;
|
||||
/** 明细数量(列表展示,非表字段) */
|
||||
private Integer detailCount;
|
||||
|
||||
public Long getWstId() { return wstId; }
|
||||
public void setWstId(Long wstId) { this.wstId = wstId; }
|
||||
public String getWstName() { return wstName; }
|
||||
public void setWstName(String wstName) { this.wstName = wstName; }
|
||||
public String getSsCode() { return ssCode; }
|
||||
public void setSsCode(String ssCode) { this.ssCode = ssCode; }
|
||||
public String getPgCode() { return pgCode; }
|
||||
public void setPgCode(String pgCode) { this.pgCode = pgCode; }
|
||||
public Long getSnId() { return snId; }
|
||||
public void setSnId(Long snId) { this.snId = snId; }
|
||||
public String getCtCode() { return ctCode; }
|
||||
public void setCtCode(String ctCode) { this.ctCode = ctCode; }
|
||||
public String getPmCode() { return pmCode; }
|
||||
public void setPmCode(String pmCode) { this.pmCode = pmCode; }
|
||||
public String getWstNote() { return wstNote; }
|
||||
public void setWstNote(String wstNote) { this.wstNote = wstNote; }
|
||||
public Long getTmsId() { return tmsId; }
|
||||
public void setTmsId(Long tmsId) { this.tmsId = tmsId; }
|
||||
public Integer getDetailCount() { return detailCount; }
|
||||
public void setDetailCount(Integer detailCount) { this.detailCount = detailCount; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("wstId", getWstId())
|
||||
.append("wstName", getWstName())
|
||||
.append("ssCode", getSsCode())
|
||||
.append("pgCode", getPgCode())
|
||||
.append("snId", getSnId())
|
||||
.append("ctCode", getCtCode())
|
||||
.append("pmCode", getPmCode())
|
||||
.append("wstNote", getWstNote())
|
||||
.append("tmsId", getTmsId())
|
||||
.append("detailCount", getDetailCount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 分区国家 xtd_zonecountry
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class XtdZoneCountry implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 分区国家ID */
|
||||
private Long zcId;
|
||||
/** 区划ID */
|
||||
private Long zdId;
|
||||
/** 国家代码(ISO2) */
|
||||
private String countryCode;
|
||||
/** 划分类型(默认C) */
|
||||
private String zcDividekind;
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
public Long getZcId() { return zcId; }
|
||||
public void setZcId(Long zcId) { this.zcId = zcId; }
|
||||
public Long getZdId() { return zdId; }
|
||||
public void setZdId(Long zdId) { this.zdId = zdId; }
|
||||
public String getCountryCode() { return countryCode; }
|
||||
public void setCountryCode(String countryCode) { this.countryCode = countryCode; }
|
||||
public String getZcDividekind() { return zcDividekind; }
|
||||
public void setZcDividekind(String zcDividekind) { this.zcDividekind = zcDividekind; }
|
||||
public Date getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
|
||||
public Date getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("zcId", getZcId())
|
||||
.append("zdId", getZdId())
|
||||
.append("countryCode", getCountryCode())
|
||||
.append("zcDividekind", getZcDividekind())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 分区区划 xtd_zone_division
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class XtdZoneDivision implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 区划ID */
|
||||
private Long zdId;
|
||||
/** 分区方案ID */
|
||||
private Long zsId;
|
||||
/** 排序 */
|
||||
private Integer zdSort;
|
||||
/** 区划代码 */
|
||||
private String zdCode;
|
||||
/** 区划名称 */
|
||||
private String znName;
|
||||
/** 区划英文名 */
|
||||
private String znEname;
|
||||
/** 备注 */
|
||||
private String znNote;
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
/** 国家数量(列表展示,非表字段) */
|
||||
private Integer countryCount;
|
||||
|
||||
public Long getZdId() { return zdId; }
|
||||
public void setZdId(Long zdId) { this.zdId = zdId; }
|
||||
public Long getZsId() { return zsId; }
|
||||
public void setZsId(Long zsId) { this.zsId = zsId; }
|
||||
public Integer getZdSort() { return zdSort; }
|
||||
public void setZdSort(Integer zdSort) { this.zdSort = zdSort; }
|
||||
public String getZdCode() { return zdCode; }
|
||||
public void setZdCode(String zdCode) { this.zdCode = zdCode; }
|
||||
public String getZnName() { return znName; }
|
||||
public void setZnName(String znName) { this.znName = znName; }
|
||||
public String getZnEname() { return znEname; }
|
||||
public void setZnEname(String znEname) { this.znEname = znEname; }
|
||||
public String getZnNote() { return znNote; }
|
||||
public void setZnNote(String znNote) { this.znNote = znNote; }
|
||||
public Date getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
|
||||
public Date getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }
|
||||
public Integer getCountryCount() { return countryCount; }
|
||||
public void setCountryCount(Integer countryCount) { this.countryCount = countryCount; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("zdId", getZdId())
|
||||
.append("zsId", getZsId())
|
||||
.append("zdSort", getZdSort())
|
||||
.append("zdCode", getZdCode())
|
||||
.append("znName", getZnName())
|
||||
.append("znEname", getZnEname())
|
||||
.append("znNote", getZnNote())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.append("countryCount", getCountryCount())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 分区方案 xtd_zone_scheme
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class XtdZoneScheme extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 分区方案ID */
|
||||
private Long zsId;
|
||||
|
||||
/** 方案名称 */
|
||||
private String zsName;
|
||||
|
||||
/** 状态码(on/off) */
|
||||
private String ssCode;
|
||||
|
||||
/** 产品组代码 */
|
||||
private String pgCode;
|
||||
|
||||
/** 服务渠道ID */
|
||||
private Long snId;
|
||||
|
||||
/** 备注 */
|
||||
private String zsNote;
|
||||
|
||||
/** 租户ID */
|
||||
private Long tmsId;
|
||||
|
||||
/** 区划数量(列表展示,非表字段) */
|
||||
private Integer divisionCount;
|
||||
|
||||
public Long getZsId() { return zsId; }
|
||||
public void setZsId(Long zsId) { this.zsId = zsId; }
|
||||
public String getZsName() { return zsName; }
|
||||
public void setZsName(String zsName) { this.zsName = zsName; }
|
||||
public String getSsCode() { return ssCode; }
|
||||
public void setSsCode(String ssCode) { this.ssCode = ssCode; }
|
||||
public String getPgCode() { return pgCode; }
|
||||
public void setPgCode(String pgCode) { this.pgCode = pgCode; }
|
||||
public Long getSnId() { return snId; }
|
||||
public void setSnId(Long snId) { this.snId = snId; }
|
||||
public String getZsNote() { return zsNote; }
|
||||
public void setZsNote(String zsNote) { this.zsNote = zsNote; }
|
||||
public Long getTmsId() { return tmsId; }
|
||||
public void setTmsId(Long tmsId) { this.tmsId = tmsId; }
|
||||
public Integer getDivisionCount() { return divisionCount; }
|
||||
public void setDivisionCount(Integer divisionCount) { this.divisionCount = divisionCount; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("zsId", getZsId())
|
||||
.append("zsName", getZsName())
|
||||
.append("ssCode", getSsCode())
|
||||
.append("pgCode", getPgCode())
|
||||
.append("snId", getSnId())
|
||||
.append("zsNote", getZsNote())
|
||||
.append("tmsId", getTmsId())
|
||||
.append("divisionCount", getDivisionCount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.price.domain.PrcCustomerPriceSet;
|
||||
|
||||
/**
|
||||
* 客户套餐 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcCustomerPriceSetMapper
|
||||
{
|
||||
public PrcCustomerPriceSet selectPrcCustomerPriceSetById(Long customerPricesetId);
|
||||
|
||||
public List<PrcCustomerPriceSet> selectPrcCustomerPriceSetList(PrcCustomerPriceSet customer);
|
||||
|
||||
public int insertPrcCustomerPriceSet(PrcCustomerPriceSet customer);
|
||||
|
||||
public int updatePrcCustomerPriceSet(PrcCustomerPriceSet customer);
|
||||
|
||||
public int deletePrcCustomerPriceSetByIds(Long[] customerPricesetIds);
|
||||
|
||||
public int deletePrcCustomerPriceSetByPriceSetId(Long priceSetId);
|
||||
|
||||
public int countByPriceSetId(Long priceSetId);
|
||||
|
||||
public int countOverlap(@Param("customerId") Long customerId,
|
||||
@Param("priceSetId") Long priceSetId,
|
||||
@Param("beginDate") java.util.Date beginDate,
|
||||
@Param("endDate") java.util.Date endDate);
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcPriceSetDetail;
|
||||
|
||||
/**
|
||||
* 价格套餐明细 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcPriceSetDetailMapper
|
||||
{
|
||||
public PrcPriceSetDetail selectPrcPriceSetDetailById(Long psdId);
|
||||
|
||||
public List<PrcPriceSetDetail> selectPrcPriceSetDetailList(PrcPriceSetDetail detail);
|
||||
|
||||
public int insertPrcPriceSetDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int updatePrcPriceSetDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int deletePrcPriceSetDetailByIds(Long[] psdIds);
|
||||
|
||||
public int deletePrcPriceSetDetailByPriceSetId(Long priceSetId);
|
||||
|
||||
public int countProductByPriceSetId(Long priceSetId);
|
||||
|
||||
public int countByPriceSetId(Long priceSetId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcPriceSet;
|
||||
|
||||
/**
|
||||
* 价格套餐 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcPriceSetMapper
|
||||
{
|
||||
public PrcPriceSet selectPrcPriceSetById(Long priceSetId);
|
||||
|
||||
public List<PrcPriceSet> selectPrcPriceSetList(PrcPriceSet set);
|
||||
|
||||
public int insertPrcPriceSet(PrcPriceSet set);
|
||||
|
||||
public int updatePrcPriceSet(PrcPriceSet set);
|
||||
|
||||
public int updatePrcPriceSetStatus(PrcPriceSet set);
|
||||
|
||||
public int deletePrcPriceSetByIds(Long[] priceSetIds);
|
||||
|
||||
public int countByName(PrcPriceSet set);
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionDetail;
|
||||
|
||||
/**
|
||||
* 重量段明细 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcWeightSectionDetailMapper
|
||||
{
|
||||
public PrcWeightSectionDetail selectPrcWeightSectionDetailById(Long wsdId);
|
||||
|
||||
public List<PrcWeightSectionDetail> selectPrcWeightSectionDetailListByWstId(Long wstId);
|
||||
|
||||
public List<PrcWeightSectionDetail> selectPrcWeightSectionDetailList(PrcWeightSectionDetail detail);
|
||||
|
||||
public int insertPrcWeightSectionDetail(PrcWeightSectionDetail detail);
|
||||
|
||||
public int updatePrcWeightSectionDetail(PrcWeightSectionDetail detail);
|
||||
|
||||
public int deletePrcWeightSectionDetailByIds(Long[] wsdIds);
|
||||
|
||||
public int countByWstId(Long wstId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionTemplate;
|
||||
|
||||
/**
|
||||
* 重量段模板 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcWeightSectionTemplateMapper
|
||||
{
|
||||
public PrcWeightSectionTemplate selectPrcWeightSectionTemplateById(Long wstId);
|
||||
|
||||
public List<PrcWeightSectionTemplate> selectPrcWeightSectionTemplateList(PrcWeightSectionTemplate template);
|
||||
|
||||
public int insertPrcWeightSectionTemplate(PrcWeightSectionTemplate template);
|
||||
|
||||
public int updatePrcWeightSectionTemplate(PrcWeightSectionTemplate template);
|
||||
|
||||
public int deletePrcWeightSectionTemplateByIds(Long[] wstIds);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.XtdZoneCountry;
|
||||
|
||||
/**
|
||||
* 分区国家 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface XtdZoneCountryMapper
|
||||
{
|
||||
public XtdZoneCountry selectXtdZoneCountryById(Long zcId);
|
||||
|
||||
public List<XtdZoneCountry> selectXtdZoneCountryListByZdId(Long zdId);
|
||||
|
||||
public List<XtdZoneCountry> selectXtdZoneCountryList(XtdZoneCountry country);
|
||||
|
||||
public int insertXtdZoneCountry(XtdZoneCountry country);
|
||||
|
||||
public int updateXtdZoneCountry(XtdZoneCountry country);
|
||||
|
||||
public int deleteXtdZoneCountryByIds(Long[] zcIds);
|
||||
|
||||
public int countByZdId(Long zdId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.XtdZoneDivision;
|
||||
|
||||
/**
|
||||
* 分区区划 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface XtdZoneDivisionMapper
|
||||
{
|
||||
public XtdZoneDivision selectXtdZoneDivisionById(Long zdId);
|
||||
|
||||
public List<XtdZoneDivision> selectXtdZoneDivisionListByZsId(Long zsId);
|
||||
|
||||
public List<XtdZoneDivision> selectXtdZoneDivisionList(XtdZoneDivision division);
|
||||
|
||||
public int insertXtdZoneDivision(XtdZoneDivision division);
|
||||
|
||||
public int updateXtdZoneDivision(XtdZoneDivision division);
|
||||
|
||||
public int deleteXtdZoneDivisionByIds(Long[] zdIds);
|
||||
|
||||
public int countByZsId(Long zsId);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.XtdZoneScheme;
|
||||
|
||||
/**
|
||||
* 分区方案 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface XtdZoneSchemeMapper
|
||||
{
|
||||
public XtdZoneScheme selectXtdZoneSchemeById(Long zsId);
|
||||
|
||||
public List<XtdZoneScheme> selectXtdZoneSchemeList(XtdZoneScheme scheme);
|
||||
|
||||
public int insertXtdZoneScheme(XtdZoneScheme scheme);
|
||||
|
||||
public int updateXtdZoneScheme(XtdZoneScheme scheme);
|
||||
|
||||
public int deleteXtdZoneSchemeByIds(Long[] zsIds);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.price.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcCustomerPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSetCheckItem;
|
||||
import com.ruoyi.price.domain.PrcPriceSetDetail;
|
||||
|
||||
/**
|
||||
* 价格套餐 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IPrcPriceSetService
|
||||
{
|
||||
public PrcPriceSet selectPrcPriceSetById(Long priceSetId);
|
||||
|
||||
public List<PrcPriceSet> selectPrcPriceSetList(PrcPriceSet set);
|
||||
|
||||
public Long savePrcPriceSet(PrcPriceSet set);
|
||||
|
||||
public int updatePrcPriceSet(PrcPriceSet set);
|
||||
|
||||
public int deletePrcPriceSetByIds(Long[] priceSetIds);
|
||||
|
||||
public int submit(Long priceSetId, String updateBy);
|
||||
|
||||
public int approve(Long priceSetId, String updateBy);
|
||||
|
||||
public int reject(Long priceSetId, String updateBy);
|
||||
|
||||
public int disable(Long priceSetId, String updateBy);
|
||||
|
||||
public Long copy(Long priceSetId, String createBy);
|
||||
|
||||
public List<PrcPriceSetCheckItem> validate(PrcPriceSet set);
|
||||
|
||||
public List<PrcPriceSetDetail> selectDetailList(PrcPriceSetDetail detail);
|
||||
|
||||
public int insertDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int updateDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int deleteDetailByIds(Long[] psdIds);
|
||||
|
||||
public List<PrcCustomerPriceSet> selectCustomerList(PrcCustomerPriceSet customer);
|
||||
|
||||
public int insertCustomer(PrcCustomerPriceSet customer);
|
||||
|
||||
public int updateCustomer(PrcCustomerPriceSet customer);
|
||||
|
||||
public int deleteCustomerByIds(Long[] customerPricesetIds);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.price.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionDetail;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionTemplate;
|
||||
|
||||
/**
|
||||
* 重量段管理 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IPrcWeightService
|
||||
{
|
||||
public PrcWeightSectionTemplate selectPrcWeightSectionTemplateById(Long wstId);
|
||||
|
||||
public List<PrcWeightSectionTemplate> selectPrcWeightSectionTemplateList(PrcWeightSectionTemplate template);
|
||||
|
||||
public int insertPrcWeightSectionTemplate(PrcWeightSectionTemplate template);
|
||||
|
||||
public int updatePrcWeightSectionTemplate(PrcWeightSectionTemplate template);
|
||||
|
||||
public int deletePrcWeightSectionTemplateByIds(Long[] wstIds);
|
||||
|
||||
public PrcWeightSectionDetail selectPrcWeightSectionDetailById(Long wsdId);
|
||||
|
||||
public List<PrcWeightSectionDetail> selectPrcWeightSectionDetailList(PrcWeightSectionDetail detail);
|
||||
|
||||
public int insertPrcWeightSectionDetail(PrcWeightSectionDetail detail);
|
||||
|
||||
public int updatePrcWeightSectionDetail(PrcWeightSectionDetail detail);
|
||||
|
||||
public int deletePrcWeightSectionDetailByIds(Long[] wsdIds);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.price.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.XtdZoneCountry;
|
||||
import com.ruoyi.price.domain.XtdZoneDivision;
|
||||
import com.ruoyi.price.domain.XtdZoneScheme;
|
||||
|
||||
/**
|
||||
* 分区管理 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IXtdZoneService
|
||||
{
|
||||
public XtdZoneScheme selectXtdZoneSchemeById(Long zsId);
|
||||
|
||||
public List<XtdZoneScheme> selectXtdZoneSchemeList(XtdZoneScheme scheme);
|
||||
|
||||
public int insertXtdZoneScheme(XtdZoneScheme scheme);
|
||||
|
||||
public int updateXtdZoneScheme(XtdZoneScheme scheme);
|
||||
|
||||
public int deleteXtdZoneSchemeByIds(Long[] zsIds);
|
||||
|
||||
public XtdZoneDivision selectXtdZoneDivisionById(Long zdId);
|
||||
|
||||
public List<XtdZoneDivision> selectXtdZoneDivisionList(XtdZoneDivision division);
|
||||
|
||||
public int insertXtdZoneDivision(XtdZoneDivision division);
|
||||
|
||||
public int updateXtdZoneDivision(XtdZoneDivision division);
|
||||
|
||||
public int deleteXtdZoneDivisionByIds(Long[] zdIds);
|
||||
|
||||
public XtdZoneCountry selectXtdZoneCountryById(Long zcId);
|
||||
|
||||
public List<XtdZoneCountry> selectXtdZoneCountryList(XtdZoneCountry country);
|
||||
|
||||
public int insertXtdZoneCountry(XtdZoneCountry country);
|
||||
|
||||
public int updateXtdZoneCountry(XtdZoneCountry country);
|
||||
|
||||
public int deleteXtdZoneCountryByIds(Long[] zcIds);
|
||||
}
|
||||
+751
@@ -0,0 +1,751 @@
|
||||
package com.ruoyi.price.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.price.domain.PrcCustomerPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSetCheckItem;
|
||||
import com.ruoyi.price.domain.PrcPriceSetDetail;
|
||||
import com.ruoyi.price.mapper.PrcCustomerPriceSetMapper;
|
||||
import com.ruoyi.price.mapper.PrcPriceSetDetailMapper;
|
||||
import com.ruoyi.price.mapper.PrcPriceSetMapper;
|
||||
import com.ruoyi.price.service.IPrcPriceSetService;
|
||||
|
||||
/**
|
||||
* 价格套餐 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
{
|
||||
private static final String STATUS_DRAFT = "D";
|
||||
private static final String STATUS_AUDIT = "A";
|
||||
private static final String STATUS_EFFECT = "E";
|
||||
private static final String STATUS_REJECT = "R";
|
||||
private static final String STATUS_STOP = "S";
|
||||
private static final String TYPE_FIXED = "FIXED";
|
||||
private static final String TYPE_DISCOUNT = "DISCOUNT";
|
||||
|
||||
@Autowired
|
||||
private PrcPriceSetMapper setMapper;
|
||||
|
||||
@Autowired
|
||||
private PrcPriceSetDetailMapper detailMapper;
|
||||
|
||||
@Autowired
|
||||
private PrcCustomerPriceSetMapper customerMapper;
|
||||
|
||||
@Override
|
||||
public PrcPriceSet selectPrcPriceSetById(Long priceSetId)
|
||||
{
|
||||
PrcPriceSet set = setMapper.selectPrcPriceSetById(priceSetId);
|
||||
if (set != null)
|
||||
{
|
||||
fillExpired(set);
|
||||
PrcPriceSetDetail query = new PrcPriceSetDetail();
|
||||
query.setPriceSetId(priceSetId);
|
||||
set.setDetails(detailMapper.selectPrcPriceSetDetailList(query));
|
||||
PrcCustomerPriceSet cquery = new PrcCustomerPriceSet();
|
||||
cquery.setPriceSetId(priceSetId);
|
||||
set.setCustomers(customerMapper.selectPrcCustomerPriceSetList(cquery));
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcPriceSet> selectPrcPriceSetList(PrcPriceSet set)
|
||||
{
|
||||
List<PrcPriceSet> list = setMapper.selectPrcPriceSetList(set);
|
||||
for (PrcPriceSet item : list)
|
||||
{
|
||||
fillExpired(item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long savePrcPriceSet(PrcPriceSet set)
|
||||
{
|
||||
validateBasic(set, false);
|
||||
if (set.getPriceSetId() == null)
|
||||
{
|
||||
if (StringUtils.isEmpty(set.getStatus()))
|
||||
{
|
||||
set.setStatus(STATUS_DRAFT);
|
||||
}
|
||||
if (!STATUS_DRAFT.equals(set.getStatus()) && !STATUS_AUDIT.equals(set.getStatus()))
|
||||
{
|
||||
set.setStatus(STATUS_DRAFT);
|
||||
}
|
||||
if (StringUtils.isEmpty(set.getSetType()))
|
||||
{
|
||||
set.setSetType(TYPE_FIXED);
|
||||
}
|
||||
setMapper.insertPrcPriceSet(set);
|
||||
if (StringUtils.isEmpty(set.getPriceSetCode()))
|
||||
{
|
||||
set.setPriceSetCode(String.format("SET%04d", set.getPriceSetId()));
|
||||
setMapper.updatePrcPriceSet(set);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PrcPriceSet db = requireSet(set.getPriceSetId());
|
||||
assertBasicEditable(db);
|
||||
set.setStatus(db.getStatus());
|
||||
setMapper.updatePrcPriceSet(set);
|
||||
}
|
||||
replaceChildren(set);
|
||||
if ("Y".equalsIgnoreCase(set.getSubmitFlag()))
|
||||
{
|
||||
submit(set.getPriceSetId(), set.getUpdateBy() != null ? set.getUpdateBy() : set.getCreateBy());
|
||||
}
|
||||
return set.getPriceSetId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePrcPriceSet(PrcPriceSet set)
|
||||
{
|
||||
PrcPriceSet db = requireSet(set.getPriceSetId());
|
||||
assertBasicEditable(db);
|
||||
validateBasic(set, false);
|
||||
set.setStatus(db.getStatus());
|
||||
return setMapper.updatePrcPriceSet(set);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int deletePrcPriceSetByIds(Long[] priceSetIds)
|
||||
{
|
||||
for (Long id : priceSetIds)
|
||||
{
|
||||
PrcPriceSet db = requireSet(id);
|
||||
if (!STATUS_DRAFT.equals(db.getStatus()) && !STATUS_REJECT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("仅草稿或驳回状态的套餐允许删除:" + displayName(db));
|
||||
}
|
||||
int bound = customerMapper.countByPriceSetId(id);
|
||||
if (bound > 0)
|
||||
{
|
||||
throw new ServiceException("套餐【" + displayName(db) + "】已绑定客户,请先解绑后再删除");
|
||||
}
|
||||
detailMapper.deletePrcPriceSetDetailByPriceSetId(id);
|
||||
}
|
||||
return setMapper.deletePrcPriceSetByIds(priceSetIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int submit(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (!STATUS_DRAFT.equals(db.getStatus()) && !STATUS_REJECT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("当前状态不允许提交审核");
|
||||
}
|
||||
PrcPriceSet payload = selectPrcPriceSetById(priceSetId);
|
||||
List<PrcPriceSetCheckItem> items = validate(payload);
|
||||
assertNoFail(items);
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_AUDIT);
|
||||
upd.setUpdateBy(updateBy);
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int approve(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (!STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("仅审核中的套餐可以生效");
|
||||
}
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_EFFECT);
|
||||
upd.setUpdateBy(updateBy);
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int reject(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (!STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("仅审核中的套餐可以驳回");
|
||||
}
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_REJECT);
|
||||
upd.setUpdateBy(updateBy);
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int disable(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (!STATUS_EFFECT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("仅生效中的套餐可以停用");
|
||||
}
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_STOP);
|
||||
upd.setUpdateBy(updateBy);
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long copy(Long priceSetId, String createBy)
|
||||
{
|
||||
PrcPriceSet src = selectPrcPriceSetById(priceSetId);
|
||||
if (src == null)
|
||||
{
|
||||
throw new ServiceException("套餐不存在");
|
||||
}
|
||||
PrcPriceSet copy = new PrcPriceSet();
|
||||
copy.setPriceSetName(src.getPriceSetName() + "-副本");
|
||||
copy.setPriceSetNote(src.getPriceSetNote());
|
||||
copy.setSetType(src.getSetType());
|
||||
copy.setDefaultDiscount(src.getDefaultDiscount());
|
||||
copy.setDefaultType(src.getDefaultType());
|
||||
copy.setCalculateSign(src.getCalculateSign());
|
||||
copy.setEffectiveDate(src.getEffectiveDate());
|
||||
copy.setExpireDate(src.getExpireDate());
|
||||
copy.setStatus(STATUS_DRAFT);
|
||||
copy.setTmsId(src.getTmsId());
|
||||
copy.setCreateBy(createBy);
|
||||
List<PrcPriceSetDetail> details = new ArrayList<PrcPriceSetDetail>();
|
||||
if (src.getDetails() != null)
|
||||
{
|
||||
for (PrcPriceSetDetail d : src.getDetails())
|
||||
{
|
||||
PrcPriceSetDetail nd = new PrcPriceSetDetail();
|
||||
nd.setProductCode(d.getProductCode());
|
||||
nd.setProductName(d.getProductName());
|
||||
nd.setCountryCode(d.getCountryCode());
|
||||
nd.setCountryName(d.getCountryName());
|
||||
nd.setZdId(d.getZdId());
|
||||
nd.setWsdId(d.getWsdId());
|
||||
nd.setWeightLabel(d.getWeightLabel());
|
||||
nd.setFvValue(d.getFvValue());
|
||||
nd.setFvRegistrationFee(d.getFvRegistrationFee());
|
||||
nd.setDiscountValue(d.getDiscountValue());
|
||||
nd.setPrId(d.getPrId());
|
||||
details.add(nd);
|
||||
}
|
||||
}
|
||||
copy.setDetails(details);
|
||||
copy.setCustomers(new ArrayList<PrcCustomerPriceSet>());
|
||||
return savePrcPriceSet(copy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcPriceSetCheckItem> validate(PrcPriceSet set)
|
||||
{
|
||||
List<PrcPriceSetCheckItem> items = new ArrayList<PrcPriceSetCheckItem>();
|
||||
if (set.getPriceSetId() != null && (set.getDetails() == null || set.getCustomers() == null))
|
||||
{
|
||||
PrcPriceSet db = selectPrcPriceSetById(set.getPriceSetId());
|
||||
if (db != null)
|
||||
{
|
||||
if (StringUtils.isEmpty(set.getPriceSetName()))
|
||||
{
|
||||
set.setPriceSetName(db.getPriceSetName());
|
||||
}
|
||||
if (set.getSetType() == null)
|
||||
{
|
||||
set.setSetType(db.getSetType());
|
||||
}
|
||||
if (set.getEffectiveDate() == null)
|
||||
{
|
||||
set.setEffectiveDate(db.getEffectiveDate());
|
||||
}
|
||||
if (set.getExpireDate() == null)
|
||||
{
|
||||
set.setExpireDate(db.getExpireDate());
|
||||
}
|
||||
if (set.getDefaultDiscount() == null)
|
||||
{
|
||||
set.setDefaultDiscount(db.getDefaultDiscount());
|
||||
}
|
||||
if (set.getDetails() == null)
|
||||
{
|
||||
set.setDetails(db.getDetails());
|
||||
}
|
||||
if (set.getCustomers() == null)
|
||||
{
|
||||
set.setCustomers(db.getCustomers());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int nameCount = setMapper.countByName(set);
|
||||
if (StringUtils.isEmpty(set.getPriceSetName()))
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("套餐名称是否重复", "FAIL", "套餐名称不能为空"));
|
||||
}
|
||||
else if (nameCount > 0)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("套餐名称是否重复", "FAIL", "当前名称已被占用"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("套餐名称是否重复", "PASS", "当前名称未占用"));
|
||||
}
|
||||
|
||||
if (set.getEffectiveDate() == null)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("生效日期 ≤ 失效日期", "FAIL", "生效日期不能为空"));
|
||||
}
|
||||
else if (set.getExpireDate() != null && set.getEffectiveDate().after(set.getExpireDate()))
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("生效日期 ≤ 失效日期", "FAIL", "生效日期不能晚于失效日期"));
|
||||
}
|
||||
else
|
||||
{
|
||||
String msg = DateUtils.parseDateToStr("yyyy-MM-dd", set.getEffectiveDate())
|
||||
+ " ≤ "
|
||||
+ (set.getExpireDate() == null ? "长期" : DateUtils.parseDateToStr("yyyy-MM-dd", set.getExpireDate()));
|
||||
items.add(new PrcPriceSetCheckItem("生效日期 ≤ 失效日期", "PASS", msg));
|
||||
}
|
||||
|
||||
String setType = StringUtils.isEmpty(set.getSetType()) ? TYPE_FIXED : set.getSetType();
|
||||
List<PrcPriceSetDetail> details = filterDetails(set.getDetails());
|
||||
if (TYPE_FIXED.equals(setType))
|
||||
{
|
||||
int incomplete = 0;
|
||||
for (PrcPriceSetDetail d : details)
|
||||
{
|
||||
if (StringUtils.isEmpty(d.getProductCode()) || StringUtils.isEmpty(d.getCountryCode())
|
||||
|| (d.getWsdId() == null && StringUtils.isEmpty(d.getWeightLabel()))
|
||||
|| d.getFvValue() == null || d.getFvRegistrationFee() == null)
|
||||
{
|
||||
incomplete++;
|
||||
}
|
||||
}
|
||||
if (details.isEmpty())
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("FIXED 明细完整性", "FAIL", "固定价模式至少需要 1 条明细"));
|
||||
}
|
||||
else if (incomplete > 0)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("FIXED 明细完整性", "FAIL", incomplete + " 条明细缺少产品/国家/重量段/运费/挂号费"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("FIXED 明细完整性", "PASS", details.size() + " 条明细,运费与挂号费均填写"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (set.getDefaultDiscount() == null
|
||||
|| set.getDefaultDiscount().compareTo(BigDecimal.ONE) < 0
|
||||
|| set.getDefaultDiscount().compareTo(new BigDecimal("99")) > 0)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("DISCOUNT 默认折扣", "FAIL", "折扣模式默认折扣需在 1~99"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("DISCOUNT 默认折扣", "PASS", "默认折扣 " + set.getDefaultDiscount().stripTrailingZeros().toPlainString() + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> uniq = new HashSet<String>();
|
||||
boolean dup = false;
|
||||
for (PrcPriceSetDetail d : details)
|
||||
{
|
||||
String key;
|
||||
if (TYPE_FIXED.equals(setType))
|
||||
{
|
||||
key = nvl(d.getProductCode()) + "|" + nvl(d.getCountryCode()) + "|"
|
||||
+ (d.getWsdId() != null ? d.getWsdId() : nvl(d.getWeightLabel()));
|
||||
}
|
||||
else
|
||||
{
|
||||
key = nvl(d.getProductCode());
|
||||
}
|
||||
if (!uniq.add(key) && StringUtils.isNotEmpty(d.getProductCode()))
|
||||
{
|
||||
dup = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dup)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("同产品同国家同重量段是否重复", "FAIL", "存在重复明细"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("同产品同国家同重量段是否重复", "PASS", "无重复明细"));
|
||||
}
|
||||
|
||||
List<PrcCustomerPriceSet> customers = filterCustomers(set.getCustomers());
|
||||
int overlap = 0;
|
||||
for (PrcCustomerPriceSet c : customers)
|
||||
{
|
||||
overlap += customerMapper.countOverlap(c.getCustomerId(), set.getPriceSetId(),
|
||||
c.getPrBegindate() != null ? c.getPrBegindate() : set.getEffectiveDate(),
|
||||
c.getPrEnddate() != null ? c.getPrEnddate() : set.getExpireDate());
|
||||
}
|
||||
if (overlap > 0)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("与同客户现有套餐是否冲突", "WARN", "存在 " + overlap + " 条与已生效套餐日期重叠的客户绑定,可共存但需确认优先级"));
|
||||
}
|
||||
else if (customers.isEmpty())
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("与同客户现有套餐是否冲突", "INFO", "暂未绑定客户,可后续补充"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("与同客户现有套餐是否冲突", "PASS", "未发现与已生效套餐的日期重叠"));
|
||||
}
|
||||
|
||||
if (TYPE_FIXED.equals(setType) && !details.isEmpty())
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("运费单价 vs 默认等级价偏差", "INFO", "默认等级价对照将在计费试算上线后自动计算"));
|
||||
}
|
||||
else if (TYPE_DISCOUNT.equals(setType))
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("运费单价 vs 默认等级价偏差", "INFO", "折扣模式按下单时默认等级价 × 折扣计费"));
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcPriceSetDetail> selectDetailList(PrcPriceSetDetail detail)
|
||||
{
|
||||
return detailMapper.selectPrcPriceSetDetailList(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertDetail(PrcPriceSetDetail detail)
|
||||
{
|
||||
PrcPriceSet db = requireSet(detail.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
validateDetail(db, detail);
|
||||
return detailMapper.insertPrcPriceSetDetail(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDetail(PrcPriceSetDetail detail)
|
||||
{
|
||||
PrcPriceSetDetail old = detailMapper.selectPrcPriceSetDetailById(detail.getPsdId());
|
||||
if (old == null)
|
||||
{
|
||||
throw new ServiceException("套餐明细不存在");
|
||||
}
|
||||
PrcPriceSet db = requireSet(old.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
detail.setPriceSetId(old.getPriceSetId());
|
||||
validateDetail(db, detail);
|
||||
return detailMapper.updatePrcPriceSetDetail(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteDetailByIds(Long[] psdIds)
|
||||
{
|
||||
for (Long id : psdIds)
|
||||
{
|
||||
PrcPriceSetDetail old = detailMapper.selectPrcPriceSetDetailById(id);
|
||||
if (old == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
PrcPriceSet db = requireSet(old.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
}
|
||||
return detailMapper.deletePrcPriceSetDetailByIds(psdIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcCustomerPriceSet> selectCustomerList(PrcCustomerPriceSet customer)
|
||||
{
|
||||
return customerMapper.selectPrcCustomerPriceSetList(customer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertCustomer(PrcCustomerPriceSet customer)
|
||||
{
|
||||
PrcPriceSet db = requireSet(customer.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
validateCustomer(customer, db);
|
||||
if (customer.getBindPriority() == null)
|
||||
{
|
||||
customer.setBindPriority(1);
|
||||
}
|
||||
return customerMapper.insertPrcCustomerPriceSet(customer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCustomer(PrcCustomerPriceSet customer)
|
||||
{
|
||||
PrcCustomerPriceSet old = customerMapper.selectPrcCustomerPriceSetById(customer.getCustomerPricesetId());
|
||||
if (old == null)
|
||||
{
|
||||
throw new ServiceException("客户绑定不存在");
|
||||
}
|
||||
PrcPriceSet db = requireSet(old.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
customer.setPriceSetId(old.getPriceSetId());
|
||||
validateCustomer(customer, db);
|
||||
return customerMapper.updatePrcCustomerPriceSet(customer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteCustomerByIds(Long[] customerPricesetIds)
|
||||
{
|
||||
for (Long id : customerPricesetIds)
|
||||
{
|
||||
PrcCustomerPriceSet old = customerMapper.selectPrcCustomerPriceSetById(id);
|
||||
if (old == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
PrcPriceSet db = requireSet(old.getPriceSetId());
|
||||
if (STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("审核中的套餐不允许解绑客户");
|
||||
}
|
||||
}
|
||||
return customerMapper.deletePrcCustomerPriceSetByIds(customerPricesetIds);
|
||||
}
|
||||
|
||||
private void replaceChildren(PrcPriceSet set)
|
||||
{
|
||||
if (set.getDetails() != null)
|
||||
{
|
||||
detailMapper.deletePrcPriceSetDetailByPriceSetId(set.getPriceSetId());
|
||||
for (PrcPriceSetDetail d : filterDetails(set.getDetails()))
|
||||
{
|
||||
validateDetail(set, d);
|
||||
d.setPsdId(null);
|
||||
d.setPriceSetId(set.getPriceSetId());
|
||||
detailMapper.insertPrcPriceSetDetail(d);
|
||||
}
|
||||
}
|
||||
if (set.getCustomers() != null)
|
||||
{
|
||||
customerMapper.deletePrcCustomerPriceSetByPriceSetId(set.getPriceSetId());
|
||||
for (PrcCustomerPriceSet c : filterCustomers(set.getCustomers()))
|
||||
{
|
||||
validateCustomer(c, set);
|
||||
c.setCustomerPricesetId(null);
|
||||
c.setPriceSetId(set.getPriceSetId());
|
||||
c.setCreateBy(set.getCreateBy());
|
||||
if (c.getBindPriority() == null)
|
||||
{
|
||||
c.setBindPriority(1);
|
||||
}
|
||||
customerMapper.insertPrcCustomerPriceSet(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void validateBasic(PrcPriceSet set, boolean strictSubmit)
|
||||
{
|
||||
if (StringUtils.isEmpty(set.getPriceSetName()))
|
||||
{
|
||||
throw new ServiceException("套餐名称不能为空");
|
||||
}
|
||||
if (set.getEffectiveDate() == null)
|
||||
{
|
||||
throw new ServiceException("生效日期不能为空");
|
||||
}
|
||||
if (set.getExpireDate() != null && set.getEffectiveDate().after(set.getExpireDate()))
|
||||
{
|
||||
throw new ServiceException("生效日期不能晚于失效日期");
|
||||
}
|
||||
if (TYPE_DISCOUNT.equals(set.getSetType()))
|
||||
{
|
||||
if (set.getDefaultDiscount() == null
|
||||
|| set.getDefaultDiscount().compareTo(BigDecimal.ONE) < 0
|
||||
|| set.getDefaultDiscount().compareTo(new BigDecimal("99")) > 0)
|
||||
{
|
||||
throw new ServiceException("折扣模式默认折扣需在 1~99");
|
||||
}
|
||||
}
|
||||
if (setMapper.countByName(set) > 0)
|
||||
{
|
||||
throw new ServiceException("套餐名称已存在");
|
||||
}
|
||||
if (strictSubmit)
|
||||
{
|
||||
assertNoFail(validate(set));
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDetail(PrcPriceSet set, PrcPriceSetDetail detail)
|
||||
{
|
||||
if (StringUtils.isEmpty(detail.getProductCode()))
|
||||
{
|
||||
throw new ServiceException("明细产品代码不能为空");
|
||||
}
|
||||
if (TYPE_FIXED.equals(set.getSetType()))
|
||||
{
|
||||
if (StringUtils.isEmpty(detail.getCountryCode()))
|
||||
{
|
||||
throw new ServiceException("固定价明细必须填写国家");
|
||||
}
|
||||
if (detail.getWsdId() == null && StringUtils.isEmpty(detail.getWeightLabel()))
|
||||
{
|
||||
throw new ServiceException("固定价明细必须填写重量段");
|
||||
}
|
||||
if (detail.getFvValue() == null)
|
||||
{
|
||||
throw new ServiceException("固定价明细必须填写运费单价");
|
||||
}
|
||||
if (detail.getFvRegistrationFee() == null)
|
||||
{
|
||||
throw new ServiceException("固定价明细必须填写挂号费");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(detail.getCountryCode()))
|
||||
{
|
||||
detail.setCountryCode(detail.getCountryCode().toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
private void validateCustomer(PrcCustomerPriceSet customer, PrcPriceSet set)
|
||||
{
|
||||
if (customer.getCustomerId() == null || customer.getCustomerId().longValue() <= 0)
|
||||
{
|
||||
throw new ServiceException("客户ID不能为空");
|
||||
}
|
||||
if (customer.getPrBegindate() == null)
|
||||
{
|
||||
customer.setPrBegindate(set.getEffectiveDate());
|
||||
}
|
||||
if (customer.getPrBegindate() == null)
|
||||
{
|
||||
throw new ServiceException("客户绑定生效日期不能为空");
|
||||
}
|
||||
if (customer.getPrEnddate() != null && customer.getPrBegindate().after(customer.getPrEnddate()))
|
||||
{
|
||||
throw new ServiceException("客户绑定生效日期不能晚于失效日期");
|
||||
}
|
||||
if (customer.getBindPriority() != null && customer.getBindPriority().intValue() < 1)
|
||||
{
|
||||
throw new ServiceException("优先级必须大于等于 1");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertBasicEditable(PrcPriceSet db)
|
||||
{
|
||||
if (STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("审核中的套餐不允许修改");
|
||||
}
|
||||
if (STATUS_STOP.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("已停用的套餐不允许修改,请使用复用新建");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertChildEditable(PrcPriceSet db)
|
||||
{
|
||||
if (STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("审核中的套餐不允许改明细或客户");
|
||||
}
|
||||
if (STATUS_STOP.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("已停用的套餐不允许改明细或客户");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertNoFail(List<PrcPriceSetCheckItem> items)
|
||||
{
|
||||
for (PrcPriceSetCheckItem item : items)
|
||||
{
|
||||
if ("FAIL".equals(item.getResult()))
|
||||
{
|
||||
throw new ServiceException(item.getItem() + ":" + item.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private PrcPriceSet requireSet(Long priceSetId)
|
||||
{
|
||||
PrcPriceSet db = setMapper.selectPrcPriceSetById(priceSetId);
|
||||
if (db == null)
|
||||
{
|
||||
throw new ServiceException("套餐不存在");
|
||||
}
|
||||
return db;
|
||||
}
|
||||
|
||||
private void fillExpired(PrcPriceSet set)
|
||||
{
|
||||
Date today = DateUtils.parseDate(DateUtils.getDate());
|
||||
boolean expired = STATUS_EFFECT.equals(set.getStatus())
|
||||
&& set.getExpireDate() != null
|
||||
&& today != null
|
||||
&& set.getExpireDate().before(today);
|
||||
set.setExpired(Boolean.valueOf(expired));
|
||||
}
|
||||
|
||||
private List<PrcPriceSetDetail> filterDetails(List<PrcPriceSetDetail> details)
|
||||
{
|
||||
List<PrcPriceSetDetail> list = new ArrayList<PrcPriceSetDetail>();
|
||||
if (details == null)
|
||||
{
|
||||
return list;
|
||||
}
|
||||
for (PrcPriceSetDetail d : details)
|
||||
{
|
||||
if (d != null && StringUtils.isNotEmpty(d.getProductCode()))
|
||||
{
|
||||
list.add(d);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<PrcCustomerPriceSet> filterCustomers(List<PrcCustomerPriceSet> customers)
|
||||
{
|
||||
List<PrcCustomerPriceSet> list = new ArrayList<PrcCustomerPriceSet>();
|
||||
if (customers == null)
|
||||
{
|
||||
return list;
|
||||
}
|
||||
for (PrcCustomerPriceSet c : customers)
|
||||
{
|
||||
if (c != null && c.getCustomerId() != null && c.getCustomerId().longValue() > 0)
|
||||
{
|
||||
list.add(c);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private String displayName(PrcPriceSet set)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(set.getPriceSetCode()))
|
||||
{
|
||||
return set.getPriceSetCode() + " " + set.getPriceSetName();
|
||||
}
|
||||
return set.getPriceSetName();
|
||||
}
|
||||
|
||||
private String nvl(String val)
|
||||
{
|
||||
return val == null ? "" : val;
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.price.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionDetail;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionTemplate;
|
||||
import com.ruoyi.price.mapper.PrcWeightSectionDetailMapper;
|
||||
import com.ruoyi.price.mapper.PrcWeightSectionTemplateMapper;
|
||||
import com.ruoyi.price.service.IPrcWeightService;
|
||||
|
||||
/**
|
||||
* 重量段管理 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class PrcWeightServiceImpl implements IPrcWeightService
|
||||
{
|
||||
@Autowired
|
||||
private PrcWeightSectionTemplateMapper templateMapper;
|
||||
|
||||
@Autowired
|
||||
private PrcWeightSectionDetailMapper detailMapper;
|
||||
|
||||
@Override
|
||||
public PrcWeightSectionTemplate selectPrcWeightSectionTemplateById(Long wstId)
|
||||
{
|
||||
PrcWeightSectionTemplate template = templateMapper.selectPrcWeightSectionTemplateById(wstId);
|
||||
if (template != null)
|
||||
{
|
||||
template.setDetailCount(detailMapper.countByWstId(wstId));
|
||||
}
|
||||
return template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcWeightSectionTemplate> selectPrcWeightSectionTemplateList(PrcWeightSectionTemplate template)
|
||||
{
|
||||
List<PrcWeightSectionTemplate> list = templateMapper.selectPrcWeightSectionTemplateList(template);
|
||||
for (PrcWeightSectionTemplate item : list)
|
||||
{
|
||||
item.setDetailCount(detailMapper.countByWstId(item.getWstId()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertPrcWeightSectionTemplate(PrcWeightSectionTemplate template)
|
||||
{
|
||||
if (StringUtils.isEmpty(template.getSsCode()))
|
||||
{
|
||||
template.setSsCode("on");
|
||||
}
|
||||
return templateMapper.insertPrcWeightSectionTemplate(template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePrcWeightSectionTemplate(PrcWeightSectionTemplate template)
|
||||
{
|
||||
// ss_code=on 时仍允许编辑(当前阶段)
|
||||
return templateMapper.updatePrcWeightSectionTemplate(template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePrcWeightSectionTemplateByIds(Long[] wstIds)
|
||||
{
|
||||
return templateMapper.deletePrcWeightSectionTemplateByIds(wstIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrcWeightSectionDetail selectPrcWeightSectionDetailById(Long wsdId)
|
||||
{
|
||||
return detailMapper.selectPrcWeightSectionDetailById(wsdId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcWeightSectionDetail> selectPrcWeightSectionDetailList(PrcWeightSectionDetail detail)
|
||||
{
|
||||
return detailMapper.selectPrcWeightSectionDetailList(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertPrcWeightSectionDetail(PrcWeightSectionDetail detail)
|
||||
{
|
||||
validateWeightRange(detail);
|
||||
return detailMapper.insertPrcWeightSectionDetail(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePrcWeightSectionDetail(PrcWeightSectionDetail detail)
|
||||
{
|
||||
validateWeightRange(detail);
|
||||
return detailMapper.updatePrcWeightSectionDetail(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePrcWeightSectionDetailByIds(Long[] wsdIds)
|
||||
{
|
||||
return detailMapper.deletePrcWeightSectionDetailByIds(wsdIds);
|
||||
}
|
||||
|
||||
private void validateWeightRange(PrcWeightSectionDetail detail)
|
||||
{
|
||||
if (detail.getWlStartweight() == null || detail.getWlEndweight() == null)
|
||||
{
|
||||
throw new ServiceException("起始重量和结束重量不能为空");
|
||||
}
|
||||
if (detail.getWlStartweight().compareTo(detail.getWlEndweight()) >= 0)
|
||||
{
|
||||
throw new ServiceException("起始重量必须小于结束重量");
|
||||
}
|
||||
}
|
||||
}
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
package com.ruoyi.price.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.price.domain.XtdZoneCountry;
|
||||
import com.ruoyi.price.domain.XtdZoneDivision;
|
||||
import com.ruoyi.price.domain.XtdZoneScheme;
|
||||
import com.ruoyi.price.mapper.XtdZoneCountryMapper;
|
||||
import com.ruoyi.price.mapper.XtdZoneDivisionMapper;
|
||||
import com.ruoyi.price.mapper.XtdZoneSchemeMapper;
|
||||
import com.ruoyi.price.service.IXtdZoneService;
|
||||
|
||||
/**
|
||||
* 分区管理 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class XtdZoneServiceImpl implements IXtdZoneService
|
||||
{
|
||||
@Autowired
|
||||
private XtdZoneSchemeMapper schemeMapper;
|
||||
|
||||
@Autowired
|
||||
private XtdZoneDivisionMapper divisionMapper;
|
||||
|
||||
@Autowired
|
||||
private XtdZoneCountryMapper countryMapper;
|
||||
|
||||
@Override
|
||||
public XtdZoneScheme selectXtdZoneSchemeById(Long zsId)
|
||||
{
|
||||
XtdZoneScheme scheme = schemeMapper.selectXtdZoneSchemeById(zsId);
|
||||
if (scheme != null)
|
||||
{
|
||||
scheme.setDivisionCount(divisionMapper.countByZsId(zsId));
|
||||
}
|
||||
return scheme;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XtdZoneScheme> selectXtdZoneSchemeList(XtdZoneScheme scheme)
|
||||
{
|
||||
List<XtdZoneScheme> list = schemeMapper.selectXtdZoneSchemeList(scheme);
|
||||
for (XtdZoneScheme item : list)
|
||||
{
|
||||
item.setDivisionCount(divisionMapper.countByZsId(item.getZsId()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertXtdZoneScheme(XtdZoneScheme scheme)
|
||||
{
|
||||
if (StringUtils.isEmpty(scheme.getSsCode()))
|
||||
{
|
||||
scheme.setSsCode("on");
|
||||
}
|
||||
return schemeMapper.insertXtdZoneScheme(scheme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateXtdZoneScheme(XtdZoneScheme scheme)
|
||||
{
|
||||
return schemeMapper.updateXtdZoneScheme(scheme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteXtdZoneSchemeByIds(Long[] zsIds)
|
||||
{
|
||||
for (Long zsId : zsIds)
|
||||
{
|
||||
int count = divisionMapper.countByZsId(zsId);
|
||||
if (count > 0)
|
||||
{
|
||||
XtdZoneScheme scheme = schemeMapper.selectXtdZoneSchemeById(zsId);
|
||||
String name = scheme != null ? scheme.getZsName() : String.valueOf(zsId);
|
||||
throw new ServiceException("分区方案【" + name + "】存在区划明细,不允许删除");
|
||||
}
|
||||
}
|
||||
return schemeMapper.deleteXtdZoneSchemeByIds(zsIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XtdZoneDivision selectXtdZoneDivisionById(Long zdId)
|
||||
{
|
||||
XtdZoneDivision division = divisionMapper.selectXtdZoneDivisionById(zdId);
|
||||
if (division != null)
|
||||
{
|
||||
division.setCountryCount(countryMapper.countByZdId(zdId));
|
||||
}
|
||||
return division;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XtdZoneDivision> selectXtdZoneDivisionList(XtdZoneDivision division)
|
||||
{
|
||||
List<XtdZoneDivision> list = divisionMapper.selectXtdZoneDivisionList(division);
|
||||
for (XtdZoneDivision item : list)
|
||||
{
|
||||
item.setCountryCount(countryMapper.countByZdId(item.getZdId()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertXtdZoneDivision(XtdZoneDivision division)
|
||||
{
|
||||
return divisionMapper.insertXtdZoneDivision(division);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateXtdZoneDivision(XtdZoneDivision division)
|
||||
{
|
||||
return divisionMapper.updateXtdZoneDivision(division);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteXtdZoneDivisionByIds(Long[] zdIds)
|
||||
{
|
||||
return divisionMapper.deleteXtdZoneDivisionByIds(zdIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XtdZoneCountry selectXtdZoneCountryById(Long zcId)
|
||||
{
|
||||
return countryMapper.selectXtdZoneCountryById(zcId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XtdZoneCountry> selectXtdZoneCountryList(XtdZoneCountry country)
|
||||
{
|
||||
return countryMapper.selectXtdZoneCountryList(country);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertXtdZoneCountry(XtdZoneCountry country)
|
||||
{
|
||||
if (StringUtils.isEmpty(country.getZcDividekind()))
|
||||
{
|
||||
country.setZcDividekind("C");
|
||||
}
|
||||
return countryMapper.insertXtdZoneCountry(country);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateXtdZoneCountry(XtdZoneCountry country)
|
||||
{
|
||||
return countryMapper.updateXtdZoneCountry(country);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteXtdZoneCountryByIds(Long[] zcIds)
|
||||
{
|
||||
return countryMapper.deleteXtdZoneCountryByIds(zcIds);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user