From dbace0790da26e7f8634fe583bc964a86984db2d Mon Sep 17 00:00:00 2001 From: 199901012 Date: Wed, 21 Apr 2021 21:26:13 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E4=B8=AD=E7=9F=B3=E5=8C=96?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excelListener/ImportCouponListener.java | 10 + .../com/bweb/model/ImportCouponModel.java | 11 + .../com/hai/schedule/SynchronizeCNPC.java | 5 +- .../src/main/resources/dev/application.yml | 4 +- .../com/hai/dao/HighCouponCodeMapper.java | 41 ++-- .../hai/dao/HighCouponCodeSqlProvider.java | 42 ++++ .../java/com/hai/entity/HighCouponCode.java | 48 +++++ .../com/hai/entity/HighCouponCodeExample.java | 190 ++++++++++++++++++ .../hai/service/HighCouponCodeService.java | 13 +- .../impl/HighCouponCodeServiceImpl.java | 15 +- 10 files changed, 355 insertions(+), 24 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java b/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java index c80b39fc..b6338b06 100644 --- a/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java +++ b/hai-bweb/src/main/java/com/bweb/excelListener/ImportCouponListener.java @@ -55,9 +55,19 @@ public class ImportCouponListener extends AnalysisEventListener 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()); // 销售截止时间 diff --git a/hai-bweb/src/main/java/com/bweb/model/ImportCouponModel.java b/hai-bweb/src/main/java/com/bweb/model/ImportCouponModel.java index 76a687f8..04bec506 100644 --- a/hai-bweb/src/main/java/com/bweb/model/ImportCouponModel.java +++ b/hai-bweb/src/main/java/com/bweb/model/ImportCouponModel.java @@ -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; } diff --git a/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java b/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java index 3ce728ed..bf135899 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java +++ b/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java @@ -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 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 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()); diff --git a/hai-schedule/src/main/resources/dev/application.yml b/hai-schedule/src/main/resources/dev/application.yml index 481490a2..ff2ce013 100644 --- a/hai-schedule/src/main/resources/dev/application.yml +++ b/hai-schedule/src/main/resources/dev/application.yml @@ -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 diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapper.java b/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapper.java index 1cce2606..250700b5 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapper.java @@ -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},", diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponCodeSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighCouponCodeSqlProvider.java index a75ff598..fcc462cf 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponCodeSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponCodeSqlProvider.java @@ -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}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighCouponCode.java b/hai-service/src/main/java/com/hai/entity/HighCouponCode.java index 5f6c8b3d..3ccbdd74 100644 --- a/hai-service/src/main/java/com/hai/entity/HighCouponCode.java +++ b/hai-service/src/main/java/com/hai/entity/HighCouponCode.java @@ -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); diff --git a/hai-service/src/main/java/com/hai/entity/HighCouponCodeExample.java b/hai-service/src/main/java/com/hai/entity/HighCouponCodeExample.java index 1f8b6c59..88b0b2ae 100644 --- a/hai-service/src/main/java/com/hai/entity/HighCouponCodeExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighCouponCodeExample.java @@ -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 values) { + addCriterion("is_assign_agent in", values, "isAssignAgent"); + return (Criteria) this; + } + + public Criteria andIsAssignAgentNotIn(List 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 values) { + addCriterion("agent_id in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotIn(List 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 values) { + addCriterion("code_key in", values, "codeKey"); + return (Criteria) this; + } + + public Criteria andCodeKeyNotIn(List 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; diff --git a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java index afd91cdc..7faeb247 100644 --- a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java +++ b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java @@ -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 胡锐 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java index 0a4acb38..b3c43317 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java @@ -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 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);