供应商类型接口迁移
This commit is contained in:
@@ -34,6 +34,8 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project: yxt-base(仓储基础信息供应商) <br/>
|
* Project: yxt-base(仓储基础信息供应商) <br/>
|
||||||
* File: BaseSupplierTypeFeignFallback.java <br/>
|
* File: BaseSupplierTypeFeignFallback.java <br/>
|
||||||
@@ -96,4 +98,12 @@ public class SupplierTypeRest {
|
|||||||
public ResultBean<Integer> checkUpdateCode(@PathVariable("supplierTypeCode") String supplierTypeCode,@PathVariable("useOrgSid") String useOrgSid,@PathVariable("orgSid")String dtoSid){
|
public ResultBean<Integer> checkUpdateCode(@PathVariable("supplierTypeCode") String supplierTypeCode,@PathVariable("useOrgSid") String useOrgSid,@PathVariable("orgSid")String dtoSid){
|
||||||
return supplierTypeService.checkUpdateCode(supplierTypeCode,useOrgSid,dtoSid);
|
return supplierTypeService.checkUpdateCode(supplierTypeCode,useOrgSid,dtoSid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取供应商类型")
|
||||||
|
@PostMapping("/selSupplierType")
|
||||||
|
public ResultBean<List<SupplierTypeDown>> selSupplierType(@RequestParam("orgPath") String orgPath){
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<SupplierTypeDown> pmsSupplierTypeDowns = supplierTypeService.selSupplierType(orgPath);
|
||||||
|
return rb.success().setData(pmsSupplierTypeDowns);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*********************************************************
|
||||||
|
*********************************************************
|
||||||
|
******************** *******************
|
||||||
|
************* ************
|
||||||
|
******* _oo0oo_ *******
|
||||||
|
*** o8888888o ***
|
||||||
|
* 88" . "88 *
|
||||||
|
* (| -_- |) *
|
||||||
|
* 0\ = /0 *
|
||||||
|
* ___/`---'\___ *
|
||||||
|
* .' \\| |// '. *
|
||||||
|
* / \\||| : |||// \ *
|
||||||
|
* / _||||| -:- |||||- \ *
|
||||||
|
* | | \\\ - /// | | *
|
||||||
|
* | \_| ''\---/'' |_/ | *
|
||||||
|
* \ .-\__ '-' ___/-. / *
|
||||||
|
* ___'. .' /--.--\ `. .'___ *
|
||||||
|
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||||
|
* `=---=' *
|
||||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||||
|
*********************************************************/
|
||||||
|
package com.yxt.supplier.biz.suppliertype;
|
||||||
|
|
||||||
|
|
||||||
|
import com.yxt.common.core.vo.Vo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Project: yxt-base(仓储基础信息供应商) <br/>
|
||||||
|
* File: BaseSupplierTypeVo.java <br/>
|
||||||
|
* Class: com.yxt.anrui.as.api.pmssuppliertype.BaseSupplierTypeVo <br/>
|
||||||
|
* Description: 供应商类型 视图数据对象. <br/>
|
||||||
|
* Copyright: Copyright (c) 2011 <br/>
|
||||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||||
|
* Makedate: 2024-03-13 16:51:56 <br/>
|
||||||
|
*
|
||||||
|
* @author liupopo
|
||||||
|
* @version 1.0
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SupplierTypeDown implements Vo {
|
||||||
|
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("供应商类型名称")
|
||||||
|
private String supplierTypeName;
|
||||||
|
}
|
||||||
@@ -62,4 +62,7 @@ public interface SupplierTypeMapper extends BaseMapper<SupplierType> {
|
|||||||
|
|
||||||
@Select("SELECT COUNT(*) FROM supplier_type WHERE supplierTypeCode = #{supplierTypeCode} AND useOrgSid = #{useOrgSid} AND sid != #{dtoSid}")
|
@Select("SELECT COUNT(*) FROM supplier_type WHERE supplierTypeCode = #{supplierTypeCode} AND useOrgSid = #{useOrgSid} AND sid != #{dtoSid}")
|
||||||
int checkUpdateCode(@Param("supplierTypeCode") String supplierTypeCode,@Param("useOrgSid") String useOrgSid,@Param("dtoSid") String dtoSid);
|
int checkUpdateCode(@Param("supplierTypeCode") String supplierTypeCode,@Param("useOrgSid") String useOrgSid,@Param("dtoSid") String dtoSid);
|
||||||
|
|
||||||
|
@Select("select * from supplier_type where useOrgSid = #{useOrgSid} and isDelete = '0'")
|
||||||
|
List<SupplierTypeDown> selSupplierType(String useOrgSid);
|
||||||
}
|
}
|
||||||
@@ -33,10 +33,16 @@ import com.yxt.common.base.utils.PagerUtil;
|
|||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.supplier.feign.portal.sysorganization.SysOrganizationFeign;
|
||||||
|
import com.yxt.supplier.feign.portal.sysorganization.SysOrganizationVo;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project: yxt-base(仓储基础信息供应商) <br/>
|
* Project: yxt-base(仓储基础信息供应商) <br/>
|
||||||
* File: BaseSupplierTypeService.java <br/>
|
* File: BaseSupplierTypeService.java <br/>
|
||||||
@@ -52,7 +58,10 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SupplierTypeService extends MybatisBaseService<SupplierTypeMapper, SupplierType> {
|
public class SupplierTypeService extends MybatisBaseService<SupplierTypeMapper, SupplierType> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SysOrganizationFeign sysOrganizationFeign;
|
||||||
|
|
||||||
public PagerVo<SupplierTypeVo> listPageVo(PagerQuery<SupplierTypeQuery> pq) {
|
public PagerVo<SupplierTypeVo> listPageVo(PagerQuery<SupplierTypeQuery> pq) {
|
||||||
SupplierTypeQuery query = pq.getParams();
|
SupplierTypeQuery query = pq.getParams();
|
||||||
QueryWrapper<SupplierType> qw = new QueryWrapper<>();
|
QueryWrapper<SupplierType> qw = new QueryWrapper<>();
|
||||||
@@ -100,4 +109,21 @@ public class SupplierTypeService extends MybatisBaseService<SupplierTypeMapper,
|
|||||||
return new ResultBean<Integer>().success().setData(baseMapper.checkUpdateCode(supplierTypeCode,orgSid,dtoSid));
|
return new ResultBean<Integer>().success().setData(baseMapper.checkUpdateCode(supplierTypeCode,orgSid,dtoSid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SupplierTypeDown> selSupplierType(String orgPath) {
|
||||||
|
String useOrgSid = "";
|
||||||
|
if (StringUtils.isNotBlank(orgPath)) {
|
||||||
|
List<String> split = Arrays.asList(orgPath.split("/"));
|
||||||
|
if (split.size() > 1) {
|
||||||
|
//获取本级sid获取本级部门信息
|
||||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(split.size() - 2)).getData();
|
||||||
|
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData();
|
||||||
|
useOrgSid = sysOrganization1.getSid();
|
||||||
|
} else {
|
||||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData();
|
||||||
|
useOrgSid = sysOrganization.getSid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<SupplierTypeDown> supplierTypeDowns = baseMapper.selSupplierType(useOrgSid);
|
||||||
|
return supplierTypeDowns;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user