'修复中石化回调问题'

dev-discount
199901012 4 years ago
parent d541bea107
commit dbace0790d
  1. 10
      hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java
  2. 11
      hai-bweb/src/main/java/com/bweb/model/ImportCouponModel.java
  3. 5
      hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java
  4. 4
      hai-schedule/src/main/resources/dev/application.yml
  5. 41
      hai-service/src/main/java/com/hai/dao/HighCouponCodeMapper.java
  6. 42
      hai-service/src/main/java/com/hai/dao/HighCouponCodeSqlProvider.java
  7. 48
      hai-service/src/main/java/com/hai/entity/HighCouponCode.java
  8. 190
      hai-service/src/main/java/com/hai/entity/HighCouponCodeExample.java
  9. 13
      hai-service/src/main/java/com/hai/service/HighCouponCodeService.java
  10. 15
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java

@ -55,9 +55,19 @@ public class ImportCouponListener extends AnalysisEventListener<ImportCouponMode
return;
}
if (StringUtils.isNotBlank(importCouponModel.getCodeKey())) {
List<HighCouponCode> codeList = allCouponCode.stream().filter(o -> o.getCodeKey().equals(importCouponModel.getCodeKey())).collect(Collectors.toList());
if (codeList.size() > 0) {
importCouponModel.setErrorMessage("卡券编号id已存在");
errorData.add(importCouponModel);
return;
}
}
highCouponCode = new HighCouponCode();
highCouponCode.setCouponId(highCoupon.getId());
highCouponCode.setMerchantId(highCoupon.getMerchantId());
highCouponCode.setCodeKey(importCouponModel.getCodeKey());
highCouponCode.setSalesCode(importCouponModel.getSalesCode());
// 销售截止时间

@ -10,6 +10,9 @@ import com.alibaba.excel.annotation.format.DateTimeFormat;
*/
public class ImportCouponModel {
@ExcelProperty("卡券编号Id")
private String codeKey;
@ExcelProperty("卡券销售码")
private String salesCode;
@ -23,6 +26,14 @@ public class ImportCouponModel {
// 错误消息
private String errorMessage;
public String getCodeKey() {
return codeKey;
}
public void setCodeKey(String codeKey) {
this.codeKey = codeKey;
}
public String getSalesCode() {
return salesCode;
}

@ -39,7 +39,7 @@ public class SynchronizeCNPC {
@Resource
private SecSinopecConfigService secSinopecConfigService;
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
@Scheduled(cron="0 0/5 * * * ?") //每5分钟执行一次
public void certification() {
List<SecSinopecConfig> sinopecConfig = secSinopecConfigService.getListSinopecConfig(new HashMap<>());
@ -55,12 +55,13 @@ public class SynchronizeCNPC {
String token = data.getString("token");
Calendar instance = Calendar.getInstance();
instance.add(Calendar.DATE, 1);
instance.add(Calendar.MINUTE, -10);
Map<String,Object> bodyMap = new HashMap<>();
bodyMap.put("appId", config.getAppId());
bodyMap.put("pageNo", 1);
bodyMap.put("pageSize", 100);
bodyMap.put("pageSize", 2000);
bodyMap.put("startTime", instance.getTime());
bodyMap.put("endTime", new Date());
bodyMap.put("customerCode", config.getCode());

@ -9,8 +9,8 @@ debug: false
#datasource数据源设置
spring:
datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: hfkj
url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username: root
password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver

@ -40,21 +40,23 @@ public interface HighCouponCodeMapper extends HighCouponCodeMapperExt {
@Insert({
"insert into high_coupon_code (coupon_id, merchant_id, ",
"is_assign_agent, agent_id, ",
"store_id, child_order_id, ",
"sales_code, sales_end_time, ",
"use_end_time, create_time, ",
"receive_time, consume_time, ",
"`status`, operator_id, ",
"operator_name, ext_1, ",
"ext_2, ext_3)",
"code_key, sales_code, ",
"sales_end_time, use_end_time, ",
"create_time, receive_time, ",
"consume_time, `status`, ",
"operator_id, operator_name, ",
"ext_1, ext_2, ext_3)",
"values (#{couponId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ",
"#{isAssignAgent,jdbcType=BIT}, #{agentId,jdbcType=BIGINT}, ",
"#{storeId,jdbcType=BIGINT}, #{childOrderId,jdbcType=BIGINT}, ",
"#{salesCode,jdbcType=VARCHAR}, #{salesEndTime,jdbcType=TIMESTAMP}, ",
"#{useEndTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{receiveTime,jdbcType=TIMESTAMP}, #{consumeTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{codeKey,jdbcType=VARCHAR}, #{salesCode,jdbcType=VARCHAR}, ",
"#{salesEndTime,jdbcType=TIMESTAMP}, #{useEndTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{receiveTime,jdbcType=TIMESTAMP}, ",
"#{consumeTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCouponCode record);
@ -68,8 +70,11 @@ public interface HighCouponCodeMapper extends HighCouponCodeMapperExt {
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT),
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="is_assign_agent", property="isAssignAgent", jdbcType=JdbcType.BIT),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="code_key", property="codeKey", jdbcType=JdbcType.VARCHAR),
@Result(column="sales_code", property="salesCode", jdbcType=JdbcType.VARCHAR),
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="use_end_time", property="useEndTime", jdbcType=JdbcType.TIMESTAMP),
@ -87,9 +92,9 @@ public interface HighCouponCodeMapper extends HighCouponCodeMapperExt {
@Select({
"select",
"id, coupon_id, merchant_id, store_id, child_order_id, sales_code, sales_end_time, ",
"use_end_time, create_time, receive_time, consume_time, `status`, operator_id, ",
"operator_name, ext_1, ext_2, ext_3",
"id, coupon_id, merchant_id, is_assign_agent, agent_id, store_id, child_order_id, ",
"code_key, sales_code, sales_end_time, use_end_time, create_time, receive_time, ",
"consume_time, `status`, operator_id, operator_name, ext_1, ext_2, ext_3",
"from high_coupon_code",
"where id = #{id,jdbcType=BIGINT}"
})
@ -97,8 +102,11 @@ public interface HighCouponCodeMapper extends HighCouponCodeMapperExt {
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT),
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="is_assign_agent", property="isAssignAgent", jdbcType=JdbcType.BIT),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="code_key", property="codeKey", jdbcType=JdbcType.VARCHAR),
@Result(column="sales_code", property="salesCode", jdbcType=JdbcType.VARCHAR),
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="use_end_time", property="useEndTime", jdbcType=JdbcType.TIMESTAMP),
@ -127,8 +135,11 @@ public interface HighCouponCodeMapper extends HighCouponCodeMapperExt {
"update high_coupon_code",
"set coupon_id = #{couponId,jdbcType=BIGINT},",
"merchant_id = #{merchantId,jdbcType=BIGINT},",
"is_assign_agent = #{isAssignAgent,jdbcType=BIT},",
"agent_id = #{agentId,jdbcType=BIGINT},",
"store_id = #{storeId,jdbcType=BIGINT},",
"child_order_id = #{childOrderId,jdbcType=BIGINT},",
"code_key = #{codeKey,jdbcType=VARCHAR},",
"sales_code = #{salesCode,jdbcType=VARCHAR},",
"sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},",
"use_end_time = #{useEndTime,jdbcType=TIMESTAMP},",

@ -36,6 +36,14 @@ public class HighCouponCodeSqlProvider {
sql.VALUES("merchant_id", "#{merchantId,jdbcType=BIGINT}");
}
if (record.getIsAssignAgent() != null) {
sql.VALUES("is_assign_agent", "#{isAssignAgent,jdbcType=BIT}");
}
if (record.getAgentId() != null) {
sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}");
}
if (record.getStoreId() != null) {
sql.VALUES("store_id", "#{storeId,jdbcType=BIGINT}");
}
@ -44,6 +52,10 @@ public class HighCouponCodeSqlProvider {
sql.VALUES("child_order_id", "#{childOrderId,jdbcType=BIGINT}");
}
if (record.getCodeKey() != null) {
sql.VALUES("code_key", "#{codeKey,jdbcType=VARCHAR}");
}
if (record.getSalesCode() != null) {
sql.VALUES("sales_code", "#{salesCode,jdbcType=VARCHAR}");
}
@ -104,8 +116,11 @@ public class HighCouponCodeSqlProvider {
}
sql.SELECT("coupon_id");
sql.SELECT("merchant_id");
sql.SELECT("is_assign_agent");
sql.SELECT("agent_id");
sql.SELECT("store_id");
sql.SELECT("child_order_id");
sql.SELECT("code_key");
sql.SELECT("sales_code");
sql.SELECT("sales_end_time");
sql.SELECT("use_end_time");
@ -147,6 +162,14 @@ public class HighCouponCodeSqlProvider {
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}");
}
if (record.getIsAssignAgent() != null) {
sql.SET("is_assign_agent = #{record.isAssignAgent,jdbcType=BIT}");
}
if (record.getAgentId() != null) {
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
}
if (record.getStoreId() != null) {
sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}");
}
@ -155,6 +178,10 @@ public class HighCouponCodeSqlProvider {
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
}
if (record.getCodeKey() != null) {
sql.SET("code_key = #{record.codeKey,jdbcType=VARCHAR}");
}
if (record.getSalesCode() != null) {
sql.SET("sales_code = #{record.salesCode,jdbcType=VARCHAR}");
}
@ -214,8 +241,11 @@ public class HighCouponCodeSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}");
sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}");
sql.SET("is_assign_agent = #{record.isAssignAgent,jdbcType=BIT}");
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}");
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
sql.SET("code_key = #{record.codeKey,jdbcType=VARCHAR}");
sql.SET("sales_code = #{record.salesCode,jdbcType=VARCHAR}");
sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}");
sql.SET("use_end_time = #{record.useEndTime,jdbcType=TIMESTAMP}");
@ -246,6 +276,14 @@ public class HighCouponCodeSqlProvider {
sql.SET("merchant_id = #{merchantId,jdbcType=BIGINT}");
}
if (record.getIsAssignAgent() != null) {
sql.SET("is_assign_agent = #{isAssignAgent,jdbcType=BIT}");
}
if (record.getAgentId() != null) {
sql.SET("agent_id = #{agentId,jdbcType=BIGINT}");
}
if (record.getStoreId() != null) {
sql.SET("store_id = #{storeId,jdbcType=BIGINT}");
}
@ -254,6 +292,10 @@ public class HighCouponCodeSqlProvider {
sql.SET("child_order_id = #{childOrderId,jdbcType=BIGINT}");
}
if (record.getCodeKey() != null) {
sql.SET("code_key = #{codeKey,jdbcType=VARCHAR}");
}
if (record.getSalesCode() != null) {
sql.SET("sales_code = #{salesCode,jdbcType=VARCHAR}");
}

@ -28,6 +28,16 @@ public class HighCouponCode implements Serializable {
*/
private Long merchantId;
/**
* 是否分配代理商
*/
private Boolean isAssignAgent;
/**
* 代理商id
*/
private Long agentId;
/**
* (消核门店) 门店id
*/
@ -38,6 +48,11 @@ public class HighCouponCode implements Serializable {
*/
private Long childOrderId;
/**
* 码key
*/
private String codeKey;
/**
* 销售码
*/
@ -115,6 +130,22 @@ public class HighCouponCode implements Serializable {
this.merchantId = merchantId;
}
public Boolean getIsAssignAgent() {
return isAssignAgent;
}
public void setIsAssignAgent(Boolean isAssignAgent) {
this.isAssignAgent = isAssignAgent;
}
public Long getAgentId() {
return agentId;
}
public void setAgentId(Long agentId) {
this.agentId = agentId;
}
public Long getStoreId() {
return storeId;
}
@ -131,6 +162,14 @@ public class HighCouponCode implements Serializable {
this.childOrderId = childOrderId;
}
public String getCodeKey() {
return codeKey;
}
public void setCodeKey(String codeKey) {
this.codeKey = codeKey;
}
public String getSalesCode() {
return salesCode;
}
@ -242,8 +281,11 @@ public class HighCouponCode implements Serializable {
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId()))
&& (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId()))
&& (this.getIsAssignAgent() == null ? other.getIsAssignAgent() == null : this.getIsAssignAgent().equals(other.getIsAssignAgent()))
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
&& (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
&& (this.getChildOrderId() == null ? other.getChildOrderId() == null : this.getChildOrderId().equals(other.getChildOrderId()))
&& (this.getCodeKey() == null ? other.getCodeKey() == null : this.getCodeKey().equals(other.getCodeKey()))
&& (this.getSalesCode() == null ? other.getSalesCode() == null : this.getSalesCode().equals(other.getSalesCode()))
&& (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime()))
&& (this.getUseEndTime() == null ? other.getUseEndTime() == null : this.getUseEndTime().equals(other.getUseEndTime()))
@ -265,8 +307,11 @@ public class HighCouponCode implements Serializable {
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode());
result = prime * result + ((getIsAssignAgent() == null) ? 0 : getIsAssignAgent().hashCode());
result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
result = prime * result + ((getChildOrderId() == null) ? 0 : getChildOrderId().hashCode());
result = prime * result + ((getCodeKey() == null) ? 0 : getCodeKey().hashCode());
result = prime * result + ((getSalesCode() == null) ? 0 : getSalesCode().hashCode());
result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode());
result = prime * result + ((getUseEndTime() == null) ? 0 : getUseEndTime().hashCode());
@ -291,8 +336,11 @@ public class HighCouponCode implements Serializable {
sb.append(", id=").append(id);
sb.append(", couponId=").append(couponId);
sb.append(", merchantId=").append(merchantId);
sb.append(", isAssignAgent=").append(isAssignAgent);
sb.append(", agentId=").append(agentId);
sb.append(", storeId=").append(storeId);
sb.append(", childOrderId=").append(childOrderId);
sb.append(", codeKey=").append(codeKey);
sb.append(", salesCode=").append(salesCode);
sb.append(", salesEndTime=").append(salesEndTime);
sb.append(", useEndTime=").append(useEndTime);

@ -305,6 +305,126 @@ public class HighCouponCodeExample {
return (Criteria) this;
}
public Criteria andIsAssignAgentIsNull() {
addCriterion("is_assign_agent is null");
return (Criteria) this;
}
public Criteria andIsAssignAgentIsNotNull() {
addCriterion("is_assign_agent is not null");
return (Criteria) this;
}
public Criteria andIsAssignAgentEqualTo(Boolean value) {
addCriterion("is_assign_agent =", value, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentNotEqualTo(Boolean value) {
addCriterion("is_assign_agent <>", value, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentGreaterThan(Boolean value) {
addCriterion("is_assign_agent >", value, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_assign_agent >=", value, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentLessThan(Boolean value) {
addCriterion("is_assign_agent <", value, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentLessThanOrEqualTo(Boolean value) {
addCriterion("is_assign_agent <=", value, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentIn(List<Boolean> values) {
addCriterion("is_assign_agent in", values, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentNotIn(List<Boolean> values) {
addCriterion("is_assign_agent not in", values, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentBetween(Boolean value1, Boolean value2) {
addCriterion("is_assign_agent between", value1, value2, "isAssignAgent");
return (Criteria) this;
}
public Criteria andIsAssignAgentNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_assign_agent not between", value1, value2, "isAssignAgent");
return (Criteria) this;
}
public Criteria andAgentIdIsNull() {
addCriterion("agent_id is null");
return (Criteria) this;
}
public Criteria andAgentIdIsNotNull() {
addCriterion("agent_id is not null");
return (Criteria) this;
}
public Criteria andAgentIdEqualTo(Long value) {
addCriterion("agent_id =", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotEqualTo(Long value) {
addCriterion("agent_id <>", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdGreaterThan(Long value) {
addCriterion("agent_id >", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdGreaterThanOrEqualTo(Long value) {
addCriterion("agent_id >=", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdLessThan(Long value) {
addCriterion("agent_id <", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdLessThanOrEqualTo(Long value) {
addCriterion("agent_id <=", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdIn(List<Long> values) {
addCriterion("agent_id in", values, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotIn(List<Long> values) {
addCriterion("agent_id not in", values, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdBetween(Long value1, Long value2) {
addCriterion("agent_id between", value1, value2, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotBetween(Long value1, Long value2) {
addCriterion("agent_id not between", value1, value2, "agentId");
return (Criteria) this;
}
public Criteria andStoreIdIsNull() {
addCriterion("store_id is null");
return (Criteria) this;
@ -425,6 +545,76 @@ public class HighCouponCodeExample {
return (Criteria) this;
}
public Criteria andCodeKeyIsNull() {
addCriterion("code_key is null");
return (Criteria) this;
}
public Criteria andCodeKeyIsNotNull() {
addCriterion("code_key is not null");
return (Criteria) this;
}
public Criteria andCodeKeyEqualTo(String value) {
addCriterion("code_key =", value, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyNotEqualTo(String value) {
addCriterion("code_key <>", value, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyGreaterThan(String value) {
addCriterion("code_key >", value, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyGreaterThanOrEqualTo(String value) {
addCriterion("code_key >=", value, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyLessThan(String value) {
addCriterion("code_key <", value, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyLessThanOrEqualTo(String value) {
addCriterion("code_key <=", value, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyLike(String value) {
addCriterion("code_key like", value, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyNotLike(String value) {
addCriterion("code_key not like", value, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyIn(List<String> values) {
addCriterion("code_key in", values, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyNotIn(List<String> values) {
addCriterion("code_key not in", values, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyBetween(String value1, String value2) {
addCriterion("code_key between", value1, value2, "codeKey");
return (Criteria) this;
}
public Criteria andCodeKeyNotBetween(String value1, String value2) {
addCriterion("code_key not between", value1, value2, "codeKey");
return (Criteria) this;
}
public Criteria andSalesCodeIsNull() {
addCriterion("sales_code is null");
return (Criteria) this;

@ -45,10 +45,10 @@ public interface HighCouponCodeService {
/**
* @Author 胡锐
* @Description 中石化回调已使用的消核
* @Description 中石化回调已使用的码key
* @Date 2021/4/19 21:53
**/
void cnpcCallbackCouponCode(String salesCode,Date useTime);
void cnpcCallbackCouponCode(String codeKey,Date useTime);
/**
* @Author 胡锐
@ -62,7 +62,14 @@ public interface HighCouponCodeService {
* @Description 根据销售码查询
* @Date 2021/3/27 12:39
**/
HighCouponCode getCouponCodeBySalesCode(String code);
HighCouponCode getCouponCodeBySalesCode(String code);
/**
* @Author 胡锐
* @Description 根据销售码key查询
* @Date 2021/4/21 20:30
**/
HighCouponCode getCouponCodeByKey(String codeKey);
/**
* @Author 胡锐

@ -124,8 +124,8 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
@Override
@Transactional
public void cnpcCallbackCouponCode(String salesCode, Date useTime) {
HighCouponCode code = getCouponCodeBySalesCode(salesCode);
public void cnpcCallbackCouponCode(String codeKey, Date useTime) {
HighCouponCode code = getCouponCodeByKey(codeKey);
if (code != null && code.getStatus() != 3) {
code.setStatus(3);
code.setConsumeTime(useTime);
@ -175,6 +175,17 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
return null;
}
@Override
public HighCouponCode getCouponCodeByKey(String codeKey) {
HighCouponCodeExample example = new HighCouponCodeExample();
example.createCriteria().andCodeKeyEqualTo(codeKey);
List<HighCouponCode> codes = highCouponCodeMapper.selectByExample(example);
if (codes != null && codes.size() > 0) {
return codes.get(0);
}
return null;
}
@Override
public HighCouponCode getCouponCodeById(Long id) {
return highCouponCodeMapper.selectByPrimaryKey(id);

Loading…
Cancel
Save