12.19
This commit is contained in:
@@ -32,4 +32,5 @@ public class LpkStore {
|
||||
private String picUrl;
|
||||
private String lonAndLat;
|
||||
private String bankSid;
|
||||
private String warehouseSid;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -13,4 +13,6 @@ import lombok.Data;
|
||||
public class LpkStoreQuery implements Query {
|
||||
private String name;
|
||||
private String sort;
|
||||
private String orgPath;
|
||||
private String userOrgSid;
|
||||
}
|
||||
|
||||
@@ -29,4 +29,6 @@ public class LpkStoreVo implements Vo {
|
||||
private String lonAndLat;
|
||||
private String bankName;
|
||||
private String bankSid;
|
||||
private String picUrl;
|
||||
private String warehouseSid;
|
||||
}
|
||||
|
||||
@@ -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<SmsOrderRock> houseRock = new ArrayList<>();
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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(仓库) <br/>
|
||||
* File: omsWarehouseInfoVo.java <br/>
|
||||
* Class: com.yxt.oms.api.omswarehouseinfo.omsWarehouseInfoVo <br/>
|
||||
* Description: 仓库 视图数据对象. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2024-04-09 14:35:56 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "仓库 视图数据详情", description = "仓库 视图数据详情")
|
||||
public class WarehouseInfoAllVo implements Vo {
|
||||
|
||||
private String sid;
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
}
|
||||
@@ -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<omsWarehouseExtendDto> omsWarehouseExtendDtos;
|
||||
private WarehouseExtendDto omsWarehouseExtendDto;
|
||||
private String userSid; //登录用户sid
|
||||
private String orgPath; //组织全路径
|
||||
}
|
||||
@@ -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;//下标
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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<WarehouseExtendVo> wmsWarehouseExtendVos;
|
||||
}
|
||||
@@ -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<Long> 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<Long> 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<Long> 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<Long> 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<Long> 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<Long> 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<List<BrandVo>> getList(){
|
||||
return IPmsBrandService.getList();
|
||||
}
|
||||
// @ApiOperation(value = "获取品牌")
|
||||
// @GetMapping("/getList")
|
||||
// ResultBean<List<BrandVo>> getList(){
|
||||
// return IPmsBrandService.getList();
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -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<Long> 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<Long> 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<PmsProductCategoryWithChildrenItem> list = IPmsProductCategoryService.listWithChildren();
|
||||
return new CommonResult().success(list);
|
||||
}
|
||||
// @ApiOperation("查询所有一级分类及子分类")
|
||||
// @RequestMapping(value = "/list/withChildren", method = RequestMethod.GET)
|
||||
// @ResponseBody
|
||||
// public Object listWithChildren() {
|
||||
// List<PmsProductCategoryWithChildrenItem> 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<Long> 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();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<select id="getStoreBySid" resultType="com.yxt.ordermall.api.customerstore.CustomerStoreVo">
|
||||
select s.storeSid, s.name ,s.phone,t.name as storeName,t.address ,t.businessHours from customer_store s left join lpk_store t on s.storeSid=t.sid
|
||||
select s.storeSid, s.name ,s.phone,t.name as storeName,t.address ,t.businessHours from customer_store s left join lpk_store t on s.storeSid=t.warehouseSid
|
||||
where customerSid=#{customerSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -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 MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
ShoppingCartService shoppingCartService;
|
||||
@Autowired
|
||||
private com.yxt.ordermall.mallplus.biz.pms.service.IPmsBrandService IPmsBrandService;
|
||||
|
||||
@Autowired
|
||||
LpkCustomerService lpkCustomerService;
|
||||
@Autowired
|
||||
@@ -177,17 +172,18 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
return listResultBean;
|
||||
}
|
||||
List<BaseGoodsSku>skus= listResultBean.getData();
|
||||
|
||||
baseMapper.delete(new QueryWrapper<LpkGoods>().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<LpkGoods>().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<LpkGoodsMapper, LpkGoods
|
||||
GoodsTypeVo vo=new GoodsTypeVo();
|
||||
ResultBean<List<BaseGoodsTypeVo>> listResultBean = baseGoodsTypeFeign.listAll(query);
|
||||
List<GoodsTypeVo> 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<LpkGoodsMapper, LpkGoods
|
||||
list.add(0,vo1);
|
||||
vo.setTypeVos(list);
|
||||
ResultBean<List<BaseBrandInfoVo>> listResultBean1 = baseBrandInfoFeign.listAll(query);
|
||||
if(!listResultBean.getCode().equals("200")){
|
||||
rb.setCode(listResultBean.getCode());
|
||||
rb.setMsg(listResultBean.getMsg());
|
||||
return rb;
|
||||
}
|
||||
List<BrandVo> list1= new ArrayList<>();
|
||||
for (BaseBrandInfoVo datum : listResultBean1.getData()) {
|
||||
BrandVo vo2=new BrandVo();
|
||||
@@ -542,10 +548,10 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
giftBagGoodss1.setUnitName(datum.getGoodsUnitName());
|
||||
giftBagGoodss1.setPrice(datum.getSalesPrice());
|
||||
giftBagGoodss1.setJPrice(datum.getSalesPrice());
|
||||
// if(StringUtils.isNotBlank(datum.getPicUrl())){
|
||||
// String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
// giftBagGoodss1.setIconUrl(urlPrefix+datum.getPicUrl());
|
||||
// }
|
||||
if(StringUtils.isNotBlank(datum.getPicUrl())){
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
giftBagGoodss1.setIconUrl(urlPrefix+datum.getPicUrl());
|
||||
}
|
||||
giftBagGoodss1.setSpecificationUnit(datum.getSPackUnit());
|
||||
giftBagGoodss1.setRemark(datum.getGoodsExplain());
|
||||
giftBagGoodss1.setRemarks(datum.getIndexes());
|
||||
@@ -568,9 +574,6 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
return listResultBean;
|
||||
}
|
||||
List<ShoppingCartVo> 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<LpkGoodsMapper, LpkGoods
|
||||
if(StringUtils.isBlank(brandId)){
|
||||
return rb.setMsg("参数不全");
|
||||
}
|
||||
PmsBrand pmsBrand=IPmsBrandService.getById(brandId);
|
||||
// PmsBrand pmsBrand=IPmsBrandService.getById(brandId);
|
||||
PmsBrand pmsBrand=new PmsBrand();
|
||||
if(pmsBrand==null){
|
||||
return rb.success();
|
||||
}else{
|
||||
|
||||
@@ -43,6 +43,6 @@
|
||||
bk.name as bankName,bk.sid as bankSid
|
||||
from lpk_store st left join lpk_bank bk on bk.sid =st.bankSid
|
||||
where
|
||||
st.sid=#{sid}
|
||||
st.warehouseSid=#{sid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -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<PagerVo<LpkStoreVo>> storeListPage(@RequestBody PagerQuery<LpkStoreQuery> pq) {
|
||||
public ResultBean<PagerVo<LpkStoreVo>> storeListPage(@RequestBody PagerQuery<WarehouseInfoQuery> 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")
|
||||
|
||||
@@ -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<LpkStoreMapper, LpkStore> {
|
||||
|
||||
public ResultBean<PagerVo<LpkStoreVo>> storeListPage(PagerQuery<LpkStoreQuery> pq) {
|
||||
@Autowired
|
||||
WarehouseInfoFeign warehouseInfoFeign;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
CommonMethod commonMethod;
|
||||
public ResultBean<PagerVo<LpkStoreVo>> storeListPage(PagerQuery<WarehouseInfoQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkStoreQuery query = pq.getParams();
|
||||
QueryWrapper<LpkStore> 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<PagerVo<WarehouseInfoVo>> pagerVoResultBean = warehouseInfoFeign.listPage(pq);
|
||||
if(!pagerVoResultBean.getCode().equals("200")){
|
||||
rb.setMsg(pagerVoResultBean.getMsg());
|
||||
return rb;
|
||||
}
|
||||
qw.orderByAsc("st.sort");
|
||||
qw.orderByDesc("createTime");
|
||||
IPage<LpkStore> page = PagerUtil.queryToPage(pq);
|
||||
IPage<LpkStoreVo> pagging = baseMapper.storeListPage(page, qw);
|
||||
PagerVo<LpkStoreVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
List<LpkStoreVo> brands=new ArrayList<>();
|
||||
for (WarehouseInfoVo record : pagerVoResultBean.getData().getRecords()) {
|
||||
LpkStore lpkStore1 = baseMapper.selectOne(new QueryWrapper<LpkStore>().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);
|
||||
}
|
||||
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<WarehouseInfo> 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<LpkStore>().eq("warehouseSid",dto.getSid()));
|
||||
BeanUtil.copyProperties(dto, entity, "id", "sid");
|
||||
baseMapper.updateById(entity);
|
||||
} else {
|
||||
@@ -56,7 +120,26 @@ public class LpkStoreService extends MybatisBaseService<LpkStoreMapper, LpkStore
|
||||
|
||||
public ResultBean<LpkStoreDetailsVo> storeInit(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
ResultBean<WarehouseInfoVo> 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<LpkStoreMapper, LpkStore
|
||||
List<StoreSelect> vos = baseMapper.getAllStore();
|
||||
return rb.success().setData(vos);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public ResultBean<List<StoreSelect>> getAllStore(OrgPathQuery query) {
|
||||
ResultBean rb = new ResultBean();
|
||||
ResultBean<List<WarehouseInfo>> listResultBean = warehouseInfoFeign.listAll(query);
|
||||
if(!listResultBean.getCode().equals("200")){
|
||||
rb.setMsg(listResultBean.getMsg());
|
||||
return rb.fail();
|
||||
}
|
||||
List<StoreSelect> 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<List<LpkStoreVo>> getAllStoreByQuery(LpkStoreQuery query) {
|
||||
ResultBean rb = new ResultBean();
|
||||
QueryWrapper<LpkStore> qw = new QueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.like("name", query.getName());
|
||||
|
||||
OrgPathQuery query1=new OrgPathQuery();
|
||||
query1.setOrgPath(query.getOrgPath());
|
||||
query1.setUserOrgSid(query.getUserOrgSid());
|
||||
query1.setName(query.getName());
|
||||
ResultBean<List<WarehouseInfo>> listResultBean = warehouseInfoFeign.listAll(query1);
|
||||
if(!listResultBean.getCode().equals("200")){
|
||||
rb.setMsg(listResultBean.getMsg());
|
||||
return rb.fail();
|
||||
}
|
||||
List<LpkStoreVo> vos=new ArrayList<>();
|
||||
QueryWrapper<LpkStore> qw = new QueryWrapper<>();
|
||||
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<LpkStoreVo> 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<LpkStore>().eq("warehouseSid",sid));
|
||||
lpkStore.setIsEnable(isEnable);
|
||||
int i = baseMapper.updateById(lpkStore);
|
||||
return rb.success().setMsg("修改成功");
|
||||
|
||||
@@ -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<OrdOrderMapper, OrdOrder> {
|
||||
|
||||
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<OrdOrderMapper, OrdOrder
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
LpkCustomerVo vo = lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData();
|
||||
Map<String, Object> sendBody = buildMessageBody(vo.getSid(), vo.getWxMpOpenid(), dto.getTotalTee(), dto.getOrdOrderDetailsVoList(), OrderUrl);
|
||||
ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class);
|
||||
TrustEveryone.trustEveryone();
|
||||
ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class);
|
||||
|
||||
ResultBean<PayOrderVo> rb1 = postForEntity.getBody();
|
||||
LinkedHashMap rb2 = (LinkedHashMap) postForEntity.getBody().getData();
|
||||
@@ -144,7 +146,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
result.setRemainder(String.valueOf(10 * 60));
|
||||
|
||||
PayUrl payUrl = new PayUrl();
|
||||
payUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/pay");
|
||||
payUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/pay");
|
||||
PayParams aVoid = new PayParams();
|
||||
aVoid.setMainSid(rb2.get("mainSid").toString());
|
||||
payUrl.setParams(aVoid);
|
||||
@@ -155,7 +157,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
orderUrl.setParams(orderParams);
|
||||
|
||||
TradeNoUrl tradeNoUrl = new TradeNoUrl();
|
||||
tradeNoUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/orderQuery");
|
||||
tradeNoUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/orderQuery");
|
||||
TradeParams tradeParams = new TradeParams();
|
||||
tradeParams.setMainSid(rb2.get("mainSid").toString());
|
||||
tradeNoUrl.setParams(tradeParams);
|
||||
@@ -209,7 +211,8 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
LpkCustomerVo vo = lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData();
|
||||
Map<String, Object> sendBody = buildMessageBody(vo.getSid(), vo.getWxMpOpenid(), dto.getTotalTee(), dto.getOrdOrderDetailsVoList(), or);
|
||||
ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class);
|
||||
TrustEveryone.trustEveryone();
|
||||
ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class);
|
||||
|
||||
ResultBean<PayOrderVo> rb1 = postForEntity.getBody();
|
||||
LinkedHashMap rb2 = (LinkedHashMap) postForEntity.getBody().getData();
|
||||
@@ -264,7 +267,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
result.setRemainder(String.valueOf(10 * 60));
|
||||
|
||||
PayUrl payUrl = new PayUrl();
|
||||
payUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/pay");
|
||||
payUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/pay");
|
||||
PayParams aVoid = new PayParams();
|
||||
aVoid.setMainSid(rb2.get("mainSid").toString());
|
||||
payUrl.setParams(aVoid);
|
||||
@@ -275,7 +278,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
orderUrl.setParams(orderParams);
|
||||
|
||||
TradeNoUrl tradeNoUrl = new TradeNoUrl();
|
||||
tradeNoUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/orderQuery");
|
||||
tradeNoUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/orderQuery");
|
||||
TradeParams tradeParams = new TradeParams();
|
||||
tradeParams.setMainSid(rb2.get("mainSid").toString());
|
||||
tradeNoUrl.setParams(tradeParams);
|
||||
@@ -440,7 +443,8 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
LpkCustomerVo vo = lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData();
|
||||
Map<String, Object> sendBody = buildMessageBody(vo.getSid(), vo.getWxMpOpenid(), dto.getTotalTee(), dto.getOrdOrderDetailsVoList(), or);
|
||||
ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class);
|
||||
TrustEveryone.trustEveryone();
|
||||
ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/order/createOrder", sendBody, ResultBean.class);
|
||||
|
||||
ResultBean<PayOrderVo> rb1 = postForEntity.getBody();
|
||||
LinkedHashMap rb2 = (LinkedHashMap) postForEntity.getBody().getData();
|
||||
@@ -491,7 +495,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
result.setRemainder(String.valueOf(10 * 60));
|
||||
|
||||
PayUrl payUrl = new PayUrl();
|
||||
payUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/pay");
|
||||
payUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/pay");
|
||||
PayParams aVoid = new PayParams();
|
||||
aVoid.setMainSid(rb2.get("mainSid").toString());
|
||||
payUrl.setParams(aVoid);
|
||||
@@ -502,7 +506,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
orderUrl.setParams(orderParams);
|
||||
|
||||
TradeNoUrl tradeNoUrl = new TradeNoUrl();
|
||||
tradeNoUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/orderQuery");
|
||||
tradeNoUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/orderQuery");
|
||||
TradeParams tradeParams = new TradeParams();
|
||||
tradeParams.setMainSid(rb2.get("mainSid").toString());
|
||||
tradeNoUrl.setParams(tradeParams);
|
||||
@@ -658,7 +662,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
result.setRemainder(String.valueOf(10 * 60));
|
||||
|
||||
PayUrl payUrl = new PayUrl();
|
||||
payUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/pay");
|
||||
payUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/pay");
|
||||
PayParams aVoid = new PayParams();
|
||||
aVoid.setMainSid(pagging.getMainSid());
|
||||
payUrl.setParams(aVoid);
|
||||
@@ -669,7 +673,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
orderUrl.setParams(orderParams);
|
||||
|
||||
TradeNoUrl tradeNoUrl = new TradeNoUrl();
|
||||
tradeNoUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/orderQuery");
|
||||
tradeNoUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/orderQuery");
|
||||
TradeParams tradeParams = new TradeParams();
|
||||
tradeParams.setMainSid(pagging.getMainSid());
|
||||
tradeNoUrl.setParams(tradeParams);
|
||||
@@ -727,7 +731,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
result.setRemainder(String.valueOf(10 * 60));
|
||||
|
||||
PayUrl payUrl = new PayUrl();
|
||||
payUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/pay");
|
||||
payUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/pay");
|
||||
PayParams aVoid = new PayParams();
|
||||
aVoid.setMainSid(pagging.getMainSid());
|
||||
payUrl.setParams(aVoid);
|
||||
@@ -738,7 +742,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
orderUrl.setParams(orderParams);
|
||||
|
||||
TradeNoUrl tradeNoUrl = new TradeNoUrl();
|
||||
tradeNoUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/orderQuery");
|
||||
tradeNoUrl.setUrl("https://ordermall.yxtsoft.com/wxPay/order/orderQuery");
|
||||
TradeParams tradeParams = new TradeParams();
|
||||
tradeParams.setMainSid(pagging.getMainSid());
|
||||
tradeNoUrl.setParams(tradeParams);
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.yxt.ordermall.biz.ordorder.OrdOrderService;
|
||||
import com.yxt.ordermall.biz.ordorderdetails.OrdOrderDetailService;
|
||||
import com.yxt.ordermall.biz.vegetablecellar.VegetableCellarService;
|
||||
import com.yxt.ordermall.feign.base.basegoodssku.BaseGoodsSkuFeign;
|
||||
import com.yxt.ordermall.utils.TrustEveryone;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -74,7 +75,8 @@ public class RefundOrderService extends MybatisBaseService<RefundOrderMapper, Re
|
||||
}
|
||||
|
||||
Map<String, Object> sendBody=buildMessageBody(orderDetail,dto.getReason());
|
||||
ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/refund/createRefundOrder", sendBody, ResultBean.class);
|
||||
TrustEveryone.trustEveryone();
|
||||
ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/refund/createRefundOrder", sendBody, ResultBean.class);
|
||||
// ResponseEntity<ResultBean> postForEntity = new RestTemplate().postForEntity("http://192.168.0.105:7777/refund/createRefundOrder", sendBody, ResultBean.class);
|
||||
ResultBean<RefundOrder> rb1 = postForEntity.getBody();
|
||||
LinkedHashMap rb2 = (LinkedHashMap) postForEntity.getBody().getData();
|
||||
@@ -93,7 +95,8 @@ public class RefundOrderService extends MybatisBaseService<RefundOrderMapper, Re
|
||||
refundOrder.setOrderSid(orderDetail.getSid());
|
||||
refundOrder.setCreateTime(new Date());
|
||||
baseMapper.insert(refundOrder);
|
||||
ResponseEntity<ResultBean> refundResponse = new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/refund/reviewRefund?orderSid="+orderDetail.getMainSid(), sendBody, ResultBean.class);
|
||||
TrustEveryone.trustEveryone();
|
||||
ResponseEntity<ResultBean> refundResponse = new RestTemplate().postForEntity("https://ordermall.yxtsoft.com/wxPay/refund/reviewRefund?orderSid="+orderDetail.getMainSid(), sendBody, ResultBean.class);
|
||||
// ResponseEntity<ResultBean> 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<RefundOrderMapper, Re
|
||||
mp_template_msg.put("name", orderDetail.getName());
|
||||
mp_template_msg.put("reason", reason);
|
||||
mp_template_msg.put("orderSid", orderDetail.getMainSid());
|
||||
mp_template_msg.put("returnUrl","https://supervise.yxtsoft.com/lpkapi/refund/isRefundBusiness");
|
||||
mp_template_msg.put("returnUrl","https://ordermall.yxtsoft.com/lpkapi/refund/isRefundBusiness");
|
||||
// https://supervise.yxtsoft.com/lpkapi/vegetablecellar/addGoods?mainSid=
|
||||
return mp_template_msg;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.yxt.ordermall.biz.func.basegoodssku.GoodsSkuDetailVo;
|
||||
import com.yxt.ordermall.biz.lpkcustomer.LpkCustomerService;
|
||||
import com.yxt.ordermall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.ordermall.feign.base.basegoodssku.BaseGoodsSkuFeign;
|
||||
import com.yxt.ordermall.mallplus.biz.pms.service.impl.PmsBrandServiceImpl;
|
||||
import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand;
|
||||
import com.yxt.ordermall.utils.DoubleUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -40,8 +39,7 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
|
||||
LpkCustomerService lpkCustomerService;
|
||||
@Autowired
|
||||
private LpkGoodsService lpkGoodsService;
|
||||
@Autowired
|
||||
PmsBrandServiceImpl pmsBrandService;
|
||||
|
||||
@Autowired
|
||||
BaseGoodsSkuFeign baseGoodsSkuFeign;
|
||||
|
||||
@@ -260,7 +258,8 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
|
||||
private ShoppingCartVo price(ShoppingCartVo vo) {
|
||||
double weight = Double.valueOf(vo.getTotalWeight());
|
||||
LpkCustomer lpkCustomer = lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid", vo.getCustomerSid()));
|
||||
PmsBrand one=pmsBrandService.getOne(new QueryWrapper<PmsBrand>().eq("id",vo.getAffiliation()));
|
||||
// PmsBrand one=pmsBrandService.getOne(new QueryWrapper<PmsBrand>().eq("id",vo.getAffiliation()));
|
||||
PmsBrand one=new PmsBrand();
|
||||
if(vo.getAffiliation().equals("1001045")){
|
||||
if (weight < one.getQssl()) {
|
||||
vo.setRemarks("不足"+one.getQssl()+"斤");
|
||||
|
||||
@@ -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
|
||||
<where>
|
||||
o.customerSid=#{query.customerSid} and state=#{query.state}
|
||||
</where>
|
||||
|
||||
@@ -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<VegeCellar
|
||||
VegetableCellarService vegetableCellarService;
|
||||
@Autowired
|
||||
BaseGoodsSkuFeign baseGoodsSkuFeign;
|
||||
@Autowired
|
||||
WarehouseInfoFeign warehouseInfoFeign;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean submission(VegeCellarReserveOrderDto dto) {
|
||||
@@ -82,14 +86,19 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
||||
return rb.setMsg("参数不全");
|
||||
}
|
||||
VegeCellarReserveOrder order = new VegeCellarReserveOrder();
|
||||
LpkStore lpkStore = lpkStoreService.getOne(new QueryWrapper<LpkStore>().eq("sid", dto.getStoreSid()));
|
||||
// LpkStore lpkStore = lpkStoreService.getOne(new QueryWrapper<LpkStore>().eq("sid", dto.getStoreSid()));
|
||||
ResultBean<WarehouseInfoVo> 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<VegeCellar
|
||||
VegetableCellarDto dto=new VegetableCellarDto();
|
||||
List<vegeVo> vos=new ArrayList<>();
|
||||
for (VegeCellarReserveDetails details:list){
|
||||
String brandId=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",details.getGoodsSid())).getBrandId().toString();
|
||||
String brandId=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("skuSid",details.getGoodsSid())).getBrandId().toString();
|
||||
vegeVo vo=new vegeVo();
|
||||
vo.setBrandId(brandId);
|
||||
vo.setGoodsSid(details.getGoodsSid());
|
||||
|
||||
@@ -156,11 +156,11 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
VegetableCellar vegetable=new VegetableCellar();
|
||||
vegetable.setAffiliation(detail.getBrandId());
|
||||
vegetable.setGoodsSid(detail.getGoodsSid());
|
||||
vegetable.setGoodsNumber(detail.getGoodsNumber());
|
||||
vegetable.setGoodsNumber(removeZeros((detail.getGoodsNumber())));
|
||||
vegetable.setCustomerSid(dto.getCustomerSid());
|
||||
baseMapper.insert(vegetable);
|
||||
}else{
|
||||
vegetableCellar.setGoodsNumber(String.valueOf(Double.valueOf(vegetableCellar.getGoodsNumber())+Double.valueOf(detail.getGoodsNumber())));
|
||||
vegetableCellar.setGoodsNumber(removeZeros(String.valueOf(Double.valueOf(vegetableCellar.getGoodsNumber())+Double.valueOf(detail.getGoodsNumber()))));
|
||||
baseMapper.updateById(vegetableCellar);
|
||||
}
|
||||
}
|
||||
@@ -190,11 +190,11 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
VegetableCellar vegetable=new VegetableCellar();
|
||||
vegetable.setAffiliation(String.valueOf(cl.getBrandId()));
|
||||
vegetable.setGoodsSid(detail.getGoodsSid());
|
||||
vegetable.setGoodsNumber(String.valueOf((int)detail.getGoodsNumber()));
|
||||
vegetable.setGoodsNumber(removeZeros(String.valueOf((int)detail.getGoodsNumber())));
|
||||
vegetable.setCustomerSid(dto.getCustomerSid());
|
||||
baseMapper.insert(vegetable);
|
||||
}else{
|
||||
vegetableCellar.setGoodsNumber(String.valueOf((int) (Double.valueOf(vegetableCellar.getGoodsNumber())+Double.valueOf(detail.getGoodsNumber()))));
|
||||
vegetableCellar.setGoodsNumber(removeZeros(String.valueOf((int) (Double.valueOf(vegetableCellar.getGoodsNumber())+Double.valueOf(detail.getGoodsNumber())))));
|
||||
baseMapper.updateById(vegetableCellar);
|
||||
}
|
||||
transferRecords.setState("2");
|
||||
@@ -204,5 +204,18 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
}
|
||||
return rb.success().setMsg("成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除多余.0
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String removeZeros(String num) {
|
||||
if (num.indexOf(".") > 0) {
|
||||
// 去掉多余的0
|
||||
num = num.replaceAll("0+?$", "");
|
||||
// 如果最后一位是. 则去掉
|
||||
num = num.replaceAll("[.]$", "");
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(门户建设) <br/>
|
||||
* File: SysRoleFeign.java <br/>
|
||||
* Class: com.yxt.anrui.portal.api.sysrole.SysRoleFeign <br/>
|
||||
* Description: 角色. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:29 <br/>
|
||||
*
|
||||
* @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<PagerVo<WarehouseInfoVo>> listPage(@RequestBody PagerQuery<WarehouseInfoQuery> pq);
|
||||
|
||||
@ApiOperation("保存修改")
|
||||
@PostMapping("/saveOrUpdate")
|
||||
public ResultBean<WarehouseInfo> saveOrUpdate(@RequestBody WarehouseInfoDto dto);
|
||||
|
||||
@ApiOperation("初始化")
|
||||
@GetMapping("/initialization/{sid}")
|
||||
public ResultBean<WarehouseInfoVo> 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<List<WarehouseInfoAllVo>> selectAll();
|
||||
@ApiOperation("订单选择仓库")
|
||||
@PostMapping("/getWareHouse")
|
||||
public ResultBean<List<SmsOrderHouseInfo>> getWareHouse(@RequestParam("createOrgSid") String createOrgSid);
|
||||
|
||||
@ApiOperation("查询所有的仓库")
|
||||
@PostMapping("/listAll")
|
||||
public ResultBean<List<WarehouseInfo>> listAll(@RequestBody OrgPathQuery query);
|
||||
|
||||
@PostMapping("/list")
|
||||
public ResultBean<List<WarehouseInfo>> list(@RequestBody WarehouseInfoMapQuery query);
|
||||
}
|
||||
@@ -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(门户建设) <br/>
|
||||
* File: SysRoleFeignFallback.java <br/>
|
||||
* Class: com.yxt.anrui.portal.api.sysrole.SysRoleFeignFallback <br/>
|
||||
* Description: 角色. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:29 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Component
|
||||
public class WarehouseInfoFeignFallback implements WarehouseInfoFeign {
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<PagerVo<WarehouseInfoVo>> listPage(PagerQuery<WarehouseInfoQuery> pq) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<WarehouseInfo> saveOrUpdate(WarehouseInfoDto dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<WarehouseInfoVo> 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<List<WarehouseInfoAllVo>> selectAll() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<SmsOrderHouseInfo>> getWareHouse(String createOrgSid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WarehouseInfo>> listAll(OrgPathQuery query) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<WarehouseInfo>> list(WarehouseInfoMapQuery query) {
|
||||
return 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;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsAlbum>(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<Long> ids) {
|
||||
boolean count = IPmsAlbumService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 画册图片表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsAlbumPic>(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<Long> ids) {
|
||||
boolean count = IPmsAlbumPicService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品评价表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsComment>(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<Long> ids) {
|
||||
boolean count = IPmsCommentService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品评价回复表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsCommentReplay>(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<Long> ids) {
|
||||
boolean count = IPmsCommentReplayService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运费模版
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsFeightTemplate>(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<Long> ids) {
|
||||
boolean count = IPmsFeightTemplateService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 帮助分类表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsGiftsCategory>(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<Long> ids) {
|
||||
boolean count = IPmsGiftsCategoryService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 帮助表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsGifts>(pageNum, pageSize), new QueryWrapper<PmsGifts>(new PmsGifts()).like("title", entity.getTitle())));
|
||||
}
|
||||
return new CommonResult().success(IPmsGiftsService.page(new Page<PmsGifts>(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<Long> 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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品会员价格表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsMemberPrice>(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<Long> ids) {
|
||||
boolean count = IPmsMemberPriceService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品属性分类表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductAttributeCategory>(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<EsShopGoodsGroupMap> list = shopGoodsGroupMapMapper.selEsShopGoodsGroupMap(coupon.getId());
|
||||
List<PmsProduct> lists = new ArrayList<PmsProduct>();
|
||||
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<Long> 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<PmsProductAttributeCategoryItem> productAttributeCategoryResultList = IPmsProductAttributeCategoryService.getListWithAttr();
|
||||
return new CommonResult().success(productAttributeCategoryResultList);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品属性参数表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductAttribute>(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<PmsProductAttribute>(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<Long> 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<ProductAttrInfo> productAttrInfoList = IPmsProductAttributeService.getProductAttrInfo(productCategoryId);
|
||||
return new CommonResult().success(productAttrInfoList);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储产品参数信息的表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductAttributeValue>(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<Long> ids) {
|
||||
boolean count = IPmsProductAttributeValueService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductCategoryAttributeRelation>(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<Long> ids) {
|
||||
boolean count = IPmsProductCategoryAttributeRelationService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品分类
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductCategory>(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<PmsProductCategory>(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<Long> 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<PmsProductCategoryWithChildrenItem> 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<Long> 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();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品咨询表
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductConsult>(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<Long> ids) {
|
||||
boolean count = IPmsProductConsultService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品信息
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProduct> 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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else {
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else if (entity.getStatus() == 2) {
|
||||
entity.setDeleteStatus(1);
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else if (entity.getStatus() == 4) {
|
||||
entity.setDeleteStatus(0);
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else {
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct> 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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else {
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else if (entity.getStatus() == 2) {
|
||||
entity.setDeleteStatus(1);
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else if (entity.getStatus() == 4) {
|
||||
entity.setDeleteStatus(1);
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else {
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
}
|
||||
|
||||
}
|
||||
if (page.getRecords()!=null && page.getRecords().size()>0){
|
||||
for (PmsProduct product : page.getRecords()) {
|
||||
List<PmsSkuStock> skuStockList = skuStockService.list(new QueryWrapper<PmsSkuStock>().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<PmsProduct> productList = IPmsProductService.list(keyword);
|
||||
return new CommonResult().success(productList);
|
||||
}
|
||||
@ApiOperation("根据商品名称或货号模糊查询")
|
||||
@RequestMapping(value = "/simpleProductList", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Object listPmsProduct(String keyword) {
|
||||
List<PmsProduct> 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<UmsMemberTag> tagList = IUmsMemberTagService.list(new QueryWrapper<UmsMemberTag>().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<Long> 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<UmsMemberTag> tagList = IUmsMemberTagService.list(new QueryWrapper<UmsMemberTag>().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<PmsProductVertifyRecord> 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<Long> 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<Long> 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<Long> 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<Long> 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<Long> 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<Long> 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<PmsProduct> 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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
like("name", entity.getKeyword()).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else {
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else if (entity.getStatus() == 2) {
|
||||
entity.setDeleteStatus(1);
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
gt("stock", 0).orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else if (entity.getStatus() == 4) {
|
||||
entity.setDeleteStatus(0);
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(entity).
|
||||
orderByDesc("create_time").select(ConstansValue.sampleGoodsList));
|
||||
} else {
|
||||
page = IPmsProductService.page(new Page<PmsProduct>(pageNum, pageSize), new QueryWrapper<PmsProduct>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品满减表(只针对同商品)
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductFullReduction>(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<Long> ids) {
|
||||
boolean count = IPmsProductFullReductionService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品阶梯价格表(只针对同商品)
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductLadder>(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<Long> ids) {
|
||||
boolean count = IPmsProductLadderService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductOperateLog>(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<Long> ids) {
|
||||
boolean count = IPmsProductOperateLogService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品审核记录
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsProductVertifyRecord>(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<Long> ids) {
|
||||
boolean count = IPmsProductVertifyRecordService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* sku的库存
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsSkuStock>(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<Long> 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<PmsSkuStock> 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<PmsSkuStock> skuStockList) {
|
||||
int count = IPmsSkuStockService.update(pid, skuStockList);
|
||||
if (count > 0) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @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<PmsSmallNaviconCategory>(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<Long> ids) {
|
||||
boolean count = IPmsSmallNaviconCategoryService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 画册图片表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsAlbumPicService extends IService<PmsAlbumPic> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 相册表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsAlbumService extends IService<PmsAlbum> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 品牌表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsBrandService extends IService<PmsBrand> {
|
||||
|
||||
int updateShowStatus(List<Long> ids, Integer showStatus);
|
||||
|
||||
int updateFactoryStatus(List<Long> ids, Integer factoryStatus);
|
||||
|
||||
ResultBean<List<BrandVo>> getList();
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品评价回复表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsCommentReplayService extends IService<PmsCommentReplay> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品评价表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsCommentService extends IService<PmsComment> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运费模版 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsFeightTemplateService extends IService<PmsFeightTemplate> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 帮助分类表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-07-07
|
||||
*/
|
||||
public interface IPmsGiftsCategoryService extends IService<PmsGiftsCategory> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 帮助表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-07-07
|
||||
*/
|
||||
public interface IPmsGiftsService extends IService<PmsGifts> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品会员价格表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsMemberPriceService extends IService<PmsMemberPrice> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品属性分类表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductAttributeCategoryService extends IService<PmsProductAttributeCategory> {
|
||||
|
||||
List<PmsProductAttributeCategoryItem> getListWithAttr();
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品属性参数表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductAttributeService extends IService<PmsProductAttribute> {
|
||||
|
||||
List<ProductAttrInfo> getProductAttrInfo(Long productCategoryId);
|
||||
|
||||
boolean saveAndUpdate(PmsProductAttribute entity);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储产品参数信息的表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductAttributeValueService extends IService<PmsProductAttributeValue> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类) 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductCategoryAttributeRelationService extends IService<PmsProductCategoryAttributeRelation> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品分类 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductCategoryService extends IService<PmsProductCategory> {
|
||||
|
||||
List<PmsProductCategoryWithChildrenItem> listWithChildren();
|
||||
|
||||
int updateNavStatus(List<Long> ids, Integer navStatus);
|
||||
|
||||
int updateShowStatus(List<Long> ids, Integer showStatus);
|
||||
|
||||
int updateIndexStatus(List<Long> 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);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品咨询表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductConsultService extends IService<PmsProductConsult> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品满减表(只针对同商品) 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductFullReductionService extends IService<PmsProductFullReduction> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品阶梯价格表(只针对同商品) 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductLadderService extends IService<PmsProductLadder> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductOperateLogService extends IService<PmsProductOperateLog> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品信息 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductService extends IService<PmsProduct> {
|
||||
@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<Long> ids, Integer publishStatus);
|
||||
|
||||
/**
|
||||
* 批量修改商品推荐状态
|
||||
*/
|
||||
int updateRecommendStatus(List<Long> ids, Integer recommendStatus);
|
||||
|
||||
/**
|
||||
* 批量修改新品状态
|
||||
*/
|
||||
int updateNewStatus(List<Long> ids, Integer newStatus);
|
||||
|
||||
int updateisFenxiao(List<Long> ids, Integer newStatus);
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
int updateDeleteStatus(List<Long> ids, Integer deleteStatus);
|
||||
|
||||
/**
|
||||
* 根据商品名称或者货号模糊查询
|
||||
*/
|
||||
List<PmsProduct> list(String keyword);
|
||||
List<PmsProduct> listPmsProduct(String keyword);
|
||||
|
||||
List<PmsProductVertifyRecord> getProductVertifyRecord(Long id);
|
||||
|
||||
int updateisVip(List<Long> ids, Integer newStatus);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品审核记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsProductVertifyRecordService extends IService<PmsProductVertifyRecord> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* sku的库存 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
public interface IPmsSkuStockService extends IService<PmsSkuStock> {
|
||||
/**
|
||||
* 根据产品id和skuCode模糊搜索
|
||||
*/
|
||||
List<PmsSkuStock> getList(Long pid, String keyword);
|
||||
|
||||
/**
|
||||
* 批量更新商品库存信息
|
||||
*/
|
||||
int update(Long pid, List<PmsSkuStock> skuStockList);
|
||||
}
|
||||
@@ -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<PmsSmallNaviconCategory> {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 画册图片表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsAlbumPicServiceImpl extends ServiceImpl<PmsAlbumPicMapper, PmsAlbumPic> implements IPmsAlbumPicService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 相册表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsAlbumServiceImpl extends ServiceImpl<PmsAlbumMapper, PmsAlbum> implements IPmsAlbumService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 品牌表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsBrandServiceImpl extends ServiceImpl<PmsBrandMapper, PmsBrand> implements IPmsBrandService {
|
||||
@Resource
|
||||
private PmsBrandMapper brandMapper;
|
||||
|
||||
@Override
|
||||
public int updateShowStatus(List<Long> ids, Integer showStatus) {
|
||||
PmsBrand pmsBrand = new PmsBrand();
|
||||
pmsBrand.setShowStatus(showStatus);
|
||||
return brandMapper.update(pmsBrand, new QueryWrapper<PmsBrand>().in("id", ids));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFactoryStatus(List<Long> ids, Integer factoryStatus) {
|
||||
PmsBrand pmsBrand = new PmsBrand();
|
||||
pmsBrand.setFactoryStatus(factoryStatus);
|
||||
return brandMapper.update(pmsBrand, new QueryWrapper<PmsBrand>().in("id", ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<BrandVo>> getList() {
|
||||
ResultBean<List<BrandVo>> rb = ResultBean.fireFail();
|
||||
List<BrandVo> brandVoList = baseMapper.getList();
|
||||
return rb.success().setData(brandVoList);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品评价回复表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsCommentReplayServiceImpl extends ServiceImpl<PmsCommentReplayMapper, PmsCommentReplay> implements IPmsCommentReplayService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品评价表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsCommentServiceImpl extends ServiceImpl<PmsCommentMapper, PmsComment> implements IPmsCommentService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运费模版 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsFeightTemplateServiceImpl extends ServiceImpl<PmsFeightTemplateMapper, PmsFeightTemplate> implements IPmsFeightTemplateService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 帮助分类表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-07-07
|
||||
*/
|
||||
@Service
|
||||
public class PmsGiftsCategoryServiceImpl extends ServiceImpl<PmsGiftsCategoryMapper, PmsGiftsCategory> implements IPmsGiftsCategoryService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 帮助表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-07-07
|
||||
*/
|
||||
@Service
|
||||
public class PmsGiftsServiceImpl extends ServiceImpl<PmsGiftsMapper, PmsGifts> implements IPmsGiftsService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品会员价格表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsMemberPriceServiceImpl extends ServiceImpl<PmsMemberPriceMapper, PmsMemberPrice> implements IPmsMemberPriceService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品属性分类表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductAttributeCategoryServiceImpl extends ServiceImpl<PmsProductAttributeCategoryMapper, PmsProductAttributeCategory> implements IPmsProductAttributeCategoryService {
|
||||
|
||||
@Resource
|
||||
private PmsProductAttributeCategoryMapper productAttributeCategoryMapper;
|
||||
|
||||
@Override
|
||||
public List<PmsProductAttributeCategoryItem> getListWithAttr() {
|
||||
return productAttributeCategoryMapper.getListWithAttr();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品属性参数表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductAttributeServiceImpl extends ServiceImpl<PmsProductAttributeMapper, PmsProductAttribute> implements IPmsProductAttributeService {
|
||||
|
||||
@Resource
|
||||
private PmsProductAttributeMapper productAttributeMapper;
|
||||
@Resource
|
||||
private PmsProductAttributeCategoryMapper productAttributeCategoryMapper;
|
||||
|
||||
@Override
|
||||
public List<ProductAttrInfo> getProductAttrInfo(Long productCategoryId) {
|
||||
return productAttributeMapper.getProductAttrInfo(productCategoryId);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean saveAndUpdate(PmsProductAttribute entity) {
|
||||
int count = productAttributeMapper.selectCount(new QueryWrapper<PmsProductAttribute>().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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 存储产品参数信息的表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductAttributeValueServiceImpl extends ServiceImpl<PmsProductAttributeValueMapper, PmsProductAttributeValue> implements IPmsProductAttributeValueService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类) 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductCategoryAttributeRelationServiceImpl extends ServiceImpl<PmsProductCategoryAttributeRelationMapper, PmsProductCategoryAttributeRelation> implements IPmsProductCategoryAttributeRelationService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品分类 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductCategoryServiceImpl extends ServiceImpl<PmsProductCategoryMapper, PmsProductCategory> implements IPmsProductCategoryService {
|
||||
|
||||
@Resource
|
||||
private PmsProductCategoryMapper categoryMapper;
|
||||
@Resource
|
||||
private PmsProductMapper productMapper;
|
||||
@Resource
|
||||
private IPmsProductCategoryAttributeRelationService pmsProductCategoryAttributeRelationService;
|
||||
@Resource
|
||||
private PmsProductCategoryAttributeRelationMapper productCategoryAttributeRelationMapper;
|
||||
|
||||
@Override
|
||||
public List<PmsProductCategoryWithChildrenItem> listWithChildren() {
|
||||
return categoryMapper.listWithChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateNavStatus(List<Long> ids, Integer navStatus) {
|
||||
PmsProductCategory productCategory = new PmsProductCategory();
|
||||
productCategory.setNavStatus(navStatus);
|
||||
return categoryMapper.update(productCategory, new QueryWrapper<PmsProductCategory>().in("id", ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateShowStatus(List<Long> ids, Integer showStatus) {
|
||||
PmsProductCategory productCategory = new PmsProductCategory();
|
||||
// productCategory.setShowStatus(showStatus);
|
||||
return categoryMapper.update(productCategory, new QueryWrapper<PmsProductCategory>().in("id", ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateIndexStatus(List<Long> ids, Integer indexStatus) {
|
||||
PmsProductCategory productCategory = new PmsProductCategory();
|
||||
productCategory.setIndexStatus(indexStatus);
|
||||
return categoryMapper.update(productCategory, new QueryWrapper<PmsProductCategory>().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<PmsProduct>().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<Long> 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<Long> productAttributeIdList) {
|
||||
List<PmsProductCategoryAttributeRelation> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品咨询表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductConsultServiceImpl extends ServiceImpl<PmsProductConsultMapper, PmsProductConsult> implements IPmsProductConsultService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品满减表(只针对同商品) 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductFullReductionServiceImpl extends ServiceImpl<PmsProductFullReductionMapper, PmsProductFullReduction> implements IPmsProductFullReductionService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品阶梯价格表(只针对同商品) 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductLadderServiceImpl extends ServiceImpl<PmsProductLadderMapper, PmsProductLadder> implements IPmsProductLadderService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductOperateLogServiceImpl extends ServiceImpl<PmsProductOperateLogMapper, PmsProductOperateLog> implements IPmsProductOperateLogService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品信息 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PmsProductServiceImpl extends ServiceImpl<PmsProductMapper, PmsProduct> 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<PmsSkuStock> 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<PmsProduct>().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<Long> ids, Integer newStatus) {
|
||||
PmsProduct record = new PmsProduct();
|
||||
record.setIsFenxiao(newStatus);
|
||||
clerGoodsRedis(ids);
|
||||
return productMapper.update(record, new QueryWrapper<PmsProduct>().in("id", ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateisVip(List<Long> ids, Integer newStatus) {
|
||||
PmsProduct record = new PmsProduct();
|
||||
record.setIsVip(newStatus);
|
||||
clerGoodsRedis(ids);
|
||||
return productMapper.update(record, new QueryWrapper<PmsProduct>().in("id", ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePublishStatus(List<Long> ids, Integer publishStatus) {
|
||||
PmsProduct record = new PmsProduct();
|
||||
record.setPublishStatus(publishStatus);
|
||||
clerGoodsRedis(ids);
|
||||
return productMapper.update(record, new QueryWrapper<PmsProduct>().in("id", ids));
|
||||
}
|
||||
|
||||
public void clerGoodsRedis(List<Long> ids) {
|
||||
for (Long id : ids) {
|
||||
// redisService.remove(String.format(Rediskey.GOODSDETAIL, id));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateRecommendStatus(List<Long> ids, Integer recommendStatus) {
|
||||
PmsProduct record = new PmsProduct();
|
||||
record.setRecommandStatus(recommendStatus);
|
||||
clerGoodsRedis(ids);
|
||||
return productMapper.update(record, new QueryWrapper<PmsProduct>().in("id", ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateNewStatus(List<Long> ids, Integer newStatus) {
|
||||
PmsProduct record = new PmsProduct();
|
||||
record.setNewStatus(newStatus);
|
||||
clerGoodsRedis(ids);
|
||||
return productMapper.update(record, new QueryWrapper<PmsProduct>().in("id", ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDeleteStatus(List<Long> ids, Integer deleteStatus) {
|
||||
PmsProduct record = new PmsProduct();
|
||||
record.setDeleteStatus(deleteStatus);
|
||||
clerGoodsRedis(ids);
|
||||
return productMapper.update(record, new QueryWrapper<PmsProduct>().in("id", ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmsProduct> 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<PmsProduct> 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<PmsProduct> l=new ArrayList<>();
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
if (!StringUtils.isEmpty(keyword)) {
|
||||
queryWrapper.like("name", keyword);
|
||||
}
|
||||
List<LpkGoods> 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<PmsProductVertifyRecord> 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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品审核记录 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsProductVertifyRecordServiceImpl extends ServiceImpl<PmsProductVertifyRecordMapper, PmsProductVertifyRecord> implements IPmsProductVertifyRecordService {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* sku的库存 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@Service
|
||||
public class PmsSkuStockServiceImpl extends ServiceImpl<PmsSkuStockMapper, PmsSkuStock> implements IPmsSkuStockService {
|
||||
@Resource
|
||||
private PmsSkuStockMapper skuStockMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<PmsSkuStock> 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<PmsSkuStock> skuStockList) {
|
||||
return skuStockMapper.replaceList(skuStockList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zscat
|
||||
* @since 2019-04-14
|
||||
*/
|
||||
@Service
|
||||
public class PmsSmallNaviconCategoryServiceImpl extends ServiceImpl<PmsSmallNaviconCategoryMapper, PmsSmallNaviconCategory> implements IPmsSmallNaviconCategoryService {
|
||||
}
|
||||
@@ -11,4 +11,5 @@ import lombok.Data;
|
||||
public class OrgPathQuery {
|
||||
private String orgPath;
|
||||
private String userOrgSid;
|
||||
private String name;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<Void> 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<Void> 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<Void> 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<Void> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user