From 5c28fa9720ba1bf19f5c57913e21ceca7c0a7db9 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 22 Mar 2021 22:15:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/bweb/controller/HighCouponController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9b5ef465..9662a63f 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -243,7 +243,7 @@ public class HighCouponController { approve.setObjectType(ApproveType.UP_SHELF_APPROVE.getType()); approve.setObjectId(id); approve.setObjectName(coupon.getCouponName()); - approve.setApproveSerialNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss"); + approve.setApproveSerialNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")); approve.setStatus(1); approve.setCreateTime(new Date()); approve.setUpdateTime(new Date()); From b9d11e53d8880c0a0c263647caddec1065bd20bd Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 22 Mar 2021 22:46:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HighGoodsPriceReferController.java | 61 ++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java index ca916280..95d3fb91 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java @@ -59,8 +59,13 @@ public class HighGoodsPriceReferController { if (highGoodsPriceRefer.getObjectType() == null || highGoodsPriceRefer.getObjectId() == null || highGoodsPriceRefer.getPromptlyType() == null - || highGoodsPriceRefer.getNewSalePrice() == null - || highGoodsPriceRefer.getEffectiveTime() == null) { + || highGoodsPriceRefer.getNewSalePrice() == null) { + log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 是否及时生效 否:需要填写生效时间 + if (highGoodsPriceRefer.getPromptlyType() == false && highGoodsPriceRefer.getEffectiveTime() == null) { log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!","参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } @@ -79,6 +84,58 @@ public class HighGoodsPriceReferController { } } + @RequestMapping(value="/updateGoodsPriceRefer",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改产品销售价格") + public ResponseData updateGoodsPriceRefer(@RequestBody HighGoodsPriceRefer highGoodsPriceRefer, HttpServletRequest request) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + if (highGoodsPriceRefer.getId() == null + || highGoodsPriceRefer.getObjectType() == null + || highGoodsPriceRefer.getObjectId() == null + || highGoodsPriceRefer.getPromptlyType() == null + || highGoodsPriceRefer.getNewSalePrice() == null) { + log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 是否及时生效 否:需要填写生效时间 + if (highGoodsPriceRefer.getPromptlyType() == false && highGoodsPriceRefer.getEffectiveTime() == null) { + log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询价格信息 + HighGoodsPriceRefer refer = highGoodsPriceReferService.getPriceReferById(highGoodsPriceRefer.getId()); + if (refer == null) { + log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!","未找到价格信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.GOODS_PRICE_REFER_ERROR, ""); + } + + // 只有审批驳回后才能修改 + if (refer.getStatus() != 102) { + log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!","状态错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); + } + + refer.setObjectType(highGoodsPriceRefer.getObjectType()); + refer.setObjectId(highGoodsPriceRefer.getObjectId()); + refer.setPromptlyType(highGoodsPriceRefer.getPromptlyType()); + refer.setNewSalePrice(highGoodsPriceRefer.getNewSalePrice()); + refer.setStatus(101); // 状态: 0:删除 1:待编辑 2:待生效 3:已生效 4:已失效 101.审批中 102.审批驳回 + refer.setOperatorId(userInfoModel.getSecUser().getId()); + refer.setOperatorName(userInfoModel.getSecUser().getUserName()); + highGoodsPriceReferService.updatePriceRefer(refer); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/getPriceReferList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询价格列表") From 22bb0ab8a3935820661460b854d63b2bba9ab627 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Wed, 24 Mar 2021 09:48:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HighMerchantStoreController.java | 12 +- .../cweb/controller/HighCouponController.java | 103 ++++++++++++++ .../HighMerchantStoreController.java | 106 ++++++++++++++ .../src/main/resources/dev/config.properties | 3 + .../com/hai/dao/HighMerchantStoreMapper.java | 20 ++- .../hai/dao/HighMerchantStoreSqlProvider.java | 28 ++++ .../com/hai/entity/HighMerchantStore.java | 42 +++++- .../hai/entity/HighMerchantStoreExample.java | 130 ++++++++++++++++++ 8 files changed, 430 insertions(+), 14 deletions(-) create mode 100644 hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java create mode 100644 hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java index a965e0ff..76fce1b2 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java @@ -14,6 +14,7 @@ import com.hai.entity.HighMerchantStore; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; +import com.hai.service.CommonService; import com.hai.service.HighMerchantService; import com.hai.service.HighMerchantStoreService; import com.hai.service.SecUserService; @@ -47,6 +48,9 @@ public class HighMerchantStoreController { @Autowired private UserCenter userCenter; + @Resource + private CommonService commonService; + @Resource private HighMerchantStoreService highMerchantStoreService; @@ -69,7 +73,8 @@ public class HighMerchantStoreController { throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); } - if (StringUtils.isBlank(highMerchantStore.getStoreKey()) + if (highMerchantStore.getRegionId() == null + || StringUtils.isBlank(highMerchantStore.getStoreKey()) || StringUtils.isBlank(highMerchantStore.getStoreName()) || StringUtils.isBlank(highMerchantStore.getTelephone()) || StringUtils.isBlank(highMerchantStore.getAddress()) @@ -101,6 +106,7 @@ public class HighMerchantStoreController { throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); } + highMerchantStore.setRegionName(commonService.getRegionsById(highMerchantStore.getRegionId()).getRegionName()); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setStatus(1); // 状态:0:删除,1:正常 @@ -130,7 +136,8 @@ public class HighMerchantStoreController { throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); } - if (highMerchantStore.getId() == null + if (highMerchantStore.getRegionId() == null + || highMerchantStore.getId() == null || StringUtils.isBlank(highMerchantStore.getStoreKey()) || StringUtils.isBlank(highMerchantStore.getStoreName()) || StringUtils.isBlank(highMerchantStore.getTelephone()) @@ -170,6 +177,7 @@ public class HighMerchantStoreController { throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); } + highMerchantStore.setRegionName(commonService.getRegionsById(highMerchantStore.getRegionId()).getRegionName()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setOperatorId(userInfoModel.getSecUser().getId()); highMerchantStore.setOperatorName(userInfoModel.getSecUser().getUserName()); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java b/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java new file mode 100644 index 00000000..ab9c22d9 --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java @@ -0,0 +1,103 @@ +package com.cweb.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.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/11 22:16 + */ +@Controller +@RequestMapping(value = "/coupon") +@Api(value = "卡卷接口") +public class HighCouponController { + + private static Logger log = LoggerFactory.getLogger(HighCouponController.class); + + @Autowired + private UserCenter userCenter; + + @Resource + private HighMerchantService highMerchantService; + + @Resource + private HighCouponService highCouponService; + + @Resource + private HighCouponHandselService highCouponHandselService; + + @Resource + private HighCouponCodeService highCouponCodeService; + + @Resource + private HighApproveService highApproveService; + + @RequestMapping(value="/getCouponList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "卡卷列表") + public ResponseData getCouponList(@RequestParam(name = "regionId", required = true) Long regionId, + @RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "couponName", required = false) String couponName, + @RequestParam(name = "couponType", required = false) Integer couponType, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { + try { + + Map map = new HashMap<>(); + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + if (userInfoModel.getBsCompany() == null) { + log.error("HighCouponController -> getCouponList() error!","权限不足"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + map.put("regionId", regionId); + map.put("merchantId", merchantId); + map.put("couponName", couponName); + map.put("couponType", couponType); + map.put("status", 2); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); + } catch (Exception e) { + log.error("HighCouponController -> getCouponList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getCouponById",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "卡卷信息") + public ResponseData getCouponById(@RequestParam(name = "couponId", required = true) Long couponId) { + try { + + return ResponseMsgUtil.success(highCouponService.getCouponById(couponId)); + + } catch (Exception e) { + log.error("HighCouponController -> getCouponById() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java b/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java new file mode 100644 index 00000000..0b6d1e12 --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java @@ -0,0 +1,106 @@ +package com.cweb.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.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.MemberValidateUtil; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighMerchant; +import com.hai.entity.HighMerchantStore; +import com.hai.model.HighMerchantStoreModel; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.HighMerchantService; +import com.hai.service.HighMerchantStoreService; +import com.hai.service.SecUserService; +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.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/9 20:58 + */ +@Controller +@RequestMapping(value = "/highMerchantStore") +@Api(value = "商户门店接口") +public class HighMerchantStoreController { + + private static Logger log = LoggerFactory.getLogger(HighMerchantStoreController.class); + + @Autowired + private UserCenter userCenter; + + @Resource + private HighMerchantStoreService highMerchantStoreService; + + @Resource + private HighMerchantService highMerchantService; + + @Resource + private SecUserService secUserService; + + @RequestMapping(value="/getMerchantStoreById",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据id查询商户门店") + public ResponseData getMerchantStoreById(@RequestParam(name = "id", required = true) Long id) { + try { + + return ResponseMsgUtil.success(highMerchantStoreService.getMerchantStoreById(id)); + + } catch (Exception e) { + log.error("HighMerchantStoreController -> getMerchantStoreById() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getStoreListByCompany",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据公司 查询商户门店列表") + public ResponseData getStoreListByCompany(@RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "telephone", required = false) String telephone, + @RequestParam(name = "storeName", required = false) String storeName, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + if (userInfoModel.getBsCompany() == null) { + log.error("HighMerchantStoreController -> getStoreListByCompany() error!","权限不足"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + + Map map = new HashMap<>(); + map.put("companyId", userInfoModel.getBsCompany().getId()); + map.put("merchantId", merchantId); + map.put("telephone", telephone); + map.put("storeName", storeName); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highMerchantStoreService.getMerchantStoreList(map))); + + } catch (Exception e) { + log.error("HighMerchantStoreController -> getStoreListByCompany() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/hai-cweb/src/main/resources/dev/config.properties b/hai-cweb/src/main/resources/dev/config.properties index 4a9c0107..f15b4fc5 100644 --- a/hai-cweb/src/main/resources/dev/config.properties +++ b/hai-cweb/src/main/resources/dev/config.properties @@ -1,5 +1,8 @@ +# ΢ wxAppId=wx8d49e2f83025229d wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df +mch_id=1603942866 +api_key=HfkjWxPayHaiShengGuang0123456789 fileUrl=/home/project/hsg/filesystem cmsPath=/home/project/hsg/filesystem/cmsPath diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapper.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapper.java index b8e0cff8..c8245082 100644 --- a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapper.java @@ -39,7 +39,8 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into high_merchant_store (company_id, merchant_id, ", + "insert into high_merchant_store (region_id, region_name, ", + "company_id, merchant_id, ", "store_key, store_name, ", "store_desc, telephone, ", "address, `status`, ", @@ -47,7 +48,8 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { "operator_id, operator_name, ", "update_time, create_time, ", "ext_1, ext_2, ext_3)", - "values (#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ", + "values (#{regionId,jdbcType=BIGINT}, #{regionName,jdbcType=VARCHAR}, ", + "#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ", "#{storeKey,jdbcType=VARCHAR}, #{storeName,jdbcType=VARCHAR}, ", "#{storeDesc,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, ", "#{address,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", @@ -66,6 +68,8 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { @SelectProvider(type=HighMerchantStoreSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), @Result(column="store_key", property="storeKey", jdbcType=JdbcType.VARCHAR), @@ -88,14 +92,16 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { @Select({ "select", - "id, company_id, merchant_id, store_key, store_name, store_desc, telephone, address, ", - "`status`, longitude, latitude, operator_id, operator_name, update_time, create_time, ", - "ext_1, ext_2, ext_3", + "id, region_id, region_name, company_id, merchant_id, store_key, store_name, ", + "store_desc, telephone, address, `status`, longitude, latitude, operator_id, ", + "operator_name, update_time, create_time, ext_1, ext_2, ext_3", "from high_merchant_store", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), @Result(column="store_key", property="storeKey", jdbcType=JdbcType.VARCHAR), @@ -127,7 +133,9 @@ public interface HighMerchantStoreMapper extends HighMerchantStoreMapperExt { @Update({ "update high_merchant_store", - "set company_id = #{companyId,jdbcType=BIGINT},", + "set region_id = #{regionId,jdbcType=BIGINT},", + "region_name = #{regionName,jdbcType=VARCHAR},", + "company_id = #{companyId,jdbcType=BIGINT},", "merchant_id = #{merchantId,jdbcType=BIGINT},", "store_key = #{storeKey,jdbcType=VARCHAR},", "store_name = #{storeName,jdbcType=VARCHAR},", diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreSqlProvider.java index 4e368676..ef8dc666 100644 --- a/hai-service/src/main/java/com/hai/dao/HighMerchantStoreSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantStoreSqlProvider.java @@ -28,6 +28,14 @@ public class HighMerchantStoreSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("high_merchant_store"); + if (record.getRegionId() != null) { + sql.VALUES("region_id", "#{regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}"); + } + if (record.getCompanyId() != null) { sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); } @@ -106,6 +114,8 @@ public class HighMerchantStoreSqlProvider { } else { sql.SELECT("id"); } + sql.SELECT("region_id"); + sql.SELECT("region_name"); sql.SELECT("company_id"); sql.SELECT("merchant_id"); sql.SELECT("store_key"); @@ -144,6 +154,14 @@ public class HighMerchantStoreSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } + if (record.getRegionId() != null) { + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + } + if (record.getCompanyId() != null) { sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); } @@ -221,6 +239,8 @@ public class HighMerchantStoreSqlProvider { sql.UPDATE("high_merchant_store"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); sql.SET("store_key = #{record.storeKey,jdbcType=VARCHAR}"); @@ -248,6 +268,14 @@ public class HighMerchantStoreSqlProvider { SQL sql = new SQL(); sql.UPDATE("high_merchant_store"); + if (record.getRegionId() != null) { + sql.SET("region_id = #{regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{regionName,jdbcType=VARCHAR}"); + } + if (record.getCompanyId() != null) { sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java index 3ec3b717..658752ff 100644 --- a/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java @@ -1,7 +1,5 @@ package com.hai.entity; -import com.hai.model.HighMerchantStoreModel; - import java.io.Serializable; import java.util.Date; @@ -20,6 +18,16 @@ public class HighMerchantStore implements Serializable { */ private Long id; + /** + * 区域 + */ + private Long regionId; + + /** + * 区域名称 + */ + private String regionName; + /** * 单位id */ @@ -51,7 +59,7 @@ public class HighMerchantStore implements Serializable { private String telephone; /** - * 门店地址 + * 商户地址 */ private String address; @@ -61,12 +69,12 @@ public class HighMerchantStore implements Serializable { private Integer status; /** - * 门店地址经度 + * 商户地址经度 */ private String longitude; /** - * 门店地址纬度 + * 商户地址纬度 */ private String latitude; @@ -106,6 +114,22 @@ public class HighMerchantStore implements Serializable { this.id = id; } + public Long getRegionId() { + return regionId; + } + + public void setRegionId(Long regionId) { + this.regionId = regionId; + } + + public String getRegionName() { + return regionName; + } + + public void setRegionName(String regionName) { + this.regionName = regionName; + } + public Long getCompanyId() { return companyId; } @@ -255,6 +279,8 @@ public class HighMerchantStore implements Serializable { } HighMerchantStore other = (HighMerchantStore) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId())) + && (this.getRegionName() == null ? other.getRegionName() == null : this.getRegionName().equals(other.getRegionName())) && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) && (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId())) && (this.getStoreKey() == null ? other.getStoreKey() == null : this.getStoreKey().equals(other.getStoreKey())) @@ -279,6 +305,8 @@ public class HighMerchantStore implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode()); + result = prime * result + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode()); result = prime * result + ((getStoreKey() == null) ? 0 : getStoreKey().hashCode()); @@ -306,6 +334,8 @@ public class HighMerchantStore implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); + sb.append(", regionId=").append(regionId); + sb.append(", regionName=").append(regionName); sb.append(", companyId=").append(companyId); sb.append(", merchantId=").append(merchantId); sb.append(", storeKey=").append(storeKey); @@ -327,4 +357,4 @@ public class HighMerchantStore implements Serializable { sb.append("]"); return sb.toString(); } -} +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStoreExample.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreExample.java index 5be9bd63..bb7e6237 100644 --- a/hai-service/src/main/java/com/hai/entity/HighMerchantStoreExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStoreExample.java @@ -185,6 +185,136 @@ public class HighMerchantStoreExample { return (Criteria) this; } + public Criteria andRegionIdIsNull() { + addCriterion("region_id is null"); + return (Criteria) this; + } + + public Criteria andRegionIdIsNotNull() { + addCriterion("region_id is not null"); + return (Criteria) this; + } + + public Criteria andRegionIdEqualTo(Long value) { + addCriterion("region_id =", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotEqualTo(Long value) { + addCriterion("region_id <>", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThan(Long value) { + addCriterion("region_id >", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThanOrEqualTo(Long value) { + addCriterion("region_id >=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThan(Long value) { + addCriterion("region_id <", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThanOrEqualTo(Long value) { + addCriterion("region_id <=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdIn(List values) { + addCriterion("region_id in", values, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotIn(List values) { + addCriterion("region_id not in", values, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdBetween(Long value1, Long value2) { + addCriterion("region_id between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotBetween(Long value1, Long value2) { + addCriterion("region_id not between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionNameIsNull() { + addCriterion("region_name is null"); + return (Criteria) this; + } + + public Criteria andRegionNameIsNotNull() { + addCriterion("region_name is not null"); + return (Criteria) this; + } + + public Criteria andRegionNameEqualTo(String value) { + addCriterion("region_name =", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotEqualTo(String value) { + addCriterion("region_name <>", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameGreaterThan(String value) { + addCriterion("region_name >", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameGreaterThanOrEqualTo(String value) { + addCriterion("region_name >=", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLessThan(String value) { + addCriterion("region_name <", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLessThanOrEqualTo(String value) { + addCriterion("region_name <=", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLike(String value) { + addCriterion("region_name like", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotLike(String value) { + addCriterion("region_name not like", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameIn(List values) { + addCriterion("region_name in", values, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotIn(List values) { + addCriterion("region_name not in", values, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameBetween(String value1, String value2) { + addCriterion("region_name between", value1, value2, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotBetween(String value1, String value2) { + addCriterion("region_name not between", value1, value2, "regionName"); + return (Criteria) this; + } + public Criteria andCompanyIdIsNull() { addCriterion("company_id is null"); return (Criteria) this;