
18 changed files with 479 additions and 617 deletions
@ -1,90 +0,0 @@ |
|||||
/********************************************************* |
|
||||
********************************************************* |
|
||||
******************** ******************* |
|
||||
************* ************ |
|
||||
******* _oo0oo_ ******* |
|
||||
*** o8888888o *** |
|
||||
* 88" . "88 * |
|
||||
* (| -_- |) * |
|
||||
* 0\ = /0 * |
|
||||
* ___/`---'\___ * |
|
||||
* .' \\| |// '. *
|
|
||||
* / \\||| : |||// \ *
|
|
||||
* / _||||| -:- |||||- \ * |
|
||||
* | | \\\ - /// | | *
|
|
||||
* | \_| ''\---/'' |_/ | * |
|
||||
* \ .-\__ '-' ___/-. / * |
|
||||
* ___'. .' /--.--\ `. .'___ * |
|
||||
* ."" '< `.___\_<|>_/___.' >' "". * |
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|
||||
* `=---=' * |
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|
||||
*********************************************************/ |
|
||||
package com.yxt.anrui.buscenter.api.buspurchasechannel; |
|
||||
|
|
||||
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: anrui-buscenter(采购渠道选择) <br/> |
|
||||
* File: BusPurchaseChannel.java <br/> |
|
||||
* Class: com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannel <br/> |
|
||||
* Description: 采购渠道选择表. <br/> |
|
||||
* Copyright: Copyright (c) 2011 <br/> |
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
|
||||
* Makedate: 2022-12-17 10:46:49 <br/> |
|
||||
* |
|
||||
* @author liupopo |
|
||||
* @version 1.0 |
|
||||
* @since 1.0 |
|
||||
*/ |
|
||||
@Data |
|
||||
@ApiModel(value = "采购渠道选择表", description = "采购渠道选择表") |
|
||||
@TableName("bus_purchase_channel") |
|
||||
public class BusPurchaseChannel extends BaseEntity { |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
@ApiModelProperty("创建人接口") |
|
||||
private String createByName; // 创建人接口
|
|
||||
@ApiModelProperty("销售订单sid") |
|
||||
private String saleOrderSid; // 销售订单sid
|
|
||||
@ApiModelProperty("销售订单编号") |
|
||||
private String saleOrderNo; // 销售订单编号
|
|
||||
@ApiModelProperty("销售订单审批日期") |
|
||||
private String saleOrderApproDate; // 销售订单审批日期
|
|
||||
@ApiModelProperty("业务类型") |
|
||||
private String businessType; // 业务类型
|
|
||||
@ApiModelProperty("申请部门sid") |
|
||||
private String applyDeptSid; // 申请部门sid
|
|
||||
@ApiModelProperty("申请部门名称") |
|
||||
private String applyDeptName; // 申请部门名称
|
|
||||
@ApiModelProperty("申请人sid") |
|
||||
private String applyPeoSid; // 申请人sid
|
|
||||
@ApiModelProperty("申请人姓名") |
|
||||
private String applyPeoName; // 申请人姓名
|
|
||||
@ApiModelProperty("车型sid") |
|
||||
private String modelSid; // 车型sid
|
|
||||
@ApiModelProperty("车型名称") |
|
||||
private String modelName; // 车型名称
|
|
||||
@ApiModelProperty("配置sid") |
|
||||
private String configSid; // 配置sid
|
|
||||
@ApiModelProperty("配置名称") |
|
||||
private String configName; // 配置名称
|
|
||||
@ApiModelProperty("数量") |
|
||||
private String num; // 数量
|
|
||||
@ApiModelProperty("分公司sid") |
|
||||
private String useOrgSid; // 分公司sid
|
|
||||
@ApiModelProperty("分公司名称") |
|
||||
private String useOrgName; // 分公司名称
|
|
||||
@ApiModelProperty("采购渠道key") |
|
||||
private String purchaseOrderTypeKey; // 采购渠道key
|
|
||||
@ApiModelProperty("采购渠道value") |
|
||||
private String purchaseOrderTypeValue; // 采购渠道value
|
|
||||
|
|
||||
} |
|
@ -1,94 +0,0 @@ |
|||||
/********************************************************* |
|
||||
********************************************************* |
|
||||
******************** ******************* |
|
||||
************* ************ |
|
||||
******* _oo0oo_ ******* |
|
||||
*** o8888888o *** |
|
||||
* 88" . "88 * |
|
||||
* (| -_- |) * |
|
||||
* 0\ = /0 * |
|
||||
* ___/`---'\___ * |
|
||||
* .' \\| |// '. *
|
|
||||
* / \\||| : |||// \ *
|
|
||||
* / _||||| -:- |||||- \ * |
|
||||
* | | \\\ - /// | | *
|
|
||||
* | \_| ''\---/'' |_/ | * |
|
||||
* \ .-\__ '-' ___/-. / * |
|
||||
* ___'. .' /--.--\ `. .'___ * |
|
||||
* ."" '< `.___\_<|>_/___.' >' "". * |
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|
||||
* `=---=' * |
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|
||||
*********************************************************/ |
|
||||
package com.yxt.anrui.buscenter.api.buspurchasechannel; |
|
||||
|
|
||||
|
|
||||
import com.yxt.common.core.vo.Vo; |
|
||||
|
|
||||
import io.swagger.annotations.ApiModel; |
|
||||
import io.swagger.annotations.ApiModelProperty; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
/** |
|
||||
* Project: anrui-buscenter(采购渠道选择) <br/> |
|
||||
* File: BusPurchaseChannelVo.java <br/> |
|
||||
* Class: com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelVo <br/> |
|
||||
* Description: 采购渠道选择表 视图数据对象. <br/> |
|
||||
* Copyright: Copyright (c) 2011 <br/> |
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
|
||||
* Makedate: 2022-12-17 10:46:49 <br/> |
|
||||
* |
|
||||
* @author liupopo |
|
||||
* @version 1.0 |
|
||||
* @since 1.0 |
|
||||
*/ |
|
||||
@Data |
|
||||
@ApiModel(value = "采购渠道选择表 视图数据对象", description = "采购渠道选择表 视图数据对象") |
|
||||
public class BusPurchaseChannelVo implements Vo { |
|
||||
|
|
||||
private String sid; // sid
|
|
||||
|
|
||||
@ApiModelProperty("创建人接口") |
|
||||
private String createByName; // 创建人接口
|
|
||||
@ApiModelProperty("销售订单sid") |
|
||||
private String saleOrderSid; // 销售订单sid
|
|
||||
@ApiModelProperty("销售订单编号") |
|
||||
private String saleOrderNo; // 销售订单编号
|
|
||||
@ApiModelProperty("销售订单审批日期") |
|
||||
private String saleOrderApproDate; // 销售订单审批日期
|
|
||||
@ApiModelProperty("业务类型") |
|
||||
private String businessType; // 业务类型
|
|
||||
@ApiModelProperty("申请部门sid") |
|
||||
private String applyDeptSid; // 申请部门sid
|
|
||||
@ApiModelProperty("申请部门名称") |
|
||||
private String applyDeptName; // 申请部门名称
|
|
||||
@ApiModelProperty("申请人sid") |
|
||||
private String applyPeoSid; // 申请人sid
|
|
||||
@ApiModelProperty("申请人姓名") |
|
||||
private String applyPeoName; // 申请人姓名
|
|
||||
@ApiModelProperty("车型sid") |
|
||||
private String modelSid; // 车型sid
|
|
||||
@ApiModelProperty("车型名称") |
|
||||
private String modelName; // 车型名称
|
|
||||
@ApiModelProperty("配置sid") |
|
||||
private String configSid; // 配置sid
|
|
||||
@ApiModelProperty("配置名称") |
|
||||
private String configName; // 配置名称
|
|
||||
@ApiModelProperty("数量") |
|
||||
private String num; // 数量
|
|
||||
@ApiModelProperty("分公司sid") |
|
||||
private String useOrgSid; // 分公司sid
|
|
||||
@ApiModelProperty("分公司名称") |
|
||||
private String useOrgName; // 分公司名称
|
|
||||
@ApiModelProperty("采购渠道key") |
|
||||
private String purchaseOrderTypeKey; // 采购渠道key
|
|
||||
@ApiModelProperty("采购渠道value") |
|
||||
private String purchaseOrderTypeValue; // 采购渠道value
|
|
||||
@ApiModelProperty("流程定义id") |
|
||||
private String procDefId; |
|
||||
@ApiModelProperty("流程实例id") |
|
||||
private String procInstId; |
|
||||
} |
|
@ -1,105 +0,0 @@ |
|||||
/********************************************************* |
|
||||
********************************************************* |
|
||||
******************** ******************* |
|
||||
************* ************ |
|
||||
******* _oo0oo_ ******* |
|
||||
*** o8888888o *** |
|
||||
* 88" . "88 * |
|
||||
* (| -_- |) * |
|
||||
* 0\ = /0 * |
|
||||
* ___/`---'\___ * |
|
||||
* .' \\| |// '. *
|
|
||||
* / \\||| : |||// \ *
|
|
||||
* / _||||| -:- |||||- \ * |
|
||||
* | | \\\ - /// | | *
|
|
||||
* | \_| ''\---/'' |_/ | * |
|
||||
* \ .-\__ '-' ___/-. / * |
|
||||
* ___'. .' /--.--\ `. .'___ * |
|
||||
* ."" '< `.___\_<|>_/___.' >' "". * |
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|
||||
* `=---=' * |
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|
||||
*********************************************************/ |
|
||||
package com.yxt.anrui.buscenter.biz.buspurchasechannel; |
|
||||
|
|
||||
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 java.util.List; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannel; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelQuery; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelVo; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelDetailsVo; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelDto; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelFeign; |
|
||||
|
|
||||
/** |
|
||||
* Project: anrui-buscenter(采购渠道选择) <br/> |
|
||||
* File: BusPurchaseChannelFeignFallback.java <br/> |
|
||||
* Class: com.yxt.anrui.buscenter.biz.buspurchasechannel.BusPurchaseChannelRest <br/> |
|
||||
* Description: 采购渠道选择表. <br/> |
|
||||
* Copyright: Copyright (c) 2011 <br/> |
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
|
||||
* Makedate: 2022-12-17 10:46:49 <br/> |
|
||||
* |
|
||||
* @author liupopo |
|
||||
* @version 1.0 |
|
||||
* @since 1.0 |
|
||||
*/ |
|
||||
@Api(tags = "采购渠道选择表") |
|
||||
@RestController("com.yxt.anrui.buscenter.biz.buspurchasechannel.BusPurchaseChannelRest") |
|
||||
@RequestMapping("v1/buspurchasechannel") |
|
||||
public class BusPurchaseChannelRest implements BusPurchaseChannelFeign { |
|
||||
|
|
||||
@Autowired |
|
||||
private BusPurchaseChannelService busPurchaseChannelService; |
|
||||
|
|
||||
@Override |
|
||||
@ApiOperation("根据条件分页查询数据的列表") |
|
||||
@PostMapping("/listPage") |
|
||||
public ResultBean<PagerVo<BusPurchaseChannelVo>> listPage(@RequestBody PagerQuery<BusPurchaseChannelQuery> pq){ |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
PagerVo<BusPurchaseChannelVo> pv = busPurchaseChannelService.listPageVo(pq); |
|
||||
return rb.success().setData(pv); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
@ApiOperation("新增或修改") |
|
||||
@PostMapping("/save") |
|
||||
public ResultBean save(@RequestBody BusPurchaseChannelDto dto){ |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
busPurchaseChannelService.saveOrUpdateDto(dto); |
|
||||
return rb.success(); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
@ApiOperation("根据sid批量删除") |
|
||||
@PostMapping("/delBySids") |
|
||||
public ResultBean delBySids(@RequestBody String[] sids){ |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
busPurchaseChannelService.delBySids(sids); |
|
||||
return rb.success(); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
@ApiOperation("根据SID获取一条记录") |
|
||||
@GetMapping("/fetchDetailsBySid/{sid}") |
|
||||
public ResultBean<BusPurchaseChannelDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
BusPurchaseChannelDetailsVo vo = busPurchaseChannelService.fetchDetailsVoBySid(sid); |
|
||||
return rb.success().setData(vo); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public ResultBean choice(List<BusPurchaseChannelDto> dto) { |
|
||||
return busPurchaseChannelService.choice(dto); |
|
||||
} |
|
||||
} |
|
@ -1,147 +0,0 @@ |
|||||
/********************************************************* |
|
||||
********************************************************* |
|
||||
******************** ******************* |
|
||||
************* ************ |
|
||||
******* _oo0oo_ ******* |
|
||||
*** o8888888o *** |
|
||||
* 88" . "88 * |
|
||||
* (| -_- |) * |
|
||||
* 0\ = /0 * |
|
||||
* ___/`---'\___ * |
|
||||
* .' \\| |// '. *
|
|
||||
* / \\||| : |||// \ *
|
|
||||
* / _||||| -:- |||||- \ * |
|
||||
* | | \\\ - /// | | *
|
|
||||
* | \_| ''\---/'' |_/ | * |
|
||||
* \ .-\__ '-' ___/-. / * |
|
||||
* ___'. .' /--.--\ `. .'___ * |
|
||||
* ."" '< `.___\_<|>_/___.' >' "". * |
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|
||||
* `=---=' * |
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|
||||
*********************************************************/ |
|
||||
package com.yxt.anrui.buscenter.biz.buspurchasechannel; |
|
||||
|
|
||||
import cn.hutool.core.bean.BeanUtil; |
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||
import org.apache.commons.lang3.StringUtils; |
|
||||
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 com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannel; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelQuery; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelVo; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelDetailsVo; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelDto; |
|
||||
import com.yxt.anrui.buscenter.api.buspurchasechannel.BusPurchaseChannelFeign; |
|
||||
|
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* Project: anrui-buscenter(采购渠道选择) <br/> |
|
||||
* File: BusPurchaseChannelService.java <br/> |
|
||||
* Class: com.yxt.anrui.buscenter.biz.buspurchasechannel.BusPurchaseChannelService <br/> |
|
||||
* Description: 采购渠道选择表 业务逻辑. <br/> |
|
||||
* Copyright: Copyright (c) 2011 <br/> |
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
|
||||
* Makedate: 2022-12-17 10:46:49 <br/> |
|
||||
* |
|
||||
* @author liupopo |
|
||||
* @version 1.0 |
|
||||
* @since 1.0 |
|
||||
*/ |
|
||||
@Service |
|
||||
public class BusPurchaseChannelService extends MybatisBaseService<BusPurchaseChannelMapper, BusPurchaseChannel> { |
|
||||
private QueryWrapper<BusPurchaseChannel> createQueryWrapper(BusPurchaseChannelQuery query) { |
|
||||
// todo: 这里根据具体业务调整查询条件
|
|
||||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
||||
QueryWrapper<BusPurchaseChannel> qw = new QueryWrapper<>(); |
|
||||
return qw; |
|
||||
} |
|
||||
|
|
||||
public PagerVo<BusPurchaseChannelVo> listPageVo(PagerQuery<BusPurchaseChannelQuery> pq) { |
|
||||
BusPurchaseChannelQuery query = pq.getParams(); |
|
||||
QueryWrapper<BusPurchaseChannel> qw = new QueryWrapper<>(); |
|
||||
qw.eq("bpc.state",query.getState()); |
|
||||
qw.eq("bpc.useOrgSid",query.getUseOrgSid()); |
|
||||
String saleOrderApproStartDate = query.getSaleOrderApproStartDate(); |
|
||||
String saleOrderApproEndDate = query.getSaleOrderApproEndDate(); |
|
||||
qw.apply(StringUtils.isNotBlank(saleOrderApproStartDate), "date_format (bpc.saleOrderApproDate,'%Y-%m-%d') >= date_format('" + saleOrderApproStartDate + "','%Y-%m-%d')"). |
|
||||
apply(StringUtils.isNotBlank(saleOrderApproEndDate), "date_format (bpc.saleOrderApproDate,'%Y-%m-%d') <= date_format('" + saleOrderApproEndDate + "','%Y-%m-%d')" |
|
||||
); |
|
||||
if (StringUtils.isNotBlank(query.getSaleOrderNo())){ |
|
||||
qw.like("bpc.saleOrderNo",query.getSaleOrderNo()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getBusinessType())){ |
|
||||
qw.like("bpc.businessType",query.getBusinessType()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getApplyDeptSid())){ |
|
||||
qw.eq("bpc.applyDeptSid",query.getApplyDeptSid()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getApplyPeoName())){ |
|
||||
qw.like("bpc.applyPeoName",query.getApplyPeoName()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getModelName())){ |
|
||||
qw.like("bpc.modelName",query.getModelName()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getConfigName())){ |
|
||||
qw.like("bpc.configName",query.getConfigName()); |
|
||||
} |
|
||||
IPage<BusPurchaseChannel> page = PagerUtil.queryToPage(pq); |
|
||||
IPage<BusPurchaseChannelVo> pagging = baseMapper.selectPageVo(page, qw); |
|
||||
PagerVo<BusPurchaseChannelVo> p = PagerUtil.pageToVo(pagging, null); |
|
||||
return p; |
|
||||
} |
|
||||
|
|
||||
public void saveOrUpdateDto(BusPurchaseChannelDto dto){ |
|
||||
String dtoSid = dto.getSid(); |
|
||||
if (StringUtils.isBlank(dtoSid)) { |
|
||||
this.insertByDto(dto); |
|
||||
return; |
|
||||
} |
|
||||
this.updateByDto(dto); |
|
||||
} |
|
||||
|
|
||||
public void insertByDto(BusPurchaseChannelDto dto){ |
|
||||
BusPurchaseChannel entity = new BusPurchaseChannel(); |
|
||||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
||||
entity.setState(1); |
|
||||
baseMapper.insert(entity); |
|
||||
} |
|
||||
|
|
||||
public void updateByDto(BusPurchaseChannelDto dto){ |
|
||||
String dtoSid = dto.getSid(); |
|
||||
if (StringUtils.isBlank(dtoSid)) { |
|
||||
return; |
|
||||
} |
|
||||
BusPurchaseChannel entity = fetchBySid(dtoSid); |
|
||||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
||||
baseMapper.updateById(entity); |
|
||||
} |
|
||||
|
|
||||
public BusPurchaseChannelDetailsVo fetchDetailsVoBySid(String sid){ |
|
||||
BusPurchaseChannel entity = fetchBySid(sid); |
|
||||
BusPurchaseChannelDetailsVo vo = new BusPurchaseChannelDetailsVo(); |
|
||||
BeanUtil.copyProperties(entity, vo); |
|
||||
return vo; |
|
||||
} |
|
||||
|
|
||||
public ResultBean choice(List<BusPurchaseChannelDto> dto) { |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
for (BusPurchaseChannelDto busPurchaseChannelDto : dto) { |
|
||||
String purchaseOrderTypeKey = busPurchaseChannelDto.getPurchaseOrderTypeKey(); |
|
||||
String purchaseOrderTypeValue = busPurchaseChannelDto.getPurchaseOrderTypeValue(); |
|
||||
String sid = busPurchaseChannelDto.getSid(); |
|
||||
baseMapper.choice(sid,purchaseOrderTypeKey,purchaseOrderTypeValue); |
|
||||
} |
|
||||
return rb.success().setMsg("选择成功"); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,77 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.scm.api.scmpurchasechannel; |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel(value = "采购渠道选择表", description = "采购渠道选择表") |
||||
|
@TableName("scm_purchase_channel") |
||||
|
public class ScmPurchaseChannel extends BaseEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@ApiModelProperty("创建人接口") |
||||
|
private String createByName; |
||||
|
@ApiModelProperty("销售订单sid") |
||||
|
private String saleOrderSid; |
||||
|
@ApiModelProperty("销售订单编号") |
||||
|
private String saleOrderNo; |
||||
|
@ApiModelProperty("销售订单审批日期") |
||||
|
private String saleOrderApproDate; |
||||
|
@ApiModelProperty("业务类型") |
||||
|
private String businessType; |
||||
|
@ApiModelProperty("申请部门sid") |
||||
|
private String applyDeptSid; |
||||
|
@ApiModelProperty("申请部门名称") |
||||
|
private String applyDeptName; |
||||
|
@ApiModelProperty("申请人sid") |
||||
|
private String applyPeoSid; |
||||
|
@ApiModelProperty("申请人姓名") |
||||
|
private String applyPeoName; |
||||
|
@ApiModelProperty("车型sid") |
||||
|
private String modelSid; |
||||
|
@ApiModelProperty("车型名称") |
||||
|
private String modelName; |
||||
|
@ApiModelProperty("配置sid") |
||||
|
private String configSid; |
||||
|
@ApiModelProperty("配置名称") |
||||
|
private String configName; |
||||
|
@ApiModelProperty("数量") |
||||
|
private String num; |
||||
|
@ApiModelProperty("分公司sid") |
||||
|
private String useOrgSid; |
||||
|
@ApiModelProperty("分公司名称") |
||||
|
private String useOrgName; |
||||
|
@ApiModelProperty("采购渠道key") |
||||
|
private String purchaseOrderTypeKey; |
||||
|
@ApiModelProperty("采购渠道value") |
||||
|
private String purchaseOrderTypeValue; |
||||
|
|
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.scm.api.scmpurchasechannel; |
||||
|
|
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel(value = "采购渠道选择表 视图数据对象", description = "采购渠道选择表 视图数据对象") |
||||
|
public class ScmPurchaseChannelVo implements Vo { |
||||
|
|
||||
|
private String sid; |
||||
|
|
||||
|
@ApiModelProperty("创建人接口") |
||||
|
private String createByName; |
||||
|
@ApiModelProperty("销售订单sid") |
||||
|
private String saleOrderSid; |
||||
|
@ApiModelProperty("销售订单编号") |
||||
|
private String saleOrderNo; |
||||
|
@ApiModelProperty("销售订单审批日期") |
||||
|
private String saleOrderApproDate; |
||||
|
@ApiModelProperty("业务类型") |
||||
|
private String businessType; |
||||
|
@ApiModelProperty("申请部门sid") |
||||
|
private String applyDeptSid; |
||||
|
@ApiModelProperty("申请部门名称") |
||||
|
private String applyDeptName; |
||||
|
@ApiModelProperty("申请人sid") |
||||
|
private String applyPeoSid; |
||||
|
@ApiModelProperty("申请人姓名") |
||||
|
private String applyPeoName; |
||||
|
@ApiModelProperty("车型sid") |
||||
|
private String modelSid; |
||||
|
@ApiModelProperty("车型名称") |
||||
|
private String modelName; |
||||
|
@ApiModelProperty("配置sid") |
||||
|
private String configSid; |
||||
|
@ApiModelProperty("配置名称") |
||||
|
private String configName; |
||||
|
@ApiModelProperty("数量") |
||||
|
private String num; |
||||
|
@ApiModelProperty("分公司sid") |
||||
|
private String useOrgSid; |
||||
|
@ApiModelProperty("分公司名称") |
||||
|
private String useOrgName; |
||||
|
@ApiModelProperty("采购渠道key") |
||||
|
private String purchaseOrderTypeKey; |
||||
|
@ApiModelProperty("采购渠道value") |
||||
|
private String purchaseOrderTypeValue; |
||||
|
@ApiModelProperty("流程定义id") |
||||
|
private String procDefId; |
||||
|
@ApiModelProperty("流程实例id") |
||||
|
private String procInstId; |
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.scm.biz.scmpurchasechannel; |
||||
|
|
||||
|
import com.yxt.anrui.scm.api.scmpurchasechannel.*; |
||||
|
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 java.util.List; |
||||
|
|
||||
|
@Api(tags = "采购渠道选择表") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/scmpurchasechannel") |
||||
|
public class ScmPurchaseChannelRest implements ScmPurchaseChannelFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private ScmPurchaseChannelService scmPurchaseChannelService; |
||||
|
|
||||
|
@Override |
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<ScmPurchaseChannelVo>> listPage(@RequestBody PagerQuery<ScmPurchaseChannelQuery> pq) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<ScmPurchaseChannelVo> pv = scmPurchaseChannelService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@ApiOperation("新增或修改") |
||||
|
@PostMapping("/save") |
||||
|
public ResultBean save(@RequestBody ScmPurchaseChannelDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
scmPurchaseChannelService.saveOrUpdateDto(dto); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@ApiOperation("根据sid批量删除") |
||||
|
@PostMapping("/delBySids") |
||||
|
public ResultBean delBySids(@RequestBody String[] sids) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
scmPurchaseChannelService.delBySids(sids); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@ApiOperation("根据SID获取一条记录") |
||||
|
@GetMapping("/fetchDetailsBySid/{sid}") |
||||
|
public ResultBean<ScmPurchaseChannelDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
ScmPurchaseChannelDetailsVo vo = scmPurchaseChannelService.fetchDetailsVoBySid(sid); |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean choice(List<ScmPurchaseChannelDto> dto) { |
||||
|
return scmPurchaseChannelService.choice(dto); |
||||
|
} |
||||
|
} |
@ -0,0 +1,128 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.scm.biz.scmpurchasechannel; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.yxt.anrui.scm.api.scmpurchasechannel.*; |
||||
|
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 org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class ScmPurchaseChannelService extends MybatisBaseService<ScmPurchaseChannelMapper, ScmPurchaseChannel> { |
||||
|
private QueryWrapper<ScmPurchaseChannel> createQueryWrapper(ScmPurchaseChannelQuery query) { |
||||
|
// todo: 这里根据具体业务调整查询条件
|
||||
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
||||
|
QueryWrapper<ScmPurchaseChannel> qw = new QueryWrapper<>(); |
||||
|
return qw; |
||||
|
} |
||||
|
|
||||
|
public PagerVo<ScmPurchaseChannelVo> listPageVo(PagerQuery<ScmPurchaseChannelQuery> pq) { |
||||
|
ScmPurchaseChannelQuery query = pq.getParams(); |
||||
|
QueryWrapper<ScmPurchaseChannel> qw = new QueryWrapper<>(); |
||||
|
qw.eq("bpc.state", query.getState()); |
||||
|
qw.eq("bpc.useOrgSid", query.getUseOrgSid()); |
||||
|
String saleOrderApproStartDate = query.getSaleOrderApproStartDate(); |
||||
|
String saleOrderApproEndDate = query.getSaleOrderApproEndDate(); |
||||
|
qw.apply(StringUtils.isNotBlank(saleOrderApproStartDate), "date_format (bpc.saleOrderApproDate,'%Y-%m-%d') >= date_format('" + saleOrderApproStartDate + "','%Y-%m-%d')"). |
||||
|
apply(StringUtils.isNotBlank(saleOrderApproEndDate), "date_format (bpc.saleOrderApproDate,'%Y-%m-%d') <= date_format('" + saleOrderApproEndDate + "','%Y-%m-%d')" |
||||
|
); |
||||
|
if (StringUtils.isNotBlank(query.getSaleOrderNo())) { |
||||
|
qw.like("bpc.saleOrderNo", query.getSaleOrderNo()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getBusinessType())) { |
||||
|
qw.like("bpc.businessType", query.getBusinessType()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getApplyDeptSid())) { |
||||
|
qw.eq("bpc.applyDeptSid", query.getApplyDeptSid()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getApplyPeoName())) { |
||||
|
qw.like("bpc.applyPeoName", query.getApplyPeoName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getModelName())) { |
||||
|
qw.like("bpc.modelName", query.getModelName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getConfigName())) { |
||||
|
qw.like("bpc.configName", query.getConfigName()); |
||||
|
} |
||||
|
IPage<ScmPurchaseChannel> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<ScmPurchaseChannelVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
PagerVo<ScmPurchaseChannelVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public void saveOrUpdateDto(ScmPurchaseChannelDto dto) { |
||||
|
String dtoSid = dto.getSid(); |
||||
|
if (StringUtils.isBlank(dtoSid)) { |
||||
|
this.insertByDto(dto); |
||||
|
return; |
||||
|
} |
||||
|
this.updateByDto(dto); |
||||
|
} |
||||
|
|
||||
|
public void insertByDto(ScmPurchaseChannelDto dto) { |
||||
|
ScmPurchaseChannel entity = new ScmPurchaseChannel(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
entity.setState(1); |
||||
|
baseMapper.insert(entity); |
||||
|
} |
||||
|
|
||||
|
public void updateByDto(ScmPurchaseChannelDto dto) { |
||||
|
String dtoSid = dto.getSid(); |
||||
|
if (StringUtils.isBlank(dtoSid)) { |
||||
|
return; |
||||
|
} |
||||
|
ScmPurchaseChannel entity = fetchBySid(dtoSid); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.updateById(entity); |
||||
|
} |
||||
|
|
||||
|
public ScmPurchaseChannelDetailsVo fetchDetailsVoBySid(String sid) { |
||||
|
ScmPurchaseChannel entity = fetchBySid(sid); |
||||
|
ScmPurchaseChannelDetailsVo vo = new ScmPurchaseChannelDetailsVo(); |
||||
|
BeanUtil.copyProperties(entity, vo); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public ResultBean choice(List<ScmPurchaseChannelDto> dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
for (ScmPurchaseChannelDto scmPurchaseChannelDto : dto) { |
||||
|
String purchaseOrderTypeKey = scmPurchaseChannelDto.getPurchaseOrderTypeKey(); |
||||
|
String purchaseOrderTypeValue = scmPurchaseChannelDto.getPurchaseOrderTypeValue(); |
||||
|
String sid = scmPurchaseChannelDto.getSid(); |
||||
|
baseMapper.choice(sid, purchaseOrderTypeKey, purchaseOrderTypeValue); |
||||
|
} |
||||
|
return rb.success().setMsg("选择成功"); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue