dev-discount
袁野 4 years ago
parent 90437fdd1f
commit d23aa290fd
  1. 13
      hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java
  2. 4
      hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java
  3. 5
      hai-bweb/src/main/java/com/bweb/controller/SecSinopecConfigController.java
  4. 20
      hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java
  5. 28
      hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java
  6. 35
      hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java
  7. 131
      hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java
  8. 2
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.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);
}
}

@ -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, "");
}

@ -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("修改成功");

@ -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<SecSinopecConfig> 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);

@ -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();

@ -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();

@ -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<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> 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<String> values) {
addCriterion("SignKey in", values, "signkey");
return (Criteria) this;
}
public Criteria andSignkeyNotIn(List<String> 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;
}
}
/**

@ -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());
// 增加新销售价格

Loading…
Cancel
Save