diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStore.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStore.java index e2b8a26..9587be8 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStore.java +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStore.java @@ -32,4 +32,5 @@ public class LpkStore { private String picUrl; private String lonAndLat; private String bankSid; + private String warehouseSid; } diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreDetailsVo.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreDetailsVo.java index 326b082..343c894 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreDetailsVo.java +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreDetailsVo.java @@ -23,4 +23,7 @@ public class LpkStoreDetailsVo { private String lonAndLat; private String bankName; private String bankSid; + private String useOrgSid; + private String createOrgSid; + private String userSid; } diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreDto.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreDto.java index 3b9bbdf..7c25062 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreDto.java +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreDto.java @@ -23,4 +23,8 @@ public class LpkStoreDto implements Dto { private String picUrl; private String lonAndLat; private String bankSid; + private String warehouseSid; + private String useOrgSid; + private String userSid; + } diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreQuery.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreQuery.java index 0a99e2d..98de468 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreQuery.java +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreQuery.java @@ -13,4 +13,6 @@ import lombok.Data; public class LpkStoreQuery implements Query { private String name; private String sort; + private String orgPath; + private String userOrgSid; } diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreVo.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreVo.java index 9c94cfa..20b9691 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreVo.java +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/LpkStoreVo.java @@ -29,4 +29,6 @@ public class LpkStoreVo implements Vo { private String lonAndLat; private String bankName; private String bankSid; + private String picUrl; + private String warehouseSid; } diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/SmsOrderHouseInfo.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/SmsOrderHouseInfo.java new file mode 100644 index 0000000..8c0d81a --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/SmsOrderHouseInfo.java @@ -0,0 +1,27 @@ +package com.yxt.ordermall.api.lpkstore; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Fan + * @description + * @date 2024/7/22 8:54 + */ +@Data +public class SmsOrderHouseInfo { + + /** + * 仓库名称 + */ + private String warehouseName; + /** + * 仓库sid + */ + private String warehouseSid; + + + List houseRock = new ArrayList<>(); +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/SmsOrderRock.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/SmsOrderRock.java new file mode 100644 index 0000000..7d8850b --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/SmsOrderRock.java @@ -0,0 +1,23 @@ +package com.yxt.ordermall.api.lpkstore; + +import lombok.Data; + +/** + * @author Fan + * @description + * @date 2024/7/22 8:54 + */ +@Data +public class SmsOrderRock { + + + /** + * 货位编码 + */ + private String warehouseRackCode; + /** + * 货位sid + */ + private String warehouseRackSid; + +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseExtendDto.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseExtendDto.java new file mode 100644 index 0000000..a24aa80 --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseExtendDto.java @@ -0,0 +1,27 @@ +package com.yxt.ordermall.api.lpkstore; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class WarehouseExtendDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String warehouseSid;//仓库sid + private Integer markupRate1;//加价率1 + private Integer markupRate2;//加价率2 + private Integer markupRate3;//加价率3 + private Integer markupRate4;//加价率4 + private Integer markupRate5;//加价率5 +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseExtendVo.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseExtendVo.java new file mode 100644 index 0000000..d09c79c --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseExtendVo.java @@ -0,0 +1,33 @@ +package com.yxt.ordermall.api.lpkstore; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class WarehouseExtendVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String warehouseSid;//仓库sid + private String warehouseName;//仓库名称 + private Integer markupRate1;//加价率1 + private Integer markupRate2;//加价率2 + private Integer markupRate3;//加价率3 + private Integer markupRate4;//加价率4 + private Integer markupRate5;//加价率5 +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfo.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfo.java new file mode 100644 index 0000000..8f3956d --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfo.java @@ -0,0 +1,32 @@ +package com.yxt.ordermall.api.lpkstore; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class WarehouseInfo extends BaseEntity { + + private String warehouseName;//仓库名称 + private String warehouseCode;//仓库编码 + private String contacts;//联系人 + private String mob;//手机 + private String telephone;//联系电话 + private String manager;//主管 + private String areaSid;//地区sid + private String address;//地址 + private String belongingPlace;//归属地 + private String lngAndLat;//经纬度 + private String longitude;//经度 + private String latitude;//纬度 + private String warehouseTypeKey;//仓库类型Key + private String warehouseTypeValue;//仓库类型value + private Integer usageStatus;//使用状态,0停用 1正常 + private String squareMeter;//平方米 + private Integer sortNo;//排序 + private String useOrgSid;//创建组织sid + private String createOrgSid;//创建组织sid +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoAllVo.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoAllVo.java new file mode 100644 index 0000000..6f777d9 --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoAllVo.java @@ -0,0 +1,54 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.ordermall.api.lpkstore; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-oms(仓库)
+ * File: omsWarehouseInfoVo.java
+ * Class: com.yxt.oms.api.omswarehouseinfo.omsWarehouseInfoVo
+ * Description: 仓库 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-04-09 14:35:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "仓库 视图数据详情", description = "仓库 视图数据详情") +public class WarehouseInfoAllVo implements Vo { + + private String sid; + @ApiModelProperty("仓库名称") + private String warehouseName; +} \ No newline at end of file diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoDto.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoDto.java new file mode 100644 index 0000000..e9c79c3 --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoDto.java @@ -0,0 +1,51 @@ +package com.yxt.ordermall.api.lpkstore; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class WarehouseInfoDto implements Dto { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String createBySid; + private String updateBySid; + private Integer isEnable; + private Integer state; + private Integer isDelete; + private String warehouseName;//仓库名称 + private String warehouseCode;//仓库编码 + private String contacts;//联系人 + private String mob;//手机 + private String telephone;//联系电话 + private String manager;//主管 + private String areaSid;//地区sid + private String address;//地址 + private String belongingPlace;//归属地 + private String lngAndLat;//经纬度 + private String longitude;//经度 + private String latitude;//纬度 + private String warehouseTypeKey;//仓库类型Key + private String warehouseTypeValue;//仓库类型value + private Integer usageStatus;//使用状态,0停用 1正常 + private String squareMeter;//平方米 + private Integer sortNo;//排序 + private String useOrgSid;//创建组织sid + private String createOrgSid;//创建组织sid +// private List omsWarehouseExtendDtos; + private WarehouseExtendDto omsWarehouseExtendDto; + private String userSid; //登录用户sid + private String orgPath; //组织全路径 +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoMapQuery.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoMapQuery.java new file mode 100644 index 0000000..f60924b --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoMapQuery.java @@ -0,0 +1,21 @@ +package com.yxt.ordermall.api.lpkstore; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/8/29 11:52 + */ +@Data +public class WarehouseInfoMapQuery { + private String name;//仓库名称 + @ApiModelProperty("菜单路由") + private String menuUrl; + @ApiModelProperty("组织全路径sid") + private String orgPath; + @ApiModelProperty("用户sid") + private String userSid; + private String orgLevelKey;// + private int index;//下标 +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoQuery.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoQuery.java new file mode 100644 index 0000000..e0930fe --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoQuery.java @@ -0,0 +1,25 @@ +package com.yxt.ordermall.api.lpkstore; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class WarehouseInfoQuery implements Query { + private String name; + private String code; + private String address; + private String orgLevelKey;//权限等级 + @ApiModelProperty("菜单路由") + private String menuUrl; + @ApiModelProperty("组织全路径sid") + private String orgPath; + @ApiModelProperty("用户sid") + private String userSid; + private int index; + +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoVo.java b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoVo.java new file mode 100644 index 0000000..5e81871 --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/api/lpkstore/WarehouseInfoVo.java @@ -0,0 +1,49 @@ +package com.yxt.ordermall.api.lpkstore; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class WarehouseInfoVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String createBySid; + private String updateBySid; + private Integer isEnable; + private Integer state; + private Integer isDelete; + private String warehouseName;//仓库名称 + private String warehouseCode;//仓库编码 + private String contacts;//联系人 + private String mob;//手机 + private String telephone;//联系电话 + private String manager;//主管 + private String areaSid;//地区sid + private String address;//地址 + private String belongingPlace;//归属地 + private String lngAndLat;//经纬度 + private String longitude;//经度 + private String latitude;//纬度 + private String warehouseTypeKey;//仓库类型Key + private String warehouseTypeValue;//仓库类型value + private Integer usageStatus;//使用状态,0停用 1正常 + private String squareMeter;//平方米 + private Integer sortNo;//排序 + private String useOrgSid;//创建组织sid + private String createOrgSid;//创建组织sid + private List wmsWarehouseExtendVos; +} diff --git a/ordermall/src/main/java/com/yxt/ordermall/apiadmin/aggregation/PmsBrandRest.java b/ordermall/src/main/java/com/yxt/ordermall/apiadmin/aggregation/PmsBrandRest.java index eb8b949..d57151e 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/apiadmin/aggregation/PmsBrandRest.java +++ b/ordermall/src/main/java/com/yxt/ordermall/apiadmin/aggregation/PmsBrandRest.java @@ -1,8 +1,6 @@ package com.yxt.ordermall.apiadmin.aggregation; import cn.hutool.core.bean.BeanUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.utils.StringUtils; import com.yxt.common.core.query.PagerQuery; @@ -14,11 +12,9 @@ import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoVo; import com.yxt.ordermall.biz.func.commonmethod.CommonMethod; import com.yxt.ordermall.biz.func.commonmethod.DataRule; import com.yxt.ordermall.feign.base.basebrandinfo.BaseBrandInfoFeign; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsBrandService; import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand; import com.yxt.ordermall.mallplus.mbg.pms.entity.brand.BrandVo; import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -43,8 +39,7 @@ import java.util.List; @Api(tags = "PmsBrandController", description = "品牌表管理") @RequestMapping("/pms/PmsBrand") public class PmsBrandRest { - @Resource - private IPmsBrandService IPmsBrandService; + @Autowired BaseBrandInfoFeign baseBrandInfoFeign; @Autowired @@ -144,51 +139,51 @@ public class PmsBrandRest { return new ResultBean<>().success().setData(coupon); } - @ApiOperation(value = "批量删除品牌表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除品牌表") - // @PreAuthorize("hasAuthority('pms:PmsBrand:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsBrandService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } +// @ApiOperation(value = "批量删除品牌表") +// @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) +// @ResponseBody +// // @SysLog(MODULE = "pms", REMARK = "批量删除品牌表") +// // @PreAuthorize("hasAuthority('pms:PmsBrand:delete')") +// public Object deleteBatch(@RequestParam("ids") List ids) { +// boolean count = IPmsBrandService.removeByIds(ids); +// if (count) { +// return new CommonResult().success(count); +// } else { +// return new CommonResult().failed(); +// } +// } - @ApiOperation(value = "批量更新显示状态") - @RequestMapping(value = "/update/showStatus", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量更新显示状态") - public Object updateShowStatus(@RequestParam("ids") List ids, - @RequestParam("showStatus") Integer showStatus) { - int count = IPmsBrandService.updateShowStatus(ids, showStatus); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } +// @ApiOperation(value = "批量更新显示状态") +// @RequestMapping(value = "/update/showStatus", method = RequestMethod.POST) +// @ResponseBody +// // @SysLog(MODULE = "pms", REMARK = "批量更新显示状态") +// public Object updateShowStatus(@RequestParam("ids") List ids, +// @RequestParam("showStatus") Integer showStatus) { +// int count = IPmsBrandService.updateShowStatus(ids, showStatus); +// if (count > 0) { +// return new CommonResult().success(count); +// } else { +// return new CommonResult().failed(); +// } +// } - @ApiOperation(value = "批量更新厂家制造商状态") - @RequestMapping(value = "/update/factoryStatus", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量更新厂家制造商状态") - public Object updateFactoryStatus(@RequestParam("ids") List ids, - @RequestParam("factoryStatus") Integer factoryStatus) { - int count = IPmsBrandService.updateFactoryStatus(ids, factoryStatus); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } +// @ApiOperation(value = "批量更新厂家制造商状态") +// @RequestMapping(value = "/update/factoryStatus", method = RequestMethod.POST) +// @ResponseBody +// // @SysLog(MODULE = "pms", REMARK = "批量更新厂家制造商状态") +// public Object updateFactoryStatus(@RequestParam("ids") List ids, +// @RequestParam("factoryStatus") Integer factoryStatus) { +// int count = IPmsBrandService.updateFactoryStatus(ids, factoryStatus); +// if (count > 0) { +// return new CommonResult().success(count); +// } else { +// return new CommonResult().failed(); +// } +// } - @ApiOperation(value = "获取品牌") - @GetMapping("/getList") - ResultBean> getList(){ - return IPmsBrandService.getList(); - } +// @ApiOperation(value = "获取品牌") +// @GetMapping("/getList") +// ResultBean> getList(){ +// return IPmsBrandService.getList(); +// } } diff --git a/ordermall/src/main/java/com/yxt/ordermall/apiadmin/aggregation/PmsProductCategoryRest.java b/ordermall/src/main/java/com/yxt/ordermall/apiadmin/aggregation/PmsProductCategoryRest.java index 38034c0..8975bc8 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/apiadmin/aggregation/PmsProductCategoryRest.java +++ b/ordermall/src/main/java/com/yxt/ordermall/apiadmin/aggregation/PmsProductCategoryRest.java @@ -1,25 +1,18 @@ package com.yxt.ordermall.apiadmin.aggregation; import cn.hutool.core.bean.BeanUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; -import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoQuery; -import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoVo; import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeDto; import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeQuery; import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeVo; import com.yxt.ordermall.biz.func.commonmethod.CommonMethod; import com.yxt.ordermall.biz.func.commonmethod.DataRule; import com.yxt.ordermall.feign.base.basegoodstype.BaseGoodsTypeFeign; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductCategoryService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand; import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategory; import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductCategoryWithChildrenItem; import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -44,8 +37,7 @@ import java.util.List; @Api(tags = "PmsProductCategoryController", description = "产品分类管理") @RequestMapping("/pms/PmsProductCategory") public class PmsProductCategoryRest { - @Resource - private IPmsProductCategoryService IPmsProductCategoryService; + @Autowired BaseGoodsTypeFeign baseGoodsTypeFeign; @Autowired @@ -151,43 +143,43 @@ public class PmsProductCategoryRest { return new ResultBean<>().success().setData(coupon); } - @ApiOperation(value = "批量删除产品分类") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除产品分类") - // @PreAuthorize("hasAuthority('pms:PmsProductCategory:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductCategoryService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } +// @ApiOperation(value = "批量删除产品分类") +// @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) +// @ResponseBody +// // @SysLog(MODULE = "pms", REMARK = "批量删除产品分类") +// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:delete')") +// public Object deleteBatch(@RequestParam("ids") List ids) { +// boolean count = IPmsProductCategoryService.removeByIds(ids); +// if (count) { +// return new CommonResult().success(count); +// } else { +// return new CommonResult().failed(); +// } +// } - @ApiOperation("查询所有一级分类及子分类") - @RequestMapping(value = "/list/withChildren", method = RequestMethod.GET) - @ResponseBody - public Object listWithChildren() { - List list = IPmsProductCategoryService.listWithChildren(); - return new CommonResult().success(list); - } +// @ApiOperation("查询所有一级分类及子分类") +// @RequestMapping(value = "/list/withChildren", method = RequestMethod.GET) +// @ResponseBody +// public Object listWithChildren() { +// List list = IPmsProductCategoryService.listWithChildren(); +// return new CommonResult().success(list); +// } - @ApiOperation("修改导航栏显示状态") - @RequestMapping(value = "/update/navStatus", method = RequestMethod.POST) - @ResponseBody - // @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')") - public Object updateNavStatus(@RequestParam("ids") Long ids, @RequestParam("navStatus") Integer navStatus) { - PmsProductCategory entity = new PmsProductCategory(); - entity.setId(ids); - entity.setNavStatus(navStatus); - - if (IPmsProductCategoryService.updateById(entity)) { - return new CommonResult().success(); - } else { - return new CommonResult().failed(); - } - } +// @ApiOperation("修改导航栏显示状态") +// @RequestMapping(value = "/update/navStatus", method = RequestMethod.POST) +// @ResponseBody +// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')") +// public Object updateNavStatus(@RequestParam("ids") Long ids, @RequestParam("navStatus") Integer navStatus) { +// PmsProductCategory entity = new PmsProductCategory(); +// entity.setId(ids); +// entity.setNavStatus(navStatus); +// +// if (IPmsProductCategoryService.updateById(entity)) { +// return new CommonResult().success(); +// } else { +// return new CommonResult().failed(); +// } +// } // public Object updateNavStatus(@RequestParam("ids") List ids, @RequestParam("navStatus") Integer navStatus) { // int count = IPmsProductCategoryService.updateNavStatus(ids, navStatus); // if (count > 0) { @@ -205,19 +197,19 @@ public class PmsProductCategoryRest { return baseGoodsTypeFeign.updateIsEnable(sid,String.valueOf(showStatus)); } - @ApiOperation("修改首页显示状态") - @RequestMapping(value = "/update/indexStatus", method = RequestMethod.POST) - @ResponseBody - // @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')") - public Object updateIndexStatus(@RequestParam("ids") Long ids, @RequestParam("indexStatus") Integer indexStatus) { - PmsProductCategory entity = new PmsProductCategory(); - entity.setId(ids); - entity.setIndexStatus(indexStatus); - if (IPmsProductCategoryService.updateById(entity)) { - return new CommonResult().success(); - } else { - return new CommonResult().failed(); - } - } +// @ApiOperation("修改首页显示状态") +// @RequestMapping(value = "/update/indexStatus", method = RequestMethod.POST) +// @ResponseBody +// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')") +// public Object updateIndexStatus(@RequestParam("ids") Long ids, @RequestParam("indexStatus") Integer indexStatus) { +// PmsProductCategory entity = new PmsProductCategory(); +// entity.setId(ids); +// entity.setIndexStatus(indexStatus); +// if (IPmsProductCategoryService.updateById(entity)) { +// return new CommonResult().success(); +// } else { +// return new CommonResult().failed(); +// } +// } } diff --git a/ordermall/src/main/java/com/yxt/ordermall/biz/customerstore/CustomerStoreMapper.xml b/ordermall/src/main/java/com/yxt/ordermall/biz/customerstore/CustomerStoreMapper.xml index ef74149..9741657 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/biz/customerstore/CustomerStoreMapper.xml +++ b/ordermall/src/main/java/com/yxt/ordermall/biz/customerstore/CustomerStoreMapper.xml @@ -5,7 +5,7 @@ \ No newline at end of file diff --git a/ordermall/src/main/java/com/yxt/ordermall/biz/lpkgoods/LpkGoodsService.java b/ordermall/src/main/java/com/yxt/ordermall/biz/lpkgoods/LpkGoodsService.java index ac7f4ee..6c5d97e 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/biz/lpkgoods/LpkGoodsService.java +++ b/ordermall/src/main/java/com/yxt/ordermall/biz/lpkgoods/LpkGoodsService.java @@ -1,7 +1,6 @@ package com.yxt.ordermall.biz.lpkgoods; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -29,7 +28,6 @@ import com.yxt.ordermall.biz.func.basegoodsskuextend.BaseGoodsSkuExtendDto; import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuDto; import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuVo; import com.yxt.ordermall.biz.func.basegoodsspudetail.BaseGoodsSpuDetailDto; -import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeQuery; import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeVo; import com.yxt.ordermall.biz.func.commonmethod.CommonMethod; import com.yxt.ordermall.biz.func.commonmethod.DataRule; @@ -40,7 +38,6 @@ import com.yxt.ordermall.feign.base.basebrandinfo.BaseBrandInfoFeign; import com.yxt.ordermall.feign.base.basegoodssku.BaseGoodsSkuFeign; import com.yxt.ordermall.feign.base.basegoodsspu.BaseGoodsSpuFeign; import com.yxt.ordermall.feign.base.basegoodstype.BaseGoodsTypeFeign; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsBrandService; import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand; import com.yxt.ordermall.mallplus.mbg.pms.entity.brand.BrandVo; import com.yxt.ordermall.utils.DoubleUtils; @@ -49,7 +46,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.awt.*; -import java.awt.event.InputEvent; import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.SimpleDateFormat; @@ -68,8 +64,7 @@ public class LpkGoodsService extends MybatisBaseServiceskus= listResultBean.getData(); - - baseMapper.delete(new QueryWrapper().eq("spuSid",skus.get(0).getGoodsSpuSid())); - LpkGoods lpkGoods=new LpkGoods(); - BeanUtil.copyProperties(dto,lpkGoods); - lpkGoods.setSid(UUID.randomUUID().toString()); - lpkGoods.setSpuSid(skus.get(0).getGoodsSpuSid()); - lpkGoods.setSkuSid(skus.get(0).getSid()); - SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); - lpkGoods.setPeriodValidity(sdf.format(new Date())); - lpkGoods.setSort("1"); - baseMapper.insert(lpkGoods); + for (BaseGoodsSku baseGoodsSku : skus) { + baseMapper.delete(new QueryWrapper().eq("spuSid",baseGoodsSku.getGoodsSpuSid())); + LpkGoods lpkGoods=new LpkGoods(); + BeanUtil.copyProperties(dto,lpkGoods); + lpkGoods.setSid(UUID.randomUUID().toString()); + lpkGoods.setSpuSid(baseGoodsSku.getGoodsSpuSid()); + lpkGoods.setSkuSid(baseGoodsSku.getSid()); + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); + lpkGoods.setPeriodValidity(sdf.format(new Date())); + lpkGoods.setSort("1"); + baseMapper.insert(lpkGoods); + } return rb.success().setMsg("成功"); } @@ -483,6 +479,11 @@ public class LpkGoodsService extends MybatisBaseService> listResultBean = baseGoodsTypeFeign.listAll(query); List list=new ArrayList<>(); + if(!listResultBean.getCode().equals("200")){ + rb.setCode(listResultBean.getCode()); + rb.setMsg(listResultBean.getMsg()); + return rb; + } for (BaseGoodsTypeVo datum : listResultBean.getData()) { GoodsTypeVo vo1=new GoodsTypeVo(); vo1.setName(datum.getGoodsTypeName()); @@ -498,6 +499,11 @@ public class LpkGoodsService extends MybatisBaseService> listResultBean1 = baseBrandInfoFeign.listAll(query); + if(!listResultBean.getCode().equals("200")){ + rb.setCode(listResultBean.getCode()); + rb.setMsg(listResultBean.getMsg()); + return rb; + } List list1= new ArrayList<>(); for (BaseBrandInfoVo datum : listResultBean1.getData()) { BrandVo vo2=new BrandVo(); @@ -542,10 +548,10 @@ public class LpkGoodsService extends MybatisBaseService l= listResultBean.getData(); - giftBagGoodss.forEach(d->{ - d.setIconUrl(fileUploadComponent.getUrlPrefix()+d.getIconUrl()); - }); if(l.size()==0){ giftBagGoodss.forEach(d->{ d.setPrice(removeZeros(d.getPrice())); @@ -601,7 +604,8 @@ public class LpkGoodsService extends MybatisBaseService \ No newline at end of file diff --git a/ordermall/src/main/java/com/yxt/ordermall/biz/lpkstore/LpkStoreRest.java b/ordermall/src/main/java/com/yxt/ordermall/biz/lpkstore/LpkStoreRest.java index 085bde5..fa3eacb 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/biz/lpkstore/LpkStoreRest.java +++ b/ordermall/src/main/java/com/yxt/ordermall/biz/lpkstore/LpkStoreRest.java @@ -3,10 +3,8 @@ package com.yxt.ordermall.biz.lpkstore; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; -import com.yxt.ordermall.api.lpkstore.LpkStoreDetailsVo; -import com.yxt.ordermall.api.lpkstore.LpkStoreDto; -import com.yxt.ordermall.api.lpkstore.LpkStoreQuery; -import com.yxt.ordermall.api.lpkstore.LpkStoreVo; +import com.yxt.ordermall.api.lpkstore.*; +import com.yxt.ordermall.utils.OrgPathQuery; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -27,7 +25,7 @@ public class LpkStoreRest { @ApiOperation("取货点(门店)信息列表") @PostMapping("/storeListPage") - public ResultBean> storeListPage(@RequestBody PagerQuery pq) { + public ResultBean> storeListPage(@RequestBody PagerQuery pq) { return lpkStoreService.storeListPage(pq); } @@ -50,8 +48,8 @@ public class LpkStoreRest { } @ApiOperation("获取全部取货点") @DeleteMapping("/getAllStore") - public ResultBean getAllStore(){ - return lpkStoreService.getAllStore(); + public ResultBean getAllStore(@RequestBody OrgPathQuery query){ + return lpkStoreService.getAllStore(query); } @ApiOperation("获取全部取货点名称") @PostMapping ("/getAllStoreByQuery") diff --git a/ordermall/src/main/java/com/yxt/ordermall/biz/lpkstore/LpkStoreService.java b/ordermall/src/main/java/com/yxt/ordermall/biz/lpkstore/LpkStoreService.java index 8ae4b04..c7a494b 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/biz/lpkstore/LpkStoreService.java +++ b/ordermall/src/main/java/com/yxt/ordermall/biz/lpkstore/LpkStoreService.java @@ -5,16 +5,26 @@ import cn.hutool.core.date.DateTime; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.base.utils.StringUtils; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; +import com.yxt.ordermall.api.lpkgoods.LpkGoodsQuery; import com.yxt.ordermall.api.lpkstore.*; +import com.yxt.ordermall.biz.func.commonmethod.CommonMethod; +import com.yxt.ordermall.biz.func.commonmethod.DataRule; +import com.yxt.ordermall.feign.warehouse.warehouseinfo.WarehouseInfoFeign; +import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand; +import com.yxt.ordermall.utils.OrgPathQuery; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * @author wangpengfei @@ -22,27 +32,81 @@ import java.util.List; */ @Service public class LpkStoreService extends MybatisBaseService { - - public ResultBean> storeListPage(PagerQuery pq) { + @Autowired + WarehouseInfoFeign warehouseInfoFeign; + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + CommonMethod commonMethod; + public ResultBean> storeListPage(PagerQuery pq) { ResultBean rb = ResultBean.fireFail(); - LpkStoreQuery query = pq.getParams(); - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("1", "1"); - if (StringUtils.isNotBlank(query.getName())) { - qw.like("st.name", query.getName()); +// qw.orderByAsc("st.sort"); +// qw.orderByDesc("createTime"); + WarehouseInfoQuery query = pq.getParams(); + DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); + pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); + pq.getParams().setIndex(dataRule.getIndex()); + ResultBean> pagerVoResultBean = warehouseInfoFeign.listPage(pq); + if(!pagerVoResultBean.getCode().equals("200")){ + rb.setMsg(pagerVoResultBean.getMsg()); + return rb; + } + List brands=new ArrayList<>(); + for (WarehouseInfoVo record : pagerVoResultBean.getData().getRecords()) { + LpkStore lpkStore1 = baseMapper.selectOne(new QueryWrapper().eq("warehouseSid", record.getSid())); + LpkStoreVo lpkStore=new LpkStoreVo(); + BeanUtil.copyProperties(lpkStore1,lpkStore,"id","sid"); + lpkStore.setSid(record.getSid()); + lpkStore.setCode(record.getWarehouseCode()); + lpkStore.setName(record.getWarehouseName()); + lpkStore.setAddress(record.getAddress()); + lpkStore.setLinker(record.getContacts()); + lpkStore.setPhone(record.getMob()); + lpkStore.setSort(record.getSortNo().toString()); + lpkStore.setLonAndLat(record.getLngAndLat()); + lpkStore.setIsEnable(record.getIsEnable().toString()); + if(StringUtils.isNotBlank(lpkStore.getPicUrl())){ + lpkStore.setPicUrl(fileUploadComponent.getUrlPrefix()+lpkStore.getPicUrl()); + } + brands.add(lpkStore); } - qw.orderByAsc("st.sort"); - qw.orderByDesc("createTime"); - IPage page = PagerUtil.queryToPage(pq); - IPage pagging = baseMapper.storeListPage(page, qw); - PagerVo p = PagerUtil.pageToVo(pagging, null); - return rb.success().setData(p); + PagerVo vo=new PagerVo(); + BeanUtil.copyProperties(pagerVoResultBean.getData(),vo); + vo.setRecords(brands); + return rb.success().setData(vo); } public ResultBean saveStore(LpkStoreDto dto) { ResultBean rb = ResultBean.fireFail(); + WarehouseInfoDto warehouseInfoDto =new WarehouseInfoDto(); + warehouseInfoDto.setWarehouseCode(dto.getCode()); + warehouseInfoDto.setWarehouseName(dto.getName()); + warehouseInfoDto.setAddress(dto.getAddress()); + warehouseInfoDto.setContacts(dto.getLinker()); + warehouseInfoDto.setMob(dto.getPhone()); + warehouseInfoDto.setSortNo(dto.getSort()); + warehouseInfoDto.setLngAndLat(dto.getLonAndLat()); + warehouseInfoDto.setUseOrgSid(dto.getUseOrgSid()); + warehouseInfoDto.setCreateOrgSid(dto.getUseOrgSid()); + warehouseInfoDto.setSid(dto.getSid()); + warehouseInfoDto.setCreateBySid(dto.getUserSid()); + warehouseInfoDto.setUpdateBySid(dto.getUserSid()); + warehouseInfoDto.setIsEnable(1); +// warehouseInfoDto.setc + ResultBean stringResultBean = warehouseInfoFeign.saveOrUpdate(warehouseInfoDto); + if(!stringResultBean.getCode().equals("200")){ + return stringResultBean; + } +// stringResultBean.getData() + dto.setWarehouseSid(stringResultBean.getData().getSid()); + String urlPrefix = fileUploadComponent.getUrlPrefix(); + if(StringUtils.isNotBlank(dto.getPicUrl())){ + String path = dto.getPicUrl().substring(urlPrefix.length()); + dto.setPicUrl(path); + } if (StringUtils.isNotBlank(dto.getSid())) { - LpkStore entity = fetchBySid(dto.getSid()); + + LpkStore entity = baseMapper.selectOne(new QueryWrapper().eq("warehouseSid",dto.getSid())); BeanUtil.copyProperties(dto, entity, "id", "sid"); baseMapper.updateById(entity); } else { @@ -56,7 +120,26 @@ public class LpkStoreService extends MybatisBaseService storeInit(String sid) { ResultBean rb = ResultBean.fireFail(); + ResultBean initialization = warehouseInfoFeign.initialization(sid); + if(!initialization.getCode().equals("200")){ + rb.setMsg(initialization.getMsg()); + return rb; + } LpkStoreDetailsVo lpkStore = baseMapper.storeInit(sid); + lpkStore.setCode(initialization.getData().getWarehouseCode()); + lpkStore.setName(initialization.getData().getWarehouseName()); + lpkStore.setAddress(initialization.getData().getAddress()); + lpkStore.setLinker(initialization.getData().getContacts()); + lpkStore.setPhone(initialization.getData().getMob()); + lpkStore.setSort(initialization.getData().getSortNo()); + lpkStore.setLonAndLat(initialization.getData().getLngAndLat()); + lpkStore.setSid(initialization.getData().getSid()); + lpkStore.setUseOrgSid(initialization.getData().getUseOrgSid()); + lpkStore.setCreateOrgSid(initialization.getData().getCreateOrgSid()); + lpkStore.setUserSid(initialization.getData().getCreateBySid()); + if(StringUtils.isNotBlank(lpkStore.getPicUrl())){ + lpkStore.setPicUrl(fileUploadComponent.getUrlPrefix()+lpkStore.getPicUrl()); + } return rb.success().setData(lpkStore); } @@ -77,22 +160,66 @@ public class LpkStoreService extends MybatisBaseService vos = baseMapper.getAllStore(); return rb.success().setData(vos); } - + /** + * @return + */ + public ResultBean> getAllStore(OrgPathQuery query) { + ResultBean rb = new ResultBean(); + ResultBean> listResultBean = warehouseInfoFeign.listAll(query); + if(!listResultBean.getCode().equals("200")){ + rb.setMsg(listResultBean.getMsg()); + return rb.fail(); + } + List vos = new ArrayList<>(); + for (WarehouseInfo datum : listResultBean.getData()) { + StoreSelect storeSelect=new StoreSelect(); + storeSelect.setText(datum.getWarehouseName()); + storeSelect.setValue(datum.getSid()); + vos.add(storeSelect); + } + return rb.success().setData(vos); + } public ResultBean> getAllStoreByQuery(LpkStoreQuery query) { ResultBean rb = new ResultBean(); + + OrgPathQuery query1=new OrgPathQuery(); + query1.setOrgPath(query.getOrgPath()); + query1.setUserOrgSid(query.getUserOrgSid()); + query1.setName(query.getName()); + ResultBean> listResultBean = warehouseInfoFeign.listAll(query1); + if(!listResultBean.getCode().equals("200")){ + rb.setMsg(listResultBean.getMsg()); + return rb.fail(); + } + List vos=new ArrayList<>(); QueryWrapper qw = new QueryWrapper<>(); - if (StringUtils.isNotBlank(query.getName())) { - qw.like("name", query.getName()); + if(listResultBean.getData().size()!=0){ + + qw.in("warehouseSid",listResultBean.getData().stream().map(s->s.getSid()).collect(Collectors.toList())); + qw.eq("isEnable",1); + vos =baseMapper.getAllStoreByQuery(qw); + } + for (WarehouseInfo datum : listResultBean.getData()) { + for (LpkStoreVo vo : vos) { + if(datum.getSid().equals(vo.getWarehouseSid())){ + vo.setSid(datum.getSid()); + vo.setCode(datum.getWarehouseCode()); + vo.setName(datum.getWarehouseName()); + vo.setAddress(datum.getAddress()); + vo.setLinker(datum.getContacts()); + vo.setPhone(datum.getMob()); + vo.setSort(datum.getSortNo().toString()); + vo.setLonAndLat(datum.getLngAndLat()); + } + } } - qw.eq("isEnable", "1"); - qw.orderByDesc("sort"); - List vos = baseMapper.getAllStoreByQuery(qw); return rb.success().setData(vos); } public ResultBean updateIsEnable(String sid, String isEnable) { ResultBean rb = new ResultBean(); - LpkStore lpkStore = fetchBySid(sid); + warehouseInfoFeign.updateIsEnable(sid,isEnable); + LpkStore lpkStore = baseMapper.selectOne(new QueryWrapper().eq("warehouseSid",sid)); lpkStore.setIsEnable(isEnable); int i = baseMapper.updateById(lpkStore); return rb.success().setMsg("修改成功"); diff --git a/ordermall/src/main/java/com/yxt/ordermall/biz/ordorder/OrdOrderService.java b/ordermall/src/main/java/com/yxt/ordermall/biz/ordorder/OrdOrderService.java index 424f87e..4dfd1d6 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/biz/ordorder/OrdOrderService.java +++ b/ordermall/src/main/java/com/yxt/ordermall/biz/ordorder/OrdOrderService.java @@ -34,6 +34,7 @@ import com.yxt.ordermall.biz.vegetablecellar.VegetableCellarService; import com.yxt.ordermall.biz.wx.RequestMes; import com.yxt.ordermall.biz.wx.WxConfig; import com.yxt.ordermall.feign.base.basegoodssku.BaseGoodsSkuFeign; +import com.yxt.ordermall.utils.TrustEveryone; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; @@ -53,9 +54,9 @@ import java.util.stream.Collectors; @Service public class OrdOrderService extends MybatisBaseService { - private static final String OrderUrl = "https://supervise.yxtsoft.com/lpkapi/empcardgift/generateTopEmpCard?mainSid="; - private static final String or = "https://supervise.yxtsoft.com/lpkapi/vegetablecellar/addGoods?mainSid="; - private static final String payUrl = "https://supervise.yxtsoft.com/lpkapi/empsreservoorder/getPreOrder"; + private static final String OrderUrl = "https://ordermall.yxtsoft.com/lpkapi/empcardgift/generateTopEmpCard?mainSid="; + private static final String or = "https://ordermall.yxtsoft.com/lpkapi/vegetablecellar/addGoods?mainSid="; + private static final String payUrl = "https://ordermall.yxtsoft.com/lpkapi/empsreservoorder/getPreOrder"; @Autowired OrdOrderDetailService ordOrderDetailsService; @Autowired @@ -92,7 +93,8 @@ public class OrdOrderService extends MybatisBaseService map = new HashMap<>(); LpkCustomerVo vo = lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData(); Map sendBody = buildMessageBody(vo.getSid(), vo.getWxMpOpenid(), dto.getTotalTee(), dto.getOrdOrderDetailsVoList(), OrderUrl); - ResponseEntity postForEntity = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class); + TrustEveryone.trustEveryone(); + ResponseEntity postForEntity = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class); ResultBean rb1 = postForEntity.getBody(); LinkedHashMap rb2 = (LinkedHashMap) postForEntity.getBody().getData(); @@ -144,7 +146,7 @@ public class OrdOrderService extends MybatisBaseService map = new HashMap<>(); LpkCustomerVo vo = lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData(); Map sendBody = buildMessageBody(vo.getSid(), vo.getWxMpOpenid(), dto.getTotalTee(), dto.getOrdOrderDetailsVoList(), or); - ResponseEntity postForEntity = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class); + TrustEveryone.trustEveryone(); + ResponseEntity postForEntity = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class); ResultBean rb1 = postForEntity.getBody(); LinkedHashMap rb2 = (LinkedHashMap) postForEntity.getBody().getData(); @@ -264,7 +267,7 @@ public class OrdOrderService extends MybatisBaseService map = new HashMap<>(); LpkCustomerVo vo = lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData(); Map sendBody = buildMessageBody(vo.getSid(), vo.getWxMpOpenid(), dto.getTotalTee(), dto.getOrdOrderDetailsVoList(), or); - ResponseEntity postForEntity = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class); + TrustEveryone.trustEveryone(); + ResponseEntity postForEntity = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class); ResultBean rb1 = postForEntity.getBody(); LinkedHashMap rb2 = (LinkedHashMap) postForEntity.getBody().getData(); @@ -491,7 +495,7 @@ public class OrdOrderService extends MybatisBaseService sendBody=buildMessageBody(orderDetail,dto.getReason()); - ResponseEntity postForEntity = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/refund/createRefundOrder", sendBody, ResultBean.class); + TrustEveryone.trustEveryone(); + ResponseEntity postForEntity = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/refund/createRefundOrder", sendBody, ResultBean.class); // ResponseEntity postForEntity = new RestTemplate().postForEntity("http://192.168.0.105:7777/refund/createRefundOrder", sendBody, ResultBean.class); ResultBean rb1 = postForEntity.getBody(); LinkedHashMap rb2 = (LinkedHashMap) postForEntity.getBody().getData(); @@ -93,7 +95,8 @@ public class RefundOrderService extends MybatisBaseService refundResponse = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/refund/reviewRefund?orderSid="+orderDetail.getMainSid(), sendBody, ResultBean.class); + TrustEveryone.trustEveryone(); + ResponseEntity refundResponse = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/refund/reviewRefund?orderSid="+orderDetail.getMainSid(), sendBody, ResultBean.class); // ResponseEntity refundResponse = new RestTemplate().postForEntity("http://192.168.0.105:7777/refund/reviewRefund?orderSid="+orderDetail.getMainSid(), sendBody, ResultBean.class); if(refundResponse.getBody().getCode().equals("200")){ //该订单状态 @@ -178,7 +181,7 @@ public class RefundOrderService extends MybatisBaseService().eq("sid", vo.getCustomerSid())); - PmsBrand one=pmsBrandService.getOne(new QueryWrapper().eq("id",vo.getAffiliation())); +// PmsBrand one=pmsBrandService.getOne(new QueryWrapper().eq("id",vo.getAffiliation())); + PmsBrand one=new PmsBrand(); if(vo.getAffiliation().equals("1001045")){ if (weight < one.getQssl()) { vo.setRemarks("不足"+one.getQssl()+"斤"); diff --git a/ordermall/src/main/java/com/yxt/ordermall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml b/ordermall/src/main/java/com/yxt/ordermall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml index 9952b42..528c553 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml +++ b/ordermall/src/main/java/com/yxt/ordermall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml @@ -28,7 +28,7 @@ o.state FROM vege_cellar_reserve_order AS o - left join lpk_store s on s.sid=o.storeSid + left join lpk_store s on s.warehouseSid=o.storeSid o.customerSid=#{query.customerSid} and state=#{query.state} diff --git a/ordermall/src/main/java/com/yxt/ordermall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java b/ordermall/src/main/java/com/yxt/ordermall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java index 5dd0d41..dc73312 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java +++ b/ordermall/src/main/java/com/yxt/ordermall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java @@ -16,6 +16,7 @@ import com.yxt.ordermall.api.cannotreservedictionary.CannotReserveDictionary; import com.yxt.ordermall.api.lpkgoods.LpkGoods; import com.yxt.ordermall.api.lpkreserveorder.LpkReserveOrderQuery; import com.yxt.ordermall.api.lpkstore.LpkStore; +import com.yxt.ordermall.api.lpkstore.WarehouseInfoVo; import com.yxt.ordermall.api.vegecallerreservedetails.VegeCellarReserveDetails; import com.yxt.ordermall.api.vegecallerreserveorder.*; import com.yxt.ordermall.api.vegetablecellar.VegetableCellarDto; @@ -28,6 +29,7 @@ import com.yxt.ordermall.biz.lpkstore.LpkStoreService; import com.yxt.ordermall.biz.vegecallerreservedetail.VegeCellarReserveDetailsService; import com.yxt.ordermall.biz.vegetablecellar.VegetableCellarService; import com.yxt.ordermall.feign.base.basegoodssku.BaseGoodsSkuFeign; +import com.yxt.ordermall.feign.warehouse.warehouseinfo.WarehouseInfoFeign; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -59,6 +61,8 @@ public class VegeCellarReserveOrderService extends MybatisBaseService().eq("sid", dto.getStoreSid())); +// LpkStore lpkStore = lpkStoreService.getOne(new QueryWrapper().eq("sid", dto.getStoreSid())); + ResultBean initialization = warehouseInfoFeign.initialization(dto.getStoreSid()); + if(!initialization.getCode().equals("200")){ + return rb; + } BeanUtil.copyProperties(dto, order, "id", "sid"); order.setStoreSid(dto.getStoreSid()); // order.setCardSid(dto.getSid()); order.setCreateTime(new DateTime()); String uuid = UniqueIdGenerator.generateUniqueID(); order.setReserveCode(uuid); - order.setStoreName(lpkStore.getName()); +// order.setStoreName(lpkStore.getName()); + order.setStoreName(initialization.getData().getWarehouseName()); baseMapper.insert(order); dto.setOrderSid(order.getSid()); rb = vegeCellarReserveDetailsService.submissionDetail(dto); @@ -105,7 +114,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService vos=new ArrayList<>(); for (VegeCellarReserveDetails details:list){ - String brandId=lpkGoodsService.getOne(new QueryWrapper().eq("sid",details.getGoodsSid())).getBrandId().toString(); + String brandId=lpkGoodsService.getOne(new QueryWrapper().eq("skuSid",details.getGoodsSid())).getBrandId().toString(); vegeVo vo=new vegeVo(); vo.setBrandId(brandId); vo.setGoodsSid(details.getGoodsSid()); diff --git a/ordermall/src/main/java/com/yxt/ordermall/biz/vegetablecellar/VegetableCellarService.java b/ordermall/src/main/java/com/yxt/ordermall/biz/vegetablecellar/VegetableCellarService.java index 9c9fef4..fc1c274 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/biz/vegetablecellar/VegetableCellarService.java +++ b/ordermall/src/main/java/com/yxt/ordermall/biz/vegetablecellar/VegetableCellarService.java @@ -156,11 +156,11 @@ public class VegetableCellarService extends MybatisBaseService 0) { + // 去掉多余的0 + num = num.replaceAll("0+?$", ""); + // 如果最后一位是. 则去掉 + num = num.replaceAll("[.]$", ""); + } + return num; + } } diff --git a/ordermall/src/main/java/com/yxt/ordermall/feign/warehouse/warehouseinfo/WarehouseInfoFeign.java b/ordermall/src/main/java/com/yxt/ordermall/feign/warehouse/warehouseinfo/WarehouseInfoFeign.java new file mode 100644 index 0000000..571e487 --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/feign/warehouse/warehouseinfo/WarehouseInfoFeign.java @@ -0,0 +1,70 @@ +package com.yxt.ordermall.feign.warehouse.warehouseinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.ordermall.api.lpkstore.*; +import com.yxt.ordermall.utils.OrgPathQuery; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysRoleFeign.java
+ * Class: com.yxt.anrui.portal.api.sysrole.SysRoleFeign
+ * Description: 角色.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:29
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "仓库信息") +@FeignClient( + contextId = "ss-common-warehouse-WarehouseInfo", + name = "ss-common-warehouse", + path = "/apiadmin/warehouseinfo", + fallback = WarehouseInfoFeignFallback.class) +public interface WarehouseInfoFeign { + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody WarehouseInfoDto dto); + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid); + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid); + + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids); + @ApiOperation("更改可用状态") + @GetMapping("/updateStatus/{sid}/{state}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("state")String state) ; + @ApiOperation("查询所有仓库") + @GetMapping("/selectAll") + public ResultBean> selectAll(); + @ApiOperation("订单选择仓库") + @PostMapping("/getWareHouse") + public ResultBean> getWareHouse(@RequestParam("createOrgSid") String createOrgSid); + + @ApiOperation("查询所有的仓库") + @PostMapping("/listAll") + public ResultBean> listAll(@RequestBody OrgPathQuery query); + + @PostMapping("/list") + public ResultBean> list(@RequestBody WarehouseInfoMapQuery query); +} \ No newline at end of file diff --git a/ordermall/src/main/java/com/yxt/ordermall/feign/warehouse/warehouseinfo/WarehouseInfoFeignFallback.java b/ordermall/src/main/java/com/yxt/ordermall/feign/warehouse/warehouseinfo/WarehouseInfoFeignFallback.java new file mode 100644 index 0000000..f66afa8 --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/feign/warehouse/warehouseinfo/WarehouseInfoFeignFallback.java @@ -0,0 +1,78 @@ +package com.yxt.ordermall.feign.warehouse.warehouseinfo; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.ordermall.api.lpkstore.*; +import com.yxt.ordermall.utils.OrgPathQuery; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysRoleFeignFallback.java
+ * Class: com.yxt.anrui.portal.api.sysrole.SysRoleFeignFallback
+ * Description: 角色.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:29
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Component +public class WarehouseInfoFeignFallback implements WarehouseInfoFeign { + + + @Override + public ResultBean> listPage(PagerQuery pq) { + return null; + } + + @Override + public ResultBean saveOrUpdate(WarehouseInfoDto dto) { + return null; + } + + @Override + public ResultBean initialization(String sid) { + return null; + } + + @Override + public ResultBean delete(String sid) { + return null; + } + + @Override + public ResultBean delBySids(String[] sids) { + return null; + } + + @Override + public ResultBean updateIsEnable(String sid, String state) { + return null; + } + + @Override + public ResultBean> selectAll() { + return null; + } + + @Override + public ResultBean> getWareHouse(String createOrgSid) { + return null; + } + + @Override + public ResultBean> listAll(OrgPathQuery query) { + return null; + } + + @Override + public ResultBean> list(WarehouseInfoMapQuery query) { + return null; + } +} \ No newline at end of file diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsAlbumController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsAlbumController.java deleted file mode 100644 index f8bf146..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsAlbumController.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsAlbumService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsAlbum; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - - -/** - *

- *

- *

- * - * @author zscat - * @since ${date} - */ -@Slf4j -@RestController -@Api(tags = "PmsAlbumController", description = "管理") -@RequestMapping("/pms/PmsAlbum") -public class PmsAlbumController { - @Resource - private IPmsAlbumService IPmsAlbumService; - -// // @SysLog(MODULE = "pms", REMARK = "查询pms_album表") - @ApiOperation("查询pms_album表") - @GetMapping(value = "/list") - - public Object getPmsAlbumByPage(PmsAlbum entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsAlbumService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("分页获取pms_album列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存pms_album表") - @ApiOperation("保存pms_album表") - @PostMapping(value = "/create") - - public Object saveAlbum(@RequestBody PmsAlbum entity) { - try { - if (IPmsAlbumService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存pms_album表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新pms_album") - @ApiOperation("更新pms_album") - @PostMapping(value = "/update/{id}") - - public Object updateAlbum(@RequestBody PmsAlbum entity) { - try { - if (IPmsAlbumService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除pms_album数据") - @ApiOperation("删除相册表数据") - @GetMapping(value = "/delete/{id}") - - public Object deleteRole(@ApiParam("相册表_id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("PmsAlbum_id"); - } - if (IPmsAlbumService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除相册表数据:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "根据ID查询pms_album") - @ApiOperation("根据ID查询pms_album") - @GetMapping(value = "/{id}") - - public Object getRoleById(@ApiParam("相册表_id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("PmsAlbum_id"); - } - PmsAlbum pmsAlbum = IPmsAlbumService.getById(id); - return new CommonResult().success(pmsAlbum); - } catch (Exception e) { - log.error("pms_album表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除PmsAlbum表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除PmsAlbum表") - - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsAlbumService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsAlbumPicController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsAlbumPicController.java deleted file mode 100644 index 4d0a8e9..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsAlbumPicController.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsAlbumPicService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsAlbumPic; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 画册图片表 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsAlbumPicController", description = "画册图片表管理") -@RequestMapping("/pms/PmsAlbumPic") -public class PmsAlbumPicController { - @Resource - private IPmsAlbumPicService IPmsAlbumPicService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有画册图片表列表") - @ApiOperation("根据条件查询所有画册图片表列表") - @GetMapping(value = "/list") - - public Object getPmsAlbumPicByPage(PmsAlbumPic entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsAlbumPicService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有画册图片表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存画册图片表") - @ApiOperation("保存画册图片表") - @PostMapping(value = "/create") - - public Object savePmsAlbumPic(@RequestBody PmsAlbumPic entity) { - try { - if (IPmsAlbumPicService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存画册图片表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新画册图片表") - @ApiOperation("更新画册图片表") - @PostMapping(value = "/update/{id}") - - public Object updatePmsAlbumPic(@RequestBody PmsAlbumPic entity) { - try { - if (IPmsAlbumPicService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新画册图片表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除画册图片表") - @ApiOperation("删除画册图片表") - @GetMapping(value = "/delete/{id}") - - public Object deletePmsAlbumPic(@ApiParam("画册图片表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("画册图片表id"); - } - if (IPmsAlbumPicService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除画册图片表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给画册图片表分配画册图片表") - @ApiOperation("查询画册图片表明细") - @GetMapping(value = "/{id}") - - public Object getPmsAlbumPicById(@ApiParam("画册图片表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("画册图片表id"); - } - PmsAlbumPic coupon = IPmsAlbumPicService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询画册图片表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除画册图片表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除画册图片表") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsAlbumPicService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsCommentController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsCommentController.java deleted file mode 100644 index 270edf6..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsCommentController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsCommentService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsComment; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 商品评价表 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsCommentController", description = "商品评价表管理") -@RequestMapping("/pms/PmsComment") -public class PmsCommentController { - @Resource - private IPmsCommentService IPmsCommentService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有商品评价表列表") - @ApiOperation("根据条件查询所有商品评价表列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsComment:read')") - public Object getPmsCommentByPage(PmsComment entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsCommentService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有商品评价表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存商品评价表") - @ApiOperation("保存商品评价表") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsComment:create')") - public Object savePmsComment(@RequestBody PmsComment entity) { - try { - if (IPmsCommentService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存商品评价表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新商品评价表") - @ApiOperation("更新商品评价表") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsComment:update')") - public Object updatePmsComment(@RequestBody PmsComment entity) { - try { - if (IPmsCommentService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新商品评价表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除商品评价表") - @ApiOperation("删除商品评价表") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsComment:delete')") - public Object deletePmsComment(@ApiParam("商品评价表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品评价表id"); - } - if (IPmsCommentService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除商品评价表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给商品评价表分配商品评价表") - @ApiOperation("查询商品评价表明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsComment:read')") - public Object getPmsCommentById(@ApiParam("商品评价表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品评价表id"); - } - PmsComment coupon = IPmsCommentService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询商品评价表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除商品评价表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除商品评价表") - // @PreAuthorize("hasAuthority('pms:PmsComment:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsCommentService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsCommentReplayController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsCommentReplayController.java deleted file mode 100644 index 6af49c4..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsCommentReplayController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsCommentReplayService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsCommentReplay; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 产品评价回复表 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsCommentReplayController", description = "产品评价回复表管理") -@RequestMapping("/pms/PmsCommentReplay") -public class PmsCommentReplayController { - @Resource - private IPmsCommentReplayService IPmsCommentReplayService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有产品评价回复表列表") - @ApiOperation("根据条件查询所有产品评价回复表列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsCommentReplay:read')") - public Object getPmsCommentReplayByPage(PmsCommentReplay entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsCommentReplayService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有产品评价回复表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存产品评价回复表") - @ApiOperation("保存产品评价回复表") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsCommentReplay:create')") - public Object savePmsCommentReplay(@RequestBody PmsCommentReplay entity) { - try { - if (IPmsCommentReplayService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存产品评价回复表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新产品评价回复表") - @ApiOperation("更新产品评价回复表") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsCommentReplay:update')") - public Object updatePmsCommentReplay(@RequestBody PmsCommentReplay entity) { - try { - if (IPmsCommentReplayService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新产品评价回复表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除产品评价回复表") - @ApiOperation("删除产品评价回复表") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsCommentReplay:delete')") - public Object deletePmsCommentReplay(@ApiParam("产品评价回复表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品评价回复表id"); - } - if (IPmsCommentReplayService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除产品评价回复表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给产品评价回复表分配产品评价回复表") - @ApiOperation("查询产品评价回复表明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsCommentReplay:read')") - public Object getPmsCommentReplayById(@ApiParam("产品评价回复表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品评价回复表id"); - } - PmsCommentReplay coupon = IPmsCommentReplayService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询产品评价回复表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除产品评价回复表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除产品评价回复表") - // @PreAuthorize("hasAuthority('pms:PmsCommentReplay:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsCommentReplayService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsFeightTemplateController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsFeightTemplateController.java deleted file mode 100644 index 04b815b..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsFeightTemplateController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsFeightTemplateService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsFeightTemplate; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -/** - *

- * 运费模版 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsFeightTemplateController", description = "运费模版管理") -@RequestMapping("/pms/PmsFeightTemplate") -public class PmsFeightTemplateController { - @Resource - private IPmsFeightTemplateService IPmsFeightTemplateService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有运费模版列表") - @ApiOperation("根据条件查询所有运费模版列表") - @GetMapping(value = "/list") - public Object getPmsFeightTemplateByPage(PmsFeightTemplate entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsFeightTemplateService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity).orderByDesc("create_time"))); - } catch (Exception e) { - log.error("根据条件查询所有运费模版列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存运费模版") - @ApiOperation("保存运费模版") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsFeightTemplate:create')") - public Object savePmsFeightTemplate(@RequestBody PmsFeightTemplate entity) { - try { - entity.setCreateTime(new Date()); - if (IPmsFeightTemplateService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存运费模版:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新运费模版") - @ApiOperation("更新运费模版") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsFeightTemplate:update')") - public Object updatePmsFeightTemplate(@RequestBody PmsFeightTemplate entity) { - try { - if (IPmsFeightTemplateService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新运费模版:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除运费模版") - @ApiOperation("删除运费模版") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsFeightTemplate:delete')") - public Object deletePmsFeightTemplate(@ApiParam("运费模版id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("运费模版id"); - } - if (IPmsFeightTemplateService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除运费模版:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给运费模版分配运费模版") - @ApiOperation("查询运费模版明细") - @GetMapping(value = "/{id}") - public Object getPmsFeightTemplateById(@ApiParam("运费模版id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("运费模版id"); - } - PmsFeightTemplate coupon = IPmsFeightTemplateService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询运费模版明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除运费模版") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除运费模版") - // @PreAuthorize("hasAuthority('pms:PmsFeightTemplate:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsFeightTemplateService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsGiftsCategoryController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsGiftsCategoryController.java deleted file mode 100644 index 67186bb..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsGiftsCategoryController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsGiftsCategoryService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsGiftsCategory; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 帮助分类表 - *

- * - * @author zscat - * @since 2019-07-07 - */ -@Slf4j -@RestController -@Api(tags = "PmsGiftsCategoryController", description = "帮助分类表管理") -@RequestMapping("/pms/PmsGiftsCategory") -public class PmsGiftsCategoryController { - @Resource - private IPmsGiftsCategoryService IPmsGiftsCategoryService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有帮助分类表列表") - @ApiOperation("根据条件查询所有帮助分类表列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsGiftsCategory:read')") - public Object getPmsGiftsCategoryByPage(PmsGiftsCategory entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsGiftsCategoryService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有帮助分类表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存帮助分类表") - @ApiOperation("保存帮助分类表") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsGiftsCategory:create')") - public Object savePmsGiftsCategory(@RequestBody PmsGiftsCategory entity) { - try { - if (IPmsGiftsCategoryService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存帮助分类表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新帮助分类表") - @ApiOperation("更新帮助分类表") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsGiftsCategory:update')") - public Object updatePmsGiftsCategory(@RequestBody PmsGiftsCategory entity) { - try { - if (IPmsGiftsCategoryService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新帮助分类表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除帮助分类表") - @ApiOperation("删除帮助分类表") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsGiftsCategory:delete')") - public Object deletePmsGiftsCategory(@ApiParam("帮助分类表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("帮助分类表id"); - } - if (IPmsGiftsCategoryService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除帮助分类表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给帮助分类表分配帮助分类表") - @ApiOperation("查询帮助分类表明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsGiftsCategory:read')") - public Object getPmsGiftsCategoryById(@ApiParam("帮助分类表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("帮助分类表id"); - } - PmsGiftsCategory coupon = IPmsGiftsCategoryService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询帮助分类表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除帮助分类表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除帮助分类表") - // @PreAuthorize("hasAuthority('pms:PmsGiftsCategory:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsGiftsCategoryService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsGiftsController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsGiftsController.java deleted file mode 100644 index 82d8595..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsGiftsController.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsGiftsService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsGifts; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; - -/** - *

- * 帮助表 - *

- * - * @author zscat - * @since 2019-07-07 - */ -@Slf4j -@RestController -@Api(tags = "PmsGiftsController", description = "帮助表管理") -@RequestMapping("/pms/PmsGifts") -public class PmsGiftsController { - @Resource - private IPmsGiftsService IPmsGiftsService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有帮助表列表") - @ApiOperation("根据条件查询所有帮助表列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsGifts:read')") - public Object getPmsGiftsByPage(PmsGifts entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - if (ValidatorUtils.notEmpty(entity.getTitle())) { - return new CommonResult().success(IPmsGiftsService.page(new Page(pageNum, pageSize), new QueryWrapper(new PmsGifts()).like("title", entity.getTitle()))); - } - return new CommonResult().success(IPmsGiftsService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - - } catch (Exception e) { - log.error("根据条件查询所有帮助表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存帮助表") - @ApiOperation("保存帮助表") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsGifts:create')") - public Object savePmsGifts(@RequestBody PmsGifts entity) { - try { - entity.setCreateTime(new Date()); - if (IPmsGiftsService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存帮助表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新帮助表") - @ApiOperation("更新帮助表") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsGifts:update')") - public Object updatePmsGifts(@RequestBody PmsGifts entity) { - try { - if (IPmsGiftsService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新帮助表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除帮助表") - @ApiOperation("删除帮助表") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsGifts:delete')") - public Object deletePmsGifts(@ApiParam("帮助表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("帮助表id"); - } - if (IPmsGiftsService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除帮助表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给帮助表分配帮助表") - @ApiOperation("查询帮助表明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsGifts:read')") - public Object getPmsGiftsById(@ApiParam("帮助表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("帮助表id"); - } - PmsGifts coupon = IPmsGiftsService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询帮助表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除帮助表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除帮助表") - // @PreAuthorize("hasAuthority('pms:PmsGifts:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsGiftsService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @ApiOperation(value = "批量更新显示状态") - @RequestMapping(value = "/update/showStatus", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量更新显示状态") - public Object updateShowStatus(@RequestParam("ids") Long ids, - @RequestParam("showStatus") Integer showStatus) { - PmsGifts g = new PmsGifts(); - g.setId(ids); - g.setShowStatus(showStatus); - if (IPmsGiftsService.updateById(g)) { - return new CommonResult().success(); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsMemberPriceController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsMemberPriceController.java deleted file mode 100644 index a253e8f..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsMemberPriceController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsMemberPriceService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsMemberPrice; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 商品会员价格表 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsMemberPriceController", description = "商品会员价格表管理") -@RequestMapping("/pms/PmsMemberPrice") -public class PmsMemberPriceController { - @Resource - private IPmsMemberPriceService IPmsMemberPriceService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有商品会员价格表列表") - @ApiOperation("根据条件查询所有商品会员价格表列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsMemberPrice:read')") - public Object getPmsMemberPriceByPage(PmsMemberPrice entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsMemberPriceService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有商品会员价格表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存商品会员价格表") - @ApiOperation("保存商品会员价格表") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsMemberPrice:create')") - public Object savePmsMemberPrice(@RequestBody PmsMemberPrice entity) { - try { - if (IPmsMemberPriceService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存商品会员价格表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新商品会员价格表") - @ApiOperation("更新商品会员价格表") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsMemberPrice:update')") - public Object updatePmsMemberPrice(@RequestBody PmsMemberPrice entity) { - try { - if (IPmsMemberPriceService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新商品会员价格表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除商品会员价格表") - @ApiOperation("删除商品会员价格表") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsMemberPrice:delete')") - public Object deletePmsMemberPrice(@ApiParam("商品会员价格表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品会员价格表id"); - } - if (IPmsMemberPriceService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除商品会员价格表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给商品会员价格表分配商品会员价格表") - @ApiOperation("查询商品会员价格表明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsMemberPrice:read')") - public Object getPmsMemberPriceById(@ApiParam("商品会员价格表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品会员价格表id"); - } - PmsMemberPrice coupon = IPmsMemberPriceService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询商品会员价格表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除商品会员价格表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除商品会员价格表") - // @PreAuthorize("hasAuthority('pms:PmsMemberPrice:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsMemberPriceService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeCategoryController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeCategoryController.java deleted file mode 100644 index 0b9e10f..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeCategoryController.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductAttributeCategoryService; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.EsShopGoodsGroupMap; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProduct; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttributeCategory; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsGoodsGroupMapMapper; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductAttributeCategoryItem; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 产品属性分类表 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductAttributeCategoryController", description = "产品属性分类表管理") -@RequestMapping("/pms/PmsProductAttributeCategory") -public class PmsProductAttributeCategoryController { - @Resource - private IPmsProductAttributeCategoryService IPmsProductAttributeCategoryService; - @Resource - private PmsGoodsGroupMapMapper shopGoodsGroupMapMapper; - - @Resource - private IPmsProductService pmsProductService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有产品属性分类表列表") - @ApiOperation("根据条件查询所有产品属性分类表列表") - @GetMapping(value = "/list") - public Object getPmsProductAttributeCategoryByPage(PmsProductAttributeCategory entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductAttributeCategoryService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有产品属性分类表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存产品属性分类表") - @ApiOperation("保存产品属性分类表") - @PostMapping(value = "/create") -// // @PreAuthorize("hasAuthority('pms:PmsProductAttributeCategory:create')") - public Object create(@RequestParam String name, - @RequestParam(value = "pic", required = false) String pic, - @RequestParam(value = "showIndex", required = false) Integer showIndex, - @RequestParam(value = "style", required = false) Integer style) { - try { - PmsProductAttributeCategory productAttributeCategory = new PmsProductAttributeCategory(); - productAttributeCategory.setName(name); - productAttributeCategory.setShowIndex(showIndex); - productAttributeCategory.setStyle(style); - productAttributeCategory.setPic(pic); - if (IPmsProductAttributeCategoryService.save(productAttributeCategory)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存产品属性分类表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存产品属性分类表") - @ApiOperation("保存产品属性分类表") - @PostMapping(value = "/createSingle") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeCategory:create')") - public Object createSingle(@RequestBody PmsProductAttributeCategory productAttributeCategory) { - try { - if (IPmsProductAttributeCategoryService.save(productAttributeCategory)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存产品属性分类表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新产品属性分类表") - @ApiOperation("更新产品属性分类表") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeCategory:update')") - public Object updatePmsProductAttributeCategory(@PathVariable Long id, @RequestParam String name) { - try { - PmsProductAttributeCategory productAttributeCategory = new PmsProductAttributeCategory(); - productAttributeCategory.setName(name); - productAttributeCategory.setId(id); - if (IPmsProductAttributeCategoryService.updateById(productAttributeCategory)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新产品属性分类表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除产品属性分类表") - @ApiOperation("删除产品属性分类表") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeCategory:delete')") - public Object deletePmsProductAttributeCategory(@ApiParam("产品属性分类表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品属性分类表id"); - } - if (IPmsProductAttributeCategoryService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除产品属性分类表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给产品属性分类表分配产品属性分类表") - @ApiOperation("查询产品属性分类表明细") - @GetMapping(value = "/{id}") - public Object getPmsProductAttributeCategoryById(@ApiParam("产品属性分类表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品属性分类表id"); - } - PmsProductAttributeCategory coupon = IPmsProductAttributeCategoryService.getById(id); - if (coupon != null) { - List list = shopGoodsGroupMapMapper.selEsShopGoodsGroupMap(coupon.getId()); - List lists = new ArrayList(); - for (EsShopGoodsGroupMap lis : list) { - //根据商品ID查询商品名称、商品图片、商品虚拟库存 - PmsProduct es = pmsProductService.getById(lis.getGoodsId()); - if (es != null) { - lists.add(es); - } - } - coupon.setListGoods(lists); - } - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询产品属性分类表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除产品属性分类表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除产品属性分类表") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeCategory:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductAttributeCategoryService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - // @SysLog(MODULE = "pms", REMARK = "获取所有商品属性分类及其下属性") - @ApiOperation("获取所有商品属性分类及其下属性") - @RequestMapping(value = "/list/withAttr", method = RequestMethod.GET) - @ResponseBody - public Object getListWithAttr() { - List productAttributeCategoryResultList = IPmsProductAttributeCategoryService.getListWithAttr(); - return new CommonResult().success(productAttributeCategoryResultList); - } -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeController.java deleted file mode 100644 index 0fd5d55..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeController.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductAttributeService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttribute; -import com.yxt.ordermall.mallplus.mbg.pms.vo.ProductAttrInfo; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.*; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 商品属性参数表 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductAttributeController", description = "商品属性参数表管理") -@RequestMapping("/pms/PmsProductAttribute") -public class PmsProductAttributeController { - @Resource - private IPmsProductAttributeService IPmsProductAttributeService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有商品属性参数表列表") - @ApiOperation("根据条件查询所有商品属性参数表列表") - @GetMapping(value = "/listAll") - public Object getPmsProductAttributeByPage(PmsProductAttribute entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductAttributeService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity).orderByDesc("id"))); - } catch (Exception e) { - log.error("根据条件查询所有商品属性参数表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "根据分类查询属性列表或参数列表") - @ApiOperation("根据分类查询属性列表或参数列表") - @ApiImplicitParams({@ApiImplicitParam(name = "type", value = "0表示属性,1表示参数", required = true, paramType = "query", dataType = "integer")}) - @RequestMapping(value = "/list/{cid}", method = RequestMethod.GET) - @ResponseBody - public Object getList(@PathVariable Long cid, - @RequestParam(value = "type") Integer type, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) { - PmsProductAttribute entity = new PmsProductAttribute(); - entity.setProductAttributeCategoryId(cid); - entity.setType(type); - try { - return new CommonResult().success(IPmsProductAttributeService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有商品属性参数表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存商品属性参数表") - @ApiOperation("保存商品属性参数表") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsProductAttribute:create')") - public Object savePmsProductAttribute(@RequestBody PmsProductAttribute entity) { - try { - if (entity.getType() == null) { - return new CommonResult().failed("请选择类型"); - } - if (IPmsProductAttributeService.saveAndUpdate(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存商品属性参数表:%s", e.getMessage(), e); - return new CommonResult().failed(e.getMessage()); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新商品属性参数表") - @ApiOperation("更新商品属性参数表") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductAttribute:update')") - public Object updatePmsProductAttribute(@RequestBody PmsProductAttribute entity) { - try { - if (IPmsProductAttributeService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新商品属性参数表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除商品属性参数表") - @ApiOperation("删除商品属性参数表") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductAttribute:delete')") - public Object deletePmsProductAttribute(@ApiParam("商品属性参数表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品属性参数表id"); - } - if (IPmsProductAttributeService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除商品属性参数表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给商品属性参数表分配商品属性参数表") - @ApiOperation("查询商品属性参数表明细") - @GetMapping(value = "/{id}") - public Object getPmsProductAttributeById(@ApiParam("商品属性参数表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品属性参数表id"); - } - PmsProductAttribute coupon = IPmsProductAttributeService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询商品属性参数表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除商品属性参数表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除商品属性参数表") - // @PreAuthorize("hasAuthority('pms:PmsProductAttribute:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductAttributeService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - // @SysLog(MODULE = "pms", REMARK = "根据商品分类的id获取商品属性及属性分类") - @ApiOperation("根据商品分类的id获取商品属性及属性分类") - @RequestMapping(value = "/attrInfo/{productCategoryId}", method = RequestMethod.GET) - @ResponseBody - public Object getAttrInfo(@PathVariable Long productCategoryId) { - List productAttrInfoList = IPmsProductAttributeService.getProductAttrInfo(productCategoryId); - return new CommonResult().success(productAttrInfoList); - } -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeValueController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeValueController.java deleted file mode 100644 index 04225ce..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductAttributeValueController.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductAttributeValueService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttributeValue; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 存储产品参数信息的表 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductAttributeValueController", description = "存储产品参数信息的表管理") -@RequestMapping("/pms/PmsProductAttributeValue") -public class PmsProductAttributeValueController { - @Resource - private IPmsProductAttributeValueService IPmsProductAttributeValueService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有存储产品参数信息的表列表") - @ApiOperation("根据条件查询所有存储产品参数信息的表列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeValue:read')") - public Object getPmsProductAttributeValueByPage(PmsProductAttributeValue entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductAttributeValueService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有存储产品参数信息的表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存存储产品参数信息的表") - @ApiOperation("保存存储产品参数信息的表") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeValue:create')") - public Object savePmsProductAttributeValue(@RequestBody PmsProductAttributeValue entity) { - try { - if (IPmsProductAttributeValueService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存存储产品参数信息的表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新存储产品参数信息的表") - @ApiOperation("更新存储产品参数信息的表") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeValue:update')") - public Object updatePmsProductAttributeValue(@RequestBody PmsProductAttributeValue entity) { - try { - if (IPmsProductAttributeValueService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新存储产品参数信息的表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除存储产品参数信息的表") - @ApiOperation("删除存储产品参数信息的表") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeValue:delete')") - public Object deletePmsProductAttributeValue(@ApiParam("存储产品参数信息的表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("存储产品参数信息的表id"); - } - if (IPmsProductAttributeValueService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除存储产品参数信息的表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给存储产品参数信息的表分配存储产品参数信息的表") - @ApiOperation("查询存储产品参数信息的表明细") - @GetMapping(value = "/{id}") - public Object getPmsProductAttributeValueById(@ApiParam("存储产品参数信息的表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("存储产品参数信息的表id"); - } - PmsProductAttributeValue coupon = IPmsProductAttributeValueService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询存储产品参数信息的表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除存储产品参数信息的表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除存储产品参数信息的表") - // @PreAuthorize("hasAuthority('pms:PmsProductAttributeValue:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductAttributeValueService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductCategoryAttributeRelationController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductCategoryAttributeRelationController.java deleted file mode 100644 index 6ce57b9..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductCategoryAttributeRelationController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductCategoryAttributeRelationService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategoryAttributeRelation; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类) - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductCategoryAttributeRelationController", description = "产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)管理") -@RequestMapping("/pms/PmsProductCategoryAttributeRelation") -public class PmsProductCategoryAttributeRelationController { - @Resource - private IPmsProductCategoryAttributeRelationService IPmsProductCategoryAttributeRelationService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)列表") - @ApiOperation("根据条件查询所有产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsProductCategoryAttributeRelation:read')") - public Object getPmsProductCategoryAttributeRelationByPage(PmsProductCategoryAttributeRelation entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductCategoryAttributeRelationService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - @ApiOperation("保存产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsProductCategoryAttributeRelation:create')") - public Object savePmsProductCategoryAttributeRelation(@RequestBody PmsProductCategoryAttributeRelation entity) { - try { - if (IPmsProductCategoryAttributeRelationService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - @ApiOperation("更新产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductCategoryAttributeRelation:update')") - public Object updatePmsProductCategoryAttributeRelation(@RequestBody PmsProductCategoryAttributeRelation entity) { - try { - if (IPmsProductCategoryAttributeRelationService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - @ApiOperation("删除产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductCategoryAttributeRelation:delete')") - public Object deletePmsProductCategoryAttributeRelation(@ApiParam("产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)id"); - } - if (IPmsProductCategoryAttributeRelationService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)分配产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - @ApiOperation("查询产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductCategoryAttributeRelation:read')") - public Object getPmsProductCategoryAttributeRelationById(@ApiParam("产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)id"); - } - PmsProductCategoryAttributeRelation coupon = IPmsProductCategoryAttributeRelationService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)") - // @PreAuthorize("hasAuthority('pms:PmsProductCategoryAttributeRelation:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductCategoryAttributeRelationService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductCategoryController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductCategoryController.java deleted file mode 100644 index 061a4b6..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductCategoryController.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductCategoryService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategory; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductCategoryWithChildrenItem; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 产品分类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductCategoryController", description = "产品分类管理") -@RequestMapping("/pms/PmsProductCategory") -public class PmsProductCategoryController { -// @Resource -// private IPmsProductCategoryService IPmsProductCategoryService; -// -// // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有产品分类列表") -// @ApiOperation("根据条件查询所有产品分类列表") -// @GetMapping(value = "/list") -// public Object getPmsProductCategoryByPage(PmsProductCategory entity, -// @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, -// @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize -// ) { -// try { -// return new CommonResult().success(IPmsProductCategoryService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); -// } catch (Exception e) { -// log.error("根据条件查询所有产品分类列表:%s", e.getMessage(), e); -// } -// return new CommonResult().failed(); -// } -// -// @ApiOperation("分页查询商品分类") -// @RequestMapping(value = "/list/{parentId}", method = RequestMethod.GET) -// @ResponseBody -// public Object getList(@PathVariable Long parentId, -// @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, -// @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) { -// PmsProductCategory entity = new PmsProductCategory(); -// entity.setParentId(parentId); -// QueryWrapper queryWrapper=new QueryWrapper<>(entity); -// queryWrapper.orderByAsc("sort"); -// return new CommonResult().success(IPmsProductCategoryService.page(new Page(pageNum, pageSize), queryWrapper)); -// } -// -// // @SysLog(MODULE = "pms", REMARK = "保存产品分类") -// @ApiOperation("保存产品分类") -// @PostMapping(value = "/create") -// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:create')") -// public Object savePmsProductCategory(@RequestBody PmsProductCategory entity) { -// try { -// //查询是否存在相同级别的相同名称的分类 -// Long parentId = entity.getParentId(); -// String name = entity.getName(); -// int count = IPmsProductCategoryService.selectCountByNameAndLevel(parentId,name); -// if(count>0){ -// return new CommonResult().failed("该分类已存在"); -// } -// if (IPmsProductCategoryService.saveAnd(entity)) { -// return new CommonResult().success(); -// } -// } catch (Exception e) { -// log.error("保存产品分类:%s", e.getMessage(), e); -// return new CommonResult().failed(); -// } -// return new CommonResult().failed(); -// } -// -// // @SysLog(MODULE = "pms", REMARK = "更新产品分类") -// @ApiOperation("更新产品分类") -// @PostMapping(value = "/update/{id}") -// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')") -// public Object updatePmsProductCategory(@RequestBody PmsProductCategory entity) { -// try { -// //查询是否存在相同级别的相同名称的分类 -// Long parentId = entity.getParentId(); -// String name = entity.getName(); -// Long id = entity.getId(); -// int count = IPmsProductCategoryService.selectCountByNameAndLevelId(parentId,name,id); -// if(count>0){ -// return new CommonResult().failed("该分类已存在"); -// } -// if (IPmsProductCategoryService.updateAnd(entity)) { -// return new CommonResult().success(); -// } -// } catch (Exception e) { -// log.error("更新产品分类:%s", e.getMessage(), e); -// return new CommonResult().failed(); -// } -// return new CommonResult().failed(); -// } -// -// // @SysLog(MODULE = "pms", REMARK = "删除产品分类") -// @ApiOperation("删除产品分类") -// @GetMapping(value = "/delete/{id}") -// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:delete')") -// public Object deletePmsProductCategory(@ApiParam("产品分类id") @PathVariable Long id) { -// try { -// if (ValidatorUtils.empty(id)) { -// return new CommonResult().paramFailed("产品分类id"); -// } -// if (IPmsProductCategoryService.removeById(id)) { -// return new CommonResult().success(); -// } -// } catch (Exception e) { -// log.error("删除产品分类:%s", e.getMessage(), e); -// return new CommonResult().failed(); -// } -// return new CommonResult().failed(); -// } -// -// // @SysLog(MODULE = "pms", REMARK = "给产品分类分配产品分类") -// @ApiOperation("查询产品分类明细") -// @GetMapping(value = "/{id}") -// public Object getPmsProductCategoryById(@ApiParam("产品分类id") @PathVariable Long id) { -// try { -// if (ValidatorUtils.empty(id)) { -// return new CommonResult().paramFailed("产品分类id"); -// } -// PmsProductCategory coupon = IPmsProductCategoryService.getById(id); -// return new CommonResult().success(coupon); -// } catch (Exception e) { -// log.error("查询产品分类明细:%s", e.getMessage(), e); -// return new CommonResult().failed(); -// } -// -// } -// -// @ApiOperation(value = "批量删除产品分类") -// @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) -// @ResponseBody -// // @SysLog(MODULE = "pms", REMARK = "批量删除产品分类") -// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:delete')") -// public Object deleteBatch(@RequestParam("ids") List ids) { -// boolean count = IPmsProductCategoryService.removeByIds(ids); -// if (count) { -// return new CommonResult().success(count); -// } else { -// return new CommonResult().failed(); -// } -// } -// -// @ApiOperation("查询所有一级分类及子分类") -// @RequestMapping(value = "/list/withChildren", method = RequestMethod.GET) -// @ResponseBody -// public Object listWithChildren() { -// List list = IPmsProductCategoryService.listWithChildren(); -// return new CommonResult().success(list); -// } -// -// @ApiOperation("修改导航栏显示状态") -// @RequestMapping(value = "/update/navStatus", method = RequestMethod.POST) -// @ResponseBody -// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')") -// public Object updateNavStatus(@RequestParam("ids") Long ids, @RequestParam("navStatus") Integer navStatus) { -// PmsProductCategory entity = new PmsProductCategory(); -// entity.setId(ids); -// entity.setNavStatus(navStatus); -// -// if (IPmsProductCategoryService.updateById(entity)) { -// return new CommonResult().success(); -// } else { -// return new CommonResult().failed(); -// } -// } -//// public Object updateNavStatus(@RequestParam("ids") List ids, @RequestParam("navStatus") Integer navStatus) { -//// int count = IPmsProductCategoryService.updateNavStatus(ids, navStatus); -//// if (count > 0) { -//// return new CommonResult().success(count); -//// } else { -//// return new CommonResult().failed(); -//// } -//// } -// -// @ApiOperation("修改显示状态") -// @RequestMapping(value = "/update/showStatus", method = RequestMethod.POST) -// @ResponseBody -// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')") -// public Object updateShowStatus(@RequestParam("ids") Long ids, @RequestParam("showStatus") Integer showStatus) { -// PmsProductCategory entity = new PmsProductCategory(); -// entity.setId(ids); -// entity.setShowStatus(showStatus); -// if (IPmsProductCategoryService.updateById(entity)) { -// return new CommonResult().success(); -// } else { -// return new CommonResult().failed(); -// } -// } -// -// @ApiOperation("修改首页显示状态") -// @RequestMapping(value = "/update/indexStatus", method = RequestMethod.POST) -// @ResponseBody -// // @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')") -// public Object updateIndexStatus(@RequestParam("ids") Long ids, @RequestParam("indexStatus") Integer indexStatus) { -// PmsProductCategory entity = new PmsProductCategory(); -// entity.setId(ids); -// entity.setIndexStatus(indexStatus); -// if (IPmsProductCategoryService.updateById(entity)) { -// return new CommonResult().success(); -// } else { -// return new CommonResult().failed(); -// } -// } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductConsultController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductConsultController.java deleted file mode 100644 index bb2606d..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductConsultController.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductConsultService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductConsult; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 产品咨询表 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductConsultController", description = "产品咨询表管理") -@RequestMapping("/pms/PmsProductConsult") -public class PmsProductConsultController { - @Resource - private IPmsProductConsultService IPmsProductConsultService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有产品咨询表列表") - @ApiOperation("根据条件查询所有产品咨询表列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsProductConsult:read')") - public Object getPmsProductConsultByPage(PmsProductConsult entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductConsultService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有产品咨询表列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - - // @SysLog(MODULE = "pms", REMARK = "删除产品咨询表") - @ApiOperation("删除产品咨询表") - @GetMapping(value = "/delete/{id}") - public Object deletePmsProductConsult(@ApiParam("产品咨询表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品咨询表id"); - } - if (IPmsProductConsultService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除产品咨询表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给产品咨询表分配产品咨询表") - @ApiOperation("查询产品咨询表明细") - @GetMapping(value = "/{id}") - public Object getPmsProductConsultById(@ApiParam("产品咨询表id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品咨询表id"); - } - PmsProductConsult coupon = IPmsProductConsultService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询产品咨询表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除产品咨询表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除产品咨询表") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductConsultService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductController.java deleted file mode 100644 index 5baf0cf..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductController.java +++ /dev/null @@ -1,542 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductService; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsSkuStockService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProduct; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductVertifyRecord; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsSkuStock; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductParam; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductResult; -import com.zscat.mallplus.enums.ConstansValue; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import com.zscat.mallplus.vo.IdStatus; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 商品信息 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductController", description = "商品信息管理") -@RequestMapping("/pms/PmsProduct") -public class PmsProductController { - @Resource - private IPmsProductService IPmsProductService; -// @Resource -// private com.zscat.mallplus.ums.service.IUmsMemberTagService IUmsMemberTagService; - @Resource - private IPmsSkuStockService skuStockService; - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有商品信息列表") - @ApiOperation("根据条件查询所有商品信息列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsProduct:read')") - public Object getPmsProductByPage(PmsProduct entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - IPage page = null; - if (ValidatorUtils.empty(entity.getStatus())) { - entity.setStatus(0); - } - if (ValidatorUtils.notEmpty(entity.getKeyword())) { - if (entity.getStatus() == 1) { - entity.setDeleteStatus(1); - entity.setPublishStatus(1); - entity.setVerifyStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 2) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).eq("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 3) { - entity.setPublishStatus(0); - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 4) { - entity.setDeleteStatus(0); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else { - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } - } else { - if (entity.getStatus() == 1) { - entity.setDeleteStatus(1); - entity.setPublishStatus(1); - entity.setVerifyStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 2) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - eq("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 3) { - entity.setPublishStatus(0); - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 4) { - entity.setDeleteStatus(0); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else { - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } - - } - return new CommonResult().success(page); - } catch (Exception e) { - log.error("根据条件查询所有商品信息列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有商品信息列表") - @ApiOperation("根据条件查询所有商品信息列表") - @GetMapping(value = "/listBySku") - // @PreAuthorize("hasAuthority('pms:PmsProduct:read')") - public Object listBySku(PmsProduct entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - IPage page = null; - if (ValidatorUtils.empty(entity.getStatus())) { - entity.setStatus(0); - } - if (ValidatorUtils.notEmpty(entity.getKeyword())) { - if (entity.getStatus() == 1) { - entity.setDeleteStatus(1); - entity.setPublishStatus(1); - entity.setVerifyStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 2) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).eq("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 3) { - entity.setPublishStatus(0); - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 4) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else { - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } - } else { - if (entity.getStatus() == 1) { - entity.setDeleteStatus(1); - entity.setPublishStatus(1); - entity.setVerifyStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 2) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - eq("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 3) { - entity.setDeleteStatus(1); - entity.setPublishStatus(0); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 4) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else { - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } - - } - if (page.getRecords()!=null && page.getRecords().size()>0){ - for (PmsProduct product : page.getRecords()) { - List skuStockList = skuStockService.list(new QueryWrapper().eq("product_id", product.getId())); - product.setSkuStockList(skuStockList); - } - } - - return new CommonResult().success(page); - } catch (Exception e) { - log.error("根据条件查询所有商品信息列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - @ApiOperation("根据商品名称或货号模糊查询") - @RequestMapping(value = "/simpleList", method = RequestMethod.GET) - @ResponseBody - public Object getList(String keyword) { - List productList = IPmsProductService.list(keyword); - return new CommonResult().success(productList); - } - @ApiOperation("根据商品名称或货号模糊查询") - @RequestMapping(value = "/simpleProductList", method = RequestMethod.GET) - @ResponseBody - public Object listPmsProduct(String keyword) { - List productList = IPmsProductService.listPmsProduct(keyword); - return new CommonResult().success(productList); - } - - // @SysLog(MODULE = "pms", REMARK = "保存商品信息") - @ApiOperation("保存商品信息") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsProduct:create')") - public Object savePmsProduct(@RequestBody PmsProductParam productParam) { - try { - productParam.setDeleteStatus(1); - int count = IPmsProductService.create(productParam); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } catch (Exception e) { - log.error("保存商品信息:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - // @SysLog(MODULE = "pms", REMARK = "更新商品信息") - @ApiOperation("更新商品信息") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProduct:update')") - public Object updatePmsProduct(@PathVariable Long id, @RequestBody PmsProductParam productParam) { - try { - int count = IPmsProductService.update(id, productParam); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } catch (Exception e) { - log.error("更新商品信息:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - // @SysLog(MODULE = "pms", REMARK = "删除商品信息") - @ApiOperation("删除商品信息") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProduct:delete')") - public Object deletePmsProduct(@ApiParam("商品信息id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品信息id"); - } - if (IPmsProductService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除商品信息:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给商品信息分配商品信息") - @ApiOperation("查询商品信息明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProduct:read')") - public Object getPmsProductById(@ApiParam("商品信息id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品信息id"); - } - PmsProduct coupon = IPmsProductService.getById(id); -// if (ValidatorUtils.notEmpty(coupon.getTags())){ -// String[] ids = coupon.getTags().split(","); -// List tagList = IUmsMemberTagService.list(new QueryWrapper().eq("type",2).eq("status",1).in("id",ids)); -// coupon.setTagList(tagList); -// } - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询商品信息明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除商品信息") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除商品信息") - // @PreAuthorize("hasAuthority('pms:PmsProduct:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @ApiOperation("根据商品id获取商品编辑信息") - @RequestMapping(value = "/updateInfo/{id}", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "根据商品id获取商品编辑信息") - // @PreAuthorize("hasAuthority('pms:PmsProduct:read')") - public Object getUpdateInfo(@PathVariable Long id) { - PmsProductResult productResult = IPmsProductService.getUpdateInfo(id); -// if (ValidatorUtils.notEmpty(productResult.getTags())){ -// String[] ids = productResult.getTags().split(","); -// List tagList = IUmsMemberTagService.list(new QueryWrapper().eq("type",2).in("id",ids)); -// productResult.setTagList(tagList); -// } - return new CommonResult().success(productResult); - } - - @ApiOperation("根据商品id获取审核信息") - @RequestMapping(value = "/fetchVList/{id}", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "据商品id获取审核信息") - public Object fetchVList(@PathVariable Long id) { - List list = IPmsProductService.getProductVertifyRecord(id); - return new CommonResult().success(list); - } - - @ApiOperation("批量修改审核状态") - @RequestMapping(value = "/update/verifyStatus") - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量修改审核状态") - // @PreAuthorize("hasAuthority('pms:PmsProduct:update')") - public Object updateVerifyStatus(@RequestParam("ids") Long ids, - @RequestParam("verifyStatus") Integer verifyStatus, - @RequestParam("detail") String detail) { - int count = IPmsProductService.updateVerifyStatus(ids, verifyStatus, detail); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @ApiOperation("批量上下架") - @RequestMapping(value = "/update/publishStatus", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量上下架") - // @PreAuthorize("hasAuthority('pms:PmsProduct:update')") - public Object updatePublishStatus(@RequestParam("ids") List ids, - @RequestParam("publishStatus") Integer publishStatus) { - int count = IPmsProductService.updatePublishStatus(ids, publishStatus); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @ApiOperation("批量上下架") - @RequestMapping(value = "/publishStatus", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量上下架") - public Object updatePublishStatu(@RequestBody IdStatus ids, BindingResult result) { - PmsProduct product = new PmsProduct(); - product.setId(ids.getId()); - product.setPublishStatus(ids.getStatus()); - Boolean count = IPmsProductService.updateById(product); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @ApiOperation("批量推荐商品") - @RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量推荐商品") - // @PreAuthorize("hasAuthority('pms:PmsProduct:update')") - public Object updateRecommendStatus(@RequestParam("ids") List ids, - @RequestParam("recommendStatus") Integer recommendStatus) { - int count = IPmsProductService.updateRecommendStatus(ids, recommendStatus); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @ApiOperation("批量设为新品") - @RequestMapping(value = "/update/newStatus", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量设为新品") - // @PreAuthorize("hasAuthority('pms:PmsProduct:update')") - public Object updateNewStatus(@RequestParam("ids") List ids, - @RequestParam("newStatus") Integer newStatus) { - int count = IPmsProductService.updateNewStatus(ids, newStatus); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @ApiOperation("批量设为分销") - @RequestMapping(value = "/update/isFenxiao", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量设为分销") - public Object updateisFenxiao(@RequestParam("ids") List ids, - @RequestParam("newStatus") Integer newStatus) { - int count = IPmsProductService.updateisFenxiao(ids, newStatus); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @ApiOperation("批量设为会员商品") - @RequestMapping(value = "/update/isVip", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量设为会员商品") - public Object updateisVip(@RequestParam("ids") List ids, - @RequestParam("newStatus") Integer newStatus) { - int count = IPmsProductService.updateisVip(ids, newStatus); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - - @ApiOperation("批量修改删除状态") - @RequestMapping(value = "/update/deleteStatus", method = RequestMethod.POST) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量修改删除状态") - // @PreAuthorize("hasAuthority('pms:PmsProduct:delete')") - public Object updateDeleteStatus(@RequestParam("ids") List ids, - @RequestParam("deleteStatus") Integer deleteStatus) { - int count = IPmsProductService.updateDeleteStatus(ids, deleteStatus); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - @GetMapping(value = "/goods/list") - public Object getPmsProductListByPage(PmsProduct entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - IPage page = null; - if (ValidatorUtils.empty(entity.getStatus())) { - entity.setStatus(0); - } - if (ValidatorUtils.notEmpty(entity.getKeyword())) { - if (entity.getStatus() == 1) { - entity.setPublishStatus(1); - entity.setVerifyStatus(1); - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 2) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).eq("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 3) { - entity.setDeleteStatus(1); - entity.setPublishStatus(0); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 4) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else { - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } - } else { - if (entity.getStatus() == 1) { - entity.setPublishStatus(1); - entity.setVerifyStatus(1); - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 2) { - entity.setDeleteStatus(1); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - eq("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 3) { - entity.setDeleteStatus(1); - entity.setPublishStatus(0); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else if (entity.getStatus() == 4) { - entity.setDeleteStatus(0); - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } else { - page = IPmsProductService.page(new Page(pageNum, pageSize), new QueryWrapper(entity). - orderByDesc("create_time").select(ConstansValue.sampleGoodsList)); - } - - } - return new CommonResult().success(page); - } catch (Exception e) { - log.error("根据条件查询所有商品信息列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - @ApiOperation("批量上下架") - @RequestMapping(value = "/updateReComStatus", method = RequestMethod.POST) - @ResponseBody - public Object updateReComStatus(@RequestBody IdStatus ids, BindingResult result) { - PmsProduct product = new PmsProduct(); - product.setId(ids.getId()); - if (ids.getType() == 1) { // 1推荐2 上下架 3 审核 4 删除 5 分销 6 会员 - product.setRecommandStatus(ids.getStatus()); - } else if (ids.getType() == 2) { - product.setPublishStatus(ids.getStatus()); - } else if (ids.getType() == 3) { - product.setVerifyStatus(ids.getStatus()); - } else if (ids.getType() == 4) { - product.setDeleteStatus(ids.getStatus()); - } else if (ids.getType() == 5) { - product.setIsFenxiao(ids.getStatus()); - } else if (ids.getType() == 6) { - product.setIsVip(ids.getStatus()); - } - - - Boolean count = IPmsProductService.updateById(product); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductFullReductionController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductFullReductionController.java deleted file mode 100644 index e792929..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductFullReductionController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductFullReductionService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductFullReduction; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 产品满减表(只针对同商品) - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductFullReductionController", description = "产品满减表(只针对同商品)管理") -@RequestMapping("/pms/PmsProductFullReduction") -public class PmsProductFullReductionController { - @Resource - private IPmsProductFullReductionService IPmsProductFullReductionService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有产品满减表(只针对同商品)列表") - @ApiOperation("根据条件查询所有产品满减表(只针对同商品)列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsProductFullReduction:read')") - public Object getPmsProductFullReductionByPage(PmsProductFullReduction entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductFullReductionService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有产品满减表(只针对同商品)列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存产品满减表(只针对同商品)") - @ApiOperation("保存产品满减表(只针对同商品)") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsProductFullReduction:create')") - public Object savePmsProductFullReduction(@RequestBody PmsProductFullReduction entity) { - try { - if (IPmsProductFullReductionService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存产品满减表(只针对同商品):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新产品满减表(只针对同商品)") - @ApiOperation("更新产品满减表(只针对同商品)") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductFullReduction:update')") - public Object updatePmsProductFullReduction(@RequestBody PmsProductFullReduction entity) { - try { - if (IPmsProductFullReductionService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新产品满减表(只针对同商品):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除产品满减表(只针对同商品)") - @ApiOperation("删除产品满减表(只针对同商品)") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductFullReduction:delete')") - public Object deletePmsProductFullReduction(@ApiParam("产品满减表(只针对同商品)id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品满减表(只针对同商品)id"); - } - if (IPmsProductFullReductionService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除产品满减表(只针对同商品):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给产品满减表(只针对同商品)分配产品满减表(只针对同商品)") - @ApiOperation("查询产品满减表(只针对同商品)明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductFullReduction:read')") - public Object getPmsProductFullReductionById(@ApiParam("产品满减表(只针对同商品)id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品满减表(只针对同商品)id"); - } - PmsProductFullReduction coupon = IPmsProductFullReductionService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询产品满减表(只针对同商品)明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除产品满减表(只针对同商品)") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除产品满减表(只针对同商品)") - // @PreAuthorize("hasAuthority('pms:PmsProductFullReduction:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductFullReductionService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductLadderController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductLadderController.java deleted file mode 100644 index 14f1033..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductLadderController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductLadderService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductLadder; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 产品阶梯价格表(只针对同商品) - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductLadderController", description = "产品阶梯价格表(只针对同商品)管理") -@RequestMapping("/pms/PmsProductLadder") -public class PmsProductLadderController { - @Resource - private IPmsProductLadderService IPmsProductLadderService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有产品阶梯价格表(只针对同商品)列表") - @ApiOperation("根据条件查询所有产品阶梯价格表(只针对同商品)列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsProductLadder:read')") - public Object getPmsProductLadderByPage(PmsProductLadder entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductLadderService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有产品阶梯价格表(只针对同商品)列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存产品阶梯价格表(只针对同商品)") - @ApiOperation("保存产品阶梯价格表(只针对同商品)") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsProductLadder:create')") - public Object savePmsProductLadder(@RequestBody PmsProductLadder entity) { - try { - if (IPmsProductLadderService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存产品阶梯价格表(只针对同商品):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新产品阶梯价格表(只针对同商品)") - @ApiOperation("更新产品阶梯价格表(只针对同商品)") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductLadder:update')") - public Object updatePmsProductLadder(@RequestBody PmsProductLadder entity) { - try { - if (IPmsProductLadderService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新产品阶梯价格表(只针对同商品):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除产品阶梯价格表(只针对同商品)") - @ApiOperation("删除产品阶梯价格表(只针对同商品)") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductLadder:delete')") - public Object deletePmsProductLadder(@ApiParam("产品阶梯价格表(只针对同商品)id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品阶梯价格表(只针对同商品)id"); - } - if (IPmsProductLadderService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除产品阶梯价格表(只针对同商品):%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给产品阶梯价格表(只针对同商品)分配产品阶梯价格表(只针对同商品)") - @ApiOperation("查询产品阶梯价格表(只针对同商品)明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductLadder:read')") - public Object getPmsProductLadderById(@ApiParam("产品阶梯价格表(只针对同商品)id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("产品阶梯价格表(只针对同商品)id"); - } - PmsProductLadder coupon = IPmsProductLadderService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询产品阶梯价格表(只针对同商品)明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除产品阶梯价格表(只针对同商品)") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除产品阶梯价格表(只针对同商品)") - // @PreAuthorize("hasAuthority('pms:PmsProductLadder:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductLadderService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductOperateLogController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductOperateLogController.java deleted file mode 100644 index e2c4ef3..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductOperateLogController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductOperateLogService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductOperateLog; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- *

- *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductOperateLogController", description = "管理") -@RequestMapping("/pms/PmsProductOperateLog") -public class PmsProductOperateLogController { - @Resource - private IPmsProductOperateLogService IPmsProductOperateLogService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有列表") - @ApiOperation("根据条件查询所有列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsProductOperateLog:read')") - public Object getPmsProductOperateLogByPage(PmsProductOperateLog entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductOperateLogService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存") - @ApiOperation("保存") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsProductOperateLog:create')") - public Object savePmsProductOperateLog(@RequestBody PmsProductOperateLog entity) { - try { - if (IPmsProductOperateLogService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新") - @ApiOperation("更新") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductOperateLog:update')") - public Object updatePmsProductOperateLog(@RequestBody PmsProductOperateLog entity) { - try { - if (IPmsProductOperateLogService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除") - @ApiOperation("删除") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductOperateLog:delete')") - public Object deletePmsProductOperateLog(@ApiParam("id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("id"); - } - if (IPmsProductOperateLogService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给分配") - @ApiOperation("查询明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductOperateLog:read')") - public Object getPmsProductOperateLogById(@ApiParam("id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("id"); - } - PmsProductOperateLog coupon = IPmsProductOperateLogService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除") - // @PreAuthorize("hasAuthority('pms:PmsProductOperateLog:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductOperateLogService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductVertifyRecordController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductVertifyRecordController.java deleted file mode 100644 index 77e2681..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsProductVertifyRecordController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductVertifyRecordService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductVertifyRecord; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 商品审核记录 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsProductVertifyRecordController", description = "商品审核记录管理") -@RequestMapping("/pms/PmsProductVertifyRecord") -public class PmsProductVertifyRecordController { - @Resource - private IPmsProductVertifyRecordService IPmsProductVertifyRecordService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有商品审核记录列表") - @ApiOperation("根据条件查询所有商品审核记录列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsProductVertifyRecord:read')") - public Object getPmsProductVertifyRecordByPage(PmsProductVertifyRecord entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsProductVertifyRecordService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有商品审核记录列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存商品审核记录") - @ApiOperation("保存商品审核记录") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsProductVertifyRecord:create')") - public Object savePmsProductVertifyRecord(@RequestBody PmsProductVertifyRecord entity) { - try { - if (IPmsProductVertifyRecordService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存商品审核记录:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新商品审核记录") - @ApiOperation("更新商品审核记录") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductVertifyRecord:update')") - public Object updatePmsProductVertifyRecord(@RequestBody PmsProductVertifyRecord entity) { - try { - if (IPmsProductVertifyRecordService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新商品审核记录:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除商品审核记录") - @ApiOperation("删除商品审核记录") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductVertifyRecord:delete')") - public Object deletePmsProductVertifyRecord(@ApiParam("商品审核记录id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品审核记录id"); - } - if (IPmsProductVertifyRecordService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除商品审核记录:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给商品审核记录分配商品审核记录") - @ApiOperation("查询商品审核记录明细") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsProductVertifyRecord:read')") - public Object getPmsProductVertifyRecordById(@ApiParam("商品审核记录id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("商品审核记录id"); - } - PmsProductVertifyRecord coupon = IPmsProductVertifyRecordService.getById(id); - return new CommonResult().success(coupon); - } catch (Exception e) { - log.error("查询商品审核记录明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除商品审核记录") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除商品审核记录") - // @PreAuthorize("hasAuthority('pms:PmsProductVertifyRecord:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsProductVertifyRecordService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsSkuStockController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsSkuStockController.java deleted file mode 100644 index 1f28f42..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsSkuStockController.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsSkuStockService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsSkuStock; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * sku的库存 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@RestController -@Api(tags = "PmsSkuStockController", description = "sku的库存管理") -@RequestMapping("/pms/PmsSkuStock") -public class PmsSkuStockController { - @Resource - private IPmsSkuStockService IPmsSkuStockService; - - // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有sku的库存列表") - @ApiOperation("根据条件查询所有sku的库存列表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsSkuStock:read')") - public Object getPmsSkuStockByPage(PmsSkuStock entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsSkuStockService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("根据条件查询所有sku的库存列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存sku的库存") - @ApiOperation("保存sku的库存") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsSkuStock:create')") - public Object savePmsSkuStock(@RequestBody PmsSkuStock entity) { - try { - if (IPmsSkuStockService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存sku的库存:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新sku的库存") - @ApiOperation("更新sku的库存") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsSkuStock:update')") - public Object updatePmsSkuStock(@RequestBody PmsSkuStock entity) { - try { - if (IPmsSkuStockService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新sku的库存:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除sku的库存") - @ApiOperation("删除sku的库存") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsSkuStock:delete')") - public Object deletePmsSkuStock(@ApiParam(name = "pid", value = "sku的库存id", required = true) @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("sku的库存id"); - } - if (IPmsSkuStockService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除sku的库存:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "给sku的库存分配sku的库存") - @ApiOperation("查询sku的库存明细") - @GetMapping(value = "select/{id}") - // @PreAuthorize("hasAuthority('pms:PmsSkuStock:read')") - public Object getPmsSkuStockById(@ApiParam("sku的库存id") @PathVariable Long id, @RequestParam(value = "keyword", required = false) String keyword) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("sku的库存id"); - } - return new CommonResult().success(IPmsSkuStockService.getList(id, keyword)); - } catch (Exception e) { - log.error("查询sku的库存明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除sku的库存") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除sku的库存") - // @PreAuthorize("hasAuthority('pms:PmsSkuStock:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsSkuStockService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - // @SysLog(MODULE = "pms", REMARK = "根据商品编号及编号模糊搜索sku库存") - @ApiOperation("根据商品编号及编号模糊搜索sku库存") - @RequestMapping(value = "/{pid}", method = RequestMethod.GET) - @ResponseBody - public Object getList(@PathVariable Long pid, @RequestParam(value = "keyword", required = false) String keyword) { - List skuStockList = IPmsSkuStockService.getList(pid, keyword); - return new CommonResult().success(skuStockList); - } - - // @SysLog(MODULE = "pms", REMARK = "批量更新库存信息") - @ApiOperation("批量更新库存信息") - @RequestMapping(value = "/updatePid/{pid}", method = RequestMethod.POST) - @ResponseBody - public Object update(@PathVariable Long pid, @RequestBody List skuStockList) { - int count = IPmsSkuStockService.update(pid, skuStockList); - if (count > 0) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsSmallNaviconCategoryController.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsSmallNaviconCategoryController.java deleted file mode 100644 index ff2139b..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/controller/PmsSmallNaviconCategoryController.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsSmallNaviconCategoryService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsSmallNaviconCategory; -import com.zscat.mallplus.utils.CommonResult; -import com.zscat.mallplus.utils.ValidatorUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- *

- *

- * - * @author zscat - * @since ${date} - */ -@Slf4j -@RestController -@Api(tags = "PmsSmallNaviconCategoryController", description = "管理") -@RequestMapping("/pms/smallNaviconCategory") -public class PmsSmallNaviconCategoryController { - @Resource - private IPmsSmallNaviconCategoryService IPmsSmallNaviconCategoryService; - - // @SysLog(MODULE = "pms", REMARK = "查询pms_small_navicon_category表") - @ApiOperation("查询pms_small_navicon_category表") - @GetMapping(value = "/list") - // @PreAuthorize("hasAuthority('pms:PmsSmallNaviconCategory:read')") - public Object getPmsSmallNaviconCategoryByPage(PmsSmallNaviconCategory entity, - @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize - ) { - try { - return new CommonResult().success(IPmsSmallNaviconCategoryService.page(new Page(pageNum, pageSize), new QueryWrapper<>(entity))); - } catch (Exception e) { - log.error("分页获取pms_small_navicon_category列表:%s", e.getMessage(), e); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "保存pms_small_navicon_category表") - @ApiOperation("保存pms_small_navicon_category表") - @PostMapping(value = "/create") - // @PreAuthorize("hasAuthority('pms:PmsSmallNaviconCategory:create')") - public Object saveSmallNaviconCategory(@RequestBody PmsSmallNaviconCategory entity) { - try { - if (IPmsSmallNaviconCategoryService.save(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("保存pms_small_navicon_category表:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "更新pms_small_navicon_category") - @ApiOperation("更新pms_small_navicon_category") - @PostMapping(value = "/update/{id}") - // @PreAuthorize("hasAuthority('pms:PmsSmallNaviconCategory:update')") - public Object updateSmallNaviconCategory(@RequestBody PmsSmallNaviconCategory entity) { - try { - if (IPmsSmallNaviconCategoryService.updateById(entity)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("更新:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "删除pms_small_navicon_category数据") - @ApiOperation("删除小程序首页nav管理数据") - @GetMapping(value = "/delete/{id}") - // @PreAuthorize("hasAuthority('pms:PmsSmallNaviconCategory:delete')") - public Object deleteRole(@ApiParam("小程序首页nav管理_id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("PmsSmallNaviconCategory_id"); - } - if (IPmsSmallNaviconCategoryService.removeById(id)) { - return new CommonResult().success(); - } - } catch (Exception e) { - log.error("删除小程序首页nav管理数据:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - return new CommonResult().failed(); - } - - // @SysLog(MODULE = "pms", REMARK = "根据ID查询pms_small_navicon_category") - @ApiOperation("根据ID查询pms_small_navicon_category") - @GetMapping(value = "/{id}") - // @PreAuthorize("hasAuthority('pms:PmsSmallNaviconCategory:read')") - public Object getRoleById(@ApiParam("小程序首页nav管理_id") @PathVariable Long id) { - try { - if (ValidatorUtils.empty(id)) { - return new CommonResult().paramFailed("PmsSmallNaviconCategory_id"); - } - PmsSmallNaviconCategory pmsSmallNaviconCategory = IPmsSmallNaviconCategoryService.getById(id); - return new CommonResult().success(pmsSmallNaviconCategory); - } catch (Exception e) { - log.error("pms_small_navicon_category表明细:%s", e.getMessage(), e); - return new CommonResult().failed(); - } - - } - - @ApiOperation(value = "批量删除PmsSmallNaviconCategory表") - @RequestMapping(value = "/delete/batch", method = RequestMethod.GET) - @ResponseBody - // @SysLog(MODULE = "pms", REMARK = "批量删除PmsSmallNaviconCategory表") - // @PreAuthorize("hasAuthority('pms:PmsSmallNaviconCategory:delete')") - public Object deleteBatch(@RequestParam("ids") List ids) { - boolean count = IPmsSmallNaviconCategoryService.removeByIds(ids); - if (count) { - return new CommonResult().success(count); - } else { - return new CommonResult().failed(); - } - } - - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsAlbumPicService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsAlbumPicService.java deleted file mode 100644 index 71326b4..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsAlbumPicService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsAlbumPic; - -/** - *

- * 画册图片表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsAlbumPicService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsAlbumService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsAlbumService.java deleted file mode 100644 index cb78a55..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsAlbumService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsAlbum; - -/** - *

- * 相册表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsAlbumService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsBrandService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsBrandService.java deleted file mode 100644 index 0d798fc..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsBrandService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.common.core.result.ResultBean; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand; -import com.yxt.ordermall.mallplus.mbg.pms.entity.brand.BrandVo; - -import java.util.List; - -/** - *

- * 品牌表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsBrandService extends IService { - - int updateShowStatus(List ids, Integer showStatus); - - int updateFactoryStatus(List ids, Integer factoryStatus); - - ResultBean> getList(); -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsCommentReplayService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsCommentReplayService.java deleted file mode 100644 index cd3e247..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsCommentReplayService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsCommentReplay; - -/** - *

- * 产品评价回复表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsCommentReplayService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsCommentService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsCommentService.java deleted file mode 100644 index 6c87023..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsCommentService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsComment; - -/** - *

- * 商品评价表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsCommentService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsFeightTemplateService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsFeightTemplateService.java deleted file mode 100644 index baea410..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsFeightTemplateService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsFeightTemplate; - -/** - *

- * 运费模版 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsFeightTemplateService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsGiftsCategoryService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsGiftsCategoryService.java deleted file mode 100644 index f07e008..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsGiftsCategoryService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsGiftsCategory; - -/** - *

- * 帮助分类表 服务类 - *

- * - * @author zscat - * @since 2019-07-07 - */ -public interface IPmsGiftsCategoryService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsGiftsService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsGiftsService.java deleted file mode 100644 index c022687..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsGiftsService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsGifts; - -/** - *

- * 帮助表 服务类 - *

- * - * @author zscat - * @since 2019-07-07 - */ -public interface IPmsGiftsService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsMemberPriceService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsMemberPriceService.java deleted file mode 100644 index 941c7d5..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsMemberPriceService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsMemberPrice; - -/** - *

- * 商品会员价格表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsMemberPriceService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeCategoryService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeCategoryService.java deleted file mode 100644 index c9ec329..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeCategoryService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttributeCategory; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductAttributeCategoryItem; - -import java.util.List; - -/** - *

- * 产品属性分类表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductAttributeCategoryService extends IService { - - List getListWithAttr(); -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeService.java deleted file mode 100644 index dad0090..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttribute; -import com.yxt.ordermall.mallplus.mbg.pms.vo.ProductAttrInfo; - -import java.util.List; - -/** - *

- * 商品属性参数表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductAttributeService extends IService { - - List getProductAttrInfo(Long productCategoryId); - - boolean saveAndUpdate(PmsProductAttribute entity); -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeValueService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeValueService.java deleted file mode 100644 index c5d6c1c..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductAttributeValueService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttributeValue; - -/** - *

- * 存储产品参数信息的表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductAttributeValueService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductCategoryAttributeRelationService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductCategoryAttributeRelationService.java deleted file mode 100644 index 2e2f869..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductCategoryAttributeRelationService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategoryAttributeRelation; - -/** - *

- * 产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类) 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductCategoryAttributeRelationService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductCategoryService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductCategoryService.java deleted file mode 100644 index 4811722..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductCategoryService.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategory; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductCategoryWithChildrenItem; - -import java.util.List; - -/** - *

- * 产品分类 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductCategoryService extends IService { - - List listWithChildren(); - - int updateNavStatus(List ids, Integer navStatus); - - int updateShowStatus(List ids, Integer showStatus); - - int updateIndexStatus(List ids, Integer indexStatus); - - boolean updateAnd(PmsProductCategory entity); - - boolean saveAnd(PmsProductCategory entity); - - int selectCountByNameAndLevel(Long parentId, String name); - - int selectCountByNameAndLevelId(Long parentId, String name, Long id); -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductConsultService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductConsultService.java deleted file mode 100644 index 5b45dd3..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductConsultService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductConsult; - -/** - *

- * 产品咨询表 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductConsultService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductFullReductionService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductFullReductionService.java deleted file mode 100644 index c6a4196..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductFullReductionService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductFullReduction; - -/** - *

- * 产品满减表(只针对同商品) 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductFullReductionService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductLadderService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductLadderService.java deleted file mode 100644 index 813c715..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductLadderService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductLadder; - -/** - *

- * 产品阶梯价格表(只针对同商品) 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductLadderService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductOperateLogService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductOperateLogService.java deleted file mode 100644 index f08c19a..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductOperateLogService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductOperateLog; - -/** - *

- * 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductOperateLogService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductService.java deleted file mode 100644 index 5175dc3..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductService.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProduct; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductVertifyRecord; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductParam; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductResult; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - *

- * 商品信息 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductService extends IService { - @Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED) - int create(PmsProductParam productParam); - - /** - * 根据商品编号获取更新信息 - */ - PmsProductResult getUpdateInfo(Long id); - - /** - * 更新商品 - */ - @Transactional - int update(Long id, PmsProductParam productParam); - - /** - * 批量修改审核状态 - * - * @param ids 产品id - * @param verifyStatus 审核状态 - * @param detail 审核详情 - */ - @Transactional - int updateVerifyStatus(Long ids, Integer verifyStatus, String detail); - - /** - * 批量修改商品上架状态 - */ - int updatePublishStatus(List ids, Integer publishStatus); - - /** - * 批量修改商品推荐状态 - */ - int updateRecommendStatus(List ids, Integer recommendStatus); - - /** - * 批量修改新品状态 - */ - int updateNewStatus(List ids, Integer newStatus); - - int updateisFenxiao(List ids, Integer newStatus); - - /** - * 批量删除商品 - */ - int updateDeleteStatus(List ids, Integer deleteStatus); - - /** - * 根据商品名称或者货号模糊查询 - */ - List list(String keyword); - List listPmsProduct(String keyword); - - List getProductVertifyRecord(Long id); - - int updateisVip(List ids, Integer newStatus); -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductVertifyRecordService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductVertifyRecordService.java deleted file mode 100644 index d2d9cf8..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsProductVertifyRecordService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductVertifyRecord; - -/** - *

- * 商品审核记录 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsProductVertifyRecordService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsSkuStockService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsSkuStockService.java deleted file mode 100644 index f7eef8e..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsSkuStockService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsSkuStock; - -import java.util.List; - -/** - *

- * sku的库存 服务类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -public interface IPmsSkuStockService extends IService { - /** - * 根据产品id和skuCode模糊搜索 - */ - List getList(Long pid, String keyword); - - /** - * 批量更新商品库存信息 - */ - int update(Long pid, List skuStockList); -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsSmallNaviconCategoryService.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsSmallNaviconCategoryService.java deleted file mode 100644 index ffec358..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/IPmsSmallNaviconCategoryService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsSmallNaviconCategory; - -/** - * 小程序首页nav管理 - * - * @author zscat - * @email 951449465@qq.com - * @date 2019-05-08 00:09:37 - */ - -public interface IPmsSmallNaviconCategoryService extends IService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsAlbumPicServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsAlbumPicServiceImpl.java deleted file mode 100644 index b2d96bc..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsAlbumPicServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsAlbumPicService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsAlbumPic; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsAlbumPicMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 画册图片表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsAlbumPicServiceImpl extends ServiceImpl implements IPmsAlbumPicService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsAlbumServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsAlbumServiceImpl.java deleted file mode 100644 index 7d74300..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsAlbumServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsAlbumService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsAlbum; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsAlbumMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 相册表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsAlbumServiceImpl extends ServiceImpl implements IPmsAlbumService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsBrandServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsBrandServiceImpl.java deleted file mode 100644 index bdcdd2a..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsBrandServiceImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.common.core.result.ResultBean; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsBrandService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand; -import com.yxt.ordermall.mallplus.mbg.pms.entity.brand.BrandVo; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsBrandMapper; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 品牌表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsBrandServiceImpl extends ServiceImpl implements IPmsBrandService { - @Resource - private PmsBrandMapper brandMapper; - - @Override - public int updateShowStatus(List ids, Integer showStatus) { - PmsBrand pmsBrand = new PmsBrand(); - pmsBrand.setShowStatus(showStatus); - return brandMapper.update(pmsBrand, new QueryWrapper().in("id", ids)); - - } - - @Override - public int updateFactoryStatus(List ids, Integer factoryStatus) { - PmsBrand pmsBrand = new PmsBrand(); - pmsBrand.setFactoryStatus(factoryStatus); - return brandMapper.update(pmsBrand, new QueryWrapper().in("id", ids)); - } - - @Override - public ResultBean> getList() { - ResultBean> rb = ResultBean.fireFail(); - List brandVoList = baseMapper.getList(); - return rb.success().setData(brandVoList); - } -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsCommentReplayServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsCommentReplayServiceImpl.java deleted file mode 100644 index 97162fa..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsCommentReplayServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsCommentReplayService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsCommentReplay; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsCommentReplayMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 产品评价回复表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsCommentReplayServiceImpl extends ServiceImpl implements IPmsCommentReplayService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsCommentServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsCommentServiceImpl.java deleted file mode 100644 index ca8e748..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsCommentServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsCommentService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsComment; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsCommentMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 商品评价表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsCommentServiceImpl extends ServiceImpl implements IPmsCommentService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsFeightTemplateServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsFeightTemplateServiceImpl.java deleted file mode 100644 index d346b05..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsFeightTemplateServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsFeightTemplateService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsFeightTemplate; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsFeightTemplateMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 运费模版 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsFeightTemplateServiceImpl extends ServiceImpl implements IPmsFeightTemplateService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsGiftsCategoryServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsGiftsCategoryServiceImpl.java deleted file mode 100644 index 3c63aca..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsGiftsCategoryServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsGiftsCategoryService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsGiftsCategory; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsGiftsCategoryMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 帮助分类表 服务实现类 - *

- * - * @author zscat - * @since 2019-07-07 - */ -@Service -public class PmsGiftsCategoryServiceImpl extends ServiceImpl implements IPmsGiftsCategoryService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsGiftsServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsGiftsServiceImpl.java deleted file mode 100644 index eeb1f02..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsGiftsServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsGiftsService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsGifts; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsGiftsMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 帮助表 服务实现类 - *

- * - * @author zscat - * @since 2019-07-07 - */ -@Service -public class PmsGiftsServiceImpl extends ServiceImpl implements IPmsGiftsService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsMemberPriceServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsMemberPriceServiceImpl.java deleted file mode 100644 index 83d531d..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsMemberPriceServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsMemberPriceService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsMemberPrice; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsMemberPriceMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 商品会员价格表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsMemberPriceServiceImpl extends ServiceImpl implements IPmsMemberPriceService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeCategoryServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeCategoryServiceImpl.java deleted file mode 100644 index 9b98f8c..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeCategoryServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductAttributeCategoryService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttributeCategory; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductAttributeCategoryMapper; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductAttributeCategoryItem; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 产品属性分类表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductAttributeCategoryServiceImpl extends ServiceImpl implements IPmsProductAttributeCategoryService { - - @Resource - private PmsProductAttributeCategoryMapper productAttributeCategoryMapper; - - @Override - public List getListWithAttr() { - return productAttributeCategoryMapper.getListWithAttr(); - } -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeServiceImpl.java deleted file mode 100644 index 941915f..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductAttributeService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttribute; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttributeCategory; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductAttributeCategoryMapper; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductAttributeMapper; -import com.yxt.ordermall.mallplus.mbg.pms.vo.ProductAttrInfo; -import com.zscat.mallplus.exception.BusinessMallException; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * 商品属性参数表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductAttributeServiceImpl extends ServiceImpl implements IPmsProductAttributeService { - - @Resource - private PmsProductAttributeMapper productAttributeMapper; - @Resource - private PmsProductAttributeCategoryMapper productAttributeCategoryMapper; - - @Override - public List getProductAttrInfo(Long productCategoryId) { - return productAttributeMapper.getProductAttrInfo(productCategoryId); - } - - @Transactional - @Override - public boolean saveAndUpdate(PmsProductAttribute entity) { - int count = productAttributeMapper.selectCount(new QueryWrapper().eq("product_attribute_category_id", entity.getProductAttributeCategoryId()).eq("type", entity.getType())); - if (count >= 3) { - throw new BusinessMallException("规格或者属性数量不能超过3个"); - } - productAttributeMapper.insert(entity); - //新增商品属性以后需要更新商品属性分类数量 - - PmsProductAttributeCategory pmsProductAttributeCategory = productAttributeCategoryMapper.selectById(entity.getProductAttributeCategoryId()); - if (entity.getType() == 0) { - pmsProductAttributeCategory.setAttributeCount(pmsProductAttributeCategory.getAttributeCount() + 1); - } else if (entity.getType() == 1) { - pmsProductAttributeCategory.setParamCount(pmsProductAttributeCategory.getParamCount() + 1); - } - productAttributeCategoryMapper.updateById(pmsProductAttributeCategory); - return true; - } -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeValueServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeValueServiceImpl.java deleted file mode 100644 index 3b9bba8..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductAttributeValueServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductAttributeValueService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductAttributeValue; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductAttributeValueMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 存储产品参数信息的表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductAttributeValueServiceImpl extends ServiceImpl implements IPmsProductAttributeValueService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductCategoryAttributeRelationServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductCategoryAttributeRelationServiceImpl.java deleted file mode 100644 index 44b4732..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductCategoryAttributeRelationServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductCategoryAttributeRelationService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategoryAttributeRelation; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductCategoryAttributeRelationMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类) 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductCategoryAttributeRelationServiceImpl extends ServiceImpl implements IPmsProductCategoryAttributeRelationService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductCategoryServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductCategoryServiceImpl.java deleted file mode 100644 index 5744d60..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductCategoryServiceImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductCategoryAttributeRelationService; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductCategoryService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProduct; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategory; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategoryAttributeRelation; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductCategoryAttributeRelationMapper; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductCategoryMapper; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductMapper; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductCategoryWithChildrenItem; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 产品分类 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductCategoryServiceImpl extends ServiceImpl implements IPmsProductCategoryService { - - @Resource - private PmsProductCategoryMapper categoryMapper; - @Resource - private PmsProductMapper productMapper; - @Resource - private IPmsProductCategoryAttributeRelationService pmsProductCategoryAttributeRelationService; - @Resource - private PmsProductCategoryAttributeRelationMapper productCategoryAttributeRelationMapper; - - @Override - public List listWithChildren() { - return categoryMapper.listWithChildren(); - } - - @Override - public int updateNavStatus(List ids, Integer navStatus) { - PmsProductCategory productCategory = new PmsProductCategory(); - productCategory.setNavStatus(navStatus); - return categoryMapper.update(productCategory, new QueryWrapper().in("id", ids)); - } - - @Override - public int updateShowStatus(List ids, Integer showStatus) { - PmsProductCategory productCategory = new PmsProductCategory(); -// productCategory.setShowStatus(showStatus); - return categoryMapper.update(productCategory, new QueryWrapper().in("id", ids)); - } - - @Override - public int updateIndexStatus(List ids, Integer indexStatus) { - PmsProductCategory productCategory = new PmsProductCategory(); - productCategory.setIndexStatus(indexStatus); - return categoryMapper.update(productCategory, new QueryWrapper().in("id", ids)); - } - - @Override - public boolean updateAnd(PmsProductCategory entity) { - PmsProductCategory productCategory = new PmsProductCategory(); - setCategoryLevel(entity); - //更新商品分类时要更新商品中的名称 - PmsProduct product = new PmsProduct(); - product.setProductCategoryName(entity.getName()); - - productMapper.update(product, new QueryWrapper().eq("product_category_id", entity.getId())); - //同时更新筛选属性的信息 - if (!CollectionUtils.isEmpty(entity.getProductAttributeIdList())) { - - productCategoryAttributeRelationMapper.delete(new QueryWrapper<>(new PmsProductCategoryAttributeRelation()).eq("product_category_id", entity.getId())); - insertRelationList(entity.getId(), entity.getProductAttributeIdList()); - } else { - productCategoryAttributeRelationMapper.delete(new QueryWrapper<>(new PmsProductCategoryAttributeRelation()).eq("product_category_id", entity.getId())); - - } - categoryMapper.updateById(entity); - return true; - } - - @Override - public boolean saveAnd(PmsProductCategory entity) { - PmsProductCategory productCategory = new PmsProductCategory(); - productCategory.setProductCount(0); - BeanUtils.copyProperties(entity, productCategory); - //没有父分类时为一级分类 - setCategoryLevel(productCategory); - int count = categoryMapper.insert(productCategory); - //创建筛选属性关联 - List productAttributeIdList = entity.getProductAttributeIdList(); - if (!CollectionUtils.isEmpty(productAttributeIdList)) { - insertRelationList(productCategory.getId(), productAttributeIdList); - } - return true; - } - - @Override - public int selectCountByNameAndLevel(Long parentId, String name) { - return baseMapper.selectCountByNameAndLevel(parentId,name); - } - - @Override - public int selectCountByNameAndLevelId(Long parentId, String name, Long id) { - return baseMapper.selectCountByNameAndLevelId(parentId,name,id); - } - - /** - * 批量插入商品分类与筛选属性关系表 - * - * @param productCategoryId 商品分类id - * @param productAttributeIdList 相关商品筛选属性id集合 - */ - private void insertRelationList(Long productCategoryId, List productAttributeIdList) { - List relationList = new ArrayList<>(); - for (Long productAttrId : productAttributeIdList) { - PmsProductCategoryAttributeRelation relation = new PmsProductCategoryAttributeRelation(); - relation.setProductAttributeId(productAttrId); - relation.setProductCategoryId(productCategoryId); - relationList.add(relation); - } - pmsProductCategoryAttributeRelationService.saveBatch(relationList); - } - - /** - * 根据分类的parentId设置分类的level - */ - private void setCategoryLevel(PmsProductCategory productCategory) { - //没有父分类时为一级分类 - if (productCategory.getParentId() == null || productCategory.getParentId() == 0) { - productCategory.setLevel(0); - } else { - //有父分类时选择根据父分类level设置 - PmsProductCategory parentCategory = categoryMapper.selectById(productCategory.getParentId()); - if (parentCategory != null) { - productCategory.setLevel(parentCategory.getLevel() + 1); - } else { - productCategory.setLevel(0); - } - } - } -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductConsultServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductConsultServiceImpl.java deleted file mode 100644 index 451b440..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductConsultServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductConsultService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductConsult; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductConsultMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 产品咨询表 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductConsultServiceImpl extends ServiceImpl implements IPmsProductConsultService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductFullReductionServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductFullReductionServiceImpl.java deleted file mode 100644 index 5e9f4f6..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductFullReductionServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductFullReductionService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductFullReduction; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductFullReductionMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 产品满减表(只针对同商品) 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductFullReductionServiceImpl extends ServiceImpl implements IPmsProductFullReductionService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductLadderServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductLadderServiceImpl.java deleted file mode 100644 index d70603c..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductLadderServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductLadderService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductLadder; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductLadderMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 产品阶梯价格表(只针对同商品) 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductLadderServiceImpl extends ServiceImpl implements IPmsProductLadderService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductOperateLogServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductOperateLogServiceImpl.java deleted file mode 100644 index 2dc19b0..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductOperateLogServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductOperateLogService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductOperateLog; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductOperateLogMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductOperateLogServiceImpl extends ServiceImpl implements IPmsProductOperateLogService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductServiceImpl.java deleted file mode 100644 index 9302538..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductServiceImpl.java +++ /dev/null @@ -1,403 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.api.lpkgoods.LpkGoods; -import com.yxt.ordermall.biz.lpkgoods.LpkGoodsService; -import com.yxt.ordermall.mallplus.biz.pms.service.*; -import com.yxt.ordermall.mallplus.biz.util.DateUtils; -import com.yxt.ordermall.mallplus.mbg.pms.entity.*; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.*; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductParam; -import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductResult; -import com.zscat.mallplus.utils.IdWorker; -import com.zscat.mallplus.utils.ValidatorUtils; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import javax.annotation.Resource; -import java.lang.reflect.Method; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; - -/** - *

- * 商品信息 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Slf4j -@Service -public class PmsProductServiceImpl extends ServiceImpl implements IPmsProductService { - - @Resource - private PmsProductMapper productMapper; - @Resource - private IPmsMemberPriceService memberPriceDao; - @Resource - private PmsMemberPriceMapper memberPriceMapper; - @Resource - private IPmsProductLadderService productLadderDao; - @Resource - private PmsProductLadderMapper productLadderMapper; - @Resource - private IPmsProductFullReductionService productFullReductionDao; - @Resource - private PmsProductFullReductionMapper productFullReductionMapper; - @Resource - private IPmsSkuStockService skuStockDao; - @Resource - private PmsSkuStockMapper skuStockMapper; - @Resource - private IPmsProductAttributeValueService productAttributeValueDao; - @Resource - private PmsProductAttributeValueMapper productAttributeValueMapper; -// @Resource -// private ICmsSubjectProductRelationService subjectProductRelationDao; - @Resource - private CmsSubjectProductRelationMapper subjectProductRelationMapper; -// @Resource -// private ICmsPrefrenceAreaProductRelationService prefrenceAreaProductRelationDao; - @Resource - private CmsPrefrenceAreaProductRelationMapper prefrenceAreaProductRelationMapper; - - @Resource - private PmsProductVertifyRecordMapper productVertifyRecordDao; - - @Resource - private PmsProductVertifyRecordMapper productVertifyRecordMapper; -// @Resource -// private RedisService redisService; - -// lpk_goods - @Resource - private LpkGoodsService lpkGoodsService; - @Override - public int create(PmsProductParam productParam) { - int count; - //创建商品 - PmsProduct product = productParam; - product.setCreateTime(new Date()); - product.setId(null); - //处理sku的编码 - handleSkuStockCode(productParam.getSkuStockList(), product); - if (ValidatorUtils.isEmpty(product.getProductSn())) { - product.setProductSn(IdWorker.getId() + ""); - } - if (ValidatorUtils.empty(product.getExpireTime())) { - product.setExpireTime(DateUtils.strToDate(DateUtils.addDay(new Date(), 5))); - } - if (ValidatorUtils.empty(product.getOriginalPrice())) { - product.setOriginalPrice(product.getPrice()); - } - if (ValidatorUtils.empty(product.getUnit())) { - product.setUnit("件"); - } -// SysUser user = UserUtils.getCurrentMember(); -// product.setStoreName(user.getStoreName()); - //product.setStoreId(user.getStoreId()); - if (ValidatorUtils.empty(product.getAlbumPics())) { - product.setAlbumPics(product.getPic()); - } - /* Long[] tagList = productParam.getTagLists(); - String tags=null; - if(tagList!=null && tagList.length>0){ - for (Long tag:tagList){ - tags=tags+tag+","; - } - tags.substring(0,tags.length()-1); - } - product.setTags(tags);*/ - productMapper.insert(product); - //根据促销类型设置价格:、阶梯价格、满减价格 - Long productId = product.getId(); - //会员价格 - // relateAndInsertList(memberPriceDao, productParam.getMemberPriceList(), productId); - //阶梯价格 - // relateAndInsertList(productLadderDao, productParam.getProductLadderList(), productId); - //满减价格 - // relateAndInsertList(productFullReductionDao, productParam.getProductFullReductionList(), productId); - - //添加sku库存信息 - relateAndInsertList(skuStockDao, productParam.getSkuStockList(), productId); - //添加商品参数,添加自定义商品规格 - relateAndInsertList(productAttributeValueDao, productParam.getProductAttributeValueList(), productId); - //关联专题 - // relateAndInsertList(subjectProductRelationDao, productParam.getSubjectProductRelationList(), productId); - //关联优选 - // relateAndInsertList(prefrenceAreaProductRelationDao, productParam.getPrefrenceAreaProductRelationList(), productId); - //关联专题 - -// if (!CollectionUtils.isEmpty(productParam.getSubjectProductRelationList())) { -// for (CmsSubjectProductRelation relation : productParam.getSubjectProductRelationList()) { -// relation.setProductId(productId); -// subjectProductRelationDao.save(relation); -// } -// } -// //关联优选 -// if (!CollectionUtils.isEmpty(productParam.getPrefrenceAreaProductRelationList())) { -// for (CmsPrefrenceAreaProductRelation relation : productParam.getPrefrenceAreaProductRelationList()) { -// relation.setProductId(productId); -// prefrenceAreaProductRelationDao.save(relation); -// } -// } - count = 1; -// redisService.set(String.format(Rediskey.GOODSDETAIL, product.getId()), JsonUtil.objectToJson(productParam)); - return count; - } - - private void handleSkuStockCode(List skuStockList, PmsProduct product) { - if (CollectionUtils.isEmpty(skuStockList)) return; - int stock = 0; - for (int i = 0; i < skuStockList.size(); i++) { - PmsSkuStock skuStock = skuStockList.get(i); - skuStock.setProductName(product.getName()); - if (StringUtils.isEmpty(skuStock.getSkuCode())) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); - StringBuilder sb = new StringBuilder(); - //日期 - sb.append(sdf.format(new Date())); - //四位商品id - sb.append(String.format("%04d", product.getProductCategoryId())); - //三位索引id - sb.append(String.format("%03d", i + 1)); - skuStock.setSkuCode(sb.toString()); - } - if (skuStock.getStock() != null && skuStock.getStock() > 0) { - stock = stock + skuStock.getStock(); - - } - - } - product.setStock(stock); - } - - @Override - public PmsProductResult getUpdateInfo(Long id) { -// return productMapper.getUpdateInfo(id); - return productMapper.getUpdateInfoLiu1(id); - } - - @Override - public int update(Long id, PmsProductParam productParam) { - - int count; - //更新商品信息 - PmsProduct product = productParam; - product.setId(id); - if (ValidatorUtils.isEmpty(product.getProductSn())) { - product.setProductSn(IdWorker.getId() + ""); - } - handleSkuStockCode(productParam.getSkuStockList(), product); - /* Long[] tagList = productParam.getTagLists(); - String tags=null; - if(tagList!=null && tagList.length>0){ - for (Long tag:tagList){ - tags=tags+tag+","; - } - tags.substring(0,tags.length()-1); - } - product.setTags(tags);*/ - productMapper.updateById(product); -// redisService.remove(String.format(Rediskey.GOODSDETAIL, product.getId())); - //会员价格 - // memberPriceMapper.delete(new QueryWrapper<>(new PmsMemberPrice()).eq("product_id", id)); - // relateAndInsertList(memberPriceDao, productParam.getMemberPriceList(), id); - //阶梯价格 - - productLadderMapper.delete(new QueryWrapper<>(new PmsProductLadder()).eq("product_id", id)); - relateAndInsertList(productLadderDao, productParam.getProductLadderList(), id); - //满减价格 - - productFullReductionMapper.delete(new QueryWrapper<>(new PmsProductFullReduction()).eq("product_id", id)); - relateAndInsertList(productFullReductionDao, productParam.getProductFullReductionList(), id); - //修改sku库存信息 - skuStockMapper.delete(new QueryWrapper<>(new PmsSkuStock()).eq("product_id", id)); - - relateAndInsertList(skuStockDao, productParam.getSkuStockList(), id); - //修改商品参数,添加自定义商品规格 - - productAttributeValueMapper.delete(new QueryWrapper<>(new PmsProductAttributeValue()).eq("product_id", id)); - relateAndInsertList(productAttributeValueDao, productParam.getProductAttributeValueList(), id); - - //关联专题 - subjectProductRelationMapper.delete(new QueryWrapper<>(new CmsSubjectProductRelation()).eq("product_id", id)); - // relateAndInsertList(subjectProductRelationDao, productParam.getSubjectProductRelationList(), id); -// if (!CollectionUtils.isEmpty(productParam.getSubjectProductRelationList())) { -// for (CmsSubjectProductRelation relation : productParam.getSubjectProductRelationList()) { -// relation.setProductId(id); -// subjectProductRelationDao.save(relation); -// } -// } - //关联优选 - - prefrenceAreaProductRelationMapper.delete(new QueryWrapper<>(new CmsPrefrenceAreaProductRelation()).eq("product_id", id)); - // relateAndInsertList(prefrenceAreaProductRelationDao, productParam.getPrefrenceAreaProductRelationList(), id); -// if (!CollectionUtils.isEmpty(productParam.getPrefrenceAreaProductRelationList())) { -// for (CmsPrefrenceAreaProductRelation relation : productParam.getPrefrenceAreaProductRelationList()) { -// relation.setProductId(id); -// prefrenceAreaProductRelationDao.save(relation); -// } -// } - count = 1; - -// redisService.set(String.format(Rediskey.GOODSDETAIL, product.getId()), JsonUtil.objectToJson(productParam)); - return count; - } - - - @Override - public int updateVerifyStatus(Long ids, Integer verifyStatus, String detail) { - PmsProduct product = new PmsProduct(); - product.setVerifyStatus(verifyStatus); - int count = productMapper.update(product, new QueryWrapper().eq("id", ids)); - //修改完审核状态后插入审核记录 - - PmsProductVertifyRecord record = new PmsProductVertifyRecord(); - record.setProductId(ids); - record.setCreateTime(new Date()); - record.setDetail(detail); - record.setStatus(verifyStatus); -// record.setVertifyMan(UserUtils.getCurrentMember().getUsername()); - productVertifyRecordMapper.insert(record); -// redisService.remove(String.format(Rediskey.GOODSDETAIL, product.getId())); - return count; - } - - @Override - public int updateisFenxiao(List ids, Integer newStatus) { - PmsProduct record = new PmsProduct(); - record.setIsFenxiao(newStatus); - clerGoodsRedis(ids); - return productMapper.update(record, new QueryWrapper().in("id", ids)); - } - - @Override - public int updateisVip(List ids, Integer newStatus) { - PmsProduct record = new PmsProduct(); - record.setIsVip(newStatus); - clerGoodsRedis(ids); - return productMapper.update(record, new QueryWrapper().in("id", ids)); - } - - @Override - public int updatePublishStatus(List ids, Integer publishStatus) { - PmsProduct record = new PmsProduct(); - record.setPublishStatus(publishStatus); - clerGoodsRedis(ids); - return productMapper.update(record, new QueryWrapper().in("id", ids)); - } - - public void clerGoodsRedis(List ids) { - for (Long id : ids) { -// redisService.remove(String.format(Rediskey.GOODSDETAIL, id)); - } - } - - @Override - public int updateRecommendStatus(List ids, Integer recommendStatus) { - PmsProduct record = new PmsProduct(); - record.setRecommandStatus(recommendStatus); - clerGoodsRedis(ids); - return productMapper.update(record, new QueryWrapper().in("id", ids)); - } - - @Override - public int updateNewStatus(List ids, Integer newStatus) { - PmsProduct record = new PmsProduct(); - record.setNewStatus(newStatus); - clerGoodsRedis(ids); - return productMapper.update(record, new QueryWrapper().in("id", ids)); - } - - @Override - public int updateDeleteStatus(List ids, Integer deleteStatus) { - PmsProduct record = new PmsProduct(); - record.setDeleteStatus(deleteStatus); - clerGoodsRedis(ids); - return productMapper.update(record, new QueryWrapper().in("id", ids)); - } - - @Override - public List list(String keyword) { - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("delete_status", 1); - - if (!StringUtils.isEmpty(keyword)) { - queryWrapper.like("name", keyword); - - } - return productMapper.selectList(queryWrapper); - } - - @Override - public List listPmsProduct(String keyword) { -// QueryWrapper queryWrapper = new QueryWrapper(); -// queryWrapper.eq("delete_status", 1); -// -// if (!StringUtils.isEmpty(keyword)) { -// queryWrapper.like("name", keyword); -// -// } -// return productMapper.selectList(queryWrapper); - List l=new ArrayList<>(); - QueryWrapper queryWrapper = new QueryWrapper(); - if (!StringUtils.isEmpty(keyword)) { - queryWrapper.like("name", keyword); - } - List list = lpkGoodsService.list(queryWrapper); - for (int i = 0; i < list.size(); i++) { - LpkGoods o = list.get(i); - PmsProduct pp=new PmsProduct(); - pp.setName(o.getName()); - pp.setProductSn(o.getCode()); - pp.setId(Long.valueOf(o.getId())); - l.add(pp); - } - return l; - } - - @Override - public List getProductVertifyRecord(Long id) { - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("product_id", id); - - return productVertifyRecordMapper.selectList(queryWrapper); - } - - - /** - * 建立和插入关系表操作 - * - * @param dao 可以操作的dao - * @param dataList 要插入的数据 - * @param productId 建立关系的id - */ - private void relateAndInsertList(Object dao, List dataList, Long productId) { - try { - if (CollectionUtils.isEmpty(dataList)) return; - for (Object item : dataList) { - Method setId = item.getClass().getMethod("setId", Long.class); - setId.invoke(item, (Long) null); - Method setProductId = item.getClass().getMethod("setProductId", Long.class); - setProductId.invoke(item, productId); - } - Method insertList = dao.getClass().getMethod("saveBatch", Collection.class); - insertList.invoke(dao, dataList); - } catch (Exception e) { - - log.warn("创建产品出错:{}", e.getMessage()); - throw new RuntimeException(e.getMessage()); - } - } - -} - - diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductVertifyRecordServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductVertifyRecordServiceImpl.java deleted file mode 100644 index 090bec4..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsProductVertifyRecordServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductVertifyRecordService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductVertifyRecord; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsProductVertifyRecordMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 商品审核记录 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsProductVertifyRecordServiceImpl extends ServiceImpl implements IPmsProductVertifyRecordService { - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsSkuStockServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsSkuStockServiceImpl.java deleted file mode 100644 index 0f0014b..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsSkuStockServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsSkuStockService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsSkuStock; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsSkuStockMapper; -import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; - -import javax.annotation.Resource; -import java.util.List; - -/** - *

- * sku的库存 服务实现类 - *

- * - * @author zscat - * @since 2019-04-19 - */ -@Service -public class PmsSkuStockServiceImpl extends ServiceImpl implements IPmsSkuStockService { - @Resource - private PmsSkuStockMapper skuStockMapper; - - - @Override - public List getList(Long pid, String keyword) { - QueryWrapper q = new QueryWrapper(); - q.eq("product_id", pid); - - if (!StringUtils.isEmpty(keyword)) { - q.like("sku_code", keyword); - } - return skuStockMapper.selectList(q); - } - - @Override - public int update(Long pid, List skuStockList) { - return skuStockMapper.replaceList(skuStockList); - } - -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsSmallNaviconCategoryServiceImpl.java b/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsSmallNaviconCategoryServiceImpl.java deleted file mode 100644 index da36277..0000000 --- a/ordermall/src/main/java/com/yxt/ordermall/mallplus/biz/pms/service/impl/PmsSmallNaviconCategoryServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yxt.ordermall.mallplus.biz.pms.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yxt.ordermall.mallplus.biz.pms.service.IPmsSmallNaviconCategoryService; -import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsSmallNaviconCategory; -import com.yxt.ordermall.mallplus.mbg.pms.mapper.PmsSmallNaviconCategoryMapper; -import org.springframework.stereotype.Service; - -/** - *

- * 服务实现类 - *

- * - * @author zscat - * @since 2019-04-14 - */ -@Service -public class PmsSmallNaviconCategoryServiceImpl extends ServiceImpl implements IPmsSmallNaviconCategoryService { -} diff --git a/ordermall/src/main/java/com/yxt/ordermall/utils/OrgPathQuery.java b/ordermall/src/main/java/com/yxt/ordermall/utils/OrgPathQuery.java index 2e02a42..ff8ef23 100644 --- a/ordermall/src/main/java/com/yxt/ordermall/utils/OrgPathQuery.java +++ b/ordermall/src/main/java/com/yxt/ordermall/utils/OrgPathQuery.java @@ -11,4 +11,5 @@ import lombok.Data; public class OrgPathQuery { private String orgPath; private String userOrgSid; + private String name; } diff --git a/ordermall/src/main/java/com/yxt/ordermall/utils/TrustEveryone.java b/ordermall/src/main/java/com/yxt/ordermall/utils/TrustEveryone.java new file mode 100644 index 0000000..f7a6a0b --- /dev/null +++ b/ordermall/src/main/java/com/yxt/ordermall/utils/TrustEveryone.java @@ -0,0 +1,76 @@ +package com.yxt.ordermall.utils; + +import javax.net.ssl.*; +import java.security.SecureRandom; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.security.cert.X509Certificate; + +/** + * @author wangpengfei + * @date 2024/12/16 15:27 + */ +public class TrustEveryone { + public static void trustEveryone() { + + try { + HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { + public boolean verify(String hostname, SSLSession session) { + return true; + } + }); + + SSLContext context = SSLContext.getInstance("TLS"); + context.init(null, new X509TrustManager[]{new X509TrustManager() { + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { + } + + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { + } + + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + }}, new SecureRandom()); + HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + public static void disableCertificateValidation() { + try { + // 创建一个信任所有证书的 TrustManager + TrustManager[] trustAllCerts = new TrustManager[]{ + new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + public void checkClientTrusted(X509Certificate[] certs, String authType) { + } + + public void checkServerTrusted(X509Certificate[] certs, String authType) { + } + } + }; + + // 初始化 SSLContext + SSLContext sc = SSLContext.getInstance("SSL"); + sc.init(null, trustAllCerts, new java.security.SecureRandom()); + + // 设置默认的 SSLSocketFactory + HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); + + // 设置默认的 HostnameVerifier + HttpsURLConnection.setDefaultHostnameVerifier((hostname, session) -> true); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/ordermallGateway/src/main/java/com/yxt/ordermall/AuthFilter.java b/ordermallGateway/src/main/java/com/yxt/ordermall/AuthFilter.java index 47f73db..3e88636 100644 --- a/ordermallGateway/src/main/java/com/yxt/ordermall/AuthFilter.java +++ b/ordermallGateway/src/main/java/com/yxt/ordermall/AuthFilter.java @@ -1,128 +1,128 @@ package com.yxt.ordermall;//package com.yxt.wms; -// -//import com.alibaba.fastjson.JSON; -//import com.yxt.wms.utils.*; -//import org.reactivestreams.Publisher; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.cloud.gateway.filter.GatewayFilterChain; -//import org.springframework.cloud.gateway.filter.GlobalFilter; -//import org.springframework.core.Ordered; -//import org.springframework.core.io.buffer.DataBuffer; -//import org.springframework.core.io.buffer.DataBufferFactory; -//import org.springframework.core.io.buffer.DataBufferUtils; -//import org.springframework.http.HttpStatus; -//import org.springframework.http.MediaType; -//import org.springframework.http.server.reactive.ServerHttpRequest; -//import org.springframework.http.server.reactive.ServerHttpResponse; -//import org.springframework.stereotype.Component; -//import org.springframework.util.MultiValueMap; -//import org.springframework.web.server.ServerWebExchange; -//import reactor.core.publisher.Mono; -// -//import static com.yxt.wms.utils.HttpStatus.OVERDUE; -// -///** -// * @author dimengzhe -// * @date 2020/12/2 9:52 -// * @description 网关鉴权 -// * 1.某些接口不需要不进行登录验证,如登录,注册,获取验证码等接口。(uri白名单) -// * 2.某些接口需要登录验证,但是不需要刷新token有效时间,如客户端轮询请求的接口。 -// * 3.特定场景下IP黑、白名单。 -// * 4.处于安全考虑的接口流量控制。 -// */ -//@Component -//public class AuthFilter implements GlobalFilter, Ordered { -// -// private static final Logger log = LoggerFactory.getLogger(AuthFilter.class); -// //过期时间设置为4小时 -// private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 60; -// private final static long EXPIRE_TIME_APP = Constants.TOKEN_EXPIRE_APP * 60; -// -// // 排除过滤的 uri 地址,nacos自行添加 -// @Autowired -// private IgnoreWhiteProperties ignoreWhite; -// @Autowired -// private RedisUtil redisUtil; -// /* -// redis中数据存储结构为两个键值对 -// 键为用户ID,值为用户token,可以通过用户ID查询用户token,实现立刻失效用户token功能。 -// 键为用户token,值为用户数据,实现token有效性,用户数据缓存功能。 -// */ -// -// @Override -// public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { -// String url = exchange.getRequest().getURI().getPath(); -// //1.uri白名单。 跳过不需要验证的路径 -// if (StringUtils.matches(url, ignoreWhite.getWhites())) { -// return chain.filter(exchange); -// } else if (StringUtils.matchesTwo(url, ignoreWhite.getWhitesTwo())) { -// return chain.filter(exchange); + +import com.alibaba.fastjson.JSON; +import com.yxt.ordermall.utils.*; +import org.reactivestreams.Publisher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.gateway.filter.GatewayFilterChain; +import org.springframework.cloud.gateway.filter.GlobalFilter; +import org.springframework.core.Ordered; +import org.springframework.core.io.buffer.DataBuffer; +import org.springframework.core.io.buffer.DataBufferFactory; +import org.springframework.core.io.buffer.DataBufferUtils; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.http.server.reactive.ServerHttpResponse; +import org.springframework.stereotype.Component; +import org.springframework.util.MultiValueMap; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +import static com.yxt.ordermall.utils.HttpStatus.OVERDUE; + +/** + * @author dimengzhe + * @date 2020/12/2 9:52 + * @description 网关鉴权 + * 1.某些接口不需要不进行登录验证,如登录,注册,获取验证码等接口。(uri白名单) + * 2.某些接口需要登录验证,但是不需要刷新token有效时间,如客户端轮询请求的接口。 + * 3.特定场景下IP黑、白名单。 + * 4.处于安全考虑的接口流量控制。 + */ +@Component +public class AuthFilter implements GlobalFilter, Ordered { + + private static final Logger log = LoggerFactory.getLogger(AuthFilter.class); + //过期时间设置为4小时 + private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 60; + private final static long EXPIRE_TIME_APP = Constants.TOKEN_EXPIRE_APP * 60; + + // 排除过滤的 uri 地址,nacos自行添加 + @Autowired + private IgnoreWhiteProperties ignoreWhite; + @Autowired + private RedisUtil redisUtil; + /* + redis中数据存储结构为两个键值对 + 键为用户ID,值为用户token,可以通过用户ID查询用户token,实现立刻失效用户token功能。 + 键为用户token,值为用户数据,实现token有效性,用户数据缓存功能。 + */ + + @Override + public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { + String url = exchange.getRequest().getURI().getPath(); + //1.uri白名单。 跳过不需要验证的路径 + if (StringUtils.matches(url, ignoreWhite.getWhites())) { + return chain.filter(exchange); + } else if (StringUtils.matchesTwo(url, ignoreWhite.getWhitesTwo())) { + return chain.filter(exchange); + } + //2.验证有无令牌。 从请求的header中获取token + String token = getToken(exchange.getRequest()); + if (StringUtils.isBlank(token)) { + return setUnauthorizedResponse(exchange, "令牌不能为空"); + } + //3.验证token是否有效。(a.验证token是否合法 b.验证token是否过期) + //从redis缓存中获取key对应的内容 + String userName = redisUtil.get(token); + + if (StringUtils.isBlank(userName)) { + + return setUnauthorizedResponse(exchange, "登录状态已过期"); + } + //验签:需要验证token中的签名是否与用户sid一致,后台用密钥+userSid+token除签名以外的内容,重新生成签名,与token中的签名进行比较 + + //刷新token过期日期 + if (token.contains("App")) { + redisUtil.expire(token, EXPIRE_TIME_APP); + } else { + redisUtil.expire(token, EXPIRE_TIME); + } + + // 在请求中增加用户信息 + ServerHttpRequest mutableReq = exchange.getRequest().mutate() + .header(CacheConstants.DETAILS_USERNAME, userName).build(); + ServerWebExchange mutableExchange = exchange.mutate().request(mutableReq).build(); + return chain.filter(mutableExchange); + } + + /** + * 鉴权异常处理 + * + * @param exchange + * @param msg + * @return + */ + private Mono setUnauthorizedResponse(ServerWebExchange exchange, String msg) { + ServerHttpResponse response = exchange.getResponse(); + response.getHeaders().setContentType(MediaType.APPLICATION_JSON); + response.setStatusCode(HttpStatus.OK); + + log.error("[鉴权异常处理]请求路径:{}", exchange.getRequest().getPath()); + + return response.writeWith(Mono.fromSupplier(() -> { + DataBufferFactory bufferFactory = response.bufferFactory(); +// return bufferFactory.wrap(JSON.toJSONBytes(com.yxt.anrui.utils.HttpStatus.OVERDUE)); + return bufferFactory.wrap(JSON.toJSONBytes(ResultBean.fireFail().setCode(OVERDUE).setMsg(msg))); + })); + } + + /** + * 获取请求token + */ + private String getToken(ServerHttpRequest request) { + String token = request.getHeaders().getFirst(CacheConstants.HEADER); +// if (StringUtils.isNotEmpty(token) && token.startsWith(CacheConstants.TOKEN_PREFIX)) { +// token = token.replace(CacheConstants.TOKEN_PREFIX, ""); // } -// //2.验证有无令牌。 从请求的header中获取token -// String token = getToken(exchange.getRequest()); -// if (StringUtils.isBlank(token)) { -// return setUnauthorizedResponse(exchange, "令牌不能为空"); -// } -// //3.验证token是否有效。(a.验证token是否合法 b.验证token是否过期) -// //从redis缓存中获取key对应的内容 -// String userName = redisUtil.get(token); -// -// if (StringUtils.isBlank(userName)) { -// -// return setUnauthorizedResponse(exchange, "登录状态已过期"); -// } -// //验签:需要验证token中的签名是否与用户sid一致,后台用密钥+userSid+token除签名以外的内容,重新生成签名,与token中的签名进行比较 -// -// //刷新token过期日期 -// if (token.contains("App")) { -// redisUtil.expire(token, EXPIRE_TIME_APP); -// } else { -// redisUtil.expire(token, EXPIRE_TIME); -// } -// -// // 在请求中增加用户信息 -// ServerHttpRequest mutableReq = exchange.getRequest().mutate() -// .header(CacheConstants.DETAILS_USERNAME, userName).build(); -// ServerWebExchange mutableExchange = exchange.mutate().request(mutableReq).build(); -// return chain.filter(mutableExchange); -// } -// -// /** -// * 鉴权异常处理 -// * -// * @param exchange -// * @param msg -// * @return -// */ -// private Mono setUnauthorizedResponse(ServerWebExchange exchange, String msg) { -// ServerHttpResponse response = exchange.getResponse(); -// response.getHeaders().setContentType(MediaType.APPLICATION_JSON); -// response.setStatusCode(HttpStatus.OK); -// -// log.error("[鉴权异常处理]请求路径:{}", exchange.getRequest().getPath()); -// -// return response.writeWith(Mono.fromSupplier(() -> { -// DataBufferFactory bufferFactory = response.bufferFactory(); -//// return bufferFactory.wrap(JSON.toJSONBytes(com.yxt.anrui.utils.HttpStatus.OVERDUE)); -// return bufferFactory.wrap(JSON.toJSONBytes(ResultBean.fireFail().setCode(OVERDUE).setMsg(msg))); -// })); -// } -// -// /** -// * 获取请求token -// */ -// private String getToken(ServerHttpRequest request) { -// String token = request.getHeaders().getFirst(CacheConstants.HEADER); -//// if (StringUtils.isNotEmpty(token) && token.startsWith(CacheConstants.TOKEN_PREFIX)) { -//// token = token.replace(CacheConstants.TOKEN_PREFIX, ""); -//// } -// return token; -// } -// -// @Override -// public int getOrder() { -// return 0; -// } -//} + return token; + } + + @Override + public int getOrder() { + return 0; + } +}