diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/restrictedbrand/RestrictedBrandRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/restrictedbrand/RestrictedBrandRest.java new file mode 100644 index 00000000..b8b779c3 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedBrandFeignFallback.java
+ * Class: com.yxt.supervise.customer.biz.restrictedbrand.RestrictedBrandRest
+ * Description: 限定品牌.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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> listPage(@RequestBody PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = restrictedBrandService.listPageVo(pq); + return rb.success().setData(pv); + } + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/brandList") + public ResultBean> brandList() { + ResultBean rb = ResultBean.fireFail(); + List 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 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; + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/restrictedcategory/RestrictedCategoryRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/restrictedcategory/RestrictedCategoryRest.java new file mode 100644 index 00000000..0dee8968 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedCategoryFeignFallback.java
+ * Class: com.yxt.supervise.customer.biz.restrictedcategory.RestrictedCategoryRest
+ * Description: 限定品类.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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> listPage(@RequestBody PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = restrictedCategoryService.listPageVo(pq); + return rb.success().setData(pv); + } + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/categoryList") + public ResultBean> categoryList() { + ResultBean rb = ResultBean.fireFail(); + List 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() { + ResultBean rb = ResultBean.fireFail(); + List list = restrictedCategoryService.listVo(); + return rb.success().setData(list); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{id}") + public ResultBean 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; + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/restrictedbrand/RestrictedBrandMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/restrictedbrand/RestrictedBrandMapper.java new file mode 100644 index 00000000..ef2ddd24 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedBrandMapper.java
+ * Class: com.yxt.supervise.customer.biz.restrictedbrand.RestrictedBrandMapper
+ * Description: 限定品牌.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface RestrictedBrandMapper extends BaseMapper { + + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from restricted_brand") + List 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 brandList(); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/restrictedcategory/RestrictedCategoryMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/restrictedcategory/RestrictedCategoryMapper.java new file mode 100644 index 00000000..39c4ea1c --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedCategoryMapper.java
+ * Class: com.yxt.supervise.customer.biz.restrictedcategory.RestrictedCategoryMapper
+ * Description: 限定品类.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface RestrictedCategoryMapper extends BaseMapper { + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from restricted_category") + List selectListVo(); + + @Select("select * from restricted_category where categorys like CONCAT('%',#{categoryKey},'%') and brands like CONCAT('%',#{brandCode},'%')") + List 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 selectByBrands(@Param("brandCode") String brand); + + RestrictedCategory selectByKey(String key); + + RestrictedCategory selectByKeyAndSid(@Param("key") String key, @Param("sid") String sid); + + List categoryList(); + + List selectFirstCategoryList(); + List selectChildernList(String sid); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrand.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrand.java new file mode 100644 index 00000000..b4f10136 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedBrand.java
+ * Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrand
+ * Description: 限定品牌.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandDetailsVo.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandDetailsVo.java new file mode 100644 index 00000000..cafe8766 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedBrandVo.java
+ * Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandVo
+ * Description: 限定品牌 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandDto.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandDto.java new file mode 100644 index 00000000..d72d7ea0 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedBrandDto.java
+ * Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandDto
+ * Description: 限定品牌 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandQuery.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandQuery.java new file mode 100644 index 00000000..ddfcb148 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedBrandQuery.java
+ * Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandQuery
+ * Description: 限定品牌 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandVo.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedbrand/RestrictedBrandVo.java new file mode 100644 index 00000000..34b77747 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedBrandVo.java
+ * Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandVo
+ * Description: 限定品牌 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategory.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategory.java new file mode 100644 index 00000000..91ad5c35 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedCategory.java
+ * Class: com.yxt.supervise.customer.api.restrictedcategory.RestrictedCategory
+ * Description: 限定品类.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryDetailsVo.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryDetailsVo.java new file mode 100644 index 00000000..662ca27a --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedCategoryVo.java
+ * Class: com.yxt.supervise.customer.api.restrictedcategory.RestrictedCategoryVo
+ * Description: 限定品类 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryDto.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryDto.java new file mode 100644 index 00000000..655308f3 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedCategoryDto.java
+ * Class: com.yxt.supervise.portal.api.restrictedcategory.RestrictedCategoryDto
+ * Description: 限定品类 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryQuery.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryQuery.java new file mode 100644 index 00000000..dce96e06 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedCategoryQuery.java
+ * Class: com.yxt.supervise.customer.api.restrictedcategory.RestrictedCategoryQuery
+ * Description: 限定品类 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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; + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryVo.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/pojo/restrictedcategory/RestrictedCategoryVo.java new file mode 100644 index 00000000..1d00ba83 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedCategoryVo.java
+ * Class: com.yxt.supervise.customer.api.restrictedcategory.RestrictedCategoryVo
+ * Description: 限定品类 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @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 children = new ArrayList<>(); + private String dictValue; + private String dictKey; + private String sort; + //1 结束 2未结束 + private String isEnd="2"; + private String pName; + private String grade; //品类等级 + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/restrictedbrand/RestrictedBrandService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/restrictedbrand/RestrictedBrandService.java new file mode 100644 index 00000000..b7c806b5 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedBrandService.java
+ * Class: com.yxt.supervise.customer.biz.restrictedbrand.RestrictedBrandService
+ * Description: 限定品牌 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Slf4j +@Service +public class RestrictedBrandService extends MybatisBaseService { + + public PagerVo listPageVo(PagerQuery pq) { + RestrictedBrandQuery query = pq.getParams(); + QueryWrapper 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 page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public List brandList() { + List 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 qw = new QueryWrapper<>(); + qw.eq("id", id); + return baseMapper.selectOne(qw); + } + public int deleteById(String id) { + Map 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 lisss = new ArrayList<>(); + List 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 qw = new QueryWrapper<>(); + qw.eq("code", code); + List list = baseMapper.selectList(qw); + if (list == null || list.isEmpty()) + return null; + return list.get(0); + + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/restrictedcategory/RestrictedCategoryService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/restrictedcategory/RestrictedCategoryService.java new file mode 100644 index 00000000..9292cdf5 --- /dev/null +++ b/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(客户中心)
+ * File: RestrictedCategoryService.java
+ * Class: com.yxt.supervise.customer.biz.restrictedcategory.RestrictedCategoryService
+ * Description: 限定品类 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-22 21:47:10
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Slf4j +@Service +public class RestrictedCategoryService extends MybatisBaseService { + /* @Resource + private DictCommonService dictCommonService; + @Resource + private BrandInfoService brandInfoService;*/ + @Resource + private RestrictedBrandService restrictedBrandService; + + /** + * 分页列表 + * + * @param pq + * @return + */ + public PagerVo listPageVo(PagerQuery pq) { + RestrictedCategoryQuery query = pq.getParams(); + QueryWrapper 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 page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public List categoryList() { + List 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().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().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 map = new HashMap<>(); + map.put("id", id); + return baseMapper.deleteByMap(map); + } + + public RestrictedCategory getRestById(String id) { + RestrictedCategory entity = fetchById(id); + QueryWrapper 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 lisss = new ArrayList<>(); + List 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 qw = new QueryWrapper<>(); +// qw.eq("category_key", categoryKey); + qw.eq("sid", sid); + List list = baseMapper.selectList(qw); + if (list == null || list.isEmpty()) + return null; + return list.get(0); + } + + /* public Map limitJudgement(String categoryKey, String brandCode) { + Map 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 listVo() { + List sysOrganizations = baseMapper.selectFirstCategoryList(); + getChildList(sysOrganizations); + return sysOrganizations; + } + + public void getChildList(List list) { + list.forEach(str -> { + String sid = str.getSid(); + String pName=str.getCategorys(); + List listChildren = baseMapper.selectChildernList(sid); + listChildren.forEach(i->{ + i.setPName(pName); + if(i.getGrade().equals("3")){ + i.setIsEnd("1"); + } + }); + str.setChildren(listChildren); + getChildList(listChildren); + }); + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedBrandMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedBrandMapper.xml new file mode 100644 index 00000000..3312ea1a --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedBrandMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedCategoryMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedCategoryMapper.xml new file mode 100644 index 00000000..5930c251 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/RestrictedCategoryMapper.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file