Browse Source

喜相随

master
wangpengfei 2 years ago
parent
commit
49c15d5964
  1. 137
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/restrictedbrand/RestrictedBrandRest.java
  2. 145
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/restrictedcategory/RestrictedCategoryRest.java
  3. 72
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/restrictedbrand/RestrictedBrandMapper.java
  4. 80
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/restrictedcategory/RestrictedCategoryMapper.java
  5. 91
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrand.java
  6. 59
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandDetailsVo.java
  7. 59
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandDto.java
  8. 57
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandQuery.java
  9. 61
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandVo.java
  10. 94
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategory.java
  11. 58
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryDetailsVo.java
  12. 61
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryDto.java
  13. 57
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryQuery.java
  14. 72
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryVo.java
  15. 211
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/restrictedbrand/RestrictedBrandService.java
  16. 285
      warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/restrictedcategory/RestrictedCategoryService.java
  17. 39
      warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedBrandMapper.xml
  18. 50
      warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedCategoryMapper.xml

137
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/restrictedbrand/RestrictedBrandRest.java

@ -0,0 +1,137 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.controller.restrictedbrand;
import com.wh.pojo.restrictedbrand.*;
import com.wh.service.restrictedbrand.RestrictedBrandService;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedBrandFeignFallback.java <br/>
* Class: com.yxt.supervise.customer.biz.restrictedbrand.RestrictedBrandRest <br/>
* Description: 限定品牌. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Api(tags = "限定品牌")
@RestController("com.wh.biz.restrictedbrand.RestrictedBrandRest")
@RequestMapping("v1/restrictedbrand")
public class RestrictedBrandRest{
@Autowired
private RestrictedBrandService restrictedBrandService;
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage")
public ResultBean<PagerVo<RestrictedBrandVo>> listPage(@RequestBody PagerQuery<RestrictedBrandQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<RestrictedBrandVo> pv = restrictedBrandService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/brandList")
public ResultBean<PagerVo<RestrictedBrandVo>> brandList() {
ResultBean rb = ResultBean.fireFail();
List<RestrictedBrandVo> pv = restrictedBrandService.brandList();
return rb.success().setData(pv);
}
@ApiOperation("新增或修改")
@PostMapping("/save")
public ResultBean save(@RequestBody RestrictedBrandDto dto) {
return restrictedBrandService.saveOrUpdateDto(dto);
}
public ResultBean delBySid(String id) {
ResultBean rb = ResultBean.fireFail();
RestrictedBrand restrictedBrand = restrictedBrandService.getRestById(id);
if(restrictedBrand == null){
return rb.setMsg("该监管品牌不存在");
}
restrictedBrandService.deleteById(id);
return rb.success();
}
@ApiOperation("根据SID获取一条记录")
@GetMapping("/fetchDetailsBySid/{id}")
public ResultBean<RestrictedBrandDetailsVo> fetchDetailsBySid(@PathVariable("id") String id) {
ResultBean rb = ResultBean.fireFail();
RestrictedBrand restrictedBrand = restrictedBrandService.getRestById(id);
if (restrictedBrand == null) {
return rb.setMsg("该品牌不存在");
}
RestrictedBrandDetailsVo vo = restrictedBrandService.fetchDetailsVoBySid(id);
return rb.success().setData(vo);
}
// @RequestMapping(value = "/importBrandSort", method = RequestMethod.POST)
public ResultBean importBrandSort(@RequestParam("filename") MultipartFile file,
HttpServletRequest request, HttpServletResponse response) {
ResultBean rb = ResultBean.fireFail();
String temp = request.getSession().getServletContext()
.getRealPath(File.separator)
+ "temp"; // 临时目录
File tempFile = new File(temp);
if (!tempFile.exists()) {
tempFile.mkdirs();
}
String name = file.getOriginalFilename();// 获取上传文件名,包括路径
long size = file.getSize();
if ((name == null || name.equals("")) && size == 0)
return null;
InputStream in = null;
try {
in = file.getInputStream();
} catch (IOException e) {
e.printStackTrace();
}
//inventoryInformationService.readBrandPeriodSorXls1(in,"");
restrictedBrandService.readBrandPeriodSorXls1(in, "");
return rb;
}
}

145
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/restrictedcategory/RestrictedCategoryRest.java

@ -0,0 +1,145 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.controller.restrictedcategory;
import com.wh.pojo.restrictedcategory.*;
import com.wh.service.restrictedcategory.RestrictedCategoryService;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedCategoryFeignFallback.java <br/>
* Class: com.yxt.supervise.customer.biz.restrictedcategory.RestrictedCategoryRest <br/>
* Description: 限定品类. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Api(tags = "限定品类")
@RestController("com.wh.biz.restrictedcategory.RestrictedCategoryRest")
@RequestMapping("v1/restrictedcategory")
public class RestrictedCategoryRest{
@Autowired
private RestrictedCategoryService restrictedCategoryService;
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage")
public ResultBean<PagerVo<RestrictedCategoryVo>> listPage(@RequestBody PagerQuery<RestrictedCategoryQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<RestrictedCategoryVo> pv = restrictedCategoryService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/categoryList")
public ResultBean<PagerVo<RestrictedCategoryVo>> categoryList() {
ResultBean rb = ResultBean.fireFail();
List<RestrictedCategoryVo> pv = restrictedCategoryService.categoryList();
return rb.success().setData(pv);
}
@ApiOperation("新增或修改")
@PostMapping("/save")
public ResultBean save(@RequestBody RestrictedCategoryDto dto) {
return restrictedCategoryService.saveOrUpdateDto(dto);
}
public ResultBean delBySid(String id) {
ResultBean rb = ResultBean.fireFail();
RestrictedCategory restrictedCategory = restrictedCategoryService.getRestById(id);
if(restrictedCategory == null){
return rb.setMsg("该监管类别不存在");
}
restrictedCategoryService.deleteById(id);
return rb.success();
}
@ApiOperation("获取类别树形")
@GetMapping("/categoryListTree")
public ResultBean<List<RestrictedCategoryVo>> list() {
ResultBean rb = ResultBean.fireFail();
List<RestrictedCategoryVo> list = restrictedCategoryService.listVo();
return rb.success().setData(list);
}
@ApiOperation("根据SID获取一条记录")
@GetMapping("/fetchDetailsBySid/{id}")
public ResultBean<RestrictedCategoryDetailsVo> fetchDetailsBySid(@PathVariable("id") String id) {
ResultBean rb = ResultBean.fireFail();
RestrictedCategory restrictedCategory = restrictedCategoryService.getRestById(id);
if(restrictedCategory == null){
return rb.setMsg("该类别不存在");
}
RestrictedCategoryDetailsVo vo = restrictedCategoryService.fetchDetailsVoBySid(id);
return rb.success().setData(vo);
}
// @RequestMapping(value = "/importBrandSort", method = RequestMethod.POST)
public ResultBean importBrandSort(@RequestParam("filename") MultipartFile file,
HttpServletRequest request, HttpServletResponse response) {
ResultBean rb = ResultBean.fireFail();
String temp = request.getSession().getServletContext()
.getRealPath(File.separator)
+ "temp"; // 临时目录
File tempFile = new File(temp);
if (!tempFile.exists()) {
tempFile.mkdirs();
}
String name = file.getOriginalFilename();// 获取上传文件名,包括路径
long size = file.getSize();
if ((name == null || name.equals("")) && size == 0)
return null;
InputStream in = null;
try {
in = file.getInputStream();
} catch (IOException e) {
e.printStackTrace();
}
//inventoryInformationService.readBrandPeriodSorXls1(in,"");
restrictedCategoryService.readBrandPeriodSorXls1(in, "");
return rb;
}
}

72
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/restrictedbrand/RestrictedBrandMapper.java

@ -0,0 +1,72 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.mapper.restrictedbrand;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.wh.pojo.restrictedbrand.RestrictedBrand;
import com.wh.pojo.restrictedbrand.RestrictedBrandVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedBrandMapper.java <br/>
* Class: com.yxt.supervise.customer.biz.restrictedbrand.RestrictedBrandMapper <br/>
* Description: 限定品牌. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface RestrictedBrandMapper extends BaseMapper<RestrictedBrand> {
IPage<RestrictedBrandVo> selectPageVo(IPage<RestrictedBrand> page, @Param(Constants.WRAPPER) Wrapper<RestrictedBrand> qw);
List<RestrictedBrandVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<RestrictedBrand> qw);
@Select("select * from restricted_brand")
List<RestrictedBrandVo> selectListVo();
@Select("select * from restricted_brand where code=#{brandCode}")
RestrictedBrand selectByBrands(@Param("brandCode") String brandCode);
RestrictedBrand selectByCodeAndSid(@Param("code") String code, @Param("sid") String sid);
RestrictedBrand selectByCode(String code);
List<RestrictedBrandVo> brandList();
}

80
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/restrictedcategory/RestrictedCategoryMapper.java

@ -0,0 +1,80 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.mapper.restrictedcategory;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.wh.pojo.restrictedcategory.RestrictedCategory;
import com.wh.pojo.restrictedcategory.RestrictedCategoryVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedCategoryMapper.java <br/>
* Class: com.yxt.supervise.customer.biz.restrictedcategory.RestrictedCategoryMapper <br/>
* Description: 限定品类. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface RestrictedCategoryMapper extends BaseMapper<RestrictedCategory> {
IPage<RestrictedCategoryVo> selectPageVo(IPage<RestrictedCategory> page, @Param(Constants.WRAPPER) Wrapper<RestrictedCategory> qw);
List<RestrictedCategoryVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<RestrictedCategory> qw);
@Select("select * from restricted_category")
List<RestrictedCategoryVo> selectListVo();
@Select("select * from restricted_category where categorys like CONCAT('%',#{categoryKey},'%') and brands like CONCAT('%',#{brandCode},'%')")
List<RestrictedCategory> limitJudgement(@Param("categoryKey") String categoryKey, @Param("brandCode") String brandCode);
@Select("select * from restricted_category where categoryKey = #{categoryKey} ")
RestrictedCategory selectByCategorys(@Param("categoryKey") String categoryKey);
@Select("select * from restricted_category where brands like CONCAT('%',#{brandCode},'%') ")
List<RestrictedCategory> selectByBrands(@Param("brandCode") String brand);
RestrictedCategory selectByKey(String key);
RestrictedCategory selectByKeyAndSid(@Param("key") String key, @Param("sid") String sid);
List<RestrictedCategoryVo> categoryList();
List<RestrictedCategoryVo> selectFirstCategoryList();
List<RestrictedCategoryVo> selectChildernList(String sid);
}

91
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrand.java

@ -0,0 +1,91 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedbrand;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxt.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.UUID;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedBrand.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrand <br/>
* Description: 限定品牌. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品牌", description = "限定品牌")
@TableName("restricted_brand")
public class RestrictedBrand {
private static final long serialVersionUID = 1L;
@ApiModelProperty("字符型编号")
private String sid = UUID.randomUUID().toString();
// @Version
@ApiModelProperty("记录版本,锁")
private Integer lock_version = 0;
@ApiModelProperty("记录创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date create_time = new Date();
@ApiModelProperty("记录最后修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date modify_time = new Date();
@ApiModelProperty("记录状态值")
private Integer state = 1;
@ApiModelProperty("记录是否可用,1:可用(默认),0:不可用")
private Integer is_enable = 1;
// @TableLogic
@ApiModelProperty("记录是否被删除,0:未删除(默认),1:已经删除")
private Integer is_delete = 0;
@ApiModelProperty("备注信息")
private String remarks;
@ApiModelProperty("创建者")
private String create_by_sid;
@ApiModelProperty("更新者")
private String update_by_sid;
@ApiModelProperty("代码")
private String code;
@ApiModelProperty("名称")
private String name;
}

59
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandDetailsVo.java

@ -0,0 +1,59 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedbrand;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedBrandVo.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandVo <br/>
* Description: 限定品牌 视图数据对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品牌 视图数据详情", description = "限定品牌 视图数据详情")
public class RestrictedBrandDetailsVo implements Vo {
private static final long serialVersionUID = 414974237796022251L;
private String sid;
@ApiModelProperty("代码")
private String code;
@ApiModelProperty("名称")
private String name;
}

59
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandDto.java

@ -0,0 +1,59 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedbrand;
import com.yxt.common.core.dto.Dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedBrandDto.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandDto <br/>
* Description: 限定品牌 数据传输对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品牌 数据传输对象", description = "限定品牌 数据传输对象")
public class RestrictedBrandDto implements Dto {
private static final long serialVersionUID = -4284546832808688666L;
private String sid;
private String id;
@ApiModelProperty("代码")
private String code;
@ApiModelProperty("名称")
private String name;
}

57
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandQuery.java

@ -0,0 +1,57 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedbrand;
import com.yxt.common.core.query.Query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedBrandQuery.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandQuery <br/>
* Description: 限定品牌 查询条件. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品牌 查询条件", description = "限定品牌 查询条件")
public class RestrictedBrandQuery implements Query {
private static final long serialVersionUID = 1469442912078558237L;
@ApiModelProperty("代码")
private String code;
@ApiModelProperty("名称")
private String name;
}

61
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandVo.java

@ -0,0 +1,61 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedbrand;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedBrandVo.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandVo <br/>
* Description: 限定品牌 视图数据对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品牌 视图数据对象", description = "限定品牌 视图数据对象")
public class RestrictedBrandVo implements Vo {
private static final long serialVersionUID = 4695482182172367290L;
private String sid;
private String id;
@ApiModelProperty("代码")
private String code;
@ApiModelProperty("名称")
private String name;
private String dictValue;
private String dictKey;
}

94
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategory.java

@ -0,0 +1,94 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedcategory;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxt.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.UUID;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedCategory.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedcategory.RestrictedCategory <br/>
* Description: 限定品类. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品类", description = "限定品类")
@TableName("restricted_category")
public class RestrictedCategory {
private static final long serialVersionUID = 1L;
@ApiModelProperty("字符型编号")
private String sid = UUID.randomUUID().toString();
// @Version
@ApiModelProperty("记录版本,锁")
private Integer lock_version = 0;
@ApiModelProperty("记录创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date create_time = new Date();
@ApiModelProperty("记录最后修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date modify_time = new Date();
@ApiModelProperty("记录状态值")
private Integer state = 1;
@ApiModelProperty("记录是否可用,1:可用(默认),0:不可用")
private Integer is_enable = 1;
// @TableLogic
@ApiModelProperty("记录是否被删除,0:未删除(默认),1:已经删除")
private Integer is_delete = 0;
@ApiModelProperty("备注信息")
private String remarks;
@ApiModelProperty("创建者")
private String create_by_sid;
@ApiModelProperty("更新者")
private String update_by_sid;
@ApiModelProperty("监管品类")
private String categorys;
@ApiModelProperty("监管品类Key")
private String category_key;
private String psid;
private String grade;
}

58
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryDetailsVo.java

@ -0,0 +1,58 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedcategory;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedCategoryVo.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedcategory.RestrictedCategoryVo <br/>
* Description: 限定品类 视图数据对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品类 视图数据详情", description = "限定品类 视图数据详情")
public class RestrictedCategoryDetailsVo implements Vo {
private static final long serialVersionUID = 855177717255339140L;
private String sid;
@ApiModelProperty("监管品类")
private String categorys;
@ApiModelProperty("监管品类Key")
private String categoryKey;
}

61
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryDto.java

@ -0,0 +1,61 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedcategory;
import com.yxt.common.core.dto.Dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedCategoryDto.java <br/>
* Class: com.yxt.supervise.portal.api.restrictedcategory.RestrictedCategoryDto <br/>
* Description: 限定品类 数据传输对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品类 数据传输对象", description = "限定品类 数据传输对象")
public class RestrictedCategoryDto implements Dto {
private static final long serialVersionUID = 2112403315598174369L;
private String sid;
private String id;
@ApiModelProperty("监管品类")
private String categorys;
@ApiModelProperty("监管品类Key")
private String category_key;
private String psid;//
private String grade;
}

57
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryQuery.java

@ -0,0 +1,57 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedcategory;
import com.yxt.common.core.query.Query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedCategoryQuery.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedcategory.RestrictedCategoryQuery <br/>
* Description: 限定品类 查询条件. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品类 查询条件", description = "限定品类 查询条件")
public class RestrictedCategoryQuery implements Query {
private static final long serialVersionUID = -8593577848480469393L;
@ApiModelProperty("监管品类")
private String categorys;
@ApiModelProperty("监管品类Key")
private String categoryKey;
}

72
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryVo.java

@ -0,0 +1,72 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.pojo.restrictedcategory;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedCategoryVo.java <br/>
* Class: com.yxt.supervise.customer.api.restrictedcategory.RestrictedCategoryVo <br/>
* Description: 限定品类 视图数据对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "限定品类 视图数据对象", description = "限定品类 视图数据对象")
public class RestrictedCategoryVo implements Vo {
private static final long serialVersionUID = 7449291362621420732L;
private String sid;
private String id;
private String psid;
@ApiModelProperty("监管品类")
private String categorys;
@ApiModelProperty("监管品类Key")
private String categoryKey;
//子集
private List<RestrictedCategoryVo> children = new ArrayList<>();
private String dictValue;
private String dictKey;
private String sort;
//1 结束 2未结束
private String isEnd="2";
private String pName;
private String grade; //品类等级
}

211
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/restrictedbrand/RestrictedBrandService.java

@ -0,0 +1,211 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.service.restrictedbrand;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wh.mapper.restrictedbrand.RestrictedBrandMapper;
import com.wh.pojo.restrictedbrand.*;
import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellType;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedBrandService.java <br/>
* Class: com.yxt.supervise.customer.biz.restrictedbrand.RestrictedBrandService <br/>
* Description: 限定品牌 业务逻辑. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Slf4j
@Service
public class RestrictedBrandService extends MybatisBaseService<RestrictedBrandMapper, RestrictedBrand> {
public PagerVo<RestrictedBrandVo> listPageVo(PagerQuery<RestrictedBrandQuery> pq) {
RestrictedBrandQuery query = pq.getParams();
QueryWrapper<RestrictedBrand> qw = new QueryWrapper<>();
if (query != null) {
if (StringUtils.isNotBlank(query.getCode())) {
qw.like("code", query.getCode());
}
if (StringUtils.isNotBlank(query.getName())) {
qw.like("name", query.getName());
}
}
IPage<RestrictedBrand> page = PagerUtil.queryToPage(pq);
IPage<RestrictedBrandVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<RestrictedBrandVo> p = PagerUtil.pageToVo(pagging, null);
return p;
}
public List<RestrictedBrandVo> brandList() {
List<RestrictedBrandVo> pagging = baseMapper.brandList();
return pagging;
}
public ResultBean saveOrUpdateDto(RestrictedBrandDto dto) {
ResultBean rb = ResultBean.fireFail();
String sid = dto.getSid();
String id =dto.getSid();
String code = dto.getCode();
if (StringUtils.isBlank(id)) {
RestrictedBrand restrictedBrand = baseMapper.selectByCode(code);
if (restrictedBrand != null) {
return rb.setMsg("该品牌编码已存在");
}
restrictedBrand = new RestrictedBrand();
BeanUtil.copyProperties(dto, restrictedBrand, "sid");
baseMapper.insert(restrictedBrand);
} else {
RestrictedBrand restrictedBrand = fetchByCode(code);
if (restrictedBrand == null) {
return rb.setMsg("该品牌不存在");
}
//查询是否存在code值相同的
RestrictedBrand restrictedBrands = baseMapper.selectByCodeAndSid(code, sid);
if (restrictedBrands != null) {
return rb.setMsg("该品牌编码已存在");
}
BeanUtil.copyProperties(dto, restrictedBrand, "sid");
baseMapper.updateById(restrictedBrand);
}
return rb.success();
}
public RestrictedBrandDetailsVo fetchDetailsVoBySid(String id) {
RestrictedBrand entity = getRestById(id);
RestrictedBrandDetailsVo vo = new RestrictedBrandDetailsVo();
BeanUtil.copyProperties(entity, vo);
return vo;
}
public RestrictedBrand getRestById(String id) {
RestrictedBrand entity = fetchById(id);
QueryWrapper<RestrictedBrand> qw = new QueryWrapper<>();
qw.eq("id", id);
return baseMapper.selectOne(qw);
}
public int deleteById(String id) {
Map<String, Object> map = new HashMap<>();
map.put("id", id);
return baseMapper.deleteByMap(map);
}
public void readBrandPeriodSorXls1(InputStream is, String sid) {
HSSFWorkbook hssfWorkbook = null;
try {
hssfWorkbook = new HSSFWorkbook(is);
} catch (IOException e) {
e.printStackTrace();
}
List<String> lisss = new ArrayList<>();
List<String> lisss2 = new ArrayList<>();
HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(0);
// 循环行Row
for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
RestrictedBrand pr = new RestrictedBrand();
HSSFRow hssfRow = hssfSheet.getRow(rowNum);
int i = 0;
try {
if (rowNum >= 1) {
for (; i < hssfRow.getLastCellNum(); i++) {
HSSFCell brandIdHSSFCell = hssfRow.getCell(i);
if (brandIdHSSFCell != null) {
if (i == 1) {//品牌编码
brandIdHSSFCell.setCellType(CellType.STRING);
if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) {
String value = brandIdHSSFCell.getStringCellValue();
pr.setCode(value);
}
}
if (i == 2) {//品牌名称
brandIdHSSFCell.setCellType(CellType.STRING);
if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) {
String value = brandIdHSSFCell.getStringCellValue();
pr.setName(value);
}
}
} else {
System.err.println("rowNum=" + rowNum + ",i=" + i + ",value=null");
}
}
}
} catch (Exception e) {
e.printStackTrace();
System.err.println("i=" + i + ",value=null");
}
lisss.add(rowNum + "");
baseMapper.insert(pr);
log.info("productInformation:{}", JSONObject.toJSONString(pr));
}
String x = JSON.toJSONString(lisss);
System.out.println(x);
String x1 = JSON.toJSONString(lisss2);
System.out.println(x1);
//return message;
}
public RestrictedBrand selectByBrands(String brandCode) {
return baseMapper.selectByBrands(brandCode);
}
public RestrictedBrand fetchByCode(String code) {
QueryWrapper<RestrictedBrand> qw = new QueryWrapper<>();
qw.eq("code", code);
List<RestrictedBrand> list = baseMapper.selectList(qw);
if (list == null || list.isEmpty())
return null;
return list.get(0);
}
}

285
warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/restrictedcategory/RestrictedCategoryService.java

@ -0,0 +1,285 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.wh.service.restrictedcategory;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wh.mapper.restrictedcategory.RestrictedCategoryMapper;
import com.wh.pojo.restrictedcategory.*;
import com.wh.service.restrictedbrand.RestrictedBrandService;
import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellType;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Project: supervise-customer(客户中心) <br/>
* File: RestrictedCategoryService.java <br/>
* Class: com.yxt.supervise.customer.biz.restrictedcategory.RestrictedCategoryService <br/>
* Description: 限定品类 业务逻辑. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-11-22 21:47:10 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Slf4j
@Service
public class RestrictedCategoryService extends MybatisBaseService<RestrictedCategoryMapper, RestrictedCategory> {
/* @Resource
private DictCommonService dictCommonService;
@Resource
private BrandInfoService brandInfoService;*/
@Resource
private RestrictedBrandService restrictedBrandService;
/**
* 分页列表
*
* @param pq
* @return
*/
public PagerVo<RestrictedCategoryVo> listPageVo(PagerQuery<RestrictedCategoryQuery> pq) {
RestrictedCategoryQuery query = pq.getParams();
QueryWrapper<RestrictedCategory> qw = new QueryWrapper<>();
if (query != null) {
if (StringUtils.isNotBlank(query.getCategorys())) {
qw.like("categorys", query.getCategorys());
}
if (StringUtils.isNotBlank(query.getCategoryKey())) {
qw.like("categoryKey", query.getCategoryKey());
}
}
IPage<RestrictedCategory> page = PagerUtil.queryToPage(pq);
IPage<RestrictedCategoryVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<RestrictedCategoryVo> p = PagerUtil.pageToVo(pagging, null);
return p;
}
public List<RestrictedCategoryVo> categoryList() {
List<RestrictedCategoryVo> pagging = baseMapper.categoryList();
return pagging;
}
public ResultBean saveOrUpdateDto(RestrictedCategoryDto dto) {
ResultBean rb = ResultBean.fireFail();
String sid = dto.getSid();
String id = dto.getId();
String key = dto.getCategory_key();
if (StringUtils.isBlank(sid)) {
RestrictedCategory restrictedCategory = baseMapper.selectByKey(key);
//查询key是否重复
if (restrictedCategory != null) {
return rb.setMsg("该类别编码已存在");
}
RestrictedCategory restrictedCategory1 =new RestrictedCategory();
if(StringUtils.isNotBlank(dto.getPsid())){
if(dto.getPsid().equals("0")){
dto.setGrade(String.valueOf(1));
}else {
restrictedCategory1= baseMapper.selectOne(new QueryWrapper<RestrictedCategory>().eq("sid",dto.getPsid()));
dto.setGrade(String.valueOf(Integer.valueOf(restrictedCategory1.getGrade())+1));
}
}
restrictedCategory = new RestrictedCategory();
BeanUtil.copyProperties(dto, restrictedCategory, "sid");
baseMapper.insert(restrictedCategory);
} else {
RestrictedCategory restrictedCategory = fetchByCode(sid);
// if (restrictedCategory == null) {
// return rb.setMsg("该类别不存在");
// }
//查询该key是否存在
// RestrictedCategory restrictedCategorys = baseMapper.selectByKeyAndSid(key, sid);
// if (restrictedCategorys != null) {
// return rb.setMsg("该类别编码已存在");
// }
BeanUtil.copyProperties(dto, restrictedCategory, "sid");
baseMapper.update(restrictedCategory,new QueryWrapper<RestrictedCategory>().eq("sid",dto.getSid()));
}
return rb.success();
}
public RestrictedCategoryDetailsVo fetchDetailsVoBySid(String id) {
RestrictedCategory entity = getRestById(id);
RestrictedCategoryDetailsVo vo = new RestrictedCategoryDetailsVo();
BeanUtil.copyProperties(entity, vo);
return vo;
}
public int deleteById(String id) {
Map<String, Object> map = new HashMap<>();
map.put("id", id);
return baseMapper.deleteByMap(map);
}
public RestrictedCategory getRestById(String id) {
RestrictedCategory entity = fetchById(id);
QueryWrapper<RestrictedCategory> qw = new QueryWrapper<>();
qw.eq("id", id);
return baseMapper.selectOne(qw);
}
public void readBrandPeriodSorXls1(InputStream is, String sid) {
HSSFWorkbook hssfWorkbook = null;
try {
hssfWorkbook = new HSSFWorkbook(is);
} catch (IOException e) {
e.printStackTrace();
}
List<String> lisss = new ArrayList<>();
List<String> lisss2 = new ArrayList<>();
HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(0);
// 循环行Row
for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
RestrictedCategory pr = new RestrictedCategory();
HSSFRow hssfRow = hssfSheet.getRow(rowNum);
int i = 0;
try {
if (rowNum >= 1) {
for (; i < hssfRow.getLastCellNum(); i++) {
HSSFCell brandIdHSSFCell = hssfRow.getCell(i);
if (brandIdHSSFCell != null) {
if (i == 1) {//编码
brandIdHSSFCell.setCellType(CellType.STRING);
if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) {
String value = brandIdHSSFCell.getStringCellValue();
pr.setCategorys(value);
}
}
/*if (i == 2) {//名称
brandIdHSSFCell.setCellType(CellType.STRING);
if (StringUtils.isNotBlank(brandIdHSSFCell.getStringCellValue())) {
String value = brandIdHSSFCell.getStringCellValue();
pr.setBrands(value);
}
}*/
} else {
System.err.println("rowNum=" + rowNum + ",i=" + i + ",value=null");
}
}
}
} catch (Exception e) {
e.printStackTrace();
System.err.println("i=" + i + ",value=null");
}
lisss.add(rowNum + "");
baseMapper.insert(pr);
log.info("productInformation:{}", JSONObject.toJSONString(pr));
}
String x = JSON.toJSONString(lisss);
System.out.println(x);
String x1 = JSON.toJSONString(lisss2);
System.out.println(x1);
//return message;
}
public RestrictedCategory fetchByCode(String sid) {
QueryWrapper<RestrictedCategory> qw = new QueryWrapper<>();
// qw.eq("category_key", categoryKey);
qw.eq("sid", sid);
List<RestrictedCategory> list = baseMapper.selectList(qw);
if (list == null || list.isEmpty())
return null;
return list.get(0);
}
/* public Map<String, String> limitJudgement(String categoryKey, String brandCode) {
Map<String, String> result = new HashMap<>();
RestrictedCategory r = baseMapper.selectByCategorys(categoryKey);
result.put("success", "1");
String msg = "";
if (r == null) {
result.put("success", "0");
DictCommonDetailsVo category = dictCommonService.fetchByKeyAndType(categoryKey, "category");
if (category == null) {
msg = msg + categoryKey + "商品品类不存在;";
} else {
msg = msg + category.getDictValue() + "[" + categoryKey + "]" + "不符合监管品类;";
}
}
RestrictedBrand r1 = restrictedBrandService.selectByBrands(brandCode);
if (r1 == null) {
result.put("success", "0");
BrandInfoVo brandInfoVo = brandInfoService.selectByCode(brandCode);
if (brandInfoVo == null) {
msg = msg + categoryKey + "商品品牌不存在;";
} else {
msg = msg + brandInfoVo.getName() + "[" + brandCode + "]" + "不符合监管品牌;";
}
}
result.put("msg", msg);
return result;//baseMapper.limitJudgement(categoryKey,brandSid);
}*/
public List<RestrictedCategoryVo> listVo() {
List<RestrictedCategoryVo> sysOrganizations = baseMapper.selectFirstCategoryList();
getChildList(sysOrganizations);
return sysOrganizations;
}
public void getChildList(List<RestrictedCategoryVo> list) {
list.forEach(str -> {
String sid = str.getSid();
String pName=str.getCategorys();
List<RestrictedCategoryVo> listChildren = baseMapper.selectChildernList(sid);
listChildren.forEach(i->{
i.setPName(pName);
if(i.getGrade().equals("3")){
i.setIsEnd("1");
}
});
str.setChildren(listChildren);
getChildList(listChildren);
});
}
}

39
warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedBrandMapper.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wh.mapper.restrictedbrand.RestrictedBrandMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.wh.pojo.restrictedbrand.RestrictedBrandVo">
SELECT *
FROM restricted_brand
<where>
${ew.sqlSegment}
</where>
</select>
<select id="selectListAllVo" resultType="com.wh.pojo.restrictedbrand.RestrictedBrandVo">
SELECT *
FROM restricted_brand
<where>
${ew.sqlSegment}
</where>
</select>
<select id="selectByCodeAndSid" resultType="com.wh.pojo.restrictedbrand.RestrictedBrand">
select *
from restricted_brand
where code = #{code}
and sid &lt;&gt; #{sid}
</select>
<select id="selectByCode" resultType="com.wh.pojo.restrictedbrand.RestrictedBrand">
select *
from restricted_brand
where code = #{code}
</select>
<select id="brandList" resultType="com.wh.pojo.restrictedbrand.RestrictedBrandVo">
select name as dictValue, code as dictKey
from restricted_brand
</select>
</mapper>

50
warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedCategoryMapper.xml

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wh.mapper.restrictedcategory.RestrictedCategoryMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.wh.pojo.restrictedcategory.RestrictedCategoryVo">
SELECT *
FROM restricted_category
<where>
${ew.sqlSegment}
</where>
</select>
<select id="selectListAllVo" resultType="com.wh.pojo.restrictedcategory.RestrictedCategoryVo">
SELECT *
FROM restricted_category
<where>
${ew.sqlSegment}
</where>
</select>
<select id="selectByKey" resultType="com.wh.pojo.restrictedcategory.RestrictedCategory">
select *
from restricted_category
where category_key = #{key}
</select>
<select id="selectByKeyAndSid" resultType="com.wh.pojo.restrictedcategory.RestrictedCategory">
select *
from restricted_category
where category_key = #{key}
and sid &lt;&gt; #{sid}
</select>
<select id="categoryList" resultType="com.wh.pojo.restrictedcategory.RestrictedCategoryVo">
select categorys as dictValue,category_key as dictKey
from restricted_category
</select>
<select id="selectChildernList" resultType="com.wh.pojo.restrictedcategory.RestrictedCategoryVo">
SELECT so.categorys, so.psid, so.sid, so.category_key as categoryKey,so.grade
FROM restricted_category so
WHERE psid = #{psid}
ORDER BY so.sort ASC
</select>
<select id="selectFirstCategoryList" resultType="com.wh.pojo.restrictedcategory.RestrictedCategoryVo">
SELECT sid, categorys, psid, category_key as categoryKey,grade
FROM restricted_category
WHERE psid = '0'
</select>
</mapper>
Loading…
Cancel
Save