From ae2773168a4c5d05c6d6ec6533309eec148c66b5 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Thu, 9 May 2024 15:36:10 +0800 Subject: [PATCH] Changes --- .../goods/GoodsBrandController.java | 19 +- .../controller/goods/GoodsController.java | 213 +++++++++++++++ .../com/hfkj/common/exception/ErrorCode.java | 5 +- .../java/com/hfkj/dao/GoodsMsgMapper.java | 8 +- .../com/hfkj/dao/GoodsMsgSqlProvider.java | 8 +- .../java/com/hfkj/dao/GoodsVpdMapper.java | 37 ++- .../com/hfkj/dao/GoodsVpdSqlProvider.java | 58 +++- .../main/java/com/hfkj/entity/GoodsMsg.java | 6 +- .../java/com/hfkj/entity/GoodsMsgExample.java | 20 +- .../main/java/com/hfkj/entity/GoodsVpd.java | 66 ++++- .../java/com/hfkj/entity/GoodsVpdExample.java | 248 ++++++++++++++++-- .../main/java/com/hfkj/model/GoodsModel.java | 59 +++++ .../hfkj/service/goods/GoodsBrandService.java | 6 +- .../hfkj/service/goods/GoodsMsgService.java | 77 ++++++ .../hfkj/service/goods/GoodsSpecsService.java | 79 ++++++ .../hfkj/service/goods/GoodsTypeService.java | 10 + .../hfkj/service/goods/GoodsVpdService.java | 80 ++++++ .../goods/impl/GoodsBrandServiceImpl.java | 20 +- .../goods/impl/GoodsMsgServiceImpl.java | 57 ++++ .../goods/impl/GoodsSpecsServiceImpl.java | 80 ++++++ .../goods/impl/GoodsTypeServiceImpl.java | 6 + .../goods/impl/GoodsVpdServiceImpl.java | 74 ++++++ 22 files changed, 1155 insertions(+), 81 deletions(-) create mode 100644 bweb/src/main/java/com/bweb/controller/goods/GoodsController.java create mode 100644 service/src/main/java/com/hfkj/model/GoodsModel.java create mode 100644 service/src/main/java/com/hfkj/service/goods/GoodsMsgService.java create mode 100644 service/src/main/java/com/hfkj/service/goods/GoodsSpecsService.java create mode 100644 service/src/main/java/com/hfkj/service/goods/GoodsVpdService.java create mode 100644 service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java create mode 100644 service/src/main/java/com/hfkj/service/goods/impl/GoodsSpecsServiceImpl.java create mode 100644 service/src/main/java/com/hfkj/service/goods/impl/GoodsVpdServiceImpl.java diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsBrandController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsBrandController.java index 336bb9e..e7bc4de 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsBrandController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsBrandController.java @@ -9,6 +9,7 @@ import com.hfkj.common.security.SessionObject; import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.GoodsBrand; +import com.hfkj.entity.GoodsType; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; import com.hfkj.service.goods.GoodsBrandService; @@ -24,7 +25,6 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.HashMap; -import java.util.List; import java.util.Map; @Controller @@ -102,5 +102,22 @@ public class GoodsBrandController { } } + @RequestMapping(value="/delete",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "删除") + public ResponseData delete(@RequestParam(value = "id" , required = false) Long id) { + try { + + + goodsBrandService.delete(id , false); + + return ResponseMsgUtil.success("删除成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java new file mode 100644 index 0000000..a11b52e --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java @@ -0,0 +1,213 @@ +package com.bweb.controller.goods; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.*; +import com.hfkj.model.GoodsModel; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.service.goods.*; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.BeanUtils; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; + +@Controller +@RequestMapping(value="/goods") +@Api(value="商品信息") +public class GoodsController { + + private static final Logger log = LoggerFactory.getLogger(GoodsController.class); + + @Resource + private GoodsMsgService goodsMsgService; + + @Resource + private GoodsBrandService goodsBrandService; + + @Resource + private GoodsSpecsService goodsSpecsService; + + @Resource + private GoodsTypeService goodsTypeService; + + @Resource + private GoodsVpdService goodsVpdService; + + @Resource + private UserCenter userCenter; + + @RequestMapping(value="/editGoodsMsg",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑商品信息") + public ResponseData editGoodsMsg(@RequestBody GoodsMsg body, HttpServletRequest request) { + + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); + } + + if (body == null + || body.getGoodsBrand() == null + || body.getGoodsType() == null + || body.getType() == null + || StringUtils.isBlank(body.getListImg()) + || StringUtils.isBlank(body.getBannerImg()) + || StringUtils.isBlank(body.getDetailImg()) + || StringUtils.isBlank(body.getTitle())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + GoodsMsg goodsMsg; + + if (body.getId() != null) { + // 查询品牌 + goodsMsg = goodsMsgService.queryDetail(body.getId()); + if (goodsMsg == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + } else { + goodsMsg = new GoodsMsg(); + goodsMsg.setCreateTime(new Date()); + } + + goodsMsg.setUpdateTime(new Date()); + goodsMsg.setGoodsBrandName(goodsBrandService.findGoodsBrandName(body.getGoodsBrand())); + goodsMsg.setGoodsTypeName(goodsTypeService.findGoodsType(body.getGoodsType())); + goodsMsg.setStatus(2); + goodsMsg.setTitle(body.getTitle()); + goodsMsg.setMerId(userModel.getAccount().getId()); + goodsMsg.setMerName(userModel.getAccount().getUserName()); + + if (body.getId() != null) { + goodsMsgService.update(goodsMsg); + } else { + goodsMsgService.create(goodsMsg); + } + + return ResponseMsgUtil.success("操作成功"); + } + + @RequestMapping(value="/editGoodsSpecs",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑商品规格") + public ResponseData editGoodsSpecs(@RequestBody GoodsModel body, HttpServletRequest request) { + + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); + } + + if (body == null + || body.getGoodsId() == null + || body.getOriginalPrice() == null + || body.getSalePrice() == null + || body.getPurLimit() == null + || body.getStock() == null + || StringUtils.isBlank(body.getBannerImg()) + || StringUtils.isBlank(body.getShowImg()) + || StringUtils.isBlank(body.getName())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + GoodsMsg goodsMsg = goodsMsgService.queryDetail(body.getGoodsId()); + + if (goodsMsg == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + + + + GoodsSpecs goodsSpecs; + GoodsVpd goodsVpd; + + + if (body.getId() != null) { + // 查询规格 + goodsSpecs = goodsSpecsService.queryDetail(body.getId()); + if (goodsSpecs == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + } else { + goodsSpecs = new GoodsSpecs(); + goodsSpecs.setCreateTime(new Date()); + } + + + goodsSpecs.setUpdateTime(new Date()); + goodsSpecs.setGoodsId(body.getGoodsId()); + goodsSpecs.setOriginalPrice(body.getOriginalPrice()); + goodsSpecs.setSalePrice(body.getSalePrice()); + goodsSpecs.setPurLimit(body.getPurLimit()); + goodsSpecs.setStock(body.getStock()); + goodsSpecs.setBannerImg(body.getBannerImg()); + goodsSpecs.setShowImg(body.getShowImg()); + goodsSpecs.setName(body.getName()); + goodsSpecs.setStatus(1); + + + if (goodsSpecs.getId() != null) { + goodsSpecsService.update(goodsSpecs); + } else { + goodsSpecsService.create(goodsSpecs); + } + + // 判断当前商品是否是虚拟商品 + if(goodsMsg.getType() == 2) { + // 判断必填项 + if ( body.getSpecsId() == null + || body.getRecycleDay() == null + || body.getType() == null + || body.getSalesEndTime() == null + || body.getSource() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询虚拟产品 + goodsVpd = goodsVpdService.queryDetailBySpecsId(goodsSpecs.getId()); + + if (goodsVpd == null) { + goodsVpd = new GoodsVpd(); + goodsVpd.setCreateTime(new Date()); + } + + goodsVpd.setSpecsId(goodsSpecs.getId()); + goodsVpd.setRecycleDay(body.getRecycleDay()); + goodsVpd.setType(body.getType()); + goodsVpd.setJumpType(body.getJumpType()); + goodsVpd.setJumpUrl(body.getJumpUrl()); + goodsVpd.setAppidId(body.getAppidId()); + goodsVpd.setSalesEndTime(body.getSalesEndTime()); + goodsVpd.setSource(body.getSource()); + goodsVpd.setSalesEndTime(body.getSalesEndTime()); + goodsVpd.setUpdateTime(new Date()); + + if (goodsVpd.getId() != null) { + goodsVpdService.update(goodsVpd); + } else { + goodsVpdService.create(goodsVpd); + } + } + + return ResponseMsgUtil.success("操作成功"); + } + + +} diff --git a/service/src/main/java/com/hfkj/common/exception/ErrorCode.java b/service/src/main/java/com/hfkj/common/exception/ErrorCode.java index 00b155f..1bcc6f0 100644 --- a/service/src/main/java/com/hfkj/common/exception/ErrorCode.java +++ b/service/src/main/java/com/hfkj/common/exception/ErrorCode.java @@ -10,9 +10,9 @@ package com.hfkj.common.exception; * 2000-2999 biz异常 * 999999 未知异常 * @author: 机器猫 - * @date: 2018年8月12日 上午11:43:30 + * @date: 2024年4月12日 上午11:43:30 * - * @Copyright: 2018 www.shinwoten.com Inc. All rights reserved. + * @Copyright: 2024 Inc. All rights reserved. */ public enum ErrorCode { @@ -27,6 +27,7 @@ public enum ErrorCode { ACCOUNT_LOGIN_EXPIRE("2002","登录账户已过期"), ACCOUNT_LOGIN_NOT("2003","账户未登录"), CONTENT_NOT_FOUND("2004","未查询到相关内容"), + ROLE_NOT_PERMISSIONS("2005","该角色没有权限"), UNKNOW_ERROR("999999","未知异常"), EXCEL_ERROR("80000","Excel处理异常"), diff --git a/service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java b/service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java index d5cc20f..14bfde8 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java +++ b/service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java @@ -50,7 +50,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { "ext_2, ext_3)", "values (#{goodsTypeName,jdbcType=VARCHAR}, #{goodsType,jdbcType=BIGINT}, ", "#{type,jdbcType=INTEGER}, #{goodsBrandName,jdbcType=VARCHAR}, ", - "#{goodsBrand,jdbcType=INTEGER}, #{goodsLabel,jdbcType=VARCHAR}, ", + "#{goodsBrand,jdbcType=BIGINT}, #{goodsLabel,jdbcType=VARCHAR}, ", "#{goodsExplain,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, ", "#{listImg,jdbcType=VARCHAR}, #{bannerImg,jdbcType=VARCHAR}, ", "#{detailImg,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", @@ -72,7 +72,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.BIGINT), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR), - @Result(column="goods_brand", property="goodsBrand", jdbcType=JdbcType.INTEGER), + @Result(column="goods_brand", property="goodsBrand", jdbcType=JdbcType.BIGINT), @Result(column="goods_label", property="goodsLabel", jdbcType=JdbcType.VARCHAR), @Result(column="goods_explain", property="goodsExplain", jdbcType=JdbcType.VARCHAR), @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), @@ -104,7 +104,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.BIGINT), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR), - @Result(column="goods_brand", property="goodsBrand", jdbcType=JdbcType.INTEGER), + @Result(column="goods_brand", property="goodsBrand", jdbcType=JdbcType.BIGINT), @Result(column="goods_label", property="goodsLabel", jdbcType=JdbcType.VARCHAR), @Result(column="goods_explain", property="goodsExplain", jdbcType=JdbcType.VARCHAR), @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), @@ -137,7 +137,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { "goods_type = #{goodsType,jdbcType=BIGINT},", "`type` = #{type,jdbcType=INTEGER},", "goods_brand_name = #{goodsBrandName,jdbcType=VARCHAR},", - "goods_brand = #{goodsBrand,jdbcType=INTEGER},", + "goods_brand = #{goodsBrand,jdbcType=BIGINT},", "goods_label = #{goodsLabel,jdbcType=VARCHAR},", "goods_explain = #{goodsExplain,jdbcType=VARCHAR},", "title = #{title,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java b/service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java index 49e5b31..993db9a 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java @@ -45,7 +45,7 @@ public class GoodsMsgSqlProvider { } if (record.getGoodsBrand() != null) { - sql.VALUES("goods_brand", "#{goodsBrand,jdbcType=INTEGER}"); + sql.VALUES("goods_brand", "#{goodsBrand,jdbcType=BIGINT}"); } if (record.getGoodsLabel() != null) { @@ -171,7 +171,7 @@ public class GoodsMsgSqlProvider { } if (record.getGoodsBrand() != null) { - sql.SET("goods_brand = #{record.goodsBrand,jdbcType=INTEGER}"); + sql.SET("goods_brand = #{record.goodsBrand,jdbcType=BIGINT}"); } if (record.getGoodsLabel() != null) { @@ -243,7 +243,7 @@ public class GoodsMsgSqlProvider { sql.SET("goods_type = #{record.goodsType,jdbcType=BIGINT}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("goods_brand_name = #{record.goodsBrandName,jdbcType=VARCHAR}"); - sql.SET("goods_brand = #{record.goodsBrand,jdbcType=INTEGER}"); + sql.SET("goods_brand = #{record.goodsBrand,jdbcType=BIGINT}"); sql.SET("goods_label = #{record.goodsLabel,jdbcType=VARCHAR}"); sql.SET("goods_explain = #{record.goodsExplain,jdbcType=VARCHAR}"); sql.SET("title = #{record.title,jdbcType=VARCHAR}"); @@ -285,7 +285,7 @@ public class GoodsMsgSqlProvider { } if (record.getGoodsBrand() != null) { - sql.SET("goods_brand = #{goodsBrand,jdbcType=INTEGER}"); + sql.SET("goods_brand = #{goodsBrand,jdbcType=BIGINT}"); } if (record.getGoodsLabel() != null) { diff --git a/service/src/main/java/com/hfkj/dao/GoodsVpdMapper.java b/service/src/main/java/com/hfkj/dao/GoodsVpdMapper.java index 4ada124..2551719 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsVpdMapper.java +++ b/service/src/main/java/com/hfkj/dao/GoodsVpdMapper.java @@ -39,16 +39,18 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into goods_vpd (goods_id, `key`, ", + "insert into goods_vpd (specs_id, `key`, ", "recycle_day, sales_end_time, ", - "`type`, `source`, create_time, ", - "update_time, ext_1, ", - "ext_2, ext_3)", - "values (#{goodsId,jdbcType=BIGINT}, #{key,jdbcType=VARCHAR}, ", + "`type`, `source`, jump_type, ", + "jump_url, appid_id, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{specsId,jdbcType=BIGINT}, #{key,jdbcType=VARCHAR}, ", "#{recycleDay,jdbcType=INTEGER}, #{salesEndTime,jdbcType=TIMESTAMP}, ", - "#{type,jdbcType=INTEGER}, #{source,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{type,jdbcType=INTEGER}, #{source,jdbcType=INTEGER}, #{jumpType,jdbcType=INTEGER}, ", + "#{jumpUrl,jdbcType=VARCHAR}, #{appidId,jdbcType=VARCHAR}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(GoodsVpd record); @@ -60,12 +62,15 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { @SelectProvider(type=GoodsVpdSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), - @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), + @Result(column="specs_id", property="specsId", jdbcType=JdbcType.BIGINT), @Result(column="key", property="key", jdbcType=JdbcType.VARCHAR), @Result(column="recycle_day", property="recycleDay", jdbcType=JdbcType.INTEGER), @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="source", property="source", jdbcType=JdbcType.INTEGER), + @Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER), + @Result(column="jump_url", property="jumpUrl", jdbcType=JdbcType.VARCHAR), + @Result(column="appid_id", property="appidId", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -76,19 +81,22 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { @Select({ "select", - "id, goods_id, `key`, recycle_day, sales_end_time, `type`, `source`, create_time, ", - "update_time, ext_1, ext_2, ext_3", + "id, specs_id, `key`, recycle_day, sales_end_time, `type`, `source`, jump_type, ", + "jump_url, appid_id, create_time, update_time, ext_1, ext_2, ext_3", "from goods_vpd", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), - @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), + @Result(column="specs_id", property="specsId", jdbcType=JdbcType.BIGINT), @Result(column="key", property="key", jdbcType=JdbcType.VARCHAR), @Result(column="recycle_day", property="recycleDay", jdbcType=JdbcType.INTEGER), @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="source", property="source", jdbcType=JdbcType.INTEGER), + @Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER), + @Result(column="jump_url", property="jumpUrl", jdbcType=JdbcType.VARCHAR), + @Result(column="appid_id", property="appidId", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -108,12 +116,15 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { @Update({ "update goods_vpd", - "set goods_id = #{goodsId,jdbcType=BIGINT},", + "set specs_id = #{specsId,jdbcType=BIGINT},", "`key` = #{key,jdbcType=VARCHAR},", "recycle_day = #{recycleDay,jdbcType=INTEGER},", "sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},", "`type` = #{type,jdbcType=INTEGER},", "`source` = #{source,jdbcType=INTEGER},", + "jump_type = #{jumpType,jdbcType=INTEGER},", + "jump_url = #{jumpUrl,jdbcType=VARCHAR},", + "appid_id = #{appidId,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", "ext_1 = #{ext1,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/GoodsVpdSqlProvider.java b/service/src/main/java/com/hfkj/dao/GoodsVpdSqlProvider.java index 0e4a955..fdf5384 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsVpdSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/GoodsVpdSqlProvider.java @@ -28,8 +28,8 @@ public class GoodsVpdSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("goods_vpd"); - if (record.getGoodsId() != null) { - sql.VALUES("goods_id", "#{goodsId,jdbcType=BIGINT}"); + if (record.getSpecsId() != null) { + sql.VALUES("specs_id", "#{specsId,jdbcType=BIGINT}"); } if (record.getKey() != null) { @@ -52,6 +52,18 @@ public class GoodsVpdSqlProvider { sql.VALUES("`source`", "#{source,jdbcType=INTEGER}"); } + if (record.getJumpType() != null) { + sql.VALUES("jump_type", "#{jumpType,jdbcType=INTEGER}"); + } + + if (record.getJumpUrl() != null) { + sql.VALUES("jump_url", "#{jumpUrl,jdbcType=VARCHAR}"); + } + + if (record.getAppidId() != null) { + sql.VALUES("appid_id", "#{appidId,jdbcType=VARCHAR}"); + } + if (record.getCreateTime() != null) { sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); } @@ -82,12 +94,15 @@ public class GoodsVpdSqlProvider { } else { sql.SELECT("id"); } - sql.SELECT("goods_id"); + sql.SELECT("specs_id"); sql.SELECT("`key`"); sql.SELECT("recycle_day"); sql.SELECT("sales_end_time"); sql.SELECT("`type`"); sql.SELECT("`source`"); + sql.SELECT("jump_type"); + sql.SELECT("jump_url"); + sql.SELECT("appid_id"); sql.SELECT("create_time"); sql.SELECT("update_time"); sql.SELECT("ext_1"); @@ -114,8 +129,8 @@ public class GoodsVpdSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } - if (record.getGoodsId() != null) { - sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}"); + if (record.getSpecsId() != null) { + sql.SET("specs_id = #{record.specsId,jdbcType=BIGINT}"); } if (record.getKey() != null) { @@ -138,6 +153,18 @@ public class GoodsVpdSqlProvider { sql.SET("`source` = #{record.source,jdbcType=INTEGER}"); } + if (record.getJumpType() != null) { + sql.SET("jump_type = #{record.jumpType,jdbcType=INTEGER}"); + } + + if (record.getJumpUrl() != null) { + sql.SET("jump_url = #{record.jumpUrl,jdbcType=VARCHAR}"); + } + + if (record.getAppidId() != null) { + sql.SET("appid_id = #{record.appidId,jdbcType=VARCHAR}"); + } + if (record.getCreateTime() != null) { sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); } @@ -167,12 +194,15 @@ public class GoodsVpdSqlProvider { sql.UPDATE("goods_vpd"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); - sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}"); + sql.SET("specs_id = #{record.specsId,jdbcType=BIGINT}"); sql.SET("`key` = #{record.key,jdbcType=VARCHAR}"); sql.SET("recycle_day = #{record.recycleDay,jdbcType=INTEGER}"); sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("`source` = #{record.source,jdbcType=INTEGER}"); + sql.SET("jump_type = #{record.jumpType,jdbcType=INTEGER}"); + sql.SET("jump_url = #{record.jumpUrl,jdbcType=VARCHAR}"); + sql.SET("appid_id = #{record.appidId,jdbcType=VARCHAR}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); @@ -188,8 +218,8 @@ public class GoodsVpdSqlProvider { SQL sql = new SQL(); sql.UPDATE("goods_vpd"); - if (record.getGoodsId() != null) { - sql.SET("goods_id = #{goodsId,jdbcType=BIGINT}"); + if (record.getSpecsId() != null) { + sql.SET("specs_id = #{specsId,jdbcType=BIGINT}"); } if (record.getKey() != null) { @@ -212,6 +242,18 @@ public class GoodsVpdSqlProvider { sql.SET("`source` = #{source,jdbcType=INTEGER}"); } + if (record.getJumpType() != null) { + sql.SET("jump_type = #{jumpType,jdbcType=INTEGER}"); + } + + if (record.getJumpUrl() != null) { + sql.SET("jump_url = #{jumpUrl,jdbcType=VARCHAR}"); + } + + if (record.getAppidId() != null) { + sql.SET("appid_id = #{appidId,jdbcType=VARCHAR}"); + } + if (record.getCreateTime() != null) { sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); } diff --git a/service/src/main/java/com/hfkj/entity/GoodsMsg.java b/service/src/main/java/com/hfkj/entity/GoodsMsg.java index 484d1ae..aa5d5bd 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsMsg.java +++ b/service/src/main/java/com/hfkj/entity/GoodsMsg.java @@ -41,7 +41,7 @@ public class GoodsMsg implements Serializable { /** * 商品品牌 */ - private Integer goodsBrand; + private Long goodsBrand; /** * 商品标签 @@ -155,11 +155,11 @@ public class GoodsMsg implements Serializable { this.goodsBrandName = goodsBrandName; } - public Integer getGoodsBrand() { + public Long getGoodsBrand() { return goodsBrand; } - public void setGoodsBrand(Integer goodsBrand) { + public void setGoodsBrand(Long goodsBrand) { this.goodsBrand = goodsBrand; } diff --git a/service/src/main/java/com/hfkj/entity/GoodsMsgExample.java b/service/src/main/java/com/hfkj/entity/GoodsMsgExample.java index 3be7dce..a58db62 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsMsgExample.java +++ b/service/src/main/java/com/hfkj/entity/GoodsMsgExample.java @@ -455,52 +455,52 @@ public class GoodsMsgExample { return (Criteria) this; } - public Criteria andGoodsBrandEqualTo(Integer value) { + public Criteria andGoodsBrandEqualTo(Long value) { addCriterion("goods_brand =", value, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandNotEqualTo(Integer value) { + public Criteria andGoodsBrandNotEqualTo(Long value) { addCriterion("goods_brand <>", value, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandGreaterThan(Integer value) { + public Criteria andGoodsBrandGreaterThan(Long value) { addCriterion("goods_brand >", value, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandGreaterThanOrEqualTo(Integer value) { + public Criteria andGoodsBrandGreaterThanOrEqualTo(Long value) { addCriterion("goods_brand >=", value, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandLessThan(Integer value) { + public Criteria andGoodsBrandLessThan(Long value) { addCriterion("goods_brand <", value, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandLessThanOrEqualTo(Integer value) { + public Criteria andGoodsBrandLessThanOrEqualTo(Long value) { addCriterion("goods_brand <=", value, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandIn(List values) { + public Criteria andGoodsBrandIn(List values) { addCriterion("goods_brand in", values, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandNotIn(List values) { + public Criteria andGoodsBrandNotIn(List values) { addCriterion("goods_brand not in", values, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandBetween(Integer value1, Integer value2) { + public Criteria andGoodsBrandBetween(Long value1, Long value2) { addCriterion("goods_brand between", value1, value2, "goodsBrand"); return (Criteria) this; } - public Criteria andGoodsBrandNotBetween(Integer value1, Integer value2) { + public Criteria andGoodsBrandNotBetween(Long value1, Long value2) { addCriterion("goods_brand not between", value1, value2, "goodsBrand"); return (Criteria) this; } diff --git a/service/src/main/java/com/hfkj/entity/GoodsVpd.java b/service/src/main/java/com/hfkj/entity/GoodsVpd.java index 048c209..83bc6f6 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsVpd.java +++ b/service/src/main/java/com/hfkj/entity/GoodsVpd.java @@ -19,9 +19,9 @@ public class GoodsVpd implements Serializable { private Long id; /** - * 商品ID + * 商品规格id */ - private Long goodsId; + private Long specsId; /** * 编号 @@ -48,6 +48,21 @@ public class GoodsVpd implements Serializable { */ private Integer source; + /** + * 跳转类型:1.小程序 2.h5 + */ + private Integer jumpType; + + /** + * 跳转地址 + */ + private String jumpUrl; + + /** + * 应用ID + */ + private String appidId; + /** * 创建时间 */ @@ -74,12 +89,12 @@ public class GoodsVpd implements Serializable { this.id = id; } - public Long getGoodsId() { - return goodsId; + public Long getSpecsId() { + return specsId; } - public void setGoodsId(Long goodsId) { - this.goodsId = goodsId; + public void setSpecsId(Long specsId) { + this.specsId = specsId; } public String getKey() { @@ -122,6 +137,30 @@ public class GoodsVpd implements Serializable { this.source = source; } + public Integer getJumpType() { + return jumpType; + } + + public void setJumpType(Integer jumpType) { + this.jumpType = jumpType; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public String getAppidId() { + return appidId; + } + + public void setAppidId(String appidId) { + this.appidId = appidId; + } + public Date getCreateTime() { return createTime; } @@ -175,12 +214,15 @@ public class GoodsVpd implements Serializable { } GoodsVpd other = (GoodsVpd) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) - && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId())) + && (this.getSpecsId() == null ? other.getSpecsId() == null : this.getSpecsId().equals(other.getSpecsId())) && (this.getKey() == null ? other.getKey() == null : this.getKey().equals(other.getKey())) && (this.getRecycleDay() == null ? other.getRecycleDay() == null : this.getRecycleDay().equals(other.getRecycleDay())) && (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource())) + && (this.getJumpType() == null ? other.getJumpType() == null : this.getJumpType().equals(other.getJumpType())) + && (this.getJumpUrl() == null ? other.getJumpUrl() == null : this.getJumpUrl().equals(other.getJumpUrl())) + && (this.getAppidId() == null ? other.getAppidId() == null : this.getAppidId().equals(other.getAppidId())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) @@ -193,12 +235,15 @@ public class GoodsVpd implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode()); + result = prime * result + ((getSpecsId() == null) ? 0 : getSpecsId().hashCode()); result = prime * result + ((getKey() == null) ? 0 : getKey().hashCode()); result = prime * result + ((getRecycleDay() == null) ? 0 : getRecycleDay().hashCode()); result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode()); + result = prime * result + ((getJumpType() == null) ? 0 : getJumpType().hashCode()); + result = prime * result + ((getJumpUrl() == null) ? 0 : getJumpUrl().hashCode()); + result = prime * result + ((getAppidId() == null) ? 0 : getAppidId().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); @@ -214,12 +259,15 @@ public class GoodsVpd implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); - sb.append(", goodsId=").append(goodsId); + sb.append(", specsId=").append(specsId); sb.append(", key=").append(key); sb.append(", recycleDay=").append(recycleDay); sb.append(", salesEndTime=").append(salesEndTime); sb.append(", type=").append(type); sb.append(", source=").append(source); + sb.append(", jumpType=").append(jumpType); + sb.append(", jumpUrl=").append(jumpUrl); + sb.append(", appidId=").append(appidId); sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); sb.append(", ext1=").append(ext1); diff --git a/service/src/main/java/com/hfkj/entity/GoodsVpdExample.java b/service/src/main/java/com/hfkj/entity/GoodsVpdExample.java index 43714c6..c2c3b1c 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsVpdExample.java +++ b/service/src/main/java/com/hfkj/entity/GoodsVpdExample.java @@ -185,63 +185,63 @@ public class GoodsVpdExample { return (Criteria) this; } - public Criteria andGoodsIdIsNull() { - addCriterion("goods_id is null"); + public Criteria andSpecsIdIsNull() { + addCriterion("specs_id is null"); return (Criteria) this; } - public Criteria andGoodsIdIsNotNull() { - addCriterion("goods_id is not null"); + public Criteria andSpecsIdIsNotNull() { + addCriterion("specs_id is not null"); return (Criteria) this; } - public Criteria andGoodsIdEqualTo(Long value) { - addCriterion("goods_id =", value, "goodsId"); + public Criteria andSpecsIdEqualTo(Long value) { + addCriterion("specs_id =", value, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdNotEqualTo(Long value) { - addCriterion("goods_id <>", value, "goodsId"); + public Criteria andSpecsIdNotEqualTo(Long value) { + addCriterion("specs_id <>", value, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdGreaterThan(Long value) { - addCriterion("goods_id >", value, "goodsId"); + public Criteria andSpecsIdGreaterThan(Long value) { + addCriterion("specs_id >", value, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdGreaterThanOrEqualTo(Long value) { - addCriterion("goods_id >=", value, "goodsId"); + public Criteria andSpecsIdGreaterThanOrEqualTo(Long value) { + addCriterion("specs_id >=", value, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdLessThan(Long value) { - addCriterion("goods_id <", value, "goodsId"); + public Criteria andSpecsIdLessThan(Long value) { + addCriterion("specs_id <", value, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdLessThanOrEqualTo(Long value) { - addCriterion("goods_id <=", value, "goodsId"); + public Criteria andSpecsIdLessThanOrEqualTo(Long value) { + addCriterion("specs_id <=", value, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdIn(List values) { - addCriterion("goods_id in", values, "goodsId"); + public Criteria andSpecsIdIn(List values) { + addCriterion("specs_id in", values, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdNotIn(List values) { - addCriterion("goods_id not in", values, "goodsId"); + public Criteria andSpecsIdNotIn(List values) { + addCriterion("specs_id not in", values, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdBetween(Long value1, Long value2) { - addCriterion("goods_id between", value1, value2, "goodsId"); + public Criteria andSpecsIdBetween(Long value1, Long value2) { + addCriterion("specs_id between", value1, value2, "specsId"); return (Criteria) this; } - public Criteria andGoodsIdNotBetween(Long value1, Long value2) { - addCriterion("goods_id not between", value1, value2, "goodsId"); + public Criteria andSpecsIdNotBetween(Long value1, Long value2) { + addCriterion("specs_id not between", value1, value2, "specsId"); return (Criteria) this; } @@ -555,6 +555,206 @@ public class GoodsVpdExample { return (Criteria) this; } + public Criteria andJumpTypeIsNull() { + addCriterion("jump_type is null"); + return (Criteria) this; + } + + public Criteria andJumpTypeIsNotNull() { + addCriterion("jump_type is not null"); + return (Criteria) this; + } + + public Criteria andJumpTypeEqualTo(Integer value) { + addCriterion("jump_type =", value, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeNotEqualTo(Integer value) { + addCriterion("jump_type <>", value, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeGreaterThan(Integer value) { + addCriterion("jump_type >", value, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("jump_type >=", value, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeLessThan(Integer value) { + addCriterion("jump_type <", value, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeLessThanOrEqualTo(Integer value) { + addCriterion("jump_type <=", value, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeIn(List values) { + addCriterion("jump_type in", values, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeNotIn(List values) { + addCriterion("jump_type not in", values, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeBetween(Integer value1, Integer value2) { + addCriterion("jump_type between", value1, value2, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpTypeNotBetween(Integer value1, Integer value2) { + addCriterion("jump_type not between", value1, value2, "jumpType"); + return (Criteria) this; + } + + public Criteria andJumpUrlIsNull() { + addCriterion("jump_url is null"); + return (Criteria) this; + } + + public Criteria andJumpUrlIsNotNull() { + addCriterion("jump_url is not null"); + return (Criteria) this; + } + + public Criteria andJumpUrlEqualTo(String value) { + addCriterion("jump_url =", value, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlNotEqualTo(String value) { + addCriterion("jump_url <>", value, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlGreaterThan(String value) { + addCriterion("jump_url >", value, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlGreaterThanOrEqualTo(String value) { + addCriterion("jump_url >=", value, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlLessThan(String value) { + addCriterion("jump_url <", value, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlLessThanOrEqualTo(String value) { + addCriterion("jump_url <=", value, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlLike(String value) { + addCriterion("jump_url like", value, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlNotLike(String value) { + addCriterion("jump_url not like", value, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlIn(List values) { + addCriterion("jump_url in", values, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlNotIn(List values) { + addCriterion("jump_url not in", values, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlBetween(String value1, String value2) { + addCriterion("jump_url between", value1, value2, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andJumpUrlNotBetween(String value1, String value2) { + addCriterion("jump_url not between", value1, value2, "jumpUrl"); + return (Criteria) this; + } + + public Criteria andAppidIdIsNull() { + addCriterion("appid_id is null"); + return (Criteria) this; + } + + public Criteria andAppidIdIsNotNull() { + addCriterion("appid_id is not null"); + return (Criteria) this; + } + + public Criteria andAppidIdEqualTo(String value) { + addCriterion("appid_id =", value, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdNotEqualTo(String value) { + addCriterion("appid_id <>", value, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdGreaterThan(String value) { + addCriterion("appid_id >", value, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdGreaterThanOrEqualTo(String value) { + addCriterion("appid_id >=", value, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdLessThan(String value) { + addCriterion("appid_id <", value, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdLessThanOrEqualTo(String value) { + addCriterion("appid_id <=", value, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdLike(String value) { + addCriterion("appid_id like", value, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdNotLike(String value) { + addCriterion("appid_id not like", value, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdIn(List values) { + addCriterion("appid_id in", values, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdNotIn(List values) { + addCriterion("appid_id not in", values, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdBetween(String value1, String value2) { + addCriterion("appid_id between", value1, value2, "appidId"); + return (Criteria) this; + } + + public Criteria andAppidIdNotBetween(String value1, String value2) { + addCriterion("appid_id not between", value1, value2, "appidId"); + return (Criteria) this; + } + public Criteria andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/model/GoodsModel.java b/service/src/main/java/com/hfkj/model/GoodsModel.java new file mode 100644 index 0000000..439667f --- /dev/null +++ b/service/src/main/java/com/hfkj/model/GoodsModel.java @@ -0,0 +1,59 @@ +package com.hfkj.model; + +import com.hfkj.entity.GoodsMsg; +import com.hfkj.entity.GoodsSpecs; +import com.hfkj.entity.GoodsVpd; +import lombok.Data; + +import java.util.Date; + +@Data +public class GoodsModel extends GoodsSpecs { + + GoodsMsg goodsMsg; + + /** + * 商品规格id + */ + private Long specsId; + + /** + * 编号 + */ + private String key; + + /** + * 归库天数 + */ + private Integer recycleDay; + + /** + * 销售截止日期 + */ + private Date salesEndTime; + + /** + * 类型 1:内部虚拟商品 2:外部虚拟产品 + */ + private Integer type; + + /** + * 产品来源:1.内部虚拟商品 4.贵州中石化 5.重庆中石油 6.比邻星停车券 7.四川中石油 10.中油优途中石油 + */ + private Integer source; + + /** + * 跳转类型:1.小程序 2.h5 + */ + private Integer jumpType; + + /** + * 跳转地址 + */ + private String jumpUrl; + + /** + * 应用ID + */ + private String appidId; +} diff --git a/service/src/main/java/com/hfkj/service/goods/GoodsBrandService.java b/service/src/main/java/com/hfkj/service/goods/GoodsBrandService.java index aecade5..6c9dbba 100644 --- a/service/src/main/java/com/hfkj/service/goods/GoodsBrandService.java +++ b/service/src/main/java/com/hfkj/service/goods/GoodsBrandService.java @@ -22,7 +22,7 @@ public interface GoodsBrandService { * @Param GoodsBrand * @return void */ - void create(GoodsBrand GoodsBrand); + void create(GoodsBrand goodsBrand); /** * @Author Sum1Dream @@ -32,7 +32,7 @@ public interface GoodsBrandService { * @Param GoodsBrand * @return void */ - void update(GoodsBrand GoodsBrand); + void update(GoodsBrand goodsBrand); /** * @Author Sum1Dream @@ -73,5 +73,7 @@ public interface GoodsBrandService { * @return java.util.List */ List getList(Map map); + + String findGoodsBrandName(Long id); } diff --git a/service/src/main/java/com/hfkj/service/goods/GoodsMsgService.java b/service/src/main/java/com/hfkj/service/goods/GoodsMsgService.java new file mode 100644 index 0000000..4624357 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/goods/GoodsMsgService.java @@ -0,0 +1,77 @@ +package com.hfkj.service.goods; + + + +import com.hfkj.entity.GoodsMsg; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName GoodsMsgService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 商品信息管理 + * @createTime 15:07 2024/4/19 + **/ +public interface GoodsMsgService { + /** + * @Author Sum1Dream + * @Name create + * @Description // 创建 + * @Date 15:11 2024/4/19 + * @Param GoodsMsg + * @return void + */ + void create(GoodsMsg goodsMsg); + + /** + * @Author Sum1Dream + * @Name update + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param GoodsMsg + * @return void + */ + void update(GoodsMsg goodsMsg); + + /** + * @Author Sum1Dream + * @Name delete + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param id + * @return void + */ + void delete(Long id , Boolean fullDelete); + + /** + * @Author Sum1Dream + * @Name queryDetail + * @Description // 根据ID查询产品类型详情 + * @Date 15:12 2024/4/19 + * @Param id + * @return com.hfkj.entity.GoodsMsg + */ + GoodsMsg queryDetail(Long id); + + /** + * @Author Sum1Dream + * @Name queryDetailByMap + * @Description // 根据多条件查询产品类型 + * @Date 15:12 2024/4/19 + * @Param map + * @return com.hfkj.entity.GoodsMsg + */ + GoodsMsg queryDetailByMap(Map map); + + /** + * @Author Sum1Dream + * @Name getList + * @Description // 根据多条件查询列表 + * @Date 15:13 2024/4/19 + * @Param map + * @return java.util.List + */ + List getList(Map map); +} diff --git a/service/src/main/java/com/hfkj/service/goods/GoodsSpecsService.java b/service/src/main/java/com/hfkj/service/goods/GoodsSpecsService.java new file mode 100644 index 0000000..9ff9f6c --- /dev/null +++ b/service/src/main/java/com/hfkj/service/goods/GoodsSpecsService.java @@ -0,0 +1,79 @@ +package com.hfkj.service.goods; + +import com.hfkj.entity.GoodsSpecs; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName .java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 商品规格管理 + * @createTime 15:07 2024/4/19 + **/ +public interface GoodsSpecsService { + + /** + * @Author Sum1Dream + * @Name create + * @Description // 创建 + * @Date 15:11 2024/4/19 + * @Param GoodsSpecs + * @return void + */ + void create(GoodsSpecs goodsSpecs); + + /** + * @Author Sum1Dream + * @Name update + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param GoodsSpecs + * @return void + */ + void update(GoodsSpecs goodsSpecs); + + /** + * @Author Sum1Dream + * @Name delete + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param id + * @return void + */ + void delete(Long id , Boolean fullDelete); + + /** + * @Author Sum1Dream + * @Name queryDetail + * @Description // 根据ID查询产品类型详情 + * @Date 15:12 2024/4/19 + * @Param id + * @return com.hfkj.entity.GoodsSpecs + */ + GoodsSpecs queryDetail(Long id); + + GoodsSpecs queryDetailByGoodsId(Long id); + + /** + * @Author Sum1Dream + * @Name queryDetailByMap + * @Description // 根据多条件查询产品类型 + * @Date 15:12 2024/4/19 + * @Param map + * @return com.hfkj.entity.GoodsSpecs + */ + GoodsSpecs queryDetailByMap(Map map); + + /** + * @Author Sum1Dream + * @Name getList + * @Description // 根据多条件查询列表 + * @Date 15:13 2024/4/19 + * @Param map + * @return java.util.List + */ + List getList(Map map); + +} diff --git a/service/src/main/java/com/hfkj/service/goods/GoodsTypeService.java b/service/src/main/java/com/hfkj/service/goods/GoodsTypeService.java index bfe14fb..f7b8e20 100644 --- a/service/src/main/java/com/hfkj/service/goods/GoodsTypeService.java +++ b/service/src/main/java/com/hfkj/service/goods/GoodsTypeService.java @@ -84,4 +84,14 @@ public interface GoodsTypeService { * @return java.util.List */ List getGoodsTypeModelList(List list); + + /** + * @Author Sum1Dream + * @Name findGoodsType + * @Description // 获取列表 + * @Date 15:13 2024/4/19 + * @Param id + * @return String + */ + String findGoodsType(Long id); } diff --git a/service/src/main/java/com/hfkj/service/goods/GoodsVpdService.java b/service/src/main/java/com/hfkj/service/goods/GoodsVpdService.java new file mode 100644 index 0000000..2a5787b --- /dev/null +++ b/service/src/main/java/com/hfkj/service/goods/GoodsVpdService.java @@ -0,0 +1,80 @@ +package com.hfkj.service.goods; + +import com.hfkj.entity.GoodsVpd; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName .java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 虚拟商品管理 + * @createTime 15:07 2024/4/19 + **/ +public interface GoodsVpdService { + + + /** + * @Author Sum1Dream + * @Name create + * @Description // 创建 + * @Date 15:11 2024/4/19 + * @Param GoodsVpd + * @return void + */ + void create(GoodsVpd goodsVpd); + + /** + * @Author Sum1Dream + * @Name update + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param GoodsVpd + * @return void + */ + void update(GoodsVpd goodsVpd); + + /** + * @Author Sum1Dream + * @Name delete + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param id + * @return void + */ + void delete(Long id); + + /** + * @Author Sum1Dream + * @Name queryDetail + * @Description // 根据ID查询产品类型详情 + * @Date 15:12 2024/4/19 + * @Param id + * @return com.hfkj.entity.GoodsVpd + */ + GoodsVpd queryDetail(Long id); + + /** + * @Author Sum1Dream + * @Name queryDetailBySpecsId + * @Description // 根据多条件查询产品类型 + * @Date 15:12 2024/4/19 + * @Param map + * @return com.hfkj.entity.GoodsVpd + */ + void deleteSpecsId(Long specsId); + + GoodsVpd queryDetailBySpecsId(Long specsId); + + /** + * @Author Sum1Dream + * @Name getList + * @Description // 根据多条件查询列表 + * @Date 15:13 2024/4/19 + * @Param map + * @return java.util.List + */ + List getList(Map map); + +} diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsBrandServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsBrandServiceImpl.java index fa44151..0c444d9 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/GoodsBrandServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsBrandServiceImpl.java @@ -3,12 +3,15 @@ package com.hfkj.service.goods.impl; import com.hfkj.dao.GoodsBrandMapper; import com.hfkj.entity.GoodsBrand; import com.hfkj.entity.GoodsBrandExample; +import com.hfkj.entity.GoodsMsg; +import com.hfkj.entity.GoodsType; import com.hfkj.service.goods.GoodsBrandService; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.Map; @@ -30,7 +33,14 @@ public class GoodsBrandServiceImpl implements GoodsBrandService { @Override public void delete(Long id, Boolean fullDelete) { - + if (fullDelete) { + goodsBrandMapper.deleteByPrimaryKey(id); + } else { + GoodsBrand goodsBrand = queryDetail(id); + goodsBrand.setStatus(0); + goodsBrand.setUpdateTime(new Date()); + update(goodsBrand); + } } @Override @@ -56,4 +66,12 @@ public class GoodsBrandServiceImpl implements GoodsBrandService { return goodsBrandMapper.selectByExample(example); } + + @Override + public String findGoodsBrandName(Long id) { + + GoodsBrand goodsBrand = queryDetail(id); + + return goodsBrand.getTitle(); + } } diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java new file mode 100644 index 0000000..827065b --- /dev/null +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java @@ -0,0 +1,57 @@ +package com.hfkj.service.goods.impl; + +import com.hfkj.dao.GoodsMsgMapper; +import com.hfkj.entity.GoodsBrand; +import com.hfkj.entity.GoodsMsg; +import com.hfkj.service.goods.GoodsMsgService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("goodsMsgService") +public class GoodsMsgServiceImpl implements GoodsMsgService { + + @Resource + private GoodsMsgMapper goodsMsgMapper; + + @Override + public void create(GoodsMsg goodsMsg) { + goodsMsgMapper.insert(goodsMsg); + } + + @Override + public void update(GoodsMsg goodsMsg) { + goodsMsgMapper.updateByPrimaryKeySelective(goodsMsg); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + if (fullDelete) { + goodsMsgMapper.deleteByPrimaryKey(id); + } else { + GoodsMsg goodsMsg = queryDetail(id); + goodsMsg.setStatus(0); + goodsMsg.setUpdateTime(new Date()); + update(goodsMsg); + } + } + + @Override + public GoodsMsg queryDetail(Long id) { + return goodsMsgMapper.selectByPrimaryKey(id); + } + + @Override + public GoodsMsg queryDetailByMap(Map map) { + return null; + } + + @Override + public List getList(Map map) { + return Collections.emptyList(); + } +} diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsSpecsServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsSpecsServiceImpl.java new file mode 100644 index 0000000..40d8080 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsSpecsServiceImpl.java @@ -0,0 +1,80 @@ +package com.hfkj.service.goods.impl; + +import com.hfkj.dao.GoodsSpecsMapper; +import com.hfkj.entity.GoodsMsg; +import com.hfkj.entity.GoodsSpecs; +import com.hfkj.entity.GoodsSpecsExample; +import com.hfkj.service.goods.GoodsSpecsService; +import com.hfkj.service.goods.GoodsVpdService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("goodsSpecsService") +public class GoodsSpecsServiceImpl implements GoodsSpecsService { + + @Resource + private GoodsSpecsMapper goodsSpecsMapper; + + @Resource + private GoodsVpdService goodsVpdService; + + + @Override + public void create(GoodsSpecs goodsSpecs) { + goodsSpecsMapper.insert(goodsSpecs); + } + + @Override + public void update(GoodsSpecs goodsSpecs) { + goodsSpecsMapper.updateByPrimaryKeySelective(goodsSpecs); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + if (fullDelete) { + goodsSpecsMapper.deleteByPrimaryKey(id); + } else { + GoodsSpecs goodsSpecs = queryDetail(id); + goodsSpecs.setStatus(0); + goodsSpecs.setUpdateTime(new Date()); + update(goodsSpecs); + } + + goodsVpdService.deleteSpecsId(id); + + } + + @Override + public GoodsSpecs queryDetail(Long id) { + return goodsSpecsMapper.selectByPrimaryKey(id); + } + + @Override + public GoodsSpecs queryDetailByGoodsId(Long id) { + GoodsSpecsExample goodsSpecsExample = new GoodsSpecsExample(); + goodsSpecsExample.createCriteria().andGoodsIdEqualTo(id); + + List goodsSpecs = goodsSpecsMapper.selectByExample(goodsSpecsExample); + + if (!goodsSpecs.isEmpty()) { + return goodsSpecs.get(0); + } + + return null; + } + + @Override + public GoodsSpecs queryDetailByMap(Map map) { + return null; + } + + @Override + public List getList(Map map) { + return Collections.emptyList(); + } +} diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java index 1c95800..f331b65 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java @@ -145,4 +145,10 @@ public class GoodsTypeServiceImpl implements GoodsTypeService { return goodsTypeModels; } + + @Override + public String findGoodsType(Long id) { + GoodsType goodsType = queryDetail(id); + return goodsType.getTitle(); + } } diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsVpdServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsVpdServiceImpl.java new file mode 100644 index 0000000..2dd9955 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsVpdServiceImpl.java @@ -0,0 +1,74 @@ +package com.hfkj.service.goods.impl; + +import com.hfkj.dao.GoodsVpdMapper; +import com.hfkj.entity.GoodsMsg; +import com.hfkj.entity.GoodsVpd; +import com.hfkj.entity.GoodsVpdExample; +import com.hfkj.service.goods.GoodsVpdService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("goodsVpdService") +public class GoodsVpdServiceImpl implements GoodsVpdService { + + @Resource + private GoodsVpdMapper goodsVpdMapper; + + @Override + public void create(GoodsVpd goodsVpd) { + goodsVpdMapper.insert(goodsVpd); + } + + @Override + public void update(GoodsVpd goodsVpd) { + goodsVpdMapper.updateByPrimaryKeySelective(goodsVpd); + } + + @Override + public void delete(Long id) { + goodsVpdMapper.deleteByPrimaryKey(id); + } + + @Override + public GoodsVpd queryDetail(Long id) { + return goodsVpdMapper.selectByPrimaryKey(id); + } + + @Override + public void deleteSpecsId(Long specsId) { + GoodsVpdExample example = new GoodsVpdExample(); + example.createCriteria().andSpecsIdEqualTo(specsId); + + List list = goodsVpdMapper.selectByExample(example); + + for (GoodsVpd goodsVpd : list) { + goodsVpdMapper.deleteByPrimaryKey(goodsVpd.getId()); + } + + } + + @Override + public GoodsVpd queryDetailBySpecsId(Long specsId) { + + GoodsVpdExample example = new GoodsVpdExample(); + example.createCriteria().andSpecsIdEqualTo(specsId); + + List list = goodsVpdMapper.selectByExample(example); + + if (!list.isEmpty()) { + return list.get(0); + } + + return null; + } + + @Override + public List getList(Map map) { + return Collections.emptyList(); + } +}