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 0565d0bf..271cc012 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -93,6 +93,15 @@ public class HighCouponController { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } + Map map = new HashMap<>(); + + map.put("couponName", highCoupon.getCouponName()); + + if (highCouponService.getCouponByCouponName(map) > 0) { + log.error("HighCouponController -> insertCoupon() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_CODE_NAME, ""); + } + // 折扣价格 大于 销售价格 if (highCoupon.getDiscountPrice().compareTo(highCoupon.getSalesPrice()) == 1) { log.error("HighCouponController -> insertCoupon() error!","参数错误"); @@ -175,6 +184,11 @@ public class HighCouponController { throw ErrorHelp.genException(SysCode.System, ErrorCode.DISCOUNT_PRICE_BIG_SALES_PRICE_ERROR, ""); } + + Map map = new HashMap<>(); + + map.put("couponName", highCoupon.getCouponName()); + // 查询卡券 HighCouponModel coupon = highCouponService.getCouponById(highCoupon.getId()); if (coupon == null) { @@ -182,6 +196,13 @@ public class HighCouponController { throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, ""); } + + if (highCouponService.getCouponByCouponName(map) > 0 && coupon.getCouponName() != highCoupon.getCouponName()) { + log.error("HighCouponController -> updateCoupon() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_CODE_NAME, ""); + } + + // 是否赠送卡卷 if (highCoupon.getIsPresent()) { if (highCoupon.getHandselCouponId() == null || highCoupon.getHandselCouponId().size() == 0) { diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighUserController.java b/hai-bweb/src/main/java/com/bweb/controller/HighUserController.java index fce209f4..b110e5f0 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighUserController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighUserController.java @@ -84,7 +84,7 @@ public class HighUserController { @RequestMapping(value = "/findByUserId", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "根据id查询职位详情") + @ApiOperation(value = "根据id查询详情") public ResponseData findById(@RequestParam(value = "userId", required = true) Long userId) { try { return ResponseMsgUtil.success(highUserService.findByUserId(userId)); diff --git a/hai-bweb/src/main/java/com/bweb/controller/SecSinopecConfigController.java b/hai-bweb/src/main/java/com/bweb/controller/SecSinopecConfigController.java new file mode 100644 index 00000000..e6f1174f --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/SecSinopecConfigController.java @@ -0,0 +1,121 @@ +package com.bweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighUser; +import com.hai.entity.SecSinopecConfig; +import com.hai.model.ResponseData; +import com.hai.service.SecSinopecConfigService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Sum1Dream + */ +@RestController +@RequestMapping(value = "/secSinopecConfig") +@Api(value = "中石化配置管理") +public class SecSinopecConfigController { + + private static Logger log = LoggerFactory.getLogger(HighUserController.class); + + @Resource + private SecSinopecConfigService secSinopecConfigService; + + @RequestMapping(value = "/getListSinopecConfig", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询用户列表") + public ResponseData getListSinopecConfig( + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize + ) { + try { + + Map map = new HashMap<>(); + + + PageHelper.startPage(pageNum, pageSize); + + List secSinopecConfigs = secSinopecConfigService.getListSinopecConfig(map); + + return ResponseMsgUtil.success(new PageInfo<>(secSinopecConfigs)); + } catch (Exception e) { + log.error("HighUserController --> getListUser() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/insertSinopec", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "新增") + public ResponseData insertSinopec(@RequestBody SecSinopecConfig reqBody) { + try { + + + secSinopecConfigService.insertSinopec(reqBody); + + return ResponseMsgUtil.success("成功"); + + } catch (Exception e) { + log.error("BsPositionController --> insertSinopec() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateSinopec", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改") + public ResponseData updateSinopec(@RequestBody SecSinopecConfig reqBody) { + try { + + if ( + reqBody.getId() == null + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + SecSinopecConfig secSinopecConfig = secSinopecConfigService.findById(reqBody.getId()); + + if (secSinopecConfig == null) { + log.error("BsPositionController --> updateUser() error!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, ""); + } + + secSinopecConfigService.updateSinopec(reqBody); + + return ResponseMsgUtil.success("修改成功"); + + } catch (Exception e) { + log.error("BsPositionController --> addPosition() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/findById", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据id查询详情") + public ResponseData findById(@RequestParam(value = "sinopecId", required = true) Integer sinopecId) { + try { + return ResponseMsgUtil.success(secSinopecConfigService.findById(sinopecId)); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java b/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java index 4565bad4..eafe6695 100644 --- a/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java +++ b/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java @@ -103,6 +103,7 @@ public enum ErrorCode { NOT_FOUND_COUPON_CODE("2121","销售码不存在"), COUPON_CODE_STATUS("2122","卡券码状态错误"), COUPON_CODE_OVERDUE("2122","卡券码已过期"), + COUPON_CODE_NAME("2123","卡券名称已存在"), STATUS_ERROR("3000","状态错误"), ADD_DATA_ERROR("3001","增加数据失败"), diff --git a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java new file mode 100644 index 00000000..192ef90d --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapper.java @@ -0,0 +1,94 @@ +package com.hai.dao; + +import com.hai.entity.SecSinopecConfig; +import com.hai.entity.SecSinopecConfigExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface SecSinopecConfigMapper extends SecSinopecConfigMapperExt { + @SelectProvider(type=SecSinopecConfigSqlProvider.class, method="countByExample") + long countByExample(SecSinopecConfigExample example); + + @DeleteProvider(type=SecSinopecConfigSqlProvider.class, method="deleteByExample") + int deleteByExample(SecSinopecConfigExample example); + + @Delete({ + "delete from sec_sinopec_config", + "where id = #{id,jdbcType=INTEGER}" + }) + int deleteByPrimaryKey(Integer id); + + @Insert({ + "insert into sec_sinopec_config (app_id, app_secret, ", + "code)", + "values (#{appId,jdbcType=VARCHAR}, #{appSecret,jdbcType=VARCHAR}, ", + "#{code,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(SecSinopecConfig record); + + @InsertProvider(type=SecSinopecConfigSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecSinopecConfig record); + + @SelectProvider(type=SecSinopecConfigSqlProvider.class, method="selectByExample") + @Results({ + @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) + }) + List selectByExample(SecSinopecConfigExample example); + + @Select({ + "select", + "id, app_id, app_secret, code", + "from sec_sinopec_config", + "where id = #{id,jdbcType=INTEGER}" + }) + @Results({ + @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) + }) + SecSinopecConfig selectByPrimaryKey(Integer id); + + @UpdateProvider(type=SecSinopecConfigSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecSinopecConfig record, @Param("example") SecSinopecConfigExample example); + + @UpdateProvider(type=SecSinopecConfigSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecSinopecConfig record, @Param("example") SecSinopecConfigExample example); + + @UpdateProvider(type=SecSinopecConfigSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecSinopecConfig record); + + @Update({ + "update sec_sinopec_config", + "set app_id = #{appId,jdbcType=VARCHAR},", + "app_secret = #{appSecret,jdbcType=VARCHAR},", + "code = #{code,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=INTEGER}" + }) + int updateByPrimaryKey(SecSinopecConfig record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapperExt.java b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapperExt.java new file mode 100644 index 00000000..65b8cde8 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface SecSinopecConfigMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java new file mode 100644 index 00000000..7c39f37b --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/SecSinopecConfigSqlProvider.java @@ -0,0 +1,220 @@ +package com.hai.dao; + +import com.hai.entity.SecSinopecConfig; +import com.hai.entity.SecSinopecConfigExample.Criteria; +import com.hai.entity.SecSinopecConfigExample.Criterion; +import com.hai.entity.SecSinopecConfigExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecSinopecConfigSqlProvider { + + public String countByExample(SecSinopecConfigExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_sinopec_config"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecSinopecConfigExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_sinopec_config"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecSinopecConfig record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_sinopec_config"); + + if (record.getAppId() != null) { + sql.VALUES("app_id", "#{appId,jdbcType=VARCHAR}"); + } + + if (record.getAppSecret() != null) { + sql.VALUES("app_secret", "#{appSecret,jdbcType=VARCHAR}"); + } + + if (record.getCode() != null) { + sql.VALUES("code", "#{code,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(SecSinopecConfigExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("app_id"); + sql.SELECT("app_secret"); + sql.SELECT("code"); + sql.FROM("sec_sinopec_config"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecSinopecConfig record = (SecSinopecConfig) parameter.get("record"); + SecSinopecConfigExample example = (SecSinopecConfigExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_sinopec_config"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=INTEGER}"); + } + + if (record.getAppId() != null) { + sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); + } + + if (record.getAppSecret() != null) { + sql.SET("app_secret = #{record.appSecret,jdbcType=VARCHAR}"); + } + + if (record.getCode() != null) { + sql.SET("code = #{record.code,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_sinopec_config"); + + sql.SET("id = #{record.id,jdbcType=INTEGER}"); + sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); + sql.SET("app_secret = #{record.appSecret,jdbcType=VARCHAR}"); + sql.SET("code = #{record.code,jdbcType=VARCHAR}"); + + SecSinopecConfigExample example = (SecSinopecConfigExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecSinopecConfig record) { + SQL sql = new SQL(); + sql.UPDATE("sec_sinopec_config"); + + if (record.getAppId() != null) { + sql.SET("app_id = #{appId,jdbcType=VARCHAR}"); + } + + if (record.getAppSecret() != null) { + sql.SET("app_secret = #{appSecret,jdbcType=VARCHAR}"); + } + + if (record.getCode() != null) { + sql.SET("code = #{code,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=INTEGER}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecSinopecConfigExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java b/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java new file mode 100644 index 00000000..e0dc2187 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/SecSinopecConfig.java @@ -0,0 +1,112 @@ +package com.hai.entity; + +import java.io.Serializable; + +/** + * sec_sinopec_config + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class SecSinopecConfig implements Serializable { + /** + * 主键 + */ + private Integer id; + + /** + * 客户AppId + */ + private String appId; + + /** + * 客户密码 + */ + private String appSecret; + + /** + * 客户编码 + */ + private String code; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getAppSecret() { + return appSecret; + } + + public void setAppSecret(String appSecret) { + this.appSecret = appSecret; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecSinopecConfig other = (SecSinopecConfig) that; + 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())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode()); + result = prime * result + ((getAppSecret() == null) ? 0 : getAppSecret().hashCode()); + result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", appId=").append(appId); + sb.append(", appSecret=").append(appSecret); + sb.append(", code=").append(code); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java b/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java new file mode 100644 index 00000000..fac87195 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/SecSinopecConfigExample.java @@ -0,0 +1,492 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.List; + +public class SecSinopecConfigExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecSinopecConfigExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andAppIdIsNull() { + addCriterion("app_id is null"); + return (Criteria) this; + } + + public Criteria andAppIdIsNotNull() { + addCriterion("app_id is not null"); + return (Criteria) this; + } + + public Criteria andAppIdEqualTo(String value) { + addCriterion("app_id =", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdNotEqualTo(String value) { + addCriterion("app_id <>", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdGreaterThan(String value) { + addCriterion("app_id >", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdGreaterThanOrEqualTo(String value) { + addCriterion("app_id >=", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdLessThan(String value) { + addCriterion("app_id <", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdLessThanOrEqualTo(String value) { + addCriterion("app_id <=", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdLike(String value) { + addCriterion("app_id like", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdNotLike(String value) { + addCriterion("app_id not like", value, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdIn(List values) { + addCriterion("app_id in", values, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdNotIn(List values) { + addCriterion("app_id not in", values, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdBetween(String value1, String value2) { + addCriterion("app_id between", value1, value2, "appId"); + return (Criteria) this; + } + + public Criteria andAppIdNotBetween(String value1, String value2) { + addCriterion("app_id not between", value1, value2, "appId"); + return (Criteria) this; + } + + public Criteria andAppSecretIsNull() { + addCriterion("app_secret is null"); + return (Criteria) this; + } + + public Criteria andAppSecretIsNotNull() { + addCriterion("app_secret is not null"); + return (Criteria) this; + } + + public Criteria andAppSecretEqualTo(String value) { + addCriterion("app_secret =", value, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretNotEqualTo(String value) { + addCriterion("app_secret <>", value, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretGreaterThan(String value) { + addCriterion("app_secret >", value, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretGreaterThanOrEqualTo(String value) { + addCriterion("app_secret >=", value, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretLessThan(String value) { + addCriterion("app_secret <", value, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretLessThanOrEqualTo(String value) { + addCriterion("app_secret <=", value, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretLike(String value) { + addCriterion("app_secret like", value, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretNotLike(String value) { + addCriterion("app_secret not like", value, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretIn(List values) { + addCriterion("app_secret in", values, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretNotIn(List values) { + addCriterion("app_secret not in", values, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretBetween(String value1, String value2) { + addCriterion("app_secret between", value1, value2, "appSecret"); + return (Criteria) this; + } + + public Criteria andAppSecretNotBetween(String value1, String value2) { + addCriterion("app_secret not between", value1, value2, "appSecret"); + return (Criteria) this; + } + + public Criteria andCodeIsNull() { + addCriterion("code is null"); + return (Criteria) this; + } + + public Criteria andCodeIsNotNull() { + addCriterion("code is not null"); + return (Criteria) this; + } + + public Criteria andCodeEqualTo(String value) { + addCriterion("code =", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotEqualTo(String value) { + addCriterion("code <>", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThan(String value) { + addCriterion("code >", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualTo(String value) { + addCriterion("code >=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThan(String value) { + addCriterion("code <", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualTo(String value) { + addCriterion("code <=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLike(String value) { + addCriterion("code like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotLike(String value) { + addCriterion("code not like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeIn(List values) { + addCriterion("code in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotIn(List values) { + addCriterion("code not in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeBetween(String value1, String value2) { + addCriterion("code between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotBetween(String value1, String value2) { + addCriterion("code not between", value1, value2, "code"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/service/HighCouponService.java b/hai-service/src/main/java/com/hai/service/HighCouponService.java index f55b94cd..95753075 100644 --- a/hai-service/src/main/java/com/hai/service/HighCouponService.java +++ b/hai-service/src/main/java/com/hai/service/HighCouponService.java @@ -100,6 +100,13 @@ public interface HighCouponService { **/ List getCouponList(Map map); + /** + * @Author 胡锐 + * @Description 获取数量 + * @Date 2021/3/15 23:12 + **/ + Long getCouponByCouponName(Map map); + /** * @Author 胡锐 * @Description 根据商户 查询处于已上架的卡卷 diff --git a/hai-service/src/main/java/com/hai/service/SecSinopecConfigService.java b/hai-service/src/main/java/com/hai/service/SecSinopecConfigService.java new file mode 100644 index 00000000..dec271b6 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/SecSinopecConfigService.java @@ -0,0 +1,64 @@ +package com.hai.service; + +import com.hai.entity.HighUser; +import com.hai.entity.SecSinopecConfig; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: SecSinopecConfigService + * @Description: 中石化配置管理 + * @author: 袁野 + * @date: 2021/03/28 9:46 + * @Copyright: 2021 www.high.com Inc. All rights reserved. + */ +public interface SecSinopecConfigService { + + /** + * + * @Title: getListSinopecConfig + * @Description: 查询列表 + * @Date: 2021/03/09 10:23 + * @author: Sum1Dream + * @param: [map] map参数 + * @return: java.util.List + * @throws Exception 抛出异常 + */ + + List getListSinopecConfig(Map map) throws Exception; + + /** + * + * @Title: findById + * @Description: 查询详情 + * @Date: 2021/03/09 10:23 + * @author: Sum1Dream + * @param: userId 用户id + * @return: HighUser + */ + SecSinopecConfig findById(Integer sinopecId); + + /** + * + * @Title: updateSinopec + * @Description: 修改信息 + * @author: Sum1Dream + * @Date: 2021/03/09 11:23 + * @param: [highUser] 用户信息 + * @return: com.hai.entity.HighUser + */ + void updateSinopec(SecSinopecConfig secSinopecConfig); + + /** + * + * @Title: insertSinopec + * @Description: 新增 + * @author: Sum1Dream + * @Date: 2021/03/09 11:23 + * @param: [highUser] 用户信息 + * @return: com.hai.entity.HighUser + */ + void insertSinopec(SecSinopecConfig secSinopecConfig); + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighAgentServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighAgentServiceImpl.java index 37aedb86..226d8212 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighAgentServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighAgentServiceImpl.java @@ -5,11 +5,18 @@ import com.hai.entity.HighAgent; import com.hai.entity.HighAgentExample; import com.hai.service.HighAgentService; import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.Map; +/** + * @Auther: 袁野 + * @Description: + * @Date: 2021/3/14 20:47 + */ +@Service("highAgentService") public class HighAgentServiceImpl implements HighAgentService { @Resource 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 c0a642cd..84816fd0 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 @@ -358,6 +358,20 @@ public class HighCouponServiceImpl implements HighCouponService { return new ArrayList<>(); } + @Override + public Long getCouponByCouponName(Map map) { + + HighCouponExample example = new HighCouponExample(); + HighCouponExample.Criteria criteria = example.createCriteria(); + + if (StringUtils.isNotBlank(MapUtils.getString(map, "couponName"))) { + criteria.andCouponNameEqualTo(MapUtils.getString(map, "couponName")); + } + + + return highCouponMapper.countByExample(example); + } + @Override public List getCouponListByMerchant(Long merchantId) { HighCouponExample example = new HighCouponExample(); diff --git a/hai-service/src/main/java/com/hai/service/impl/SecSinopecConfigServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/SecSinopecConfigServiceImpl.java new file mode 100644 index 00000000..1310d0d8 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/SecSinopecConfigServiceImpl.java @@ -0,0 +1,43 @@ +package com.hai.service.impl; + +import com.hai.dao.SecSinopecConfigMapper; + +import com.hai.entity.SecSinopecConfig; +import com.hai.entity.SecSinopecConfigExample; +import com.hai.service.SecSinopecConfigService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service("secSinopecConfigService") +public class SecSinopecConfigServiceImpl implements SecSinopecConfigService { + + @Resource + private SecSinopecConfigMapper secSinopecConfigMapper; + + @Override + public List getListSinopecConfig(Map map) throws Exception { + + SecSinopecConfigExample example = new SecSinopecConfigExample(); + SecSinopecConfigExample.Criteria criteria = example.createCriteria(); + + return secSinopecConfigMapper.selectByExample(example); + } + + @Override + public SecSinopecConfig findById(Integer sinopecId) { + return secSinopecConfigMapper.selectByPrimaryKey(sinopecId); + } + + @Override + public void updateSinopec(SecSinopecConfig secSinopecConfig) { + secSinopecConfigMapper.updateByPrimaryKey(secSinopecConfig); + } + + @Override + public void insertSinopec(SecSinopecConfig secSinopecConfig) { + secSinopecConfigMapper.insert(secSinopecConfig); + } +}