diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java b/hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java index 38a8914f..9d36e026 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java @@ -58,6 +58,15 @@ public class HighAgentController { throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); } +// if ( +// StringUtils.isBlank(highAgentModel.getSecUser().getPassword()) +// || StringUtils.isBlank(highAgentModel.getSecUser().getUserName()) +// || StringUtils.isBlank(highAgentModel.getSecUser().getUserName()) +// +// ) + + + // if (highAgentModel.getAgentAddress() == null // || StringUtils.isBlank(highMerchantStore.getStoreKey()) // || StringUtils.isBlank(highMerchantStore.getSecUser().getPassword()) @@ -93,10 +102,10 @@ public class HighAgentController { // // highUserService.updateUser(reqBody); - return ResponseMsgUtil.success("修改成功"); + return ResponseMsgUtil.success("新增成功"); } catch (Exception e) { - log.error("BsPositionController --> addPosition() error!", e); + log.error("HighAgentController --> insertAgent() error!", e); return ResponseMsgUtil.exception(e); } } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java index b845629b..f8211039 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -108,7 +108,7 @@ public class HighCouponController { } // 是否赠送卡卷 - if (highCoupon.getIsPresent() == true) { + if (highCoupon.getIsPresent()) { if (highCoupon.getHandselCouponId() == null || highCoupon.getHandselCouponId().size() == 0) { log.error("HighCouponController -> insertCoupon() error!","请选择赠送卡卷名单"); throw ErrorHelp.genException(SysCode.System, ErrorCode.SELECT_HANDSEL_COUPON_ERROR, ""); @@ -195,7 +195,7 @@ public class HighCouponController { } - if (highCouponService.getCouponByCouponName(map) > 0 && coupon.getCouponName() != highCoupon.getCouponName()) { + if (highCouponService.getCouponByCouponName(map) > 0 && !coupon.getCouponName().equals(highCoupon.getCouponName())) { log.error("HighCouponController -> updateCoupon() error!","参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_CODE_NAME, ""); } diff --git a/hai-bweb/src/main/java/com/bweb/controller/SecSinopecConfigController.java b/hai-bweb/src/main/java/com/bweb/controller/SecSinopecConfigController.java index e6f1174f..7d97f7e2 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/SecSinopecConfigController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/SecSinopecConfigController.java @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.text.SimpleDateFormat; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -66,6 +67,8 @@ public class SecSinopecConfigController { try { + reqBody.setCreateTime(new Date()); + secSinopecConfigService.insertSinopec(reqBody); return ResponseMsgUtil.success("成功"); @@ -95,6 +98,8 @@ public class SecSinopecConfigController { throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, ""); } + reqBody.setCreateTime(secSinopecConfig.getCreateTime()); + secSinopecConfigService.updateSinopec(reqBody); return ResponseMsgUtil.success("修改成功"); diff --git a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java index 192ef90d..67cbeff8 100644 --- a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java +++ b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java @@ -40,9 +40,11 @@ public interface SecSinopecConfigMapper extends SecSinopecConfigMapperExt { @Insert({ "insert into sec_sinopec_config (app_id, app_secret, ", - "code)", + "code, create_time, ", + "SignKey)", "values (#{appId,jdbcType=VARCHAR}, #{appSecret,jdbcType=VARCHAR}, ", - "#{code,jdbcType=VARCHAR})" + "#{code,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{signkey,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(SecSinopecConfig record); @@ -56,13 +58,15 @@ public interface SecSinopecConfigMapper extends SecSinopecConfigMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), @Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR), @Result(column="app_secret", property="appSecret", jdbcType=JdbcType.VARCHAR), - @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR) + @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="SignKey", property="signkey", jdbcType=JdbcType.VARCHAR) }) List selectByExample(SecSinopecConfigExample example); @Select({ "select", - "id, app_id, app_secret, code", + "id, app_id, app_secret, code, create_time, SignKey", "from sec_sinopec_config", "where id = #{id,jdbcType=INTEGER}" }) @@ -70,7 +74,9 @@ public interface SecSinopecConfigMapper extends SecSinopecConfigMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), @Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR), @Result(column="app_secret", property="appSecret", jdbcType=JdbcType.VARCHAR), - @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR) + @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="SignKey", property="signkey", jdbcType=JdbcType.VARCHAR) }) SecSinopecConfig selectByPrimaryKey(Integer id); @@ -87,7 +93,9 @@ public interface SecSinopecConfigMapper extends SecSinopecConfigMapperExt { "update sec_sinopec_config", "set app_id = #{appId,jdbcType=VARCHAR},", "app_secret = #{appSecret,jdbcType=VARCHAR},", - "code = #{code,jdbcType=VARCHAR}", + "code = #{code,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "SignKey = #{signkey,jdbcType=VARCHAR}", "where id = #{id,jdbcType=INTEGER}" }) int updateByPrimaryKey(SecSinopecConfig record); diff --git a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java index 7c39f37b..93a97a1a 100644 --- a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java @@ -40,6 +40,14 @@ public class SecSinopecConfigSqlProvider { sql.VALUES("code", "#{code,jdbcType=VARCHAR}"); } + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getSignkey() != null) { + sql.VALUES("SignKey", "#{signkey,jdbcType=VARCHAR}"); + } + return sql.toString(); } @@ -53,6 +61,8 @@ public class SecSinopecConfigSqlProvider { sql.SELECT("app_id"); sql.SELECT("app_secret"); sql.SELECT("code"); + sql.SELECT("create_time"); + sql.SELECT("SignKey"); sql.FROM("sec_sinopec_config"); applyWhere(sql, example, false); @@ -86,6 +96,14 @@ public class SecSinopecConfigSqlProvider { sql.SET("code = #{record.code,jdbcType=VARCHAR}"); } + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getSignkey() != null) { + sql.SET("SignKey = #{record.signkey,jdbcType=VARCHAR}"); + } + applyWhere(sql, example, true); return sql.toString(); } @@ -98,6 +116,8 @@ public class SecSinopecConfigSqlProvider { sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); sql.SET("app_secret = #{record.appSecret,jdbcType=VARCHAR}"); sql.SET("code = #{record.code,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("SignKey = #{record.signkey,jdbcType=VARCHAR}"); SecSinopecConfigExample example = (SecSinopecConfigExample) parameter.get("example"); applyWhere(sql, example, true); @@ -120,6 +140,14 @@ public class SecSinopecConfigSqlProvider { sql.SET("code = #{code,jdbcType=VARCHAR}"); } + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getSignkey() != null) { + sql.SET("SignKey = #{signkey,jdbcType=VARCHAR}"); + } + sql.WHERE("id = #{id,jdbcType=INTEGER}"); return sql.toString(); diff --git a/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java b/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java index e0dc2187..591fac0a 100644 --- a/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java +++ b/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java @@ -1,6 +1,7 @@ package com.hai.entity; import java.io.Serializable; +import java.util.Date; /** * sec_sinopec_config @@ -32,6 +33,16 @@ public class SecSinopecConfig implements Serializable { */ private String code; + /** + * 创建时间 + */ + private Date createTime; + + /** + * 签名key + */ + private String signkey; + private static final long serialVersionUID = 1L; public Integer getId() { @@ -66,6 +77,22 @@ public class SecSinopecConfig implements Serializable { this.code = code; } + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getSignkey() { + return signkey; + } + + public void setSignkey(String signkey) { + this.signkey = signkey; + } + @Override public boolean equals(Object that) { if (this == that) { @@ -81,7 +108,9 @@ public class SecSinopecConfig implements Serializable { return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId())) && (this.getAppSecret() == null ? other.getAppSecret() == null : this.getAppSecret().equals(other.getAppSecret())) - && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode())); + && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getSignkey() == null ? other.getSignkey() == null : this.getSignkey().equals(other.getSignkey())); } @Override @@ -92,6 +121,8 @@ public class SecSinopecConfig implements Serializable { result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode()); result = prime * result + ((getAppSecret() == null) ? 0 : getAppSecret().hashCode()); result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getSignkey() == null) ? 0 : getSignkey().hashCode()); return result; } @@ -105,6 +136,8 @@ public class SecSinopecConfig implements Serializable { sb.append(", appId=").append(appId); sb.append(", appSecret=").append(appSecret); sb.append(", code=").append(code); + sb.append(", createTime=").append(createTime); + sb.append(", signkey=").append(signkey); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java b/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java index fac87195..10e1e0a2 100644 --- a/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java +++ b/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java @@ -1,6 +1,7 @@ package com.hai.entity; import java.util.ArrayList; +import java.util.Date; import java.util.List; public class SecSinopecConfigExample { @@ -393,6 +394,136 @@ public class SecSinopecConfigExample { addCriterion("code not between", value1, value2, "code"); return (Criteria) this; } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andSignkeyIsNull() { + addCriterion("SignKey is null"); + return (Criteria) this; + } + + public Criteria andSignkeyIsNotNull() { + addCriterion("SignKey is not null"); + return (Criteria) this; + } + + public Criteria andSignkeyEqualTo(String value) { + addCriterion("SignKey =", value, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyNotEqualTo(String value) { + addCriterion("SignKey <>", value, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyGreaterThan(String value) { + addCriterion("SignKey >", value, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyGreaterThanOrEqualTo(String value) { + addCriterion("SignKey >=", value, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyLessThan(String value) { + addCriterion("SignKey <", value, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyLessThanOrEqualTo(String value) { + addCriterion("SignKey <=", value, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyLike(String value) { + addCriterion("SignKey like", value, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyNotLike(String value) { + addCriterion("SignKey not like", value, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyIn(List values) { + addCriterion("SignKey in", values, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyNotIn(List values) { + addCriterion("SignKey not in", values, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyBetween(String value1, String value2) { + addCriterion("SignKey between", value1, value2, "signkey"); + return (Criteria) this; + } + + public Criteria andSignkeyNotBetween(String value1, String value2) { + addCriterion("SignKey not between", value1, value2, "signkey"); + return (Criteria) this; + } } /** diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 84816fd0..a9c2d0af 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -117,7 +117,7 @@ public class HighCouponServiceImpl implements HighCouponService { HighCouponModel coupon = getCouponById(highCouponModel.getId()); // 如果卡卷销售价格进行了修改 - if (!coupon.getCouponPrice().equals(highCouponModel.getCouponPrice())) { + if (!coupon.getSalesPrice().equals(highCouponModel.getSalesPrice())) { // 所有价格失效 highGoodsPriceReferService.couponAllSalesPriceInvalid(highCouponModel.getId()); // 增加新销售价格