diff --git a/cweb/src/main/java/com/cweb/config/AuthConfig.java b/cweb/src/main/java/com/cweb/config/AuthConfig.java index e99009d..275d93d 100644 --- a/cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -117,6 +117,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/test/*") .excludePathPatterns("/sms/*") .excludePathPatterns("/ocr/*") + .excludePathPatterns("/openGroup/*") ; } diff --git a/cweb/src/main/java/com/cweb/controller/CommonController.java b/cweb/src/main/java/com/cweb/controller/CommonController.java index 6823139..f31391a 100644 --- a/cweb/src/main/java/com/cweb/controller/CommonController.java +++ b/cweb/src/main/java/com/cweb/controller/CommonController.java @@ -12,11 +12,8 @@ import com.hfkj.common.utils.CoordCommonUtil; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsCompany; import com.hfkj.entity.SecRegion; -import com.hfkj.model.OpenStoreModel; import com.hfkj.model.ResponseData; -import com.hfkj.model.StoreModel; import com.hfkj.service.*; -import com.hfkj.service.impl.BsLklMccServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; @@ -280,7 +277,7 @@ public class CommonController { ) { try { - return ResponseMsgUtil.success(storeService.getStoreList(name , childId)); + return ResponseMsgUtil.success(storeService.getStoreList(name , childId , null)); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/cweb/src/main/java/com/cweb/controller/group/BsStoreGroupController.java b/cweb/src/main/java/com/cweb/controller/group/BsStoreGroupController.java new file mode 100644 index 0000000..ddf1294 --- /dev/null +++ b/cweb/src/main/java/com/cweb/controller/group/BsStoreGroupController.java @@ -0,0 +1,428 @@ +package com.cweb.controller.group; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.*; +import com.hfkj.group.BsStoreGroupProductService; +import com.hfkj.group.BsStoreGroupService; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +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.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Controller +@Api(value = "门店产品管理") +@RequestMapping(value = "/storeGroup") +public class BsStoreGroupController { + + private static Logger log = LoggerFactory.getLogger(BsStoreImgController.class); + + @Resource + private BsStoreGroupProductService storeGroupProductService; + + @Resource + private BsStoreGroupService storeGroupService; + + @Resource + private UserCenter userCenter; + + @RequestMapping(value="/insertGroupContent",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "新增门店团购内容") + public ResponseData insertGroupContent(@RequestBody BsStoreGroupContent storeGroupContent) { + try { + + if (storeGroupContent == null + || storeGroupContent.getStoreId() == null + || storeGroupContent.getAstrict() == null + || storeGroupContent.getName() == null + || storeGroupContent.getPrice() == null + || storeGroupContent.getOriginalPrice() == null + || storeGroupContent.getValidity() == null + || StringUtils.isBlank(storeGroupContent.getImg()) + + ) { + log.error("configStore error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || userInfoModel.getSalesman() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限"); + } + + storeGroupContent.setStatus(2); + storeGroupContent.setCreateTime(new Date()); + storeGroupContent.setUpdateTime(new Date()); + storeGroupContent.setOpId(userInfoModel.getSalesman().getId()); + storeGroupContent.setOpName(userInfoModel.getSalesman().getName()); + + storeGroupProductService.insertStoreGroupContent(storeGroupContent); + + return ResponseMsgUtil.success(storeGroupContent); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/editGroupContent",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改门店团购内容") + public ResponseData editGroupContent(@RequestBody BsStoreGroupContent storeGroupContent) { + try { + + if (storeGroupContent == null + || storeGroupContent.getId() == null + || storeGroupContent.getStoreId() == null + || storeGroupContent.getAstrict() == null + || storeGroupContent.getName() == null + || storeGroupContent.getPrice() == null + || storeGroupContent.getOriginalPrice() == null + || storeGroupContent.getValidity() == null + || StringUtils.isBlank(storeGroupContent.getImg()) + + ) { + log.error("configStore error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || userInfoModel.getSalesman() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限"); + } + + BsStoreGroupContent bsStoreGroupContent = storeGroupProductService.findStoreGroupContent(storeGroupContent.getId()); + if (bsStoreGroupContent.getStatus() == 1) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前状态不可编辑!"); + } + + storeGroupContent.setStatus(bsStoreGroupContent.getStatus()); + storeGroupContent.setUpdateTime(new Date()); + storeGroupContent.setOpId(userInfoModel.getSalesman().getId()); + storeGroupContent.setOpName(userInfoModel.getSalesman().getName()); + + storeGroupProductService.editStoreGroupContent(storeGroupContent); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/editGroupContentDetail",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑门店团购内容详情") + public ResponseData editGroupContentDetail(@RequestBody JSONObject object) { + try { + + if (object == null + || object.getLong("groupId") == null + || object.getString("name") == null + || object.getJSONArray("details") == null + + ) { + log.error("configStore error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || userInfoModel.getSalesman() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限"); + } + + JSONArray objects = object.getJSONArray("details"); + BsStoreGroupDetail storeGroupDetail; + for (Object o : objects) { + JSONObject data = (JSONObject) o; + + storeGroupDetail = storeGroupProductService.findGroupDetail(data.getString("productId") , object.getLong("groupId")); + + BsStoreProduct storeProduct = storeGroupService.findStoreProduct(data.getLong("productId")); + + if (storeProduct != null) { + if (storeGroupDetail == null) { + storeGroupDetail = new BsStoreGroupDetail(); + storeGroupDetail.setGroupId(object.getLong("groupId")); + storeGroupDetail.setCount(data.getInteger("count")); + storeGroupDetail.setName(object.getString("name")); + storeGroupDetail.setProductImg(storeProduct.getImg()); + storeGroupDetail.setProductName(storeProduct.getName()); + storeGroupDetail.setProductSpec(storeProduct.getSpec()); + storeGroupDetail.setStoreProductId(data.getString("productId")); + storeGroupDetail.setCreateTime(new Date()); + storeGroupDetail.setStatus(1); + storeGroupDetail.setUpdateTime(new Date()); + storeGroupDetail.setOpId(userInfoModel.getSalesman().getId()); + storeGroupDetail.setOpName(userInfoModel.getSalesman().getName()); + + storeGroupProductService.insertGroupDetail(storeGroupDetail); + } else { + storeGroupDetail.setCount(data.getInteger("count")); + storeGroupProductService.editGroupDetail(storeGroupDetail); + } + } + + + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/deleteGroupDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "删除团购内容详情") + public ResponseData deleteGroupDetail(@RequestParam(value = "id" , required = true) Long id) { + try { + + storeGroupProductService.deleteGroupDetail(id); + + return ResponseMsgUtil.success("删除成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/editGroupServeRule",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑门店团购使用规则") + public ResponseData editGroupServeRule(@RequestBody BsStoreGroupServeRule storeGroupServeRule) { + try { + + if (storeGroupServeRule == null + || storeGroupServeRule.getGroupId() == null + || storeGroupServeRule.getContent() == null + ) { + log.error("configStore error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + + BsStoreGroupServeRule bsStoreGroupServeRule = storeGroupProductService.findGroupServeRuleByGroup(storeGroupServeRule.getGroupId()); + + if (bsStoreGroupServeRule == null) { + storeGroupServeRule.setStatus(1); + storeGroupServeRule.setCreateTime(new Date()); + storeGroupServeRule.setUpdateTime(new Date()); + storeGroupServeRule.setOpId(userInfoModel.getSalesman().getId()); + storeGroupServeRule.setOpName(userInfoModel.getSalesman().getName()); + storeGroupProductService.insertGroupServeRule(storeGroupServeRule); + } else { + bsStoreGroupServeRule.setContent(storeGroupServeRule.getContent()); + bsStoreGroupServeRule.setUpdateTime(new Date()); + storeGroupProductService.editGroupServeRule(bsStoreGroupServeRule); + } + + if (userInfoModel == null || userInfoModel.getSalesman() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限"); + } + + + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + + + @RequestMapping(value="/upDownGroup",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "上下架团购") + public ResponseData upDownGroup(@RequestParam(value = "id" , required = true) Long id) { + try { + + BsStoreGroupContent bsStoreGroupContent = storeGroupProductService.findStoreGroupContent(id); + if (bsStoreGroupContent.getStatus() == 0) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前状态错误!"); + } + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || userInfoModel.getSalesman() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该角色暂无权限"); + } + + + bsStoreGroupContent.setStatus(bsStoreGroupContent.getStatus() == 1 ? 2:1); + bsStoreGroupContent.setUpdateTime(new Date()); + bsStoreGroupContent.setOpId(userInfoModel.getSalesman().getId()); + bsStoreGroupContent.setOpName(userInfoModel.getSalesman().getName()); + storeGroupProductService.editStoreGroupContent(bsStoreGroupContent); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getStoreGroupList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询门店团购列表") + public ResponseData getStoreGroupList(@RequestParam(value = "storeId" , required = true) Long storeId) { + try { + + + Map map = new HashMap<>(); + map.put("storeId" , storeId); + + return ResponseMsgUtil.success(storeGroupProductService.getStoreGroupContentByList(map)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/findStoreGroupContent",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询团购详情") + public ResponseData findStoreGroupContent(@RequestParam(value = "groupId" , required = true) Long groupId) { + try { + + return ResponseMsgUtil.success(storeGroupProductService.findStoreGroupContent(groupId)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getStoreGroupDetailList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询门店团购内容列表") + public ResponseData getStoreGroupDetailList(@RequestParam(value = "groupId" , required = true) Long groupId) { + try { + + Map map = new HashMap<>(); + map.put("groupId" , groupId); + + List list = storeGroupProductService.getGroupDetailByList(map); + + Map> collect = list.stream().collect(Collectors.groupingBy(BsStoreGroupDetail::getName)); + + List groupDetails = collect.keySet().stream().map(key -> { + JSONObject detailObject = new JSONObject(true); + detailObject.put("name",key.toUpperCase()); + detailObject.put("list",collect.get(key)); + return detailObject; + }).collect(Collectors.toList()); + + return ResponseMsgUtil.success(groupDetails); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/findGroupServeRuleByGroup",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询门店团购规则内容") + public ResponseData findGroupServeRuleByGroup(@RequestParam(value = "groupId" , required = true) Long groupId) { + try { + + return ResponseMsgUtil.success(storeGroupProductService.findGroupServeRuleByGroup(groupId)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/editStoreExtMsg",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑门店扩展字段") + public ResponseData editStoreExtMsg(@RequestBody BsStoreExtMsg storeExtMsg) { + try { + + if (storeExtMsg == null + || storeExtMsg.getAddress() == null + || storeExtMsg.getStoreTag() == null + || storeExtMsg.getOpeningHours() == null + || storeExtMsg.getStoreLabel() == null + || storeExtMsg.getStoreId() == null + ) { + log.error("configStore error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + + BsStoreExtMsg bsStoreExtMsg = storeGroupService.findStoreExtMsgByStoreId(storeExtMsg.getStoreId()); + + if (bsStoreExtMsg == null) { + storeExtMsg.setStatus(1); + storeExtMsg.setCreateTime(new Date()); + storeExtMsg.setUpdateTime(new Date()); + storeExtMsg.setOpId(userInfoModel.getSalesman().getId()); + storeExtMsg.setOpName(userInfoModel.getSalesman().getName()); + storeGroupService.insertStoreExtMsg(storeExtMsg); + } else { + storeExtMsg.setId(bsStoreExtMsg.getId()); + storeExtMsg.setStatus(bsStoreExtMsg.getStatus()); + storeExtMsg.setUpdateTime(new Date()); + storeExtMsg.setOpId(userInfoModel.getSalesman().getId()); + storeExtMsg.setOpName(userInfoModel.getSalesman().getName()); + storeGroupService.editStoreExtMsg(storeExtMsg); + } + + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/findStoreExtMsgByStoreId",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询门店拓展信息") + public ResponseData findStoreExtMsgByStoreId(@RequestParam(value = "storeId" , required = true) Long storeId) { + try { + + return ResponseMsgUtil.success(storeGroupService.findStoreExtMsgByStoreId(storeId)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java b/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java new file mode 100644 index 0000000..51173d5 --- /dev/null +++ b/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java @@ -0,0 +1,151 @@ +package com.cweb.controller.group; + +import com.alibaba.fastjson.JSONObject; +import com.cweb.controller.CommonController; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.CoordCommonUtil; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsStore; +import com.hfkj.entity.BsStoreGroupContent; +import com.hfkj.entity.BsStoreGroupDetail; +import com.hfkj.group.BsStoreGroupProductService; +import com.hfkj.group.BsStoreGroupService; +import com.hfkj.model.GroupContentModel; +import com.hfkj.model.OpenStoreModel; +import com.hfkj.model.ResponseData; +import com.hfkj.service.BsStoreService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Controller +@Api(value = "团购对外接口") +@RequestMapping(value = "/openGroup") +public class OpenGroupController { + + Logger log = LoggerFactory.getLogger(OpenGroupController.class); + + @Resource + private BsStoreService storeService; + + @Resource + private BsStoreService bsStoreService; + + @Resource + private BsStoreGroupService storeGroupService; + + @Resource + private BsStoreGroupProductService storeGroupProductService; + + @RequestMapping(value="/getStoreList",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "商户查询门店列表") + public ResponseData getStoreListByMer(@RequestBody JSONObject body) { + try { + + String longitude = body.getString("longitude"); + String latitude = body.getString("latitude"); + + List list = storeService.getStoreList(body.getString("name") , body.getLong("childId") , body.getLong("parentId")); + + for (OpenStoreModel storeModel : list) { + Map map = new HashMap<>(); + map.put("storeId" , storeModel.getStoreId()); + List storeGroupContent = storeGroupProductService.getStoreGroupContentByList(map); + if (longitude != null && latitude != null && storeModel.getLatitude() != null && storeModel.getLongitude() != null) { + double distance = CoordCommonUtil.getDistance(Double.valueOf(storeModel.getLatitude()), Double.valueOf(storeModel.getLongitude()), Double.valueOf(latitude), Double.valueOf(longitude)); + double storeDistance = Math.round(distance/100d)/10d; + storeModel.setDistance(storeDistance); + if (distance < 1000) { + storeModel.setDistances(distance < 1 ? "1" : (int) distance + "m"); + } else { + storeModel.setDistances((int) storeDistance + "km"); + } + + } + storeModel.setStoreGroupContentList(storeGroupContent); + } + + list = list.stream().filter(data -> !data.getStoreGroupContentList().isEmpty()).sorted(Comparator.comparing(OpenStoreModel::getDistance)).collect(Collectors.toList()); + + return ResponseMsgUtil.success(list); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getGroupContent",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询团购内容") + public ResponseData getGroupContent(@RequestParam(value = "groupId" , required = true) Long groupId) { + try { + + Map map = new HashMap<>(); + map.put("groupId" , groupId); + + BsStoreGroupContent storeGroupContent = storeGroupProductService.findStoreGroupContent(groupId); + + List list = storeGroupProductService.getGroupDetailByList(map); + + Map> collect = list.stream().collect(Collectors.groupingBy(BsStoreGroupDetail::getName)); + + List groupDetails = collect.keySet().stream().map(key -> { + JSONObject detailObject = new JSONObject(true); + detailObject.put("name",key.toUpperCase()); + detailObject.put("list",collect.get(key)); + return detailObject; + }).collect(Collectors.toList()); + + storeGroupContent.setGroupDetails(groupDetails); + storeGroupContent.setStoreGroupServeRule(storeGroupProductService.findGroupServeRuleByGroup(groupId)); + + return ResponseMsgUtil.success(storeGroupContent); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getStoreMsg",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询团购内容") + public ResponseData getStoreMsg(@RequestParam(value = "storeId" , required = true) Long storeId) { + try { + + Map map = new HashMap<>(); + map.put("storeId" , storeId); + + BsStore bsStore = bsStoreService.getStoreById(storeId); + + if (bsStore == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到门店信息!"); + } + + bsStore.setStoreGroupContentList(storeGroupProductService.getStoreGroupContentByList(map)); + bsStore.setBsStoreExtMsg(storeGroupService.findStoreExtMsgByStoreId(storeId)); + bsStore.setBsStoreImg(storeGroupService.getBsStoreImgByList(map)); + + return ResponseMsgUtil.success(bsStore); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/service/src/main/java/com/hfkj/channel/tianque/service/TianQueFundManageService.java b/service/src/main/java/com/hfkj/channel/tianque/service/TianQueFundManageService.java index eb61434..8495fd8 100644 --- a/service/src/main/java/com/hfkj/channel/tianque/service/TianQueFundManageService.java +++ b/service/src/main/java/com/hfkj/channel/tianque/service/TianQueFundManageService.java @@ -15,10 +15,7 @@ import java.util.HashMap; import java.util.Map; /** -<<<<<<< HEAD -======= * 营销转账 ->>>>>>> pre * @className: TianQueFundManageService * @author: HuRui * @date: 2023/10/8 diff --git a/service/src/main/java/com/hfkj/dao/BsStoreGroupContentMapper.java b/service/src/main/java/com/hfkj/dao/BsStoreGroupContentMapper.java index 1343887..658595d 100644 --- a/service/src/main/java/com/hfkj/dao/BsStoreGroupContentMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsStoreGroupContentMapper.java @@ -40,19 +40,19 @@ public interface BsStoreGroupContentMapper extends BsStoreGroupContentMapperExt @Insert({ "insert into bs_store_group_content (store_id, `name`, ", - "price, img, astrict, ", - "validity, service_time, ", - "completion_degree, create_time, ", - "update_time, `status`, ", - "op_id, op_name, ext_1, ", - "ext_2, ext_3)", + "original_price, price, ", + "img, astrict, validity, ", + "service_time, completion_degree, ", + "create_time, update_time, ", + "`status`, op_id, op_name, ", + "ext_1, ext_2, ext_3)", "values (#{storeId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ", - "#{price,jdbcType=DECIMAL}, #{img,jdbcType=VARCHAR}, #{astrict,jdbcType=VARCHAR}, ", - "#{validity,jdbcType=VARCHAR}, #{serviceTime,jdbcType=VARCHAR}, ", - "#{completionDegree,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", - "#{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{originalPrice,jdbcType=DECIMAL}, #{price,jdbcType=DECIMAL}, ", + "#{img,jdbcType=VARCHAR}, #{astrict,jdbcType=VARCHAR}, #{validity,jdbcType=VARCHAR}, ", + "#{serviceTime,jdbcType=VARCHAR}, #{completionDegree,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{status,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsStoreGroupContent record); @@ -66,6 +66,7 @@ public interface BsStoreGroupContentMapper extends BsStoreGroupContentMapperExt @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="original_price", property="originalPrice", jdbcType=JdbcType.DECIMAL), @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), @Result(column="astrict", property="astrict", jdbcType=JdbcType.VARCHAR), @@ -85,8 +86,9 @@ public interface BsStoreGroupContentMapper extends BsStoreGroupContentMapperExt @Select({ "select", - "id, store_id, `name`, price, img, astrict, validity, service_time, completion_degree, ", - "create_time, update_time, `status`, op_id, op_name, ext_1, ext_2, ext_3", + "id, store_id, `name`, original_price, price, img, astrict, validity, service_time, ", + "completion_degree, create_time, update_time, `status`, op_id, op_name, ext_1, ", + "ext_2, ext_3", "from bs_store_group_content", "where id = #{id,jdbcType=BIGINT}" }) @@ -94,6 +96,7 @@ public interface BsStoreGroupContentMapper extends BsStoreGroupContentMapperExt @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="original_price", property="originalPrice", jdbcType=JdbcType.DECIMAL), @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), @Result(column="astrict", property="astrict", jdbcType=JdbcType.VARCHAR), @@ -124,6 +127,7 @@ public interface BsStoreGroupContentMapper extends BsStoreGroupContentMapperExt "update bs_store_group_content", "set store_id = #{storeId,jdbcType=BIGINT},", "`name` = #{name,jdbcType=VARCHAR},", + "original_price = #{originalPrice,jdbcType=DECIMAL},", "price = #{price,jdbcType=DECIMAL},", "img = #{img,jdbcType=VARCHAR},", "astrict = #{astrict,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/BsStoreGroupContentSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsStoreGroupContentSqlProvider.java index 9a887a3..a2d8832 100644 --- a/service/src/main/java/com/hfkj/dao/BsStoreGroupContentSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsStoreGroupContentSqlProvider.java @@ -36,6 +36,10 @@ public class BsStoreGroupContentSqlProvider { sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); } + if (record.getOriginalPrice() != null) { + sql.VALUES("original_price", "#{originalPrice,jdbcType=DECIMAL}"); + } + if (record.getPrice() != null) { sql.VALUES("price", "#{price,jdbcType=DECIMAL}"); } @@ -104,6 +108,7 @@ public class BsStoreGroupContentSqlProvider { } sql.SELECT("store_id"); sql.SELECT("`name`"); + sql.SELECT("original_price"); sql.SELECT("price"); sql.SELECT("img"); sql.SELECT("astrict"); @@ -147,6 +152,10 @@ public class BsStoreGroupContentSqlProvider { sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); } + if (record.getOriginalPrice() != null) { + sql.SET("original_price = #{record.originalPrice,jdbcType=DECIMAL}"); + } + if (record.getPrice() != null) { sql.SET("price = #{record.price,jdbcType=DECIMAL}"); } @@ -214,6 +223,7 @@ public class BsStoreGroupContentSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + sql.SET("original_price = #{record.originalPrice,jdbcType=DECIMAL}"); sql.SET("price = #{record.price,jdbcType=DECIMAL}"); sql.SET("img = #{record.img,jdbcType=VARCHAR}"); sql.SET("astrict = #{record.astrict,jdbcType=VARCHAR}"); @@ -246,6 +256,10 @@ public class BsStoreGroupContentSqlProvider { sql.SET("`name` = #{name,jdbcType=VARCHAR}"); } + if (record.getOriginalPrice() != null) { + sql.SET("original_price = #{originalPrice,jdbcType=DECIMAL}"); + } + if (record.getPrice() != null) { sql.SET("price = #{price,jdbcType=DECIMAL}"); } diff --git a/service/src/main/java/com/hfkj/dao/BsStoreGroupDetailMapper.java b/service/src/main/java/com/hfkj/dao/BsStoreGroupDetailMapper.java index b965a99..ce2307f 100644 --- a/service/src/main/java/com/hfkj/dao/BsStoreGroupDetailMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsStoreGroupDetailMapper.java @@ -39,14 +39,20 @@ public interface BsStoreGroupDetailMapper extends BsStoreGroupDetailMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into bs_store_group_detail (`name`, store_product_id, ", - "create_time, update_time, ", - "`status`, op_id, op_name, ", - "ext_1, ext_2, ext_3)", - "values (#{name,jdbcType=VARCHAR}, #{storeProductId,jdbcType=VARCHAR}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{status,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "insert into bs_store_group_detail (group_id, `name`, ", + "product_name, product_img, ", + "product_spec, store_product_id, ", + "`count`, create_time, ", + "update_time, `status`, ", + "op_id, op_name, ext_1, ", + "ext_2, ext_3)", + "values (#{groupId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ", + "#{productName,jdbcType=VARCHAR}, #{productImg,jdbcType=VARCHAR}, ", + "#{productSpec,jdbcType=VARCHAR}, #{storeProductId,jdbcType=VARCHAR}, ", + "#{count,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsStoreGroupDetail record); @@ -58,8 +64,13 @@ public interface BsStoreGroupDetailMapper extends BsStoreGroupDetailMapperExt { @SelectProvider(type=BsStoreGroupDetailSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="group_id", property="groupId", jdbcType=JdbcType.BIGINT), @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), + @Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR), + @Result(column="product_spec", property="productSpec", jdbcType=JdbcType.VARCHAR), @Result(column="store_product_id", property="storeProductId", jdbcType=JdbcType.VARCHAR), + @Result(column="count", property="count", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -73,15 +84,20 @@ public interface BsStoreGroupDetailMapper extends BsStoreGroupDetailMapperExt { @Select({ "select", - "id, `name`, store_product_id, create_time, update_time, `status`, op_id, op_name, ", - "ext_1, ext_2, ext_3", + "id, group_id, `name`, product_name, product_img, product_spec, store_product_id, ", + "`count`, create_time, update_time, `status`, op_id, op_name, ext_1, ext_2, ext_3", "from bs_store_group_detail", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="group_id", property="groupId", jdbcType=JdbcType.BIGINT), @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), + @Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR), + @Result(column="product_spec", property="productSpec", jdbcType=JdbcType.VARCHAR), @Result(column="store_product_id", property="storeProductId", jdbcType=JdbcType.VARCHAR), + @Result(column="count", property="count", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -104,8 +120,13 @@ public interface BsStoreGroupDetailMapper extends BsStoreGroupDetailMapperExt { @Update({ "update bs_store_group_detail", - "set `name` = #{name,jdbcType=VARCHAR},", + "set group_id = #{groupId,jdbcType=BIGINT},", + "`name` = #{name,jdbcType=VARCHAR},", + "product_name = #{productName,jdbcType=VARCHAR},", + "product_img = #{productImg,jdbcType=VARCHAR},", + "product_spec = #{productSpec,jdbcType=VARCHAR},", "store_product_id = #{storeProductId,jdbcType=VARCHAR},", + "`count` = #{count,jdbcType=INTEGER},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", "`status` = #{status,jdbcType=INTEGER},", diff --git a/service/src/main/java/com/hfkj/dao/BsStoreGroupDetailSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsStoreGroupDetailSqlProvider.java index a22f857..07b2b11 100644 --- a/service/src/main/java/com/hfkj/dao/BsStoreGroupDetailSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsStoreGroupDetailSqlProvider.java @@ -28,14 +28,34 @@ public class BsStoreGroupDetailSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("bs_store_group_detail"); + if (record.getGroupId() != null) { + sql.VALUES("group_id", "#{groupId,jdbcType=BIGINT}"); + } + if (record.getName() != null) { sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); } + if (record.getProductName() != null) { + sql.VALUES("product_name", "#{productName,jdbcType=VARCHAR}"); + } + + if (record.getProductImg() != null) { + sql.VALUES("product_img", "#{productImg,jdbcType=VARCHAR}"); + } + + if (record.getProductSpec() != null) { + sql.VALUES("product_spec", "#{productSpec,jdbcType=VARCHAR}"); + } + if (record.getStoreProductId() != null) { sql.VALUES("store_product_id", "#{storeProductId,jdbcType=VARCHAR}"); } + if (record.getCount() != null) { + sql.VALUES("`count`", "#{count,jdbcType=INTEGER}"); + } + if (record.getCreateTime() != null) { sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); } @@ -78,8 +98,13 @@ public class BsStoreGroupDetailSqlProvider { } else { sql.SELECT("id"); } + sql.SELECT("group_id"); sql.SELECT("`name`"); + sql.SELECT("product_name"); + sql.SELECT("product_img"); + sql.SELECT("product_spec"); sql.SELECT("store_product_id"); + sql.SELECT("`count`"); sql.SELECT("create_time"); sql.SELECT("update_time"); sql.SELECT("`status`"); @@ -109,14 +134,34 @@ public class BsStoreGroupDetailSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } + if (record.getGroupId() != null) { + sql.SET("group_id = #{record.groupId,jdbcType=BIGINT}"); + } + if (record.getName() != null) { sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); } + if (record.getProductName() != null) { + sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); + } + + if (record.getProductImg() != null) { + sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}"); + } + + if (record.getProductSpec() != null) { + sql.SET("product_spec = #{record.productSpec,jdbcType=VARCHAR}"); + } + if (record.getStoreProductId() != null) { sql.SET("store_product_id = #{record.storeProductId,jdbcType=VARCHAR}"); } + if (record.getCount() != null) { + sql.SET("`count` = #{record.count,jdbcType=INTEGER}"); + } + if (record.getCreateTime() != null) { sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); } @@ -158,8 +203,13 @@ public class BsStoreGroupDetailSqlProvider { sql.UPDATE("bs_store_group_detail"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("group_id = #{record.groupId,jdbcType=BIGINT}"); sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); + sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}"); + sql.SET("product_spec = #{record.productSpec,jdbcType=VARCHAR}"); sql.SET("store_product_id = #{record.storeProductId,jdbcType=VARCHAR}"); + sql.SET("`count` = #{record.count,jdbcType=INTEGER}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); @@ -178,14 +228,34 @@ public class BsStoreGroupDetailSqlProvider { SQL sql = new SQL(); sql.UPDATE("bs_store_group_detail"); + if (record.getGroupId() != null) { + sql.SET("group_id = #{groupId,jdbcType=BIGINT}"); + } + if (record.getName() != null) { sql.SET("`name` = #{name,jdbcType=VARCHAR}"); } + if (record.getProductName() != null) { + sql.SET("product_name = #{productName,jdbcType=VARCHAR}"); + } + + if (record.getProductImg() != null) { + sql.SET("product_img = #{productImg,jdbcType=VARCHAR}"); + } + + if (record.getProductSpec() != null) { + sql.SET("product_spec = #{productSpec,jdbcType=VARCHAR}"); + } + if (record.getStoreProductId() != null) { sql.SET("store_product_id = #{storeProductId,jdbcType=VARCHAR}"); } + if (record.getCount() != null) { + sql.SET("`count` = #{count,jdbcType=INTEGER}"); + } + if (record.getCreateTime() != null) { sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); } diff --git a/service/src/main/java/com/hfkj/dao/BsStoreMapperExt.java b/service/src/main/java/com/hfkj/dao/BsStoreMapperExt.java index 64b49b4..16e3fc5 100644 --- a/service/src/main/java/com/hfkj/dao/BsStoreMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsStoreMapperExt.java @@ -27,7 +27,8 @@ public interface BsStoreMapperExt { @Select(" ") List getStoreList(@Param("param") Map param); } diff --git a/service/src/main/java/com/hfkj/entity/BsStore.java b/service/src/main/java/com/hfkj/entity/BsStore.java index 0ccdf09..4962e67 100644 --- a/service/src/main/java/com/hfkj/entity/BsStore.java +++ b/service/src/main/java/com/hfkj/entity/BsStore.java @@ -1,5 +1,7 @@ package com.hfkj.entity; +import com.hfkj.model.BsStoreExtMsgModel; + import java.io.Serializable; import java.util.Date; @@ -12,7 +14,7 @@ import java.util.Date; * 代码由工具生成 * **/ -public class BsStore implements Serializable { +public class BsStore extends BsStoreExtMsgModel implements Serializable { /** * 主键 */ diff --git a/service/src/main/java/com/hfkj/entity/BsStoreGroupContent.java b/service/src/main/java/com/hfkj/entity/BsStoreGroupContent.java index 356f9cb..4a87950 100644 --- a/service/src/main/java/com/hfkj/entity/BsStoreGroupContent.java +++ b/service/src/main/java/com/hfkj/entity/BsStoreGroupContent.java @@ -1,5 +1,7 @@ package com.hfkj.entity; +import com.hfkj.model.GroupContentModel; + import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; @@ -13,7 +15,7 @@ import java.util.Date; * 代码由工具生成 * **/ -public class BsStoreGroupContent implements Serializable { +public class BsStoreGroupContent extends GroupContentModel implements Serializable { /** * 主键 */ @@ -29,6 +31,11 @@ public class BsStoreGroupContent implements Serializable { */ private String name; + /** + * 原价 + */ + private BigDecimal originalPrice; + /** * 团购价格 */ @@ -125,6 +132,14 @@ public class BsStoreGroupContent implements Serializable { this.name = name; } + public BigDecimal getOriginalPrice() { + return originalPrice; + } + + public void setOriginalPrice(BigDecimal originalPrice) { + this.originalPrice = originalPrice; + } + public BigDecimal getPrice() { return price; } @@ -252,6 +267,7 @@ public class BsStoreGroupContent implements Serializable { return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId())) && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getOriginalPrice() == null ? other.getOriginalPrice() == null : this.getOriginalPrice().equals(other.getOriginalPrice())) && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg())) && (this.getAstrict() == null ? other.getAstrict() == null : this.getAstrict().equals(other.getAstrict())) @@ -275,6 +291,7 @@ public class BsStoreGroupContent implements Serializable { result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode()); result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getOriginalPrice() == null) ? 0 : getOriginalPrice().hashCode()); result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode()); result = prime * result + ((getAstrict() == null) ? 0 : getAstrict().hashCode()); @@ -301,6 +318,7 @@ public class BsStoreGroupContent implements Serializable { sb.append(", id=").append(id); sb.append(", storeId=").append(storeId); sb.append(", name=").append(name); + sb.append(", originalPrice=").append(originalPrice); sb.append(", price=").append(price); sb.append(", img=").append(img); sb.append(", astrict=").append(astrict); diff --git a/service/src/main/java/com/hfkj/entity/BsStoreGroupContentExample.java b/service/src/main/java/com/hfkj/entity/BsStoreGroupContentExample.java index 8fb305c..a2fd328 100644 --- a/service/src/main/java/com/hfkj/entity/BsStoreGroupContentExample.java +++ b/service/src/main/java/com/hfkj/entity/BsStoreGroupContentExample.java @@ -316,6 +316,66 @@ public class BsStoreGroupContentExample { return (Criteria) this; } + public Criteria andOriginalPriceIsNull() { + addCriterion("original_price is null"); + return (Criteria) this; + } + + public Criteria andOriginalPriceIsNotNull() { + addCriterion("original_price is not null"); + return (Criteria) this; + } + + public Criteria andOriginalPriceEqualTo(BigDecimal value) { + addCriterion("original_price =", value, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceNotEqualTo(BigDecimal value) { + addCriterion("original_price <>", value, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceGreaterThan(BigDecimal value) { + addCriterion("original_price >", value, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("original_price >=", value, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceLessThan(BigDecimal value) { + addCriterion("original_price <", value, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("original_price <=", value, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceIn(List values) { + addCriterion("original_price in", values, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceNotIn(List values) { + addCriterion("original_price not in", values, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("original_price between", value1, value2, "originalPrice"); + return (Criteria) this; + } + + public Criteria andOriginalPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("original_price not between", value1, value2, "originalPrice"); + return (Criteria) this; + } + public Criteria andPriceIsNull() { addCriterion("price is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/entity/BsStoreGroupDetail.java b/service/src/main/java/com/hfkj/entity/BsStoreGroupDetail.java index 0c26b9f..332a8f6 100644 --- a/service/src/main/java/com/hfkj/entity/BsStoreGroupDetail.java +++ b/service/src/main/java/com/hfkj/entity/BsStoreGroupDetail.java @@ -18,16 +18,41 @@ public class BsStoreGroupDetail implements Serializable { */ private Long id; + /** + * 团购id + */ + private Long groupId; + /** * 详情名称 */ private String name; /** - * 门店产品编码合计 + * 产品名称 + */ + private String productName; + + /** + * 产品图片 + */ + private String productImg; + + /** + * 产品规格 + */ + private String productSpec; + + /** + * 门店产品编码 */ private String storeProductId; + /** + * 数量 + */ + private Integer count; + /** * 创建时间 */ @@ -78,6 +103,14 @@ public class BsStoreGroupDetail implements Serializable { this.id = id; } + public Long getGroupId() { + return groupId; + } + + public void setGroupId(Long groupId) { + this.groupId = groupId; + } + public String getName() { return name; } @@ -86,6 +119,30 @@ public class BsStoreGroupDetail implements Serializable { this.name = name; } + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductImg() { + return productImg; + } + + public void setProductImg(String productImg) { + this.productImg = productImg; + } + + public String getProductSpec() { + return productSpec; + } + + public void setProductSpec(String productSpec) { + this.productSpec = productSpec; + } + public String getStoreProductId() { return storeProductId; } @@ -94,6 +151,14 @@ public class BsStoreGroupDetail implements Serializable { this.storeProductId = storeProductId; } + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + public Date getCreateTime() { return createTime; } @@ -171,8 +236,13 @@ public class BsStoreGroupDetail implements Serializable { } BsStoreGroupDetail other = (BsStoreGroupDetail) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getGroupId() == null ? other.getGroupId() == null : this.getGroupId().equals(other.getGroupId())) && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName())) + && (this.getProductImg() == null ? other.getProductImg() == null : this.getProductImg().equals(other.getProductImg())) + && (this.getProductSpec() == null ? other.getProductSpec() == null : this.getProductSpec().equals(other.getProductSpec())) && (this.getStoreProductId() == null ? other.getStoreProductId() == null : this.getStoreProductId().equals(other.getStoreProductId())) + && (this.getCount() == null ? other.getCount() == null : this.getCount().equals(other.getCount())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) @@ -188,8 +258,13 @@ public class BsStoreGroupDetail implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getGroupId() == null) ? 0 : getGroupId().hashCode()); result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode()); + result = prime * result + ((getProductImg() == null) ? 0 : getProductImg().hashCode()); + result = prime * result + ((getProductSpec() == null) ? 0 : getProductSpec().hashCode()); result = prime * result + ((getStoreProductId() == null) ? 0 : getStoreProductId().hashCode()); + result = prime * result + ((getCount() == null) ? 0 : getCount().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); @@ -208,8 +283,13 @@ public class BsStoreGroupDetail implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); + sb.append(", groupId=").append(groupId); sb.append(", name=").append(name); + sb.append(", productName=").append(productName); + sb.append(", productImg=").append(productImg); + sb.append(", productSpec=").append(productSpec); sb.append(", storeProductId=").append(storeProductId); + sb.append(", count=").append(count); sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); sb.append(", status=").append(status); diff --git a/service/src/main/java/com/hfkj/entity/BsStoreGroupDetailExample.java b/service/src/main/java/com/hfkj/entity/BsStoreGroupDetailExample.java index b2589af..2dbf09d 100644 --- a/service/src/main/java/com/hfkj/entity/BsStoreGroupDetailExample.java +++ b/service/src/main/java/com/hfkj/entity/BsStoreGroupDetailExample.java @@ -185,6 +185,66 @@ public class BsStoreGroupDetailExample { return (Criteria) this; } + public Criteria andGroupIdIsNull() { + addCriterion("group_id is null"); + return (Criteria) this; + } + + public Criteria andGroupIdIsNotNull() { + addCriterion("group_id is not null"); + return (Criteria) this; + } + + public Criteria andGroupIdEqualTo(Long value) { + addCriterion("group_id =", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdNotEqualTo(Long value) { + addCriterion("group_id <>", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdGreaterThan(Long value) { + addCriterion("group_id >", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdGreaterThanOrEqualTo(Long value) { + addCriterion("group_id >=", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdLessThan(Long value) { + addCriterion("group_id <", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdLessThanOrEqualTo(Long value) { + addCriterion("group_id <=", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdIn(List values) { + addCriterion("group_id in", values, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdNotIn(List values) { + addCriterion("group_id not in", values, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdBetween(Long value1, Long value2) { + addCriterion("group_id between", value1, value2, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdNotBetween(Long value1, Long value2) { + addCriterion("group_id not between", value1, value2, "groupId"); + return (Criteria) this; + } + public Criteria andNameIsNull() { addCriterion("`name` is null"); return (Criteria) this; @@ -255,6 +315,216 @@ public class BsStoreGroupDetailExample { return (Criteria) this; } + public Criteria andProductNameIsNull() { + addCriterion("product_name is null"); + return (Criteria) this; + } + + public Criteria andProductNameIsNotNull() { + addCriterion("product_name is not null"); + return (Criteria) this; + } + + public Criteria andProductNameEqualTo(String value) { + addCriterion("product_name =", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotEqualTo(String value) { + addCriterion("product_name <>", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameGreaterThan(String value) { + addCriterion("product_name >", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameGreaterThanOrEqualTo(String value) { + addCriterion("product_name >=", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLessThan(String value) { + addCriterion("product_name <", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLessThanOrEqualTo(String value) { + addCriterion("product_name <=", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLike(String value) { + addCriterion("product_name like", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotLike(String value) { + addCriterion("product_name not like", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameIn(List values) { + addCriterion("product_name in", values, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotIn(List values) { + addCriterion("product_name not in", values, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameBetween(String value1, String value2) { + addCriterion("product_name between", value1, value2, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotBetween(String value1, String value2) { + addCriterion("product_name not between", value1, value2, "productName"); + return (Criteria) this; + } + + public Criteria andProductImgIsNull() { + addCriterion("product_img is null"); + return (Criteria) this; + } + + public Criteria andProductImgIsNotNull() { + addCriterion("product_img is not null"); + return (Criteria) this; + } + + public Criteria andProductImgEqualTo(String value) { + addCriterion("product_img =", value, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgNotEqualTo(String value) { + addCriterion("product_img <>", value, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgGreaterThan(String value) { + addCriterion("product_img >", value, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgGreaterThanOrEqualTo(String value) { + addCriterion("product_img >=", value, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgLessThan(String value) { + addCriterion("product_img <", value, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgLessThanOrEqualTo(String value) { + addCriterion("product_img <=", value, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgLike(String value) { + addCriterion("product_img like", value, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgNotLike(String value) { + addCriterion("product_img not like", value, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgIn(List values) { + addCriterion("product_img in", values, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgNotIn(List values) { + addCriterion("product_img not in", values, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgBetween(String value1, String value2) { + addCriterion("product_img between", value1, value2, "productImg"); + return (Criteria) this; + } + + public Criteria andProductImgNotBetween(String value1, String value2) { + addCriterion("product_img not between", value1, value2, "productImg"); + return (Criteria) this; + } + + public Criteria andProductSpecIsNull() { + addCriterion("product_spec is null"); + return (Criteria) this; + } + + public Criteria andProductSpecIsNotNull() { + addCriterion("product_spec is not null"); + return (Criteria) this; + } + + public Criteria andProductSpecEqualTo(String value) { + addCriterion("product_spec =", value, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecNotEqualTo(String value) { + addCriterion("product_spec <>", value, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecGreaterThan(String value) { + addCriterion("product_spec >", value, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecGreaterThanOrEqualTo(String value) { + addCriterion("product_spec >=", value, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecLessThan(String value) { + addCriterion("product_spec <", value, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecLessThanOrEqualTo(String value) { + addCriterion("product_spec <=", value, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecLike(String value) { + addCriterion("product_spec like", value, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecNotLike(String value) { + addCriterion("product_spec not like", value, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecIn(List values) { + addCriterion("product_spec in", values, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecNotIn(List values) { + addCriterion("product_spec not in", values, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecBetween(String value1, String value2) { + addCriterion("product_spec between", value1, value2, "productSpec"); + return (Criteria) this; + } + + public Criteria andProductSpecNotBetween(String value1, String value2) { + addCriterion("product_spec not between", value1, value2, "productSpec"); + return (Criteria) this; + } + public Criteria andStoreProductIdIsNull() { addCriterion("store_product_id is null"); return (Criteria) this; @@ -325,6 +595,66 @@ public class BsStoreGroupDetailExample { return (Criteria) this; } + public Criteria andCountIsNull() { + addCriterion("`count` is null"); + return (Criteria) this; + } + + public Criteria andCountIsNotNull() { + addCriterion("`count` is not null"); + return (Criteria) this; + } + + public Criteria andCountEqualTo(Integer value) { + addCriterion("`count` =", value, "count"); + return (Criteria) this; + } + + public Criteria andCountNotEqualTo(Integer value) { + addCriterion("`count` <>", value, "count"); + return (Criteria) this; + } + + public Criteria andCountGreaterThan(Integer value) { + addCriterion("`count` >", value, "count"); + return (Criteria) this; + } + + public Criteria andCountGreaterThanOrEqualTo(Integer value) { + addCriterion("`count` >=", value, "count"); + return (Criteria) this; + } + + public Criteria andCountLessThan(Integer value) { + addCriterion("`count` <", value, "count"); + return (Criteria) this; + } + + public Criteria andCountLessThanOrEqualTo(Integer value) { + addCriterion("`count` <=", value, "count"); + return (Criteria) this; + } + + public Criteria andCountIn(List values) { + addCriterion("`count` in", values, "count"); + return (Criteria) this; + } + + public Criteria andCountNotIn(List values) { + addCriterion("`count` not in", values, "count"); + return (Criteria) this; + } + + public Criteria andCountBetween(Integer value1, Integer value2) { + addCriterion("`count` between", value1, value2, "count"); + return (Criteria) this; + } + + public Criteria andCountNotBetween(Integer value1, Integer value2) { + addCriterion("`count` not between", value1, value2, "count"); + return (Criteria) this; + } + public Criteria andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/group/BsStoreGroupProductService.java b/service/src/main/java/com/hfkj/group/BsStoreGroupProductService.java index 51c37ef..7050720 100644 --- a/service/src/main/java/com/hfkj/group/BsStoreGroupProductService.java +++ b/service/src/main/java/com/hfkj/group/BsStoreGroupProductService.java @@ -84,6 +84,10 @@ public interface BsStoreGroupProductService { */ BsStoreGroupDetail findGroupDetail(Long id); + BsStoreGroupDetail findGroupDetail(String productId , Long groupId); + + void deleteGroupDetail(Long id); + /** * @Author Sum1Dream * @Name getGroupDetailByList @@ -124,6 +128,8 @@ public interface BsStoreGroupProductService { */ BsStoreGroupServeRule findGroupServeRule(Long id); + BsStoreGroupServeRule findGroupServeRuleByGroup(Long groupId); + /** * @Author Sum1Dream * @Name getGroupServeRuleByList diff --git a/service/src/main/java/com/hfkj/group/BsStoreGroupService.java b/service/src/main/java/com/hfkj/group/BsStoreGroupService.java index 61bd071..5c21518 100644 --- a/service/src/main/java/com/hfkj/group/BsStoreGroupService.java +++ b/service/src/main/java/com/hfkj/group/BsStoreGroupService.java @@ -1,5 +1,6 @@ package com.hfkj.group; +import com.hfkj.entity.BsStoreExtMsg; import com.hfkj.entity.BsStoreImg; import com.hfkj.entity.BsStoreProduct; import org.bouncycastle.crypto.tls.MACAlgorithm; @@ -47,6 +48,8 @@ public interface BsStoreGroupService { */ BsStoreImg findStoreImg(Long id); + BsStoreImg findStoreImgByStoreId(Long storeId); + /** * @Author Sum1Dream * @Name getBsStoreByList @@ -96,4 +99,58 @@ public interface BsStoreGroupService { * @return void */ List getStoreProductByList(Map map); + + + /** + * @Author Sum1Dream + * @Name insertStoreExtMsg + * @Description // 新增门店扩展信息 + * @Date 9:33 2023/11/1 + * @Param bsStoreExtMsg + * @return void + */ + void insertStoreExtMsg(BsStoreExtMsg bsStoreExtMsg); + + + /** + * @Author Sum1Dream + * @Name editStoreExtMsg + * @Description // 编辑门店扩展信息 + * @Date 9:33 2023/11/1 + * @Param bsStoreExtMsg + * @return void + */ + void editStoreExtMsg(BsStoreExtMsg bsStoreExtMsg); + + /** + * @Author Sum1Dream + * @Name findStoreExtMsg + * @Description // 根据id查询门店扩展信息内容 + * @Date 9:34 2023/11/1 + * @Param id + * @return com.hfkj.entity.BsStoreExtMsg + */ + BsStoreExtMsg findStoreExtMsg(Long id); + + /** + * @Author Sum1Dream + * @Name findStoreExtMsgByStoreId + * @Description // 根据门店Id查询门店扩展信息内容 + * @Date 9:36 2023/11/1 + * @Param storeId + * @return com.hfkj.entity.BsStoreExtMsg + */ + BsStoreExtMsg findStoreExtMsgByStoreId(Long storeId); + + /** + * @Author Sum1Dream + * @Name getStoreExtMsgByList + * @Description // 查询列表 + * @Date 9:34 2023/11/1 + * @Param map + * @return java.util.List + */ + List getStoreExtMsgByList(Map map); + + } diff --git a/service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java b/service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java index e530023..76746be 100644 --- a/service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java +++ b/service/src/main/java/com/hfkj/group/impl/BsStoreGroupProductServiceImpl.java @@ -3,10 +3,9 @@ package com.hfkj.group.impl; import com.hfkj.dao.BsStoreGroupContentMapper; import com.hfkj.dao.BsStoreGroupDetailMapper; import com.hfkj.dao.BsStoreGroupServeRuleMapper; -import com.hfkj.entity.BsStoreGroupContent; -import com.hfkj.entity.BsStoreGroupDetail; -import com.hfkj.entity.BsStoreGroupServeRule; +import com.hfkj.entity.*; import com.hfkj.group.BsStoreGroupProductService; +import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -27,56 +26,110 @@ public class BsStoreGroupProductServiceImpl implements BsStoreGroupProductServic @Override public void insertStoreGroupContent(BsStoreGroupContent bsStoreGroupContent) { - + storeGroupContentMapper.insert(bsStoreGroupContent); } @Override public void editStoreGroupContent(BsStoreGroupContent bsStoreGroupContent) { - + storeGroupContentMapper.updateByPrimaryKey(bsStoreGroupContent); } @Override public BsStoreGroupContent findStoreGroupContent(Long id) { - return null; + return storeGroupContentMapper.selectByPrimaryKey(id); } @Override public List getStoreGroupContentByList(Map map) { - return null; + BsStoreGroupContentExample example = new BsStoreGroupContentExample(); + BsStoreGroupContentExample.Criteria criteria = example.createCriteria(); + + if (org.apache.commons.collections4.MapUtils.getLong(map, "storeId") != null) { + criteria.andStoreIdEqualTo(MapUtils.getLong(map, "storeId")); + } + criteria.andStatusNotEqualTo(0); + + return storeGroupContentMapper.selectByExample(example); } @Override public void insertGroupDetail(BsStoreGroupDetail storeGroupDetail) { - + storeGroupDetailMapper.insert(storeGroupDetail); } @Override public void editGroupDetail(BsStoreGroupDetail storeGroupDetail) { - + storeGroupDetailMapper.updateByPrimaryKeySelective(storeGroupDetail); } @Override public BsStoreGroupDetail findGroupDetail(Long id) { + return storeGroupDetailMapper.selectByPrimaryKey(id); + } + + @Override + public BsStoreGroupDetail findGroupDetail(String productId , Long groupId) { + BsStoreGroupDetailExample example = new BsStoreGroupDetailExample(); + BsStoreGroupDetailExample.Criteria criteria = example.createCriteria(); + + criteria.andStatusEqualTo(1).andStoreProductIdEqualTo(productId).andGroupIdEqualTo(groupId); + + List list = storeGroupDetailMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; } + @Override + public void deleteGroupDetail(Long id) { + storeGroupDetailMapper.deleteByPrimaryKey(id); + } + @Override public List getGroupDetailByList(Map map) { - return null; + + BsStoreGroupDetailExample example = new BsStoreGroupDetailExample(); + BsStoreGroupDetailExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map, "groupId") != null) { + criteria.andGroupIdEqualTo(MapUtils.getLong(map, "groupId")); + } + + criteria.andStatusNotEqualTo(0); + + return storeGroupDetailMapper.selectByExample(example); } @Override public void insertGroupServeRule(BsStoreGroupServeRule storeGroupServeRule) { - + storeGroupServeRuleMapper.insert(storeGroupServeRule); } @Override public void editGroupServeRule(BsStoreGroupServeRule storeGroupServeRule) { - + storeGroupServeRuleMapper.updateByPrimaryKeySelective(storeGroupServeRule); } @Override public BsStoreGroupServeRule findGroupServeRule(Long id) { + return storeGroupServeRuleMapper.selectByPrimaryKey(id); + } + + @Override + public BsStoreGroupServeRule findGroupServeRuleByGroup(Long groupId) { + BsStoreGroupServeRuleExample example = new BsStoreGroupServeRuleExample(); + BsStoreGroupServeRuleExample.Criteria criteria = example.createCriteria(); + + criteria.andGroupIdEqualTo(groupId); + + List list = storeGroupServeRuleMapper.selectByExample(example); + + if (!list.isEmpty()) { + return list.get(0); + } + return null; } diff --git a/service/src/main/java/com/hfkj/group/impl/BsStoreGroupServiceImpl.java b/service/src/main/java/com/hfkj/group/impl/BsStoreGroupServiceImpl.java index 1bdc018..0f07103 100644 --- a/service/src/main/java/com/hfkj/group/impl/BsStoreGroupServiceImpl.java +++ b/service/src/main/java/com/hfkj/group/impl/BsStoreGroupServiceImpl.java @@ -1,11 +1,9 @@ package com.hfkj.group.impl; +import com.hfkj.dao.BsStoreExtMsgMapper; import com.hfkj.dao.BsStoreImgMapper; import com.hfkj.dao.BsStoreProductMapper; -import com.hfkj.entity.BsStoreImg; -import com.hfkj.entity.BsStoreImgExample; -import com.hfkj.entity.BsStoreProduct; -import com.hfkj.entity.BsStoreProductExample; +import com.hfkj.entity.*; import com.hfkj.group.BsStoreGroupService; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; @@ -23,6 +21,9 @@ public class BsStoreGroupServiceImpl implements BsStoreGroupService { @Resource private BsStoreProductMapper storeProductMapper; + @Resource + private BsStoreExtMsgMapper storeExtMsgMapper; + @Override public void insertStoreImg(BsStoreImg bsStoreImg) { bsStoreImgMapper.insert(bsStoreImg); @@ -38,6 +39,20 @@ public class BsStoreGroupServiceImpl implements BsStoreGroupService { return bsStoreImgMapper.selectByPrimaryKey(id); } + @Override + public BsStoreImg findStoreImgByStoreId(Long storeId) { + BsStoreImgExample example = new BsStoreImgExample(); + BsStoreImgExample.Criteria criteria = example.createCriteria(); + criteria.andStoreIdEqualTo(storeId); + + List list = bsStoreImgMapper.selectByExample(example); + + if (list.size() > 0) { + return list.get(0); + } + return null; + } + @Override public List getBsStoreImgByList(Map map) { BsStoreImgExample example = new BsStoreImgExample(); @@ -81,4 +96,40 @@ public class BsStoreGroupServiceImpl implements BsStoreGroupService { return storeProductMapper.selectByExample(example); } + + @Override + public void insertStoreExtMsg(BsStoreExtMsg bsStoreExtMsg) { + storeExtMsgMapper.insert(bsStoreExtMsg); + } + + @Override + public void editStoreExtMsg(BsStoreExtMsg bsStoreExtMsg) { + storeExtMsgMapper.updateByPrimaryKey(bsStoreExtMsg); + } + + @Override + public BsStoreExtMsg findStoreExtMsg(Long id) { + return storeExtMsgMapper.selectByPrimaryKey(id); + } + + @Override + public BsStoreExtMsg findStoreExtMsgByStoreId(Long storeId) { + BsStoreExtMsgExample example = new BsStoreExtMsgExample(); + BsStoreExtMsgExample.Criteria criteria = example.createCriteria(); + + criteria.andStoreIdEqualTo(storeId).andStatusEqualTo(1); + + List list = storeExtMsgMapper.selectByExample(example); + + if (list.size() > 0) { + return list.get(0); + } + + return null; + } + + @Override + public List getStoreExtMsgByList(Map map) { + return null; + } } diff --git a/service/src/main/java/com/hfkj/model/BsStoreExtMsgModel.java b/service/src/main/java/com/hfkj/model/BsStoreExtMsgModel.java new file mode 100644 index 0000000..0c01913 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/BsStoreExtMsgModel.java @@ -0,0 +1,19 @@ +package com.hfkj.model; + +import com.hfkj.entity.BsStoreExtMsg; +import com.hfkj.entity.BsStoreGroupContent; +import com.hfkj.entity.BsStoreImg; +import lombok.Data; + +import java.util.List; + +@Data +public class BsStoreExtMsgModel { + + private List bsStoreImg; + + private List storeGroupContentList; + + private BsStoreExtMsg bsStoreExtMsg; + +} diff --git a/service/src/main/java/com/hfkj/model/GroupContentModel.java b/service/src/main/java/com/hfkj/model/GroupContentModel.java new file mode 100644 index 0000000..2988685 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/GroupContentModel.java @@ -0,0 +1,18 @@ +package com.hfkj.model; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.entity.BsStoreGroupContent; +import com.hfkj.entity.BsStoreGroupServeRule; +import com.hfkj.entity.BsStoreImg; +import lombok.Data; + +import java.util.List; + +@Data +public class GroupContentModel { + + private List groupDetails; + + private BsStoreGroupServeRule storeGroupServeRule; + +} diff --git a/service/src/main/java/com/hfkj/model/OpenStoreModel.java b/service/src/main/java/com/hfkj/model/OpenStoreModel.java index 9dedcfb..749130d 100644 --- a/service/src/main/java/com/hfkj/model/OpenStoreModel.java +++ b/service/src/main/java/com/hfkj/model/OpenStoreModel.java @@ -1,18 +1,24 @@ package com.hfkj.model; import ch.qos.logback.core.db.dialect.DBUtil; +import com.hfkj.entity.BsStoreGroupContent; import javax.xml.crypto.Data; +import java.util.List; /** * 对外的门店信息内容 * @author sum1dream */ +@lombok.Data public class OpenStoreModel { // 门店地址 private String address; + // 门店Id + private String storeId; + // 门头照 private String doorHeadImg; @@ -34,7 +40,6 @@ public class OpenStoreModel { // 门店状态 0:删除 1:正常 2:停用 3:审核中 4:审核失败 private Integer storeStatus; - // 唯独 private String latitude; @@ -46,101 +51,9 @@ public class OpenStoreModel { private Double distance; - public Double getDistance() { - return distance; - } - - public void setDistance(Double distance) { - this.distance = distance; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - - public String getDoorHeadImg() { - return doorHeadImg; - } - - public void setDoorHeadImg(String doorHeadImg) { - this.doorHeadImg = doorHeadImg; - } - - public String getStoreName() { - return storeName; - } - - public void setStoreName(String storeName) { - this.storeName = storeName; - } - - public Long getParentId() { - return parentId; - } - - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - public Long getChildId() { - return childId; - } - - public void setChildId(Long childId) { - this.childId = childId; - } - - public String getParentName() { - return parentName; - } - - public void setParentName(String parentName) { - this.parentName = parentName; - } - - public String getChildName() { - return childName; - } - - public void setChildName(String childName) { - this.childName = childName; - } - - public Integer getStoreStatus() { - return storeStatus; - } + private String distances; - public void setStoreStatus(Integer storeStatus) { - this.storeStatus = storeStatus; - } - public Data getStoreCreateTime() { - return storeCreateTime; - } + private List storeGroupContentList; - public void setStoreCreateTime(Data storeCreateTime) { - this.storeCreateTime = storeCreateTime; - } } diff --git a/service/src/main/java/com/hfkj/service/BsStoreService.java b/service/src/main/java/com/hfkj/service/BsStoreService.java index 7efc41c..26e556a 100644 --- a/service/src/main/java/com/hfkj/service/BsStoreService.java +++ b/service/src/main/java/com/hfkj/service/BsStoreService.java @@ -71,7 +71,7 @@ public interface BsStoreService { * @Param [name] * @Return java.util.List */ - List getStoreList(String name , Long childId); + List getStoreList(String name , Long childId , Long parentId); /** * 统计门店交易 diff --git a/service/src/main/java/com/hfkj/service/impl/BsStoreServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsStoreServiceImpl.java index e65ed3d..482adf0 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsStoreServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsStoreServiceImpl.java @@ -228,7 +228,7 @@ public class BsStoreServiceImpl implements BsStoreService { } @Override - public List getStoreList(String name , Long childId) { + public List getStoreList(String name , Long childId , Long parentId) { Map map = new HashMap<>(); if (name != null) { @@ -238,6 +238,10 @@ public class BsStoreServiceImpl implements BsStoreService { map.put("childId" , childId); } + if (parentId != null) { + map.put("parentId" , parentId); + } + return storeMapper.getStoreList(map); }