商品后台接口统一字段
This commit is contained in:
@@ -48,4 +48,5 @@ public class LpkCustomer {
|
||||
|
||||
@ApiModelProperty("客户绑定的支行sid")
|
||||
private String customerBankSid;
|
||||
private String orgPath;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yxt.ordermall.api.lpkgoods;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@@ -31,6 +32,8 @@ public class LpkGoods {
|
||||
private String price;
|
||||
private String picUrl;
|
||||
private String appContent;
|
||||
@TableField(exist = false)
|
||||
private String specificationUnitSid;
|
||||
private String specificationUnit;
|
||||
private String number;
|
||||
private String isAppletGrounding;
|
||||
@@ -38,9 +41,9 @@ public class LpkGoods {
|
||||
private String weight;
|
||||
private String useTo;
|
||||
|
||||
private Long brandId; // 品牌ID';
|
||||
private String brandId; // 品牌ID';
|
||||
private String brandName; // 品牌名称';
|
||||
private Long categoryId; // 类别ID';
|
||||
private String categoryId; // 类别ID';
|
||||
private String categoryName; // 类别名称';
|
||||
@ApiModelProperty("阶梯重量")
|
||||
private String stepWeight;
|
||||
@@ -48,4 +51,6 @@ public class LpkGoods {
|
||||
private String stepPrice;
|
||||
private String periodValidity;
|
||||
private String sort;
|
||||
private String spuSid;
|
||||
private String skuSid;
|
||||
}
|
||||
|
||||
@@ -27,14 +27,17 @@ public class LpkGoodsDetailsVo implements Vo {
|
||||
private String picUrl;//图片
|
||||
private String appContent;
|
||||
private String specificationUnit;
|
||||
private String specificationUnitSid;
|
||||
private double number;
|
||||
private String content;
|
||||
private String weight;
|
||||
private String isAppletGrounding;
|
||||
private String useTo;
|
||||
|
||||
|
||||
private Long brandId; // 品牌ID';
|
||||
private String brandId; // 品牌ID';
|
||||
private String brandName; // 品牌名称';
|
||||
private Long categoryId; // 类别ID';
|
||||
private String categoryId; // 类别ID';
|
||||
private String categoryName; // 类别名称';
|
||||
|
||||
@ApiModelProperty("阶梯重量")
|
||||
@@ -53,4 +56,9 @@ public class LpkGoodsDetailsVo implements Vo {
|
||||
private String goodsNumber;
|
||||
private String mefenPrice;
|
||||
private String sort;
|
||||
private String spuSid;
|
||||
private String skuSid;
|
||||
private String useOrgSid;
|
||||
private String createOrgSid;
|
||||
private String userSid;
|
||||
}
|
||||
|
||||
@@ -18,19 +18,21 @@ public class LpkGoodsDto implements Dto {
|
||||
private String barcode;
|
||||
private String name;
|
||||
private String unitName;
|
||||
private String unitSid;
|
||||
private String typeCode;
|
||||
private String price;
|
||||
private String picUrl;
|
||||
private String appContent;
|
||||
private String specificationUnit;
|
||||
private String specificationUnitSid;
|
||||
private double number;
|
||||
private String content;
|
||||
private String weight;
|
||||
private String useTo;
|
||||
|
||||
private Long brandId; // 品牌ID';
|
||||
private String brandId; // 品牌ID';
|
||||
private String brandName; // 品牌名称';
|
||||
private Long categoryId; // 类别ID';
|
||||
private String categoryId; // 类别ID';
|
||||
private String categoryName; // 类别名称';
|
||||
|
||||
@ApiModelProperty("阶梯重量")
|
||||
@@ -39,4 +41,10 @@ public class LpkGoodsDto implements Dto {
|
||||
private String stepPrice;
|
||||
private String periodValidity;
|
||||
private String sort;
|
||||
|
||||
private String useOrgSid;
|
||||
private String createOrgSid;
|
||||
private String userSid;
|
||||
private String signSid;//标识sid 用于两端系统相对应
|
||||
private String skuSid;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.yxt.ordermall.api.lpkgoods;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -17,4 +18,12 @@ public class LpkGoodsQuery implements Query {
|
||||
private String brandId;
|
||||
private String periodValidity;
|
||||
private String now;
|
||||
private String orgLevelKey;//权限等级
|
||||
@ApiModelProperty("菜单路由")
|
||||
private String menuUrl;
|
||||
@ApiModelProperty("组织全路径sid")
|
||||
private String orgPath;
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
private int index;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ public class LpkGoodsVo implements Vo {
|
||||
private String useTo;
|
||||
private String weight;
|
||||
|
||||
private Long brandId; // 品牌ID';
|
||||
private String brandId; // 品牌ID';
|
||||
private String brandName; // 品牌名称';
|
||||
private Long categoryId; // 类别ID';
|
||||
private String categoryId; // 类别ID';
|
||||
private String categoryName; // 类别名称';
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date periodValidity;
|
||||
|
||||
@@ -4,11 +4,15 @@ import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.ordermall.apiadmin.vo.PmsBrandVo;
|
||||
import com.yxt.ordermall.apiadmin.vo.PmsProductCategoryVo;
|
||||
import com.yxt.ordermall.adminservice.AdminMallService;
|
||||
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoVo;
|
||||
import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeVo;
|
||||
import com.yxt.ordermall.feign.base.basebrandinfo.BaseBrandInfoFeign;
|
||||
import com.yxt.ordermall.feign.base.basegoodstype.BaseGoodsTypeFeign;
|
||||
import com.yxt.ordermall.utils.OrgPathQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController("com.yxt.ordermall.adminapi.AdminMallRest")
|
||||
@@ -17,17 +21,35 @@ public class AdminMallRest {
|
||||
|
||||
@Autowired
|
||||
private AdminMallService adminMallService;
|
||||
@Autowired
|
||||
BaseBrandInfoFeign baseBrandInfoFeign;
|
||||
@Autowired
|
||||
BaseGoodsTypeFeign baseGoodsTypeFeign;
|
||||
|
||||
@GetMapping(value = "/listAllBrand")
|
||||
public ResultBean<List<PmsBrandVo>> listAllBrand() {
|
||||
@PostMapping(value = "/listAllBrand")
|
||||
public ResultBean<List<PmsBrandVo>> listAllBrand(@RequestBody OrgPathQuery query) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<PmsBrandVo> list = adminMallService.listBrand();
|
||||
return rb.success().setData(list);
|
||||
ResultBean<List<BaseBrandInfoVo>> list=baseBrandInfoFeign.listAll(query);
|
||||
List<PmsBrandVo> brandVos=new ArrayList<>();
|
||||
for (BaseBrandInfoVo datum : list.getData()) {
|
||||
PmsBrandVo vo=new PmsBrandVo();
|
||||
vo.setName(datum.getBrandName());
|
||||
vo.setSid(datum.getSid());
|
||||
brandVos.add(vo);
|
||||
}
|
||||
return rb.success().setData(brandVos);
|
||||
}
|
||||
@GetMapping(value = "/listAllCategory")
|
||||
public ResultBean<List<PmsBrandVo>> listAllCategory() {
|
||||
@PostMapping(value = "/listAllCategory")
|
||||
public ResultBean<List<PmsBrandVo>> listAllCategory(@RequestBody OrgPathQuery query) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<PmsProductCategoryVo> list = adminMallService.listAllCategory();
|
||||
return rb.success().setData(list);
|
||||
ResultBean<List<BaseGoodsTypeVo>> list=baseGoodsTypeFeign.listAll(query);
|
||||
List<PmsProductCategoryVo> list1 = new ArrayList<>();
|
||||
for (BaseGoodsTypeVo datum : list.getData()) {
|
||||
PmsProductCategoryVo pmsProductCategoryVo=new PmsProductCategoryVo();
|
||||
pmsProductCategoryVo.setName(datum.getGoodsTypeName());
|
||||
pmsProductCategoryVo.setSid(datum.getSid());
|
||||
list1.add(pmsProductCategoryVo);
|
||||
}
|
||||
return rb.success().setData(list1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.yxt.ordermall.apiadmin.aggregation;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.ordermall.biz.func.basegoodsunit.BaseGoodsUnitDto;
|
||||
import com.yxt.ordermall.biz.func.basegoodsunit.BaseGoodsUnitQuery;
|
||||
import com.yxt.ordermall.biz.func.basegoodsunit.BaseGoodsUnitService;
|
||||
import com.yxt.ordermall.biz.func.basegoodsunit.BaseGoodsUnitVo;
|
||||
import com.yxt.ordermall.utils.OrgPathQuery;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2024/3/8 9:19
|
||||
*/
|
||||
@Api(tags = "商品类型")
|
||||
@RestController
|
||||
@RequestMapping("/apiadmin/base/basegoodsunit")
|
||||
public class BaseGoodsUnitRest {
|
||||
@Autowired
|
||||
BaseGoodsUnitService baseGoodsUnitService;
|
||||
|
||||
|
||||
@ApiOperation("分页列表")
|
||||
@PostMapping("/listPage")
|
||||
public ResultBean<PagerVo<BaseGoodsUnitVo>> listPage(@RequestBody PagerQuery<BaseGoodsUnitQuery> pq) {
|
||||
return baseGoodsUnitService.listPage(pq);
|
||||
}
|
||||
@ApiOperation("查询所有的类别")
|
||||
@PostMapping("/listAll")
|
||||
public ResultBean<List<BaseGoodsUnitVo>> listAll(@RequestBody OrgPathQuery query) {
|
||||
return baseGoodsUnitService.listAll(query);
|
||||
}
|
||||
|
||||
@ApiOperation("保存修改")
|
||||
@PostMapping("/saveOrUpdate")
|
||||
public ResultBean<String> saveOrUpdate(@RequestBody BaseGoodsUnitDto dto) {
|
||||
return baseGoodsUnitService.saveOrUpdate(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("初始化")
|
||||
@GetMapping("/initialization/{sid}")
|
||||
public ResultBean<BaseGoodsUnitVo> initialization(@PathVariable("sid") String sid) {
|
||||
return baseGoodsUnitService.initialization(sid);
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/delete/{sid}")
|
||||
public ResultBean delete(@PathVariable("sid") String sid) {
|
||||
return baseGoodsUnitService.delete(sid);
|
||||
}
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/delBySids")
|
||||
public ResultBean delBySids(@RequestBody String[] sids) {
|
||||
return baseGoodsUnitService.delAll(sids);
|
||||
}
|
||||
|
||||
@ApiOperation("更改可用状态")
|
||||
@GetMapping("/updateIsEnable/{sid}/{isEnable}")
|
||||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) {
|
||||
return baseGoodsUnitService.updateIsEnable(sid,isEnable);
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,16 @@ package com.yxt.ordermall.apiadmin.aggregation;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoDto;
|
||||
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoQuery;
|
||||
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoVo;
|
||||
import com.yxt.ordermall.biz.func.commonmethod.CommonMethod;
|
||||
import com.yxt.ordermall.biz.func.commonmethod.DataRule;
|
||||
import com.yxt.ordermall.feign.base.basebrandinfo.BaseBrandInfoFeign;
|
||||
import com.yxt.ordermall.mallplus.biz.pms.service.IPmsBrandService;
|
||||
import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand;
|
||||
@@ -43,18 +47,28 @@ public class PmsBrandRest {
|
||||
private IPmsBrandService IPmsBrandService;
|
||||
@Autowired
|
||||
BaseBrandInfoFeign baseBrandInfoFeign;
|
||||
@Autowired
|
||||
CommonMethod commonMethod;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
// @SysLog(MODULE = "pms", REMARK = "根据条件查询所有品牌表列表")
|
||||
@ApiOperation("根据条件查询所有品牌表列表")
|
||||
@GetMapping(value = "/list")
|
||||
@PostMapping(value = "/list")
|
||||
public ResultBean getPmsBrandByPage(@RequestBody PagerQuery<BaseBrandInfoQuery> pq) {
|
||||
PmsBrand brand=new PmsBrand();
|
||||
BaseBrandInfoQuery query=pq.getParams();
|
||||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData();
|
||||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId());
|
||||
pq.getParams().setIndex(dataRule.getIndex());
|
||||
|
||||
List<PmsBrand> brands=new ArrayList<>();
|
||||
PagerVo vo=new PagerVo();
|
||||
ResultBean<PagerVo<BaseBrandInfoVo>> voResultBean=baseBrandInfoFeign.listPage(pq);
|
||||
for (BaseBrandInfoVo record : voResultBean.getData().getRecords()) {
|
||||
brand.setId(Long.valueOf(record.getBrandCode()));
|
||||
PmsBrand brand=new PmsBrand();
|
||||
// brand.setId(Long.valueOf(record.getBrandCode()));
|
||||
brand.setName(record.getBrandName());
|
||||
brand.setFirstLetter(record.getLetter());
|
||||
brand.setSid(record.getSid());
|
||||
// brand.setSort(record.get);
|
||||
brands.add(brand);
|
||||
}
|
||||
@@ -67,75 +81,67 @@ public class PmsBrandRest {
|
||||
@ApiOperation("保存品牌表")
|
||||
@PostMapping(value = "/create")
|
||||
// @PreAuthorize("hasAuthority('pms:PmsBrand:create')")
|
||||
public Object savePmsBrand(@RequestBody PmsBrand entity) {
|
||||
|
||||
public ResultBean savePmsBrand(@RequestBody PmsBrand entity) {
|
||||
BaseBrandInfoDto dto =new BaseBrandInfoDto();
|
||||
dto.setBrandCode(entity.getId().toString());
|
||||
dto.setBrandName(entity.getName());
|
||||
// dto.set
|
||||
baseBrandInfoFeign.saveOrUpdate(dto);
|
||||
|
||||
|
||||
try {
|
||||
if (IPmsBrandService.save(entity)) {
|
||||
return new CommonResult().success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("保存品牌表:%s", e.getMessage(), e);
|
||||
return new CommonResult().failed();
|
||||
BeanUtil.copyProperties(entity,dto);
|
||||
// dto.setBrandCode(entity.getId().toString());
|
||||
dto.setRemarks(entity.getBrandStory());
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
if(StringUtils.isNotBlank(entity.getLogo())){
|
||||
String path = entity.getLogo().substring(urlPrefix.length());
|
||||
dto.setImage(path);
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
dto.setBrandName(entity.getName());
|
||||
dto.setLetter(entity.getFirstLetter());
|
||||
|
||||
return baseBrandInfoFeign.saveOrUpdate(dto);
|
||||
}
|
||||
|
||||
// @SysLog(MODULE = "pms", REMARK = "更新品牌表")
|
||||
@ApiOperation("更新品牌表")
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public Object updatePmsBrand(@RequestBody PmsBrand entity) {
|
||||
try {
|
||||
if (IPmsBrandService.updateById(entity)) {
|
||||
return new CommonResult().success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("更新品牌表:%s", e.getMessage(), e);
|
||||
return new CommonResult().failed();
|
||||
BaseBrandInfoDto dto =new BaseBrandInfoDto();
|
||||
BeanUtil.copyProperties(entity,dto);
|
||||
// dto.setBrandCode(entity.getId().toString());
|
||||
dto.setRemarks(entity.getBrandStory());
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
if(StringUtils.isNotBlank(entity.getLogo())){
|
||||
String path = entity.getLogo().substring(urlPrefix.length());
|
||||
dto.setImage(path);
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
dto.setBrandName(entity.getName());
|
||||
dto.setLetter(entity.getFirstLetter());
|
||||
|
||||
return baseBrandInfoFeign.saveOrUpdate(dto);
|
||||
}
|
||||
|
||||
// @SysLog(MODULE = "pms", REMARK = "删除品牌表")
|
||||
@ApiOperation("删除品牌表")
|
||||
@GetMapping(value = "/delete/{id}")
|
||||
@DeleteMapping(value = "/delete")
|
||||
// @PreAuthorize("hasAuthority('pms:PmsBrand:delete')")
|
||||
public Object deletePmsBrand(@ApiParam("品牌表id") @PathVariable Long id) {
|
||||
try {
|
||||
if (ValidatorUtils.empty(id)) {
|
||||
return new CommonResult().paramFailed("品牌表id");
|
||||
}
|
||||
if (IPmsBrandService.removeById(id)) {
|
||||
return new CommonResult().success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("删除品牌表:%s", e.getMessage(), e);
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
public Object deletePmsBrand( @RequestBody String [] sids) {
|
||||
return baseBrandInfoFeign.delBySids(sids);
|
||||
}
|
||||
|
||||
// @SysLog(MODULE = "pms", REMARK = "给品牌表分配品牌表")
|
||||
@ApiOperation("查询品牌表明细")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Object getPmsBrandById(@ApiParam("品牌表id") @PathVariable Long id) {
|
||||
try {
|
||||
if (ValidatorUtils.empty(id)) {
|
||||
return new CommonResult().paramFailed("品牌表id");
|
||||
}
|
||||
PmsBrand coupon = IPmsBrandService.getById(id);
|
||||
return new CommonResult().success(coupon);
|
||||
} catch (Exception e) {
|
||||
log.error("查询品牌表明细:%s", e.getMessage(), e);
|
||||
return new CommonResult().failed();
|
||||
@GetMapping(value = "/{sid}")
|
||||
public Object getPmsBrandById(@ApiParam("sid") @PathVariable String sid) {
|
||||
ResultBean<BaseBrandInfoVo> bean= baseBrandInfoFeign.initialization(sid);
|
||||
PmsBrand coupon =new PmsBrand();
|
||||
BeanUtil.copyProperties(bean.getData(),coupon);
|
||||
coupon.setName(bean.getData().getBrandName());
|
||||
coupon.setBrandStory(bean.getData().getRemarks());
|
||||
coupon.setFirstLetter(bean.getData().getLetter());
|
||||
coupon.setUseOrgSid(bean.getData().getUseOrgSid());
|
||||
coupon.setCreateOrgSid(bean.getData().getCreateOrgSid());
|
||||
coupon.setUserSid(bean.getData().getCreateOrgSid());
|
||||
if(StringUtils.isNotBlank(bean.getData().getImage())){
|
||||
coupon.setLogo(fileUploadComponent.getUrlPrefix()+bean.getData().getImage());
|
||||
}
|
||||
|
||||
// coupon.setId(Long.valueOf(bean.getData().getBrandCode()));
|
||||
return new ResultBean<>().success().setData(coupon);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除品牌表")
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.yxt.ordermall.apiadmin.aggregation;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoQuery;
|
||||
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoVo;
|
||||
import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeDto;
|
||||
import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeQuery;
|
||||
import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeVo;
|
||||
import com.yxt.ordermall.biz.func.commonmethod.CommonMethod;
|
||||
import com.yxt.ordermall.biz.func.commonmethod.DataRule;
|
||||
import com.yxt.ordermall.feign.base.basegoodstype.BaseGoodsTypeFeign;
|
||||
import com.yxt.ordermall.mallplus.biz.pms.service.IPmsProductCategoryService;
|
||||
import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand;
|
||||
import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsProductCategory;
|
||||
import com.yxt.ordermall.mallplus.mbg.pms.vo.PmsProductCategoryWithChildrenItem;
|
||||
import com.zscat.mallplus.utils.CommonResult;
|
||||
import com.zscat.mallplus.utils.ValidatorUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 = "PmsProductCategoryController", description = "产品分类管理")
|
||||
@RequestMapping("/pms/PmsProductCategory")
|
||||
public class PmsProductCategoryRest {
|
||||
@Resource
|
||||
private IPmsProductCategoryService IPmsProductCategoryService;
|
||||
@Autowired
|
||||
BaseGoodsTypeFeign baseGoodsTypeFeign;
|
||||
@Autowired
|
||||
CommonMethod commonMethod;
|
||||
|
||||
// // @SysLog(MODULE = "pms", REMARK = "根据条件查询所有产品分类列表")
|
||||
// @ApiOperation("根据条件查询所有产品分类列表")
|
||||
// @PostMapping(value = "/list")
|
||||
// public Object getPmsProductCategoryByPage(@RequestBody PagerQuery<BaseGoodsTypeQuery> pq) {
|
||||
// BaseGoodsTypeQuery query=pq.getParams();
|
||||
// DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData();
|
||||
// pq.getParams().setOrgLevelKey(dataRule.getDataRuleId());
|
||||
// pq.getParams().setIndex(dataRule.getIndex());
|
||||
// PmsProductCategory c=new PmsProductCategory();
|
||||
// List<PmsProductCategory> list=new ArrayList<>();
|
||||
// PagerVo vo=new PagerVo();
|
||||
// ResultBean<PagerVo<BaseGoodsTypeVo>> voResultBean= baseGoodsTypeFeign.listPage(pq);
|
||||
// for (BaseGoodsTypeVo record : voResultBean.getData().getRecords()) {
|
||||
// c.setId(Long.valueOf(record.getGoodsTypeCode()));
|
||||
// c.setName(record.getGoodsTypeName());
|
||||
// list.add(c);
|
||||
// }
|
||||
// BeanUtil.copyProperties(voResultBean.getData(),vo);
|
||||
// vo.setRecords(list);
|
||||
// return new ResultBean<>().success().setData(vo);
|
||||
// }
|
||||
|
||||
@ApiOperation("分页查询商品分类")
|
||||
@PostMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public ResultBean getList(@RequestBody PagerQuery<BaseGoodsTypeQuery> pq) {
|
||||
BaseGoodsTypeQuery query=pq.getParams();
|
||||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData();
|
||||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId());
|
||||
pq.getParams().setIndex(dataRule.getIndex());
|
||||
|
||||
List<PmsProductCategory> list=new ArrayList<>();
|
||||
PagerVo vo=new PagerVo();
|
||||
ResultBean<PagerVo<BaseGoodsTypeVo>> voResultBean= baseGoodsTypeFeign.listPage(pq);
|
||||
for (BaseGoodsTypeVo record : voResultBean.getData().getRecords()) {
|
||||
PmsProductCategory c=new PmsProductCategory();
|
||||
// c.setId(Long.valueOf(record.getGoodsTypeCode()));
|
||||
c.setDescription(record.getRemarks());
|
||||
c.setName(record.getGoodsTypeName());
|
||||
c.setSid(record.getSid());
|
||||
c.setShowStatus(record.getIsEnable());
|
||||
list.add(c);
|
||||
}
|
||||
BeanUtil.copyProperties(voResultBean.getData(),vo);
|
||||
vo.setRecords(list);
|
||||
return new ResultBean<>().success().setData(vo);
|
||||
}
|
||||
|
||||
// @SysLog(MODULE = "pms", REMARK = "保存产品分类")
|
||||
@ApiOperation("保存产品分类")
|
||||
@PostMapping(value = "/create")
|
||||
// @PreAuthorize("hasAuthority('pms:PmsProductCategory:create')")
|
||||
public Object savePmsProductCategory(@RequestBody PmsProductCategory entity) {
|
||||
BaseGoodsTypeDto dto =new BaseGoodsTypeDto();
|
||||
BeanUtil.copyProperties(entity,dto);
|
||||
// dto.setGoodsTypeCode(entity.getId().toString());
|
||||
dto.setRemarks(entity.getDescription());
|
||||
dto.setGoodsTypeName(entity.getName());
|
||||
dto.setIsEnable(entity.getShowStatus());
|
||||
return baseGoodsTypeFeign.saveOrUpdate(dto);
|
||||
}
|
||||
|
||||
// @SysLog(MODULE = "pms", REMARK = "更新产品分类")
|
||||
@ApiOperation("更新产品分类")
|
||||
@PostMapping(value = "/update/{id}")
|
||||
// @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')")
|
||||
public Object updatePmsProductCategory(@RequestBody PmsProductCategory entity) {
|
||||
BaseGoodsTypeDto dto =new BaseGoodsTypeDto();
|
||||
BeanUtil.copyProperties(entity,dto);
|
||||
// dto.setGoodsTypeCode(entity.getId().toString());
|
||||
dto.setRemarks(entity.getDescription());
|
||||
dto.setGoodsTypeName(entity.getName());
|
||||
dto.setIsEnable(entity.getShowStatus());
|
||||
return baseGoodsTypeFeign.saveOrUpdate(dto);
|
||||
}
|
||||
|
||||
// @SysLog(MODULE = "pms", REMARK = "删除产品分类")
|
||||
@ApiOperation("删除产品分类")
|
||||
@DeleteMapping(value = "/delete")
|
||||
// @PreAuthorize("hasAuthority('pms:PmsProductCategory:delete')")
|
||||
public Object deletePmsProductCategory(@ApiParam("产品分类id") @RequestBody String [] sids) {
|
||||
return baseGoodsTypeFeign.delBySids(sids);
|
||||
}
|
||||
|
||||
// @SysLog(MODULE = "pms", REMARK = "给产品分类分配产品分类")
|
||||
@ApiOperation("查询产品分类明细")
|
||||
@GetMapping(value = "/{sid}")
|
||||
public Object getPmsProductCategoryById(@ApiParam("产品分类id") @PathVariable String sid) {
|
||||
ResultBean<BaseGoodsTypeVo> bean= baseGoodsTypeFeign.initialization(sid);
|
||||
PmsProductCategory coupon =new PmsProductCategory();
|
||||
BeanUtil.copyProperties(bean.getData(),coupon);
|
||||
coupon.setName(bean.getData().getGoodsTypeName());
|
||||
coupon.setDescription(bean.getData().getRemarks());
|
||||
coupon.setUseOrgSid(bean.getData().getUseOrgSid());
|
||||
coupon.setCreateOrgSid(bean.getData().getCreateOrgSid());
|
||||
coupon.setShowStatus(bean.getData().getIsEnable());
|
||||
coupon.setUserSid(bean.getData().getCreateOrgSid());
|
||||
return new ResultBean<>().success().setData(coupon);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除产品分类")
|
||||
@RequestMapping(value = "/delete/batch", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
// @SysLog(MODULE = "pms", REMARK = "批量删除产品分类")
|
||||
// @PreAuthorize("hasAuthority('pms:PmsProductCategory:delete')")
|
||||
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
|
||||
boolean count = IPmsProductCategoryService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("查询所有一级分类及子分类")
|
||||
@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("sid") String sid, @RequestParam("showStatus") Integer showStatus) {
|
||||
return baseGoodsTypeFeign.updateIsEnable(sid,String.valueOf(showStatus));
|
||||
}
|
||||
|
||||
@ApiOperation("修改首页显示状态")
|
||||
@RequestMapping(value = "/update/indexStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
// @PreAuthorize("hasAuthority('pms:PmsProductCategory:update')")
|
||||
public Object updateIndexStatus(@RequestParam("ids") Long ids, @RequestParam("indexStatus") Integer indexStatus) {
|
||||
PmsProductCategory entity = new PmsProductCategory();
|
||||
entity.setId(ids);
|
||||
entity.setIndexStatus(indexStatus);
|
||||
if (IPmsProductCategoryService.updateById(entity)) {
|
||||
return new CommonResult().success();
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.ordermall.apiadmin.vo;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@@ -27,4 +28,12 @@ public class PmsBrandVo {
|
||||
* 专区大图
|
||||
*/
|
||||
private String bigPic;
|
||||
@TableField(exist = false)
|
||||
private String sid;
|
||||
@TableField(exist = false)
|
||||
private String useOrgSid;//使用组织sid
|
||||
@TableField(exist = false)
|
||||
private String createOrgSid;//创建组织sid
|
||||
@TableField(exist = false)
|
||||
private String userSid;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ public class PmsProductCategoryVo {
|
||||
private Long parentId;
|
||||
|
||||
private String name;
|
||||
private String sid;
|
||||
private Integer level;
|
||||
private Integer sort;
|
||||
|
||||
|
||||
@@ -19,4 +19,5 @@ public class BaseGoodsSku extends BaseEntity {
|
||||
private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序
|
||||
private String barCode;//条形码
|
||||
private String aidBarCode;//辅助条码
|
||||
private String signSid;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import com.yxt.ordermall.biz.func.basegoodsskuextend.BaseGoodsSkuExtendDto;
|
||||
import com.yxt.ordermall.biz.lpkgoods.GoodsSkuSubunitDto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -30,4 +31,6 @@ public class BaseGoodsSkuDto implements Dto {
|
||||
private BaseGoodsSkuExtendDto baseGoodsSkuExtend;//sku扩展
|
||||
private String barCode;//条形码
|
||||
private String aidBarCode;//辅助条码
|
||||
private GoodsSkuSubunitDto goodsSkuSubunit;
|
||||
private String signSid;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.ordermall.biz.func.basegoodssku;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -10,4 +11,12 @@ import lombok.Data;
|
||||
@Data
|
||||
public class BaseGoodsSkuQuery implements Query {
|
||||
private String name;
|
||||
private String orgLevelKey;//权限等级
|
||||
@ApiModelProperty("菜单路由")
|
||||
private String menuUrl;
|
||||
@ApiModelProperty("组织全路径sid")
|
||||
private String orgPath;
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
private int index;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yxt.ordermall.biz.func.basegoodssku;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2024/12/5 9:01
|
||||
*/
|
||||
@Data
|
||||
public class GoodsSkuVo1 {
|
||||
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 title;//商品Skutitle
|
||||
private String skuSid;//
|
||||
private String goodsSkuCode;//skuCode
|
||||
private String barCode;//条码
|
||||
private String picUrl;//图片
|
||||
private String salesPrice;//销售价格
|
||||
private String sortNo;//排序
|
||||
private String goodsName;//spuName
|
||||
private String goodsCode;//spuName
|
||||
private String spuSid;//
|
||||
private String unitName;//单位
|
||||
private String unitSid;//
|
||||
private String goodsTypeName;//分类
|
||||
private String typeSid;//
|
||||
private String brandName;//品牌
|
||||
private String brandSid;//
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public class BaseGoodsSpuDto implements Dto {
|
||||
private String sid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String createBySid;
|
||||
private String remarks;
|
||||
private String isEnable;
|
||||
private String goodsCode;//商品代码
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yxt.ordermall.biz.lpkgoods;
|
||||
|
||||
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 GoodsSkuSubunitDto 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 skuSid;//
|
||||
private String unitName;//计量单位名称
|
||||
private String unitBarCode;//计量单位名称
|
||||
private String ruler;//换算规则(该单位与基础单位的量级关系)数字类型
|
||||
private String price;//销售价格后续害应该包括采购价、销售价、批发价、参考成本等多个价格字段
|
||||
private String weight;//重量
|
||||
private String volume;//体积
|
||||
private String vLength;//长
|
||||
private String vWidth;//宽
|
||||
private String vHeight;//高
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.ordermall.api.appletgiftbag.MyGoodsVo;
|
||||
import com.yxt.ordermall.api.lpkgiftcard.LpkGiftCardQuery;
|
||||
import com.yxt.ordermall.api.lpkgoods.*;
|
||||
import com.yxt.ordermall.utils.OrgPathQuery;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -100,8 +101,8 @@ public class LpkGoodsRest {
|
||||
}
|
||||
@ApiOperation("获取所有的商品类型和品牌")
|
||||
@GetMapping("/getGoodsTypeAndBrand")
|
||||
public ResultBean getGoodsTypeAndBrand() {
|
||||
return lpkGoodsService.getGoodsTypeAndBrand();
|
||||
public ResultBean getGoodsTypeAndBrand(@RequestBody OrgPathQuery query) {
|
||||
return lpkGoodsService.getGoodsTypeAndBrand(query);
|
||||
}
|
||||
@ApiOperation("根据类型查询商品")
|
||||
@PostMapping("/getGoodsByType")
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.yxt.ordermall.biz.lpkgoods;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
@@ -21,21 +22,36 @@ import com.yxt.ordermall.api.shoppingcart.ShoppingCart;
|
||||
import com.yxt.ordermall.api.shoppingcart.ShoppingCartQuery;
|
||||
import com.yxt.ordermall.api.shoppingcart.ShoppingCartVo;
|
||||
import com.yxt.ordermall.biz.enterprisecertification.EnterpriseCertificationService;
|
||||
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoVo;
|
||||
import com.yxt.ordermall.biz.func.basegoodssku.*;
|
||||
import com.yxt.ordermall.biz.func.basegoodsskuextend.BaseGoodsSkuExtendDto;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuDto;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuVo;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspudetail.BaseGoodsSpuDetailDto;
|
||||
import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeQuery;
|
||||
import com.yxt.ordermall.biz.func.basegoodstype.BaseGoodsTypeVo;
|
||||
import com.yxt.ordermall.biz.func.commonmethod.CommonMethod;
|
||||
import com.yxt.ordermall.biz.func.commonmethod.DataRule;
|
||||
import com.yxt.ordermall.biz.lpkcustomer.LpkCustomerService;
|
||||
import com.yxt.ordermall.biz.shoppingcart.ShoppingCartService;
|
||||
import com.yxt.ordermall.feign.base.basebrandinfo.BaseBrandInfoFeign;
|
||||
import com.yxt.ordermall.feign.base.basegoodssku.BaseGoodsSkuFeign;
|
||||
import com.yxt.ordermall.feign.base.basegoodsspu.BaseGoodsSpuFeign;
|
||||
import com.yxt.ordermall.feign.base.basegoodstype.BaseGoodsTypeFeign;
|
||||
import com.yxt.ordermall.mallplus.biz.pms.service.IPmsBrandService;
|
||||
import com.yxt.ordermall.mallplus.mbg.pms.entity.PmsBrand;
|
||||
import com.yxt.ordermall.mallplus.mbg.pms.entity.brand.BrandVo;
|
||||
import com.yxt.ordermall.utils.DoubleUtils;
|
||||
import com.yxt.ordermall.utils.OrgPathQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -55,78 +71,163 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
LpkCustomerService lpkCustomerService;
|
||||
@Autowired
|
||||
EnterpriseCertificationService enterpriseCertificationService;
|
||||
|
||||
@Autowired
|
||||
CommonMethod commonMethod;
|
||||
@Autowired
|
||||
BaseGoodsSkuFeign baseGoodsSkuFeign;
|
||||
@Autowired
|
||||
BaseGoodsSpuFeign baseGoodsSpuFeign;
|
||||
@Autowired
|
||||
BaseGoodsTypeFeign baseGoodsTypeFeign;
|
||||
@Autowired
|
||||
BaseBrandInfoFeign baseBrandInfoFeign;
|
||||
|
||||
public ResultBean<PagerVo<LpkGoodsVo>> goodsListPage(PagerQuery<LpkGoodsQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkGoodsQuery query = pq.getParams();
|
||||
QueryWrapper<LpkGoods> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.like("name", query.getName());
|
||||
}
|
||||
qw.orderByAsc("sort");
|
||||
IPage<LpkGoods> page = PagerUtil.queryToPage(pq);
|
||||
IPage<LpkGoodsVo> pagging = baseMapper.goodsListPage(page, qw);
|
||||
PagerVo<LpkGoodsVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
List<LpkGoodsVo> records = pagging.getRecords();
|
||||
records.removeAll(Collections.singleton(null));
|
||||
if (!records.isEmpty()) {
|
||||
for (LpkGoodsVo record : records) {
|
||||
if (StringUtils.isNotBlank(record.getPicUrl())) {
|
||||
record.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public ResultBean<String> saveGoods(LpkGoodsDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
String sid = "";
|
||||
if (StringUtils.isNotBlank(dto.getSid())) {
|
||||
sid = dto.getSid();
|
||||
LpkGoods lpkGoods = fetchBySid(dto.getSid());
|
||||
BeanUtil.copyProperties(dto, lpkGoods, "id", "sid");
|
||||
if (StringUtils.isNotBlank(dto.getPicUrl())) {
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
String path = dto.getPicUrl().substring(urlPrefix.length());
|
||||
lpkGoods.setPicUrl(path);
|
||||
}
|
||||
baseMapper.updateById(lpkGoods);
|
||||
} else {
|
||||
LpkGoods goods=baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("name",dto.getName()));
|
||||
if(null!=goods){
|
||||
return rb.setMsg("商品名不能重复");
|
||||
}
|
||||
LpkGoods lpkGoods = new LpkGoods();
|
||||
sid = lpkGoods.getSid();
|
||||
BeanUtil.copyProperties(dto, lpkGoods, "id", "sid");
|
||||
lpkGoods.setCreateTime(new DateTime());
|
||||
if (StringUtils.isNotBlank(dto.getPicUrl())) {
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
String path = dto.getPicUrl().substring(urlPrefix.length());
|
||||
lpkGoods.setPicUrl(path);
|
||||
}
|
||||
baseMapper.insert(lpkGoods);
|
||||
}
|
||||
return rb.success().setData(sid);
|
||||
}
|
||||
|
||||
public ResultBean<LpkGoodsDetailsVo> goodsInit(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkGoodsDetailsVo vo = new LpkGoodsDetailsVo();
|
||||
LpkGoods lpkGoods = fetchBySid(sid);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (null != lpkGoods) {
|
||||
BeanUtil.copyProperties(lpkGoods, vo);
|
||||
if (StringUtils.isNotBlank(lpkGoods.getPicUrl())) {
|
||||
vo.setPicUrl(fileUploadComponent.getUrlPrefix() + lpkGoods.getPicUrl());
|
||||
}
|
||||
vo.setCreateTime(sdf.format(lpkGoods.getCreateTime()));
|
||||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData();
|
||||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId());
|
||||
pq.getParams().setIndex(dataRule.getIndex());
|
||||
PagerQuery<BaseGoodsSkuQuery> baseGoodsSkuQueryPagerQuery=new PagerQuery<>();
|
||||
BeanUtil.copyProperties(pq,baseGoodsSkuQueryPagerQuery);
|
||||
ResultBean<PagerVo<GoodsSkuVo1>>sku= baseGoodsSkuFeign.listPage(baseGoodsSkuQueryPagerQuery);
|
||||
List<LpkGoodsVo> records = new ArrayList<>();
|
||||
PagerVo vo=new PagerVo();
|
||||
BeanUtil.copyProperties(sku.getData(),vo);
|
||||
LpkGoodsVo vv=new LpkGoodsVo();
|
||||
for (GoodsSkuVo1 record : sku.getData().getRecords()) {
|
||||
vv.setCreateTime(new Date());
|
||||
vv.setCode(record.getGoodsCode());
|
||||
vv.setPrice(record.getSalesPrice());
|
||||
vv.setBarcode(record.getBarCode());
|
||||
vv.setName(record.getGoodsName());
|
||||
vv.setWeight(record.getTitle());
|
||||
vv.setUnitName(record.getUnitName());
|
||||
vv.setPrice(record.getSalesPrice());
|
||||
vv.setBrandId(record.getBrandSid());
|
||||
vv.setBrandName(record.getBrandName());
|
||||
vv.setCategoryId(record.getTypeSid());
|
||||
vv.setCategoryName(record.getGoodsTypeName());
|
||||
vv.setSort(record.getSortNo());
|
||||
vv.setSid(record.getSkuSid());
|
||||
if (StringUtils.isNotBlank(record.getPicUrl())) {
|
||||
vv.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl());
|
||||
}
|
||||
LpkGoods lpkGoods = baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("skuSid", vv.getSid()));
|
||||
vv.setIsAppletGrounding(lpkGoods.getIsAppletGrounding());
|
||||
vv.setUseTo(lpkGoods.getUseTo());
|
||||
records.add(vv);
|
||||
}
|
||||
vo.setRecords(records);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
public ResultBean saveGoods(LpkGoodsDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
dto.setSignSid(UUID.randomUUID().toString());
|
||||
BaseGoodsSpuDto spuDto=new BaseGoodsSpuDto();
|
||||
BaseGoodsSpuDetailDto detailDto=new BaseGoodsSpuDetailDto();
|
||||
detailDto.setGoodsExplain(dto.getAppContent());
|
||||
spuDto.setSid(dto.getSid());
|
||||
spuDto.setBrandSid(dto.getBrandId());
|
||||
spuDto.setBrandName(dto.getBrandName());
|
||||
spuDto.setGoodsName(dto.getName());
|
||||
spuDto.setGoodsTypeName(dto.getCategoryName());
|
||||
spuDto.setGoodsTypeSid(dto.getCategoryId());
|
||||
|
||||
spuDto.setGoodsUnitSid(dto.getSpecificationUnitSid());
|
||||
spuDto.setGoodsUnitName(dto.getSpecificationUnit());
|
||||
spuDto.setGoodsCode(dto.getCode());
|
||||
spuDto.setBarCode(dto.getBarcode());
|
||||
spuDto.setUseOrgSid(dto.getUseOrgSid());
|
||||
spuDto.setCreateOrgSid(dto.getUseOrgSid());
|
||||
spuDto.setCreateBySid(dto.getUserSid());
|
||||
spuDto.setSortNo(dto.getSort());
|
||||
List<BaseGoodsSkuDto> baseGoodsSkus=new ArrayList<>();//商品sku
|
||||
BaseGoodsSkuDto dto1=new BaseGoodsSkuDto();
|
||||
BaseGoodsSkuExtendDto extendDto=new BaseGoodsSkuExtendDto();
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
if(StringUtils.isNotBlank(dto.getPicUrl())){
|
||||
String path = dto.getPicUrl().substring(urlPrefix.length());
|
||||
extendDto.setPicUrl(path);
|
||||
}
|
||||
extendDto.setPackUnit(dto.getUnitName());
|
||||
extendDto.setSalesPrice(dto.getPrice());
|
||||
dto1.setSid(dto.getSkuSid());
|
||||
dto1.setTitle(dto.getWeight());
|
||||
dto1.setIndexes(dto.getRemarks());
|
||||
dto1.setRemarks(dto.getContent());
|
||||
dto1.setSignSid(dto.getSignSid());
|
||||
baseGoodsSkus.add(dto1);
|
||||
for (BaseGoodsSkuDto goodsSkus : baseGoodsSkus) {
|
||||
goodsSkus.setBaseGoodsSkuExtend(extendDto);
|
||||
}
|
||||
spuDto.setBaseGoodsSpuDetail(detailDto);
|
||||
spuDto.setBaseGoodsSkus(baseGoodsSkus);
|
||||
ResultBean<List<BaseGoodsSku>> listResultBean = baseGoodsSpuFeign.saveOrUpdateByName(spuDto);
|
||||
if(!listResultBean.getCode().equals("200")){
|
||||
return listResultBean;
|
||||
}
|
||||
List<BaseGoodsSku>skus= listResultBean.getData();
|
||||
|
||||
baseMapper.delete(new QueryWrapper<LpkGoods>().eq("spuSid",skus.get(0).getGoodsSpuSid()));
|
||||
LpkGoods lpkGoods=new LpkGoods();
|
||||
BeanUtil.copyProperties(dto,lpkGoods);
|
||||
lpkGoods.setSid(UUID.randomUUID().toString());
|
||||
lpkGoods.setSpuSid(skus.get(0).getGoodsSpuSid());
|
||||
lpkGoods.setSkuSid(skus.get(0).getSid());
|
||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||
lpkGoods.setPeriodValidity(sdf.format(new Date()));
|
||||
lpkGoods.setSort("1");
|
||||
baseMapper.insert(lpkGoods);
|
||||
return rb.success().setMsg("成功");
|
||||
}
|
||||
|
||||
public ResultBean goodsInit(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
ResultBean<BaseGoodsSkuVo> w=baseGoodsSkuFeign.initialization(sid);
|
||||
if(!w.getCode().equals("200")){
|
||||
return w;
|
||||
}
|
||||
ResultBean<BaseGoodsSpuVo> initialization = baseGoodsSpuFeign.initialization(w.getData().getGoodsSpuSid());
|
||||
if(!initialization.getCode().equals("200")){
|
||||
return initialization;
|
||||
}
|
||||
LpkGoods lpkGoods1 = baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("skuSid", w.getData().getSid()));
|
||||
BaseGoodsSpuVo data = initialization.getData();
|
||||
LpkGoodsDetailsVo lpkGoods = new LpkGoodsDetailsVo();
|
||||
lpkGoods.setBarcode(data.getBarCode());
|
||||
lpkGoods.setCreateTime(data.getCreateTime().toString());
|
||||
lpkGoods.setCode(data.getGoodsCode());
|
||||
lpkGoods.setName(data.getGoodsName());
|
||||
lpkGoods.setUnitName(data.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getPackUnit());
|
||||
// lpkGoods.setTypeCode();
|
||||
lpkGoods.setPrice(data.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getSalesPrice());
|
||||
lpkGoods.setAppContent(data.getBaseGoodsSpuDetail().getGoodsExplain());
|
||||
lpkGoods.setSpecificationUnit(data.getGoodsUnitName());
|
||||
lpkGoods.setSpecificationUnitSid(data.getGoodsUnitSid());
|
||||
// lpkGoods.setNumber(d);
|
||||
lpkGoods.setIsAppletGrounding(lpkGoods1.getIsAppletGrounding());
|
||||
lpkGoods.setContent(data.getBaseGoodsSkus().get(0).getRemarks());
|
||||
lpkGoods.setWeight(data.getBaseGoodsSkus().get(0).getTitle());
|
||||
lpkGoods.setUseTo(lpkGoods1.getUseTo());
|
||||
lpkGoods.setBrandId(data.getBrandSid());
|
||||
lpkGoods.setBrandName(data.getBrandName());
|
||||
lpkGoods.setCategoryId(data.getGoodsTypeSid());
|
||||
lpkGoods.setCategoryName(data.getTypeName());
|
||||
lpkGoods.setStepWeight(lpkGoods1.getStepWeight());
|
||||
lpkGoods.setPeriodValidity(DateUtil.parse(lpkGoods1.getPeriodValidity()));
|
||||
lpkGoods.setSort(data.getSortNo());
|
||||
lpkGoods.setSpuSid(data.getSid());
|
||||
lpkGoods.setSkuSid(data.getBaseGoodsSkus().get(0).getSid());
|
||||
lpkGoods.setSid(data.getSid());
|
||||
lpkGoods.setRemarks(data.getBaseGoodsSkus().get(0).getIndexes());
|
||||
lpkGoods.setUseOrgSid(data.getUseOrgSid());
|
||||
lpkGoods.setCreateOrgSid(data.getCreateOrgSid());
|
||||
if (StringUtils.isNotBlank(data.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getPicUrl())) {
|
||||
lpkGoods.setPicUrl(fileUploadComponent.getUrlPrefix() + data.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getPicUrl());
|
||||
}
|
||||
return rb.success().setData(lpkGoods);
|
||||
}
|
||||
|
||||
public ResultBean<LpkGoodsDetailsVo> goodsDetails(String sid,String customerSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
@@ -178,7 +279,7 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
|
||||
public ResultBean appletGrounding(String sid,String state) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkGoods lpkGoods = fetchBySid(sid);
|
||||
LpkGoods lpkGoods=baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("skuSid",sid));
|
||||
if (null != lpkGoods) {
|
||||
lpkGoods.setIsAppletGrounding(state);
|
||||
baseMapper.updateById(lpkGoods);
|
||||
@@ -190,7 +291,8 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
}
|
||||
public ResultBean appletUseTo(String sid,String state) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkGoods lpkGoods = fetchBySid(sid);
|
||||
// LpkGoods lpkGoods = fetchBySid(sid);
|
||||
LpkGoods lpkGoods=baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("skuSid",sid));
|
||||
if (null != lpkGoods) {
|
||||
lpkGoods.setUseTo(state);
|
||||
baseMapper.updateById(lpkGoods);
|
||||
@@ -304,16 +406,33 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
List<GoodsTypeVo> list=baseMapper.getType();
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
public ResultBean<List<GoodsTypeVo>> getGoodsTypeAndBrand() {
|
||||
public ResultBean<List<GoodsTypeVo>> getGoodsTypeAndBrand(OrgPathQuery query) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
GoodsTypeVo vo=new GoodsTypeVo();
|
||||
List<GoodsTypeVo> list=baseMapper.getType();
|
||||
ResultBean<List<BaseGoodsTypeVo>> listResultBean = baseGoodsTypeFeign.listAll(query);
|
||||
List<GoodsTypeVo> list=new ArrayList<>();
|
||||
for (BaseGoodsTypeVo datum : listResultBean.getData()) {
|
||||
GoodsTypeVo vo1=new GoodsTypeVo();
|
||||
vo1.setName(datum.getGoodsTypeName());
|
||||
// vo1.setId();
|
||||
vo1.setSid(datum.getSid());
|
||||
}
|
||||
|
||||
GoodsTypeVo vo1=new GoodsTypeVo();
|
||||
vo1.setName("全部分类");
|
||||
vo1.setId("0");
|
||||
vo1.setSid("0");
|
||||
list.add(0,vo1);
|
||||
vo.setTypeVos(list);
|
||||
List<BrandVo> list1= IPmsBrandService.getList().getData();
|
||||
ResultBean<List<BaseBrandInfoVo>> listResultBean1 = baseBrandInfoFeign.listAll(query);
|
||||
List<BrandVo> list1= new ArrayList<>();
|
||||
for (BaseBrandInfoVo datum : listResultBean1.getData()) {
|
||||
BrandVo vo2=new BrandVo();
|
||||
vo2.setBrandName(datum.getBrandName());
|
||||
vo2.setSid(datum.getSid());
|
||||
list1.add(vo2);
|
||||
}
|
||||
|
||||
vo.setBrandVos(list1);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
@@ -396,10 +515,51 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
double a =1.88;
|
||||
double b =10;
|
||||
System.out.println(a*b);
|
||||
public static void main(String[] args) throws AWTException, InterruptedException {
|
||||
Robot robot = new Robot();
|
||||
// robot.delay(50000);
|
||||
// 76, 198, 244;
|
||||
int rgb = robot.getPixelColor(1629, 336).getBlue();
|
||||
int rgb1 = robot.getPixelColor(1629, 336).getRed();
|
||||
int rgb2= robot.getPixelColor(1629, 336).getGreen();
|
||||
while (1==1){
|
||||
|
||||
if(rgb!=242){
|
||||
if(rgb1!=80){
|
||||
if(rgb2!=201){
|
||||
System.out.println(1111);
|
||||
// robot.mouseMove(1522, 562);
|
||||
// robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
// robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
// robot.delay(100);
|
||||
// robot.mouseMove(1674, 750);
|
||||
// robot.delay(100);
|
||||
// robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
// robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
// robot.delay(100);
|
||||
// robot.mouseMove(1664, 400);
|
||||
// robot.delay(2000);
|
||||
// robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
// robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
// robot.delay(100);
|
||||
// robot.mouseMove(1780,750);
|
||||
// robot.delay(2000);
|
||||
// robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
// robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
System.out.println(222);
|
||||
Thread.sleep(2000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// System.out.println(rgb);
|
||||
// robot.mousePress();
|
||||
// double a =1.88;
|
||||
// double b =10;
|
||||
// System.out.println(a*b);
|
||||
}
|
||||
/**
|
||||
* 去除多余.0
|
||||
|
||||
@@ -22,7 +22,9 @@ import java.util.List;
|
||||
path = "/apiadmin/base/basegoodssku",
|
||||
fallback = BaseGoodsSkuFeignFallback.class)
|
||||
public interface BaseGoodsSkuFeign {
|
||||
|
||||
@ApiOperation("分页列表")
|
||||
@PostMapping("/listPage")
|
||||
public ResultBean<PagerVo<GoodsSkuVo1>> listPage(@RequestBody PagerQuery<BaseGoodsSkuQuery> pq);
|
||||
@ApiOperation("获取商品信息")
|
||||
@GetMapping("/getDetails")
|
||||
ResultBean<BaseGoodsSkuDetailsVo> getDetails(@RequestParam("sid") String sid);
|
||||
@@ -38,4 +40,6 @@ public interface BaseGoodsSkuFeign {
|
||||
@ApiOperation("根据code查询商品")
|
||||
@GetMapping("/getSkuByCode/{code}/{title}")
|
||||
public ResultBean<BaseGoodsSku> getSkuByCode(@PathVariable("code") String code,@PathVariable("title") String title);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,11 @@ import java.util.List;
|
||||
**/
|
||||
@Component
|
||||
public class BaseGoodsSkuFeignFallback implements BaseGoodsSkuFeign{
|
||||
@Override
|
||||
public ResultBean<PagerVo<GoodsSkuVo1>> listPage(PagerQuery<BaseGoodsSkuQuery> pq) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<BaseGoodsSkuDetailsVo> getDetails(String sid) {
|
||||
return null;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yxt.ordermall.feign.base.basegoodsspu;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.ordermall.biz.func.basegoodssku.BaseGoodsSku;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuDto;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuQuery;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuVo;
|
||||
@@ -35,7 +36,9 @@ public interface BaseGoodsSpuFeign {
|
||||
@ApiOperation("保存修改")
|
||||
@PostMapping("/saveOrUpdate")
|
||||
public ResultBean<String> saveOrUpdate(@RequestBody BaseGoodsSpuDto dto);
|
||||
|
||||
@ApiOperation("保存修改")
|
||||
@PostMapping("/saveOrUpdateByName")
|
||||
public ResultBean<List<BaseGoodsSku>> saveOrUpdateByName(@RequestBody BaseGoodsSpuDto dto);
|
||||
@ApiOperation("初始化")
|
||||
@GetMapping("/initialization/{sid}")
|
||||
public ResultBean<BaseGoodsSpuVo> initialization(@PathVariable("sid") String sid);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yxt.ordermall.feign.base.basegoodsspu;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.ordermall.biz.func.basegoodssku.BaseGoodsSku;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuDto;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuQuery;
|
||||
import com.yxt.ordermall.biz.func.basegoodsspu.BaseGoodsSpuVo;
|
||||
@@ -31,6 +32,11 @@ public class BaseGoodsSpuFeignFallback implements BaseGoodsSpuFeign {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<BaseGoodsSku>> saveOrUpdateByName(BaseGoodsSpuDto dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<BaseGoodsSpuVo> initialization(String sid) {
|
||||
return null;
|
||||
|
||||
@@ -1,168 +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.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.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 = "PmsBrandController", description = "品牌表管理")
|
||||
@RequestMapping("/pms/PmsBrand")
|
||||
public class PmsBrandController {
|
||||
@Resource
|
||||
private IPmsBrandService IPmsBrandService;
|
||||
|
||||
// @SysLog(MODULE = "pms", REMARK = "根据条件查询所有品牌表列表")
|
||||
@ApiOperation("根据条件查询所有品牌表列表")
|
||||
@GetMapping(value = "/list")
|
||||
public Object getPmsBrandByPage(PmsBrand entity,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize
|
||||
) {
|
||||
try {
|
||||
if (ValidatorUtils.notEmpty(entity.getName())) {
|
||||
return new CommonResult().success(IPmsBrandService.page(new Page<PmsBrand>(pageNum, pageSize), new QueryWrapper<PmsBrand>(new PmsBrand()).like("name", entity.getName())));
|
||||
}
|
||||
return new CommonResult().success(IPmsBrandService.page(new Page<PmsBrand>(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:PmsBrand:create')")
|
||||
public Object savePmsBrand(@RequestBody PmsBrand entity) {
|
||||
try {
|
||||
if (IPmsBrandService.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 updatePmsBrand(@RequestBody PmsBrand entity) {
|
||||
try {
|
||||
if (IPmsBrandService.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:PmsBrand:delete')")
|
||||
public Object deletePmsBrand(@ApiParam("品牌表id") @PathVariable Long id) {
|
||||
try {
|
||||
if (ValidatorUtils.empty(id)) {
|
||||
return new CommonResult().paramFailed("品牌表id");
|
||||
}
|
||||
if (IPmsBrandService.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 getPmsBrandById(@ApiParam("品牌表id") @PathVariable Long id) {
|
||||
try {
|
||||
if (ValidatorUtils.empty(id)) {
|
||||
return new CommonResult().paramFailed("品牌表id");
|
||||
}
|
||||
PmsBrand coupon = IPmsBrandService.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:PmsBrand:delete')")
|
||||
public Object deleteBatch(@RequestParam("ids") List<Long> ids) {
|
||||
boolean count = IPmsBrandService.removeByIds(ids);
|
||||
if (count) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量更新显示状态")
|
||||
@RequestMapping(value = "/update/showStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
// @SysLog(MODULE = "pms", REMARK = "批量更新显示状态")
|
||||
public Object updateShowStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("showStatus") Integer showStatus) {
|
||||
int count = IPmsBrandService.updateShowStatus(ids, showStatus);
|
||||
if (count > 0) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量更新厂家制造商状态")
|
||||
@RequestMapping(value = "/update/factoryStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
// @SysLog(MODULE = "pms", REMARK = "批量更新厂家制造商状态")
|
||||
public Object updateFactoryStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("factoryStatus") Integer factoryStatus) {
|
||||
int count = IPmsBrandService.updateFactoryStatus(ids, factoryStatus);
|
||||
if (count > 0) {
|
||||
return new CommonResult().success(count);
|
||||
} else {
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取品牌")
|
||||
@GetMapping("/getList")
|
||||
ResultBean<List<BrandVo>> getList(){
|
||||
return IPmsBrandService.getList();
|
||||
}
|
||||
}
|
||||
@@ -29,194 +29,194 @@ import java.util.List;
|
||||
@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) {
|
||||
// @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 = "/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();
|
||||
}
|
||||
}
|
||||
//
|
||||
// @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();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class PmsProductCategoryServiceImpl extends ServiceImpl<PmsProductCategor
|
||||
@Override
|
||||
public int updateShowStatus(List<Long> ids, Integer showStatus) {
|
||||
PmsProductCategory productCategory = new PmsProductCategory();
|
||||
productCategory.setShowStatus(showStatus);
|
||||
// productCategory.setShowStatus(showStatus);
|
||||
return categoryMapper.update(productCategory, new QueryWrapper<PmsProductCategory>().in("id", ids));
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.zscat.mallplus.utils.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -17,10 +18,18 @@ import java.io.Serializable;
|
||||
* @since 2019-04-19
|
||||
*/
|
||||
@TableName("pms_brand")
|
||||
@Data
|
||||
public class PmsBrand extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String sid;
|
||||
@TableField(exist = false)
|
||||
private String useOrgSid;//使用组织sid
|
||||
@TableField(exist = false)
|
||||
private String createOrgSid;//创建组织sid
|
||||
@TableField(exist = false)
|
||||
private String userSid;
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class PmsProductCategory extends BaseEntity implements Serializable {
|
||||
* 显示状态:0->不显示;1->显示
|
||||
*/
|
||||
@TableField("show_status")
|
||||
private Integer showStatus;
|
||||
private String showStatus;
|
||||
/**
|
||||
* 是否是首页分类0-->不是,1-->是
|
||||
*/
|
||||
@@ -83,5 +83,12 @@ public class PmsProductCategory extends BaseEntity implements Serializable {
|
||||
private List<Long> productAttributeIdList;
|
||||
@TableField(exist = false)
|
||||
private List<PmsProductCategory> childList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String sid;
|
||||
@TableField(exist = false)
|
||||
private String useOrgSid;//使用组织sid
|
||||
@TableField(exist = false)
|
||||
private String createOrgSid;//创建组织sid
|
||||
@TableField(exist = false)
|
||||
private String userSid;
|
||||
}
|
||||
|
||||
@@ -22,4 +22,5 @@ public class BrandVo {
|
||||
@ApiModelProperty("起订协议")
|
||||
private String qdxy;
|
||||
private String count;
|
||||
private String sid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user