12 changed files with 895 additions and 1 deletions
@ -0,0 +1,58 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.api.restrictedbrand; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 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 extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty("代码") |
|||
private String code; |
|||
@ApiModelProperty("名称") |
|||
private String name; |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.api.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; |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.api.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; |
|||
|
|||
@ApiModelProperty("代码") |
|||
private String code; |
|||
@ApiModelProperty("名称") |
|||
private String name; |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.api.restrictedbrand; |
|||
|
|||
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.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* Project: supervise-customer(客户中心) <br/> |
|||
* File: RestrictedBrandFeign.java <br/> |
|||
* Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandFeign <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 = "限定品牌") |
|||
@FeignClient( |
|||
contextId = "supervise-customer-RestrictedBrand", |
|||
name = "supervise-customer", |
|||
path = "v1/restrictedbrand", |
|||
fallback = RestrictedBrandFeignFallback.class) |
|||
public interface RestrictedBrandFeign { |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
@ResponseBody |
|||
public ResultBean<PagerVo<RestrictedBrandVo>> listPage(@RequestBody PagerQuery<RestrictedBrandQuery> pq); |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
@ResponseBody |
|||
public ResultBean save(@RequestBody RestrictedBrandDto dto); |
|||
|
|||
@ApiOperation("根据sid删除记录") |
|||
@DeleteMapping("/delBySids") |
|||
@ResponseBody |
|||
public ResultBean delBySids(@RequestBody String[] sids); |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
@ResponseBody |
|||
public ResultBean<RestrictedBrandDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid); |
|||
} |
@ -0,0 +1,70 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.api.restrictedbrand; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* Project: supervise-customer(客户中心) <br/> |
|||
* File: RestrictedBrandFeignFallback.java <br/> |
|||
* Class: com.yxt.supervise.customer.api.restrictedbrand.RestrictedBrandFeignFallback <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 |
|||
*/ |
|||
@Component |
|||
public class RestrictedBrandFeignFallback implements RestrictedBrandFeign { |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<RestrictedBrandVo>> listPage(PagerQuery<RestrictedBrandQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return rb.setMsg("接口yxt-supervise/restrictedbrand/listPage无法访问"); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean save(RestrictedBrandDto dto) { |
|||
return ResultBean.fireFail().setMsg("接口yxt-supervise/restrictedbrand/save无法访问"); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean delBySids(String[] sids) { |
|||
return ResultBean.fireFail().setMsg("接口yxt-supervise/restrictedbrand/delBySids无法访问"); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<RestrictedBrandDetailsVo> fetchDetailsBySid(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return rb.setMsg("接口yxt-supervise/restrictedbrand/fetchDetailsBySid无法访问"); |
|||
} |
|||
} |
@ -0,0 +1,57 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.api.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; |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.api.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; |
|||
|
|||
@ApiModelProperty("代码") |
|||
private String code; |
|||
@ApiModelProperty("名称") |
|||
private String name; |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.biz.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.yxt.supervise.customer.api.restrictedbrand.RestrictedBrand; |
|||
import com.yxt.supervise.customer.api.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> { |
|||
|
|||
//@Update("update restricted_brand set name=#{msg} where id=#{id}")
|
|||
//IPage<RestrictedBrandVo> voPage(IPage<RestrictedBrand> page, @Param(Constants.WRAPPER) QueryWrapper<RestrictedBrand> qw);
|
|||
|
|||
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); |
|||
} |
@ -0,0 +1,13 @@ |
|||
<?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.yxt.supervise.customer.biz.restrictedbrand.RestrictedBrandMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.portal.api.restrictedbrand.RestrictedBrandVo"> |
|||
SELECT * FROM restricted_brand <where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
|
|||
<select id="selectListAllVo" resultType="com.yxt.supervise.portal.api.restrictedbrand.RestrictedBrandVo"> |
|||
SELECT * FROM restricted_brand <where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,128 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.biz.restrictedbrand; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.customer.api.restrictedbrand.*; |
|||
import com.yxt.supervise.portal.api.restrictedbrand.*; |
|||
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; |
|||
|
|||
/** |
|||
* 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 |
|||
@RequestMapping("v1/restrictedbrand") |
|||
public class RestrictedBrandRest implements RestrictedBrandFeign { |
|||
|
|||
@Autowired |
|||
private RestrictedBrandService restrictedBrandService; |
|||
|
|||
@Override |
|||
@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); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody RestrictedBrandDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
restrictedBrandService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
restrictedBrandService.delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@Override |
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<RestrictedBrandDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
RestrictedBrandDetailsVo vo = restrictedBrandService.fetchDetailsVoBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
|
|||
@ApiOperation(" ") |
|||
@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; |
|||
} |
|||
} |
@ -0,0 +1,176 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.supervise.customer.biz.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.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.customer.api.restrictedbrand.*; |
|||
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.List; |
|||
|
|||
/** |
|||
* 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> { |
|||
private QueryWrapper<RestrictedBrand> createQueryWrapper(RestrictedBrandQuery query) { |
|||
// todo: 这里根据具体业务调整查询条件
|
|||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|||
QueryWrapper<RestrictedBrand> qw = new QueryWrapper<>(); |
|||
return qw; |
|||
} |
|||
|
|||
public PagerVo<RestrictedBrandVo> listPageVo(PagerQuery<RestrictedBrandQuery> pq) { |
|||
RestrictedBrandQuery query = pq.getParams(); |
|||
QueryWrapper<RestrictedBrand> qw = createQueryWrapper(query); |
|||
IPage<RestrictedBrand> page = PagerUtil.queryToPage(pq); |
|||
IPage<RestrictedBrandVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<RestrictedBrandVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public void saveOrUpdateDto(RestrictedBrandDto dto) { |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
this.insertByDto(dto); |
|||
return; |
|||
} |
|||
this.updateByDto(dto); |
|||
} |
|||
|
|||
public void insertByDto(RestrictedBrandDto dto) { |
|||
RestrictedBrand entity = new RestrictedBrand(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
} |
|||
|
|||
public void updateByDto(RestrictedBrandDto dto) { |
|||
String dtoSid = dto.getSid(); |
|||
if (StringUtils.isBlank(dtoSid)) { |
|||
return; |
|||
} |
|||
RestrictedBrand entity = fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
|
|||
public RestrictedBrandDetailsVo fetchDetailsVoBySid(String sid) { |
|||
RestrictedBrand entity = fetchBySid(sid); |
|||
RestrictedBrandDetailsVo vo = new RestrictedBrandDetailsVo(); |
|||
BeanUtil.copyProperties(entity, vo); |
|||
return vo; |
|||
} |
|||
|
|||
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); |
|||
} |
|||
} |
Loading…
Reference in new issue