From d778f41a2bbae98a1ccd97aa2866755d709130ed Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Fri, 19 Mar 2021 17:43:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=9C=8D=E5=8A=A1=EF=BC=88?= =?UTF-8?q?=E5=95=86=E5=93=81=EF=BC=89=E5=86=85=E5=AE=B9=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apis/shopgoods/ShopGoodsController.java | 111 ++++ .../shopgoods/ShopGoodsAppController.java | 121 ++++ .../tenlion/dao/shopgoods/IShopGoodsDao.java | 120 ++++ .../pojo/bos/shopgoods/ShopGoodsBO.java | 204 +++++++ .../pojo/dtos/shopgoods/ShopGoodsDTO.java | 229 ++++++++ .../pojo/pos/shopgoods/ShopGoodsPO.java | 204 +++++++ .../pojo/vos/shopgoods/ShopGoodsVO.java | 241 ++++++++ .../service/shopgoods/IShopGoodsService.java | 188 ++++++ .../shopgoods/impl/ShopGoodsServiceImpl.java | 170 ++++++ .../mapper/shopGoods/shopGoods-mapper.xml | 455 +++++++++++++++ .../static/route/shopGoods/list.html | 432 ++++++++++++++ .../static/route/shopGoods/save.html | 524 +++++++++++++++++ .../static/route/shopGoods/update.html | 541 ++++++++++++++++++ 13 files changed, 3540 insertions(+) create mode 100644 src/main/java/cn/com/tenlion/controller/apis/shopgoods/ShopGoodsController.java create mode 100644 src/main/java/cn/com/tenlion/controller/app/apis/shopgoods/ShopGoodsAppController.java create mode 100644 src/main/java/cn/com/tenlion/dao/shopgoods/IShopGoodsDao.java create mode 100644 src/main/java/cn/com/tenlion/pojo/bos/shopgoods/ShopGoodsBO.java create mode 100644 src/main/java/cn/com/tenlion/pojo/dtos/shopgoods/ShopGoodsDTO.java create mode 100644 src/main/java/cn/com/tenlion/pojo/pos/shopgoods/ShopGoodsPO.java create mode 100644 src/main/java/cn/com/tenlion/pojo/vos/shopgoods/ShopGoodsVO.java create mode 100644 src/main/java/cn/com/tenlion/service/shopgoods/IShopGoodsService.java create mode 100644 src/main/java/cn/com/tenlion/service/shopgoods/impl/ShopGoodsServiceImpl.java create mode 100644 src/main/resources/mybatis/mapper/shopGoods/shopGoods-mapper.xml create mode 100644 src/main/resources/static/route/shopGoods/list.html create mode 100644 src/main/resources/static/route/shopGoods/save.html create mode 100644 src/main/resources/static/route/shopGoods/update.html diff --git a/src/main/java/cn/com/tenlion/controller/apis/shopgoods/ShopGoodsController.java b/src/main/java/cn/com/tenlion/controller/apis/shopgoods/ShopGoodsController.java new file mode 100644 index 0000000..c05f4da --- /dev/null +++ b/src/main/java/cn/com/tenlion/controller/apis/shopgoods/ShopGoodsController.java @@ -0,0 +1,111 @@ +package cn.com.tenlion.controller.apis.shopgoods; + +import cn.com.tenlion.pojo.dtos.shopgoods.ShopGoodsDTO; +import cn.com.tenlion.pojo.vos.shopgoods.ShopGoodsVO; +import cn.com.tenlion.service.shopgoods.IShopGoodsService; +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: ShopGoodsController + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/shopgoods") +public class ShopGoodsController extends DefaultBaseController { + + @Autowired + private IShopGoodsService shopGoodsService; + + @ApiOperation(value = "新增", notes = "新增接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody ShopGoodsVO shopGoodsVO) { + shopGoodsService.save(shopGoodsVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除", notes = "删除接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@PathVariable("ids") String ids) { + shopGoodsService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改", notes = "修改接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "shopGoodsId", value = "ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{shopGoodsId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("shopGoodsId") String shopGoodsId, @RequestBody ShopGoodsVO shopGoodsVO) { + shopGoodsService.update(shopGoodsId, shopGoodsVO); + return new SuccessResult(); + } + + @ApiOperation(value = "详情", notes = "详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "shopGoodsId", value = "ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{shopGoodsId}") + public ShopGoodsDTO get(@PathVariable("shopGoodsId") String shopGoodsId) { + return shopGoodsService.get(shopGoodsId); + } + + @ApiOperation(value = "列表", notes = "列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return shopGoodsService.list(params); + } + + @ApiOperation(value = "分页列表", notes = "分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return shopGoodsService.listPage(page); + } + + @ApiOperation(value = "统计", notes = "统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(shopGoodsService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/controller/app/apis/shopgoods/ShopGoodsAppController.java b/src/main/java/cn/com/tenlion/controller/app/apis/shopgoods/ShopGoodsAppController.java new file mode 100644 index 0000000..9e12458 --- /dev/null +++ b/src/main/java/cn/com/tenlion/controller/app/apis/shopgoods/ShopGoodsAppController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.controller.app.apis.shopgoods; + +import cn.com.tenlion.pojo.dtos.shopgoods.ShopGoodsDTO; +import cn.com.tenlion.pojo.vos.shopgoods.ShopGoodsVO; +import cn.com.tenlion.service.shopgoods.IShopGoodsService; +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: ShopGoodsAppController + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/shopgoods") +public class ShopGoodsAppController extends DefaultBaseController { + + @Autowired + private IShopGoodsService shopGoodsService; + + @ApiOperation(value = "新增", notes = "新增接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestHeader("token") String token, @RequestBody ShopGoodsVO shopGoodsVO) { + shopGoodsService.save(token, shopGoodsVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除(id列表)", notes = "删除(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) { + shopGoodsService.remove(token, Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改", notes = "修改接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "shopGoodsId", value = "ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updateshopgoods/{shopGoodsId}") + @CheckRequestBodyAnnotation + public SuccessResult updateShopGoods(@RequestHeader("token") String token, @PathVariable("shopGoodsId") String shopGoodsId, @RequestBody ShopGoodsVO shopGoodsVO) { + shopGoodsService.update(token, shopGoodsId, shopGoodsVO); + return new SuccessResult(); + } + + @ApiOperation(value = "详情(通过ID)", notes = "详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "shopGoodsId", value = "ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{shopGoodsId}") + public ShopGoodsDTO get(@RequestHeader("token") String token, @PathVariable("shopGoodsId") String shopGoodsId) { + return shopGoodsService.get(shopGoodsId); + } + + @ApiOperation(value = "列表", notes = "列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list(@RequestHeader("token") String token) { + Map params = requestParams(); + return shopGoodsService.list(params); + } + + @ApiOperation(value = "分页列表", notes = "分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpageshopgoods") + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { + Map params = requestParams(); + page.setParams(params); + return shopGoodsService.listPage(page); + } + + @ApiOperation(value = "统计", notes = "统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(shopGoodsService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/dao/shopgoods/IShopGoodsDao.java b/src/main/java/cn/com/tenlion/dao/shopgoods/IShopGoodsDao.java new file mode 100644 index 0000000..963c07e --- /dev/null +++ b/src/main/java/cn/com/tenlion/dao/shopgoods/IShopGoodsDao.java @@ -0,0 +1,120 @@ +package cn.com.tenlion.dao.shopgoods; + +import cn.com.tenlion.pojo.bos.shopgoods.ShopGoodsBO; +import cn.com.tenlion.pojo.dtos.shopgoods.ShopGoodsDTO; +import cn.com.tenlion.pojo.pos.shopgoods.ShopGoodsPO; +import ink.wgink.exceptions.RemoveException; +import ink.wgink.exceptions.SaveException; +import ink.wgink.exceptions.SearchException; +import ink.wgink.exceptions.UpdateException; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IShopGoodsDao + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +@Repository +public interface IShopGoodsDao { + + /** + * 新增 + * + * @param params + * @throws SaveException + */ + void save(Map params) throws SaveException; + + /** + * 删除 + * + * @param params + * @throws RemoveException + */ + void remove(Map params) throws RemoveException; + + /** + * 删除(物理) + * + * @param params + * @throws RemoveException + */ + void delete(Map params) throws RemoveException; + + /** + * 修改 + * + * @param params + * @throws UpdateException + */ + void update(Map params) throws UpdateException; + + /** + * 详情 + * + * @param params + * @return + * @throws SearchException + */ + ShopGoodsDTO get(Map params) throws SearchException; + + /** + * 详情 + * + * @param params + * @return + * @throws SearchException + */ + ShopGoodsBO getBO(Map params) throws SearchException; + + /** + * 详情 + * + * @param params + * @return + * @throws SearchException + */ + ShopGoodsPO getPO(Map params) throws SearchException; + + /** + * 列表 + * + * @param params + * @return + * @throws SearchException + */ + List list(Map params) throws SearchException; + + /** + * 列表 + * + * @param params + * @return + * @throws SearchException + */ + List listBO(Map params) throws SearchException; + + /** + * 列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + + /** + * 统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer count(Map params) throws SearchException; + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/bos/shopgoods/ShopGoodsBO.java b/src/main/java/cn/com/tenlion/pojo/bos/shopgoods/ShopGoodsBO.java new file mode 100644 index 0000000..8295bda --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/bos/shopgoods/ShopGoodsBO.java @@ -0,0 +1,204 @@ +package cn.com.tenlion.pojo.bos.shopgoods; + +/** + * + * @ClassName: ShopGoodsBO + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +public class ShopGoodsBO { + + private String goodsId; + private String goodsName; + private String goodsSummary; + private String goodsIcon; + private String shopId; + private String categoryId; + private Double goodsSort; + private Integer goodsTotal; + private Integer goodsStatus; + private Double goodsUnitPrice; + private String goodsUnit; + private Integer paymentType; + private String goodsPhotos; + private String goodsVideo; + private Double goodStar; + private Double userEvaluate; + private String gmtCreate; + private String creator; + private String gmtModified; + private String modifier; + private Integer isDelete; + + public String getGoodsId() { + return goodsId == null ? "" : goodsId.trim(); + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName == null ? "" : goodsName.trim(); + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getGoodsSummary() { + return goodsSummary == null ? "" : goodsSummary.trim(); + } + + public void setGoodsSummary(String goodsSummary) { + this.goodsSummary = goodsSummary; + } + + public String getGoodsIcon() { + return goodsIcon == null ? "" : goodsIcon.trim(); + } + + public void setGoodsIcon(String goodsIcon) { + this.goodsIcon = goodsIcon; + } + + public String getShopId() { + return shopId == null ? "" : shopId.trim(); + } + + public void setShopId(String shopId) { + this.shopId = shopId; + } + + public String getCategoryId() { + return categoryId == null ? "" : categoryId.trim(); + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public Double getGoodsSort() { + return goodsSort == null ? 0D : goodsSort; + } + + public void setGoodsSort(Double goodsSort) { + this.goodsSort = goodsSort; + } + + public Integer getGoodsTotal() { + return goodsTotal == null ? 0 : goodsTotal; + } + + public void setGoodsTotal(Integer goodsTotal) { + this.goodsTotal = goodsTotal; + } + + public Integer getGoodsStatus() { + return goodsStatus == null ? 0 : goodsStatus; + } + + public void setGoodsStatus(Integer goodsStatus) { + this.goodsStatus = goodsStatus; + } + + public Double getGoodsUnitPrice() { + return goodsUnitPrice == null ? 0D : goodsUnitPrice; + } + + public void setGoodsUnitPrice(Double goodsUnitPrice) { + this.goodsUnitPrice = goodsUnitPrice; + } + + public String getGoodsUnit() { + return goodsUnit == null ? "" : goodsUnit.trim(); + } + + public void setGoodsUnit(String goodsUnit) { + this.goodsUnit = goodsUnit; + } + + public Integer getPaymentType() { + return paymentType == null ? 0 : paymentType; + } + + public void setPaymentType(Integer paymentType) { + this.paymentType = paymentType; + } + + public String getGoodsPhotos() { + return goodsPhotos == null ? "" : goodsPhotos.trim(); + } + + public void setGoodsPhotos(String goodsPhotos) { + this.goodsPhotos = goodsPhotos; + } + + public String getGoodsVideo() { + return goodsVideo == null ? "" : goodsVideo.trim(); + } + + public void setGoodsVideo(String goodsVideo) { + this.goodsVideo = goodsVideo; + } + + public Double getGoodStar() { + return goodStar == null ? 0D : goodStar; + } + + public void setGoodStar(Double goodStar) { + this.goodStar = goodStar; + } + + public Double getUserEvaluate() { + return userEvaluate == null ? 0D : userEvaluate; + } + + public void setUserEvaluate(Double userEvaluate) { + this.userEvaluate = userEvaluate; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/shopgoods/ShopGoodsDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/shopgoods/ShopGoodsDTO.java new file mode 100644 index 0000000..c472306 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/shopgoods/ShopGoodsDTO.java @@ -0,0 +1,229 @@ +package cn.com.tenlion.pojo.dtos.shopgoods; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: ShopGoodsDTO + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +@ApiModel +public class ShopGoodsDTO { + + @ApiModelProperty(name = "goodsId", value = "商品ID") + private String goodsId; + @ApiModelProperty(name = "goodsName", value = "商品名称") + private String goodsName; + @ApiModelProperty(name = "goodsSummary", value = "商品说明") + private String goodsSummary; + @ApiModelProperty(name = "goodsIcon", value = "商品LOGO") + private String goodsIcon; + @ApiModelProperty(name = "shopId", value = "店铺ID") + private String shopId; + @ApiModelProperty(name = "categoryId", value = "类目ID") + private String categoryId; + @ApiModelProperty(name = "goodsSort", value = "排序") + private Double goodsSort; + @ApiModelProperty(name = "goodsTotal", value = "商品总数,最大9999标识不限制") + private Integer goodsTotal; + @ApiModelProperty(name = "goodsStatus", value = "商品状态1:上架,2:下架") + private Integer goodsStatus; + @ApiModelProperty(name = "goodsUnitPrice", value = "商品单价") + private Double goodsUnitPrice; + @ApiModelProperty(name = "goodsUnit", value = "商品单位") + private String goodsUnit; + @ApiModelProperty(name = "paymentType", value = "支付类型1:线上支付,2:到店支付") + private Integer paymentType; + @ApiModelProperty(name = "goodsPhotos", value = "商品图片,最多9张") + private String goodsPhotos; + @ApiModelProperty(name = "goodsVideo", value = "商品视频,最多1个") + private String goodsVideo; + @ApiModelProperty(name = "goodStar", value = "商品星级,最高5星") + private Double goodStar; + @ApiModelProperty(name = "userEvaluate", value = "用户评价,分数,满分10分,通过用户的评价自动计算") + private Double userEvaluate; + @ApiModelProperty(name = "gmtCreate", value = "创建时间") + private String gmtCreate; + @ApiModelProperty(name = "creator", value = "创建人") + private String creator; + @ApiModelProperty(name = "gmtModified", value = "修改时间") + private String gmtModified; + @ApiModelProperty(name = "modifier", value = "修改人") + private String modifier; + @ApiModelProperty(name = "isDelete", value = "是否删除0:是,1:否") + private Integer isDelete; + + public String getGoodsId() { + return goodsId == null ? "" : goodsId.trim(); + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName == null ? "" : goodsName.trim(); + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getGoodsSummary() { + return goodsSummary == null ? "" : goodsSummary.trim(); + } + + public void setGoodsSummary(String goodsSummary) { + this.goodsSummary = goodsSummary; + } + + public String getGoodsIcon() { + return goodsIcon == null ? "" : goodsIcon.trim(); + } + + public void setGoodsIcon(String goodsIcon) { + this.goodsIcon = goodsIcon; + } + + public String getShopId() { + return shopId == null ? "" : shopId.trim(); + } + + public void setShopId(String shopId) { + this.shopId = shopId; + } + + public String getCategoryId() { + return categoryId == null ? "" : categoryId.trim(); + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public Double getGoodsSort() { + return goodsSort == null ? 0D : goodsSort; + } + + public void setGoodsSort(Double goodsSort) { + this.goodsSort = goodsSort; + } + + public Integer getGoodsTotal() { + return goodsTotal == null ? 0 : goodsTotal; + } + + public void setGoodsTotal(Integer goodsTotal) { + this.goodsTotal = goodsTotal; + } + + public Integer getGoodsStatus() { + return goodsStatus == null ? 0 : goodsStatus; + } + + public void setGoodsStatus(Integer goodsStatus) { + this.goodsStatus = goodsStatus; + } + + public Double getGoodsUnitPrice() { + return goodsUnitPrice == null ? 0D : goodsUnitPrice; + } + + public void setGoodsUnitPrice(Double goodsUnitPrice) { + this.goodsUnitPrice = goodsUnitPrice; + } + + public String getGoodsUnit() { + return goodsUnit == null ? "" : goodsUnit.trim(); + } + + public void setGoodsUnit(String goodsUnit) { + this.goodsUnit = goodsUnit; + } + + public Integer getPaymentType() { + return paymentType == null ? 0 : paymentType; + } + + public void setPaymentType(Integer paymentType) { + this.paymentType = paymentType; + } + + public String getGoodsPhotos() { + return goodsPhotos == null ? "" : goodsPhotos.trim(); + } + + public void setGoodsPhotos(String goodsPhotos) { + this.goodsPhotos = goodsPhotos; + } + + public String getGoodsVideo() { + return goodsVideo == null ? "" : goodsVideo.trim(); + } + + public void setGoodsVideo(String goodsVideo) { + this.goodsVideo = goodsVideo; + } + + public Double getGoodStar() { + return goodStar == null ? 0D : goodStar; + } + + public void setGoodStar(Double goodStar) { + this.goodStar = goodStar; + } + + public Double getUserEvaluate() { + return userEvaluate == null ? 0D : userEvaluate; + } + + public void setUserEvaluate(Double userEvaluate) { + this.userEvaluate = userEvaluate; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/pos/shopgoods/ShopGoodsPO.java b/src/main/java/cn/com/tenlion/pojo/pos/shopgoods/ShopGoodsPO.java new file mode 100644 index 0000000..0b1ab1d --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/pos/shopgoods/ShopGoodsPO.java @@ -0,0 +1,204 @@ +package cn.com.tenlion.pojo.pos.shopgoods; + +/** + * + * @ClassName: ShopGoodsPO + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +public class ShopGoodsPO { + + private String goodsId; + private String goodsName; + private String goodsSummary; + private String goodsIcon; + private String shopId; + private String categoryId; + private Double goodsSort; + private Integer goodsTotal; + private Integer goodsStatus; + private Double goodsUnitPrice; + private String goodsUnit; + private Integer paymentType; + private String goodsPhotos; + private String goodsVideo; + private Double goodStar; + private Double userEvaluate; + private String gmtCreate; + private String creator; + private String gmtModified; + private String modifier; + private Integer isDelete; + + public String getGoodsId() { + return goodsId == null ? "" : goodsId.trim(); + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName == null ? "" : goodsName.trim(); + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getGoodsSummary() { + return goodsSummary == null ? "" : goodsSummary.trim(); + } + + public void setGoodsSummary(String goodsSummary) { + this.goodsSummary = goodsSummary; + } + + public String getGoodsIcon() { + return goodsIcon == null ? "" : goodsIcon.trim(); + } + + public void setGoodsIcon(String goodsIcon) { + this.goodsIcon = goodsIcon; + } + + public String getShopId() { + return shopId == null ? "" : shopId.trim(); + } + + public void setShopId(String shopId) { + this.shopId = shopId; + } + + public String getCategoryId() { + return categoryId == null ? "" : categoryId.trim(); + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public Double getGoodsSort() { + return goodsSort == null ? 0D : goodsSort; + } + + public void setGoodsSort(Double goodsSort) { + this.goodsSort = goodsSort; + } + + public Integer getGoodsTotal() { + return goodsTotal == null ? 0 : goodsTotal; + } + + public void setGoodsTotal(Integer goodsTotal) { + this.goodsTotal = goodsTotal; + } + + public Integer getGoodsStatus() { + return goodsStatus == null ? 0 : goodsStatus; + } + + public void setGoodsStatus(Integer goodsStatus) { + this.goodsStatus = goodsStatus; + } + + public Double getGoodsUnitPrice() { + return goodsUnitPrice == null ? 0D : goodsUnitPrice; + } + + public void setGoodsUnitPrice(Double goodsUnitPrice) { + this.goodsUnitPrice = goodsUnitPrice; + } + + public String getGoodsUnit() { + return goodsUnit == null ? "" : goodsUnit.trim(); + } + + public void setGoodsUnit(String goodsUnit) { + this.goodsUnit = goodsUnit; + } + + public Integer getPaymentType() { + return paymentType == null ? 0 : paymentType; + } + + public void setPaymentType(Integer paymentType) { + this.paymentType = paymentType; + } + + public String getGoodsPhotos() { + return goodsPhotos == null ? "" : goodsPhotos.trim(); + } + + public void setGoodsPhotos(String goodsPhotos) { + this.goodsPhotos = goodsPhotos; + } + + public String getGoodsVideo() { + return goodsVideo == null ? "" : goodsVideo.trim(); + } + + public void setGoodsVideo(String goodsVideo) { + this.goodsVideo = goodsVideo; + } + + public Double getGoodStar() { + return goodStar == null ? 0D : goodStar; + } + + public void setGoodStar(Double goodStar) { + this.goodStar = goodStar; + } + + public Double getUserEvaluate() { + return userEvaluate == null ? 0D : userEvaluate; + } + + public void setUserEvaluate(Double userEvaluate) { + this.userEvaluate = userEvaluate; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/pojo/vos/shopgoods/ShopGoodsVO.java b/src/main/java/cn/com/tenlion/pojo/vos/shopgoods/ShopGoodsVO.java new file mode 100644 index 0000000..20bf3af --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/vos/shopgoods/ShopGoodsVO.java @@ -0,0 +1,241 @@ +package cn.com.tenlion.pojo.vos.shopgoods; + +import ink.wgink.annotation.CheckEmptyAnnotation; +import ink.wgink.annotation.CheckNumberAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: ShopGoodsVO + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +@ApiModel +public class ShopGoodsVO { + + @ApiModelProperty(name = "goodsId", value = "商品ID") + private String goodsId; + @ApiModelProperty(name = "goodsName", value = "商品名称") + private String goodsName; + @ApiModelProperty(name = "goodsSummary", value = "商品说明") + private String goodsSummary; + @ApiModelProperty(name = "goodsIcon", value = "商品LOGO") + private String goodsIcon; + @ApiModelProperty(name = "shopId", value = "店铺ID") + private String shopId; + @ApiModelProperty(name = "categoryId", value = "类目ID") + private String categoryId; + @ApiModelProperty(name = "goodsSort", value = "排序") + @CheckNumberAnnotation(name = "排序") + private Double goodsSort; + @ApiModelProperty(name = "goodsTotal", value = "商品总数,最大9999标识不限制") + @CheckNumberAnnotation(name = "商品总数,最大9999标识不限制") + private Integer goodsTotal; + @ApiModelProperty(name = "goodsStatus", value = "商品状态1:上架,2:下架") + @CheckNumberAnnotation(name = "商品状态1:上架,2:下架") + private Integer goodsStatus; + @ApiModelProperty(name = "goodsUnitPrice", value = "商品单价") + @CheckNumberAnnotation(name = "商品单价") + private Double goodsUnitPrice; + @ApiModelProperty(name = "goodsUnit", value = "商品单位") + private String goodsUnit; + @ApiModelProperty(name = "paymentType", value = "支付类型1:线上支付,2:到店支付") + @CheckNumberAnnotation(name = "支付类型1:线上支付,2:到店支付") + private Integer paymentType; + @ApiModelProperty(name = "goodsPhotos", value = "商品图片,最多9张") + private String goodsPhotos; + @ApiModelProperty(name = "goodsVideo", value = "商品视频,最多1个") + private String goodsVideo; + @ApiModelProperty(name = "goodStar", value = "商品星级,最高5星") + @CheckNumberAnnotation(name = "商品星级,最高5星") + private Double goodStar; + @ApiModelProperty(name = "userEvaluate", value = "用户评价,分数,满分10分,通过用户的评价自动计算") + @CheckNumberAnnotation(name = "用户评价,分数,满分10分,通过用户的评价自动计算") + private Double userEvaluate; + @ApiModelProperty(name = "gmtCreate", value = "创建时间") + @CheckEmptyAnnotation(name = "创建时间", verifyType = "datetime") + private String gmtCreate; + @ApiModelProperty(name = "creator", value = "创建人") + private String creator; + @ApiModelProperty(name = "gmtModified", value = "修改时间") + @CheckEmptyAnnotation(name = "修改时间", verifyType = "datetime") + private String gmtModified; + @ApiModelProperty(name = "modifier", value = "修改人") + private String modifier; + @ApiModelProperty(name = "isDelete", value = "是否删除0:是,1:否") + @CheckNumberAnnotation(name = "是否删除0:是,1:否") + private Integer isDelete; + + public String getGoodsId() { + return goodsId == null ? "" : goodsId.trim(); + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName == null ? "" : goodsName.trim(); + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getGoodsSummary() { + return goodsSummary == null ? "" : goodsSummary.trim(); + } + + public void setGoodsSummary(String goodsSummary) { + this.goodsSummary = goodsSummary; + } + + public String getGoodsIcon() { + return goodsIcon == null ? "" : goodsIcon.trim(); + } + + public void setGoodsIcon(String goodsIcon) { + this.goodsIcon = goodsIcon; + } + + public String getShopId() { + return shopId == null ? "" : shopId.trim(); + } + + public void setShopId(String shopId) { + this.shopId = shopId; + } + + public String getCategoryId() { + return categoryId == null ? "" : categoryId.trim(); + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public Double getGoodsSort() { + return goodsSort == null ? 0D : goodsSort; + } + + public void setGoodsSort(Double goodsSort) { + this.goodsSort = goodsSort; + } + + public Integer getGoodsTotal() { + return goodsTotal == null ? 0 : goodsTotal; + } + + public void setGoodsTotal(Integer goodsTotal) { + this.goodsTotal = goodsTotal; + } + + public Integer getGoodsStatus() { + return goodsStatus == null ? 0 : goodsStatus; + } + + public void setGoodsStatus(Integer goodsStatus) { + this.goodsStatus = goodsStatus; + } + + public Double getGoodsUnitPrice() { + return goodsUnitPrice == null ? 0D : goodsUnitPrice; + } + + public void setGoodsUnitPrice(Double goodsUnitPrice) { + this.goodsUnitPrice = goodsUnitPrice; + } + + public String getGoodsUnit() { + return goodsUnit == null ? "" : goodsUnit.trim(); + } + + public void setGoodsUnit(String goodsUnit) { + this.goodsUnit = goodsUnit; + } + + public Integer getPaymentType() { + return paymentType == null ? 0 : paymentType; + } + + public void setPaymentType(Integer paymentType) { + this.paymentType = paymentType; + } + + public String getGoodsPhotos() { + return goodsPhotos == null ? "" : goodsPhotos.trim(); + } + + public void setGoodsPhotos(String goodsPhotos) { + this.goodsPhotos = goodsPhotos; + } + + public String getGoodsVideo() { + return goodsVideo == null ? "" : goodsVideo.trim(); + } + + public void setGoodsVideo(String goodsVideo) { + this.goodsVideo = goodsVideo; + } + + public Double getGoodStar() { + return goodStar == null ? 0D : goodStar; + } + + public void setGoodStar(Double goodStar) { + this.goodStar = goodStar; + } + + public Double getUserEvaluate() { + return userEvaluate == null ? 0D : userEvaluate; + } + + public void setUserEvaluate(Double userEvaluate) { + this.userEvaluate = userEvaluate; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/service/shopgoods/IShopGoodsService.java b/src/main/java/cn/com/tenlion/service/shopgoods/IShopGoodsService.java new file mode 100644 index 0000000..1fc4a99 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/shopgoods/IShopGoodsService.java @@ -0,0 +1,188 @@ +package cn.com.tenlion.service.shopgoods; + +import cn.com.tenlion.pojo.bos.shopgoods.ShopGoodsBO; +import cn.com.tenlion.pojo.dtos.shopgoods.ShopGoodsDTO; +import cn.com.tenlion.pojo.pos.shopgoods.ShopGoodsPO; +import cn.com.tenlion.pojo.vos.shopgoods.ShopGoodsVO; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IShopGoodsService + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +public interface IShopGoodsService { + + /** + * 新增 + * + * @param shopGoodsVO + * @return + */ + void save(ShopGoodsVO shopGoodsVO); + + /** + * 新增 + * + * @param token + * @param shopGoodsVO + * @return + */ + void save(String token, ShopGoodsVO shopGoodsVO); + + /** + * 新增 + * + * @param shopGoodsVO + * @return shopGoodsId + */ + String saveReturnId(ShopGoodsVO shopGoodsVO); + + /** + * 新增 + * + * @param token + * @param shopGoodsVO + * @return shopGoodsId + */ + String saveReturnId(String token, ShopGoodsVO shopGoodsVO); + + /** + * 删除 + * + * @param ids id列表 + * @return + */ + void remove(List ids); + + + /** + * 删除 + * + * @param token + * @param ids id列表 + * @return + */ + void remove(String token, List ids); + + /** + * 删除(物理删除) + * + * @param ids id列表 + */ + void delete(List ids); + + /** + * 修改 + * + * @param shopGoodsId + * @param shopGoodsVO + * @return + */ + void update(String shopGoodsId, ShopGoodsVO shopGoodsVO); + + /** + * 修改 + * + * @param token + * @param shopGoodsId + * @param shopGoodsVO + * @return + */ + void update(String token, String shopGoodsId, ShopGoodsVO shopGoodsVO); + + /** + * 详情 + * + * @param params 参数Map + * @return + */ + ShopGoodsDTO get(Map params); + + /** + * 详情 + * + * @param shopGoodsId + * @return + */ + ShopGoodsDTO get(String shopGoodsId); + + /** + * 详情 + * + * @param params 参数Map + * @return + */ + ShopGoodsBO getBO(Map params); + + /** + * 详情 + * + * @param shopGoodsId + * @return + */ + ShopGoodsBO getBO(String shopGoodsId); + + /** + * 详情 + * + * @param params 参数Map + * @return + */ + ShopGoodsPO getPO(Map params); + + /** + * 详情 + * + * @param shopGoodsId + * @return + */ + ShopGoodsPO getPO(String shopGoodsId); + + /** + * 列表 + * + * @param params + * @return + */ + List list(Map params); + + /** + * 列表 + * + * @param params + * @return + */ + List listBO(Map params); + + /** + * 列表 + * + * @param params + * @return + */ + List listPO(Map params); + + /** + * 分页列表 + * + * @param page + * @return + */ + SuccessResultList> listPage(ListPage page); + + /** + * 统计 + * + * @param params + * @return + */ + Integer count(Map params); + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/shopgoods/impl/ShopGoodsServiceImpl.java b/src/main/java/cn/com/tenlion/service/shopgoods/impl/ShopGoodsServiceImpl.java new file mode 100644 index 0000000..6e74556 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/shopgoods/impl/ShopGoodsServiceImpl.java @@ -0,0 +1,170 @@ +package cn.com.tenlion.service.shopgoods.impl; + +import cn.com.tenlion.dao.shopgoods.IShopGoodsDao; +import cn.com.tenlion.pojo.bos.shopgoods.ShopGoodsBO; +import cn.com.tenlion.pojo.dtos.shopgoods.ShopGoodsDTO; +import cn.com.tenlion.pojo.pos.shopgoods.ShopGoodsPO; +import cn.com.tenlion.pojo.vos.shopgoods.ShopGoodsVO; +import cn.com.tenlion.service.shopgoods.IShopGoodsService; +import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.util.map.HashMapUtil; +import ink.wgink.util.UUIDUtil; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @ClassName: ShopGoodsServiceImpl + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-19 16:55:10 + * @Version: 3.0 + **/ +@Service +public class ShopGoodsServiceImpl extends DefaultBaseService implements IShopGoodsService { + + @Autowired + private IShopGoodsDao shopGoodsDao; + + @Override + public void save(ShopGoodsVO shopGoodsVO) { + saveReturnId(shopGoodsVO); + } + + @Override + public void save(String token, ShopGoodsVO shopGoodsVO) { + saveReturnId(token, shopGoodsVO); + } + + @Override + public String saveReturnId(ShopGoodsVO shopGoodsVO) { + return saveReturnId(null, shopGoodsVO); + } + + @Override + public String saveReturnId(String token, ShopGoodsVO shopGoodsVO) { + String shopGoodsId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(shopGoodsVO); + params.put("shopGoodsId", shopGoodsId); + if (StringUtils.isBlank(token)) { + setSaveInfo(params); + } else { + setAppSaveInfo(token, params); + } + shopGoodsDao.save(params); + return shopGoodsId; + } + + @Override + public void remove(List ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map params = getHashMap(2); + params.put("shopGoodsIds", ids); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + shopGoodsDao.remove(params); + } + + @Override + public void delete(List ids) { + Map params = getHashMap(2); + params.put("shopGoodsIds", ids); + shopGoodsDao.delete(params); + } + + @Override + public void update(String shopGoodsId, ShopGoodsVO shopGoodsVO) { + update(null, shopGoodsId, shopGoodsVO); + } + + @Override + public void update(String token, String shopGoodsId, ShopGoodsVO shopGoodsVO) { + Map params = HashMapUtil.beanToMap(shopGoodsVO); + params.put("shopGoodsId", shopGoodsId); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + shopGoodsDao.update(params); + } + + @Override + public ShopGoodsDTO get(Map params) { + return shopGoodsDao.get(params); + } + + @Override + public ShopGoodsDTO get(String shopGoodsId) { + Map params = super.getHashMap(2); + params.put("shopGoodsId", shopGoodsId); + return get(params); + } + + @Override + public ShopGoodsBO getBO(Map params) { + return shopGoodsDao.getBO(params); + } + + @Override + public ShopGoodsBO getBO(String shopGoodsId) { + Map params = super.getHashMap(2); + params.put("shopGoodsId", shopGoodsId); + return getBO(params); + } + + @Override + public ShopGoodsPO getPO(Map params) { + return shopGoodsDao.getPO(params); + } + + @Override + public ShopGoodsPO getPO(String shopGoodsId) { + Map params = super.getHashMap(2); + params.put("shopGoodsId", shopGoodsId); + return getPO(params); + } + + @Override + public List list(Map params) { + return shopGoodsDao.list(params); + } + + @Override + public List listBO(Map params) { + return shopGoodsDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return shopGoodsDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List shopGoodsDTOs = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(shopGoodsDTOs); + return new SuccessResultList<>(shopGoodsDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = shopGoodsDao.count(params); + return count == null ? 0 : count; + } + +} \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/shopGoods/shopGoods-mapper.xml b/src/main/resources/mybatis/mapper/shopGoods/shopGoods-mapper.xml new file mode 100644 index 0000000..aa9e224 --- /dev/null +++ b/src/main/resources/mybatis/mapper/shopGoods/shopGoods-mapper.xml @@ -0,0 +1,455 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO svc_shop_goods( + goods_id, + goods_name, + goods_summary, + goods_icon, + shop_id, + category_id, + goods_sort, + goods_total, + goods_status, + goods_unit_price, + goods_unit, + payment_type, + goods_photos, + goods_video, + good_star, + user_evaluate, + gmt_create, + creator, + gmt_modified, + modifier, + is_delete + ) VALUES( + #{goodsId}, + #{goodsName}, + #{goodsSummary}, + #{goodsIcon}, + #{shopId}, + #{categoryId}, + #{goodsSort}, + #{goodsTotal}, + #{goodsStatus}, + #{goodsUnitPrice}, + #{goodsUnit}, + #{paymentType}, + #{goodsPhotos}, + #{goodsVideo}, + #{goodStar}, + #{userEvaluate}, + #{gmtCreate}, + #{creator}, + #{gmtModified}, + #{modifier}, + #{isDelete} + ) + + + + + UPDATE + svc_shop_goods + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + + + + + + DELETE FROM + svc_shop_goods + WHERE + + + + + + UPDATE + svc_shop_goods + SET + + goods_id = #{goodsId}, + + + goods_name = #{goodsName}, + + + goods_summary = #{goodsSummary}, + + + goods_icon = #{goodsIcon}, + + + shop_id = #{shopId}, + + + category_id = #{categoryId}, + + + goods_sort = #{goodsSort}, + + + goods_total = #{goodsTotal}, + + + goods_status = #{goodsStatus}, + + + goods_unit_price = #{goodsUnitPrice}, + + + goods_unit = #{goodsUnit}, + + + payment_type = #{paymentType}, + + + goods_photos = #{goodsPhotos}, + + + goods_video = #{goodsVideo}, + + + good_star = #{goodStar}, + + + user_evaluate = #{userEvaluate}, + + + gmt_create = #{gmtCreate}, + + + creator = #{creator}, + + + gmt_modified = #{gmtModified}, + + + modifier = #{modifier}, + + + is_delete = #{isDelete} + + WHERE + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/shopGoods/list.html b/src/main/resources/static/route/shopGoods/list.html new file mode 100644 index 0000000..3ea0bfa --- /dev/null +++ b/src/main/resources/static/route/shopGoods/list.html @@ -0,0 +1,432 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/shopGoods/save.html b/src/main/resources/static/route/shopGoods/save.html new file mode 100644 index 0000000..c355834 --- /dev/null +++ b/src/main/resources/static/route/shopGoods/save.html @@ -0,0 +1,524 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/shopGoods/update.html b/src/main/resources/static/route/shopGoods/update.html new file mode 100644 index 0000000..68e3d14 --- /dev/null +++ b/src/main/resources/static/route/shopGoods/update.html @@ -0,0 +1,541 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file