lzh 2 years ago
parent
commit
4f36f54de6
  1. 123
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierbankinfo/SupplierBankInfoService.java
  2. 10
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierindex/SupplierIndexService.java

123
yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierbankinfo/SupplierBankInfoService.java

@ -36,6 +36,7 @@ import com.yxt.common.core.vo.PagerVo;
import com.yxt.supervise.customer.api.purchaserequisition.PurchaseRequisition;
import com.yxt.supervise.customer.api.supplierbankinfo.*;
import com.yxt.supervise.customer.api.suppliercontractinfo.SupplierContractInfoDto;
import com.yxt.supervise.customer.api.supplierindex.SupplierIndex;
import com.yxt.supervise.customer.api.supplierindex.SupplierIndexQuery;
import com.yxt.supervise.customer.biz.purchaserequisition.PurchaseRequisitionService;
import com.yxt.supervise.customer.biz.suppliercontractinfo.SupplierContractInfoService;
@ -89,7 +90,8 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
}
if (StringUtils.isNotBlank(query.getBusinessLicenseNo())) {
qw.like("businessLicenseNo", query.getBusinessLicenseNo());
}if (StringUtils.isNotBlank(query.getBankAccountNumber())) {
}
if (StringUtils.isNotBlank(query.getBankAccountNumber())) {
qw.like("bankAccountNumber", query.getBankAccountNumber());
}
return qw;
@ -100,8 +102,8 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
QueryWrapper<SupplierBankInfo> qw = createQueryWrapper(query);
SupplierBankInfoQuery params = pq.getParams();
String name = params.getName();
if(StringUtils.isNotBlank(name)){
qw.like("i.name",name);
if (StringUtils.isNotBlank(name)) {
qw.like("i.name", name);
}
IPage<SupplierBankInfo> page = PagerUtil.queryToPage(pq);
IPage<SupplierBankInfoVo> pagging = baseMapper.selectPageVo(page, qw);
@ -109,7 +111,7 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
return p;
}
public void saveOrUpdateDto(SupplierBankInfoDto dto){
public void saveOrUpdateDto(SupplierBankInfoDto dto) {
String dtoSid = dto.getSid();
if (StringUtils.isBlank(dtoSid)) {
this.insertByDto(dto);
@ -118,46 +120,46 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
this.updateByDto(dto);
}
public void insertByDto(SupplierBankInfoDto dto){
public void insertByDto(SupplierBankInfoDto dto) {
SupplierBankInfo entity = new SupplierBankInfo();
BeanUtil.copyProperties(dto, entity, "id", "sid");
baseMapper.insert(entity);
List<String> codeIndex = dto.getCodeIndex();
baseMapper.insertSUpplierIndex(entity.getName(),entity.getCodeUnified(),entity.getSid(),entity.getCodeUnified());
baseMapper.insertSUpplierIndex(entity.getName(), entity.getCodeUnified(), entity.getSid(), entity.getCodeUnified());
for (String index : codeIndex) {
if (!index.equals(entity.getCodeUnified())){
baseMapper.insertSUpplierIndex(entity.getName(),entity.getCodeUnified(),entity.getSid(),index);
if (!index.equals(entity.getCodeUnified())) {
baseMapper.insertSUpplierIndex(entity.getName(), entity.getCodeUnified(), entity.getSid(), index);
}
}
baseMapper.deleteSupplierFiles(entity.getSid(),"1");
baseMapper.deleteSupplierFiles(entity.getSid(), "1");
String[] businessLicenseFiles = dto.getBusinessLicenseFiles();
if(businessLicenseFiles!=null){
List<Map<String,String>> maps=new ArrayList<>();
for(String s:businessLicenseFiles){
Map<String,String>m=new HashMap<>();
m.put("mainSid",entity.getSid());
m.put("url",s);
m.put("type","1");
if (businessLicenseFiles != null) {
List<Map<String, String>> maps = new ArrayList<>();
for (String s : businessLicenseFiles) {
Map<String, String> m = new HashMap<>();
m.put("mainSid", entity.getSid());
m.put("url", s);
m.put("type", "1");
m.put("sid", UUID.randomUUID().toString());
maps.add(m);
}
if(maps.size()>0){
if (maps.size() > 0) {
baseMapper.insertSupplierFiles(maps);
}
}
baseMapper.deleteSupplierFiles(entity.getSid(),"2");
baseMapper.deleteSupplierFiles(entity.getSid(), "2");
String[] contractFiles = dto.getContractInfo().getContractFiles();
if(contractFiles!=null){
List<Map<String,String>> maps=new ArrayList<>();
for(String s:contractFiles){
Map<String,String>m=new HashMap<>();
m.put("mainSid",entity.getSid());
m.put("url",s);
m.put("type","2");
if (contractFiles != null) {
List<Map<String, String>> maps = new ArrayList<>();
for (String s : contractFiles) {
Map<String, String> m = new HashMap<>();
m.put("mainSid", entity.getSid());
m.put("url", s);
m.put("type", "2");
m.put("sid", UUID.randomUUID().toString());
maps.add(m);
}
if(maps.size()>0){
if (maps.size() > 0) {
baseMapper.insertSupplierFiles(maps);
}
}
@ -166,7 +168,7 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
supplierContractInfoService.saveOrUpdateDto(supplierContractInfoDto);
}
public void updateByDto(SupplierBankInfoDto dto){
public void updateByDto(SupplierBankInfoDto dto) {
String dtoSid = dto.getSid();
if (StringUtils.isBlank(dtoSid)) {
return;
@ -176,35 +178,35 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
baseMapper.updateById(entity);
supplierIndexService.delByMainSid(dtoSid);
List<String> codeIndex = dto.getCodeIndex();
baseMapper.insertSUpplierIndex(entity.getName(),entity.getCodeUnified(),dtoSid,entity.getCodeUnified());
baseMapper.insertSUpplierIndex(entity.getName(), entity.getCodeUnified(), dtoSid, entity.getCodeUnified());
for (String index : codeIndex) {
if (!index.equals(entity.getCodeUnified())){
baseMapper.insertSUpplierIndex(entity.getName(),entity.getCodeUnified(),entity.getSid(),index);
if (!index.equals(entity.getCodeUnified())) {
baseMapper.insertSUpplierIndex(entity.getName(), entity.getCodeUnified(), entity.getSid(), index);
}
}
baseMapper.deleteSupplierFiles(entity.getSid(),"1");
baseMapper.deleteSupplierFiles(entity.getSid(), "1");
String[] businessLicenseFiles = dto.getBusinessLicenseFiles();
if(businessLicenseFiles!=null){
List<Map<String,String>> maps=new ArrayList<>();
for(String s:businessLicenseFiles){
Map<String,String>m=new HashMap<>();
m.put("mainSid",entity.getSid());
m.put("url",s);
m.put("type","1");
if (businessLicenseFiles != null) {
List<Map<String, String>> maps = new ArrayList<>();
for (String s : businessLicenseFiles) {
Map<String, String> m = new HashMap<>();
m.put("mainSid", entity.getSid());
m.put("url", s);
m.put("type", "1");
m.put("sid", UUID.randomUUID().toString());
maps.add(m);
}
baseMapper.insertSupplierFiles(maps);
}
baseMapper.deleteSupplierFiles(entity.getSid(),"2");
baseMapper.deleteSupplierFiles(entity.getSid(), "2");
String[] contractFiles = dto.getContractInfo().getContractFiles();
if(contractFiles!=null){
List<Map<String,String>> maps=new ArrayList<>();
for(String s:contractFiles){
Map<String,String>m=new HashMap<>();
m.put("mainSid",entity.getSid());
m.put("url",s);
m.put("type","2");
if (contractFiles != null) {
List<Map<String, String>> maps = new ArrayList<>();
for (String s : contractFiles) {
Map<String, String> m = new HashMap<>();
m.put("mainSid", entity.getSid());
m.put("url", s);
m.put("type", "2");
m.put("sid", UUID.randomUUID().toString());
maps.add(m);
}
@ -214,28 +216,30 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
supplierContractInfoDto.setSupplierSid(entity.getSid());
supplierContractInfoService.saveOrUpdateDto(supplierContractInfoDto);
}
public ResultBean delBySids(String sids) {
ResultBean<Object> resultBean = ResultBean.fireFail();
String[] split = sids.split(",");
int i= baseMapper.delBySids(split);
int i = baseMapper.delBySids(split);
return resultBean.success().setData("1");
}
public SupplierBankInfoDetailsVo fetchDetailsVoBySid(String sid){
public SupplierBankInfoDetailsVo fetchDetailsVoBySid(String sid) {
SupplierBankInfo entity = baseMapper.selectBySid(sid);
SupplierBankInfoDetailsVo vo = new SupplierBankInfoDetailsVo();
SupplierContractInfoDto contractInfo = new SupplierContractInfoDto();
BeanUtil.copyProperties(entity, vo);
String s1=baseMapper.selectSupplierFiles(sid,"1");
if(StringUtils.isNotBlank(s1)){
String s1 = baseMapper.selectSupplierFiles(sid, "1");
if (StringUtils.isNotBlank(s1)) {
vo.setBusinessLicenseFiles(s1.split(","));
}else{
} else {
vo.setBusinessLicenseFiles(new String[]{});
}
String s2=baseMapper.selectSupplierFiles(sid,"2");
if(StringUtils.isNotBlank(s2)){
String s2 = baseMapper.selectSupplierFiles(sid, "2");
if (StringUtils.isNotBlank(s2)) {
contractInfo.setContractFiles(s2.split(","));
contractInfo.setContractFiles(s2.split(","));
}else{
} else {
contractInfo.setContractFiles(new String[]{});
}
vo.setContractInfo(contractInfo);
@ -249,13 +253,22 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
public List<PurchaseRequisitionCheckVo> checkPurchaseRequisition(String purchaseRequisitionSid) {
List<PurchaseRequisitionCheckVo> list = new ArrayList<>();
PurchaseRequisition pr = purchaseRequisitionService.fetchBySid(purchaseRequisitionSid);
if(pr==null)
if (pr == null)
return list;
String supplierCode = pr.getSupplierCode();
String supplierName = pr.getSupplierName();
String supplierOnlyCode = pr.getSupplierOnlyCode();
SupplierIndex si = supplierIndexService.fetchbyCode(supplierCode);
if (si == null) {
}
return list;
}
public void checkInTransitByUniCode(String supplierOnlyCode) {
}
}

10
yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierindex/SupplierIndexService.java

@ -62,8 +62,8 @@ public class SupplierIndexService extends ServiceImpl<SupplierIndexMapper, Suppl
QueryWrapper<SupplierIndex> qw = new QueryWrapper<>();
SupplierIndexQuery params = pq.getParams();
String name = params.getName();
if(StringUtils.isNotBlank(name)){
qw.like("i.name",name);
if (StringUtils.isNotBlank(name)) {
qw.like("i.name", name);
}
IPage<SupplierIndex> page = PagerUtil.queryToPage(pq);
IPage<SupplierIndexVo> pagging = baseMapper.selectPageVo(page, qw);
@ -114,4 +114,10 @@ public class SupplierIndexService extends ServiceImpl<SupplierIndexMapper, Suppl
public void delByMainSid(String dtoSid) {
baseMapper.delByMainSid(dtoSid);
}
public SupplierIndex fetchbyCode(String supplierCode) {
QueryWrapper<SupplierIndex> qw = new QueryWrapper<>();
qw.eq("code", supplierCode);
return baseMapper.selectOne(qw);
}
}

Loading…
Cancel
Save