98 changed files with 1044 additions and 5220 deletions
@ -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; |
|||
} |
@ -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 { |
|||
} |
@ -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; |
|||
} |
|||
} |
|||
|
Loading…
Reference in new issue