|
@ -36,6 +36,7 @@ import com.yxt.common.core.vo.PagerVo; |
|
|
import com.yxt.supervise.customer.api.supplierbankinfo.*; |
|
|
import com.yxt.supervise.customer.api.supplierbankinfo.*; |
|
|
import com.yxt.supervise.customer.api.suppliercontractinfo.SupplierContractInfoDto; |
|
|
import com.yxt.supervise.customer.api.suppliercontractinfo.SupplierContractInfoDto; |
|
|
import com.yxt.supervise.customer.biz.suppliercontractinfo.SupplierContractInfoService; |
|
|
import com.yxt.supervise.customer.biz.suppliercontractinfo.SupplierContractInfoService; |
|
|
|
|
|
import com.yxt.supervise.customer.biz.supplierindex.SupplierIndexService; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@ -59,6 +60,9 @@ import java.util.*; |
|
|
public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfoMapper, SupplierBankInfo> { |
|
|
public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfoMapper, SupplierBankInfo> { |
|
|
@Resource |
|
|
@Resource |
|
|
private SupplierContractInfoService supplierContractInfoService; |
|
|
private SupplierContractInfoService supplierContractInfoService; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private SupplierIndexService supplierIndexService; |
|
|
|
|
|
|
|
|
private QueryWrapper<SupplierBankInfo> createQueryWrapper(SupplierBankInfoQuery query) { |
|
|
private QueryWrapper<SupplierBankInfo> createQueryWrapper(SupplierBankInfoQuery query) { |
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
@ -106,7 +110,13 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo |
|
|
SupplierBankInfo entity = new SupplierBankInfo(); |
|
|
SupplierBankInfo entity = new SupplierBankInfo(); |
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
baseMapper.insert(entity); |
|
|
baseMapper.insert(entity); |
|
|
baseMapper.insertSUpplierIndex(entity.getName(),entity.getCodeUnified(),entity.getSid()); |
|
|
List<String> codeIndex = dto.getCodeIndex(); |
|
|
|
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
baseMapper.deleteSupplierFiles(entity.getSid(),"1"); |
|
|
baseMapper.deleteSupplierFiles(entity.getSid(),"1"); |
|
|
String[] businessLicenseFiles = dto.getBusinessLicenseFiles(); |
|
|
String[] businessLicenseFiles = dto.getBusinessLicenseFiles(); |
|
|
if(businessLicenseFiles!=null){ |
|
|
if(businessLicenseFiles!=null){ |
|
@ -124,7 +134,7 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
baseMapper.deleteSupplierFiles(entity.getSid(),"2"); |
|
|
baseMapper.deleteSupplierFiles(entity.getSid(),"2"); |
|
|
String[] contractFiles = dto.getContractFiles(); |
|
|
String[] contractFiles = dto.getContractInfo().getContractFiles(); |
|
|
if(contractFiles!=null){ |
|
|
if(contractFiles!=null){ |
|
|
List<Map<String,String>> maps=new ArrayList<>(); |
|
|
List<Map<String,String>> maps=new ArrayList<>(); |
|
|
for(String s:contractFiles){ |
|
|
for(String s:contractFiles){ |
|
@ -139,7 +149,7 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo |
|
|
baseMapper.insertSupplierFiles(maps); |
|
|
baseMapper.insertSupplierFiles(maps); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
SupplierContractInfoDto supplierContractInfoDto = dto.getSupplierContractInfoDto(); |
|
|
SupplierContractInfoDto supplierContractInfoDto = dto.getContractInfo(); |
|
|
supplierContractInfoDto.setSupplierSid(entity.getSid()); |
|
|
supplierContractInfoDto.setSupplierSid(entity.getSid()); |
|
|
supplierContractInfoService.saveOrUpdateDto(supplierContractInfoDto); |
|
|
supplierContractInfoService.saveOrUpdateDto(supplierContractInfoDto); |
|
|
} |
|
|
} |
|
@ -152,6 +162,14 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo |
|
|
SupplierBankInfo entity = baseMapper.selectBySid(dtoSid); |
|
|
SupplierBankInfo entity = baseMapper.selectBySid(dtoSid); |
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
baseMapper.updateById(entity); |
|
|
baseMapper.updateById(entity); |
|
|
|
|
|
supplierIndexService.delByMainSid(dtoSid); |
|
|
|
|
|
List<String> codeIndex = dto.getCodeIndex(); |
|
|
|
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
baseMapper.deleteSupplierFiles(entity.getSid(),"1"); |
|
|
baseMapper.deleteSupplierFiles(entity.getSid(),"1"); |
|
|
String[] businessLicenseFiles = dto.getBusinessLicenseFiles(); |
|
|
String[] businessLicenseFiles = dto.getBusinessLicenseFiles(); |
|
|
if(businessLicenseFiles!=null){ |
|
|
if(businessLicenseFiles!=null){ |
|
@ -167,7 +185,7 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo |
|
|
baseMapper.insertSupplierFiles(maps); |
|
|
baseMapper.insertSupplierFiles(maps); |
|
|
} |
|
|
} |
|
|
baseMapper.deleteSupplierFiles(entity.getSid(),"2"); |
|
|
baseMapper.deleteSupplierFiles(entity.getSid(),"2"); |
|
|
String[] contractFiles = dto.getContractFiles(); |
|
|
String[] contractFiles = dto.getContractInfo().getContractFiles(); |
|
|
if(contractFiles!=null){ |
|
|
if(contractFiles!=null){ |
|
|
List<Map<String,String>> maps=new ArrayList<>(); |
|
|
List<Map<String,String>> maps=new ArrayList<>(); |
|
|
for(String s:contractFiles){ |
|
|
for(String s:contractFiles){ |
|
@ -180,7 +198,7 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo |
|
|
} |
|
|
} |
|
|
baseMapper.insertSupplierFiles(maps); |
|
|
baseMapper.insertSupplierFiles(maps); |
|
|
} |
|
|
} |
|
|
SupplierContractInfoDto supplierContractInfoDto = dto.getSupplierContractInfoDto(); |
|
|
SupplierContractInfoDto supplierContractInfoDto = dto.getContractInfo(); |
|
|
supplierContractInfoDto.setSupplierSid(entity.getSid()); |
|
|
supplierContractInfoDto.setSupplierSid(entity.getSid()); |
|
|
supplierContractInfoService.saveOrUpdateDto(supplierContractInfoDto); |
|
|
supplierContractInfoService.saveOrUpdateDto(supplierContractInfoDto); |
|
|
} |
|
|
} |
|
@ -193,6 +211,7 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo |
|
|
public SupplierBankInfoDetailsVo fetchDetailsVoBySid(String sid){ |
|
|
public SupplierBankInfoDetailsVo fetchDetailsVoBySid(String sid){ |
|
|
SupplierBankInfo entity = baseMapper.selectBySid(sid); |
|
|
SupplierBankInfo entity = baseMapper.selectBySid(sid); |
|
|
SupplierBankInfoDetailsVo vo = new SupplierBankInfoDetailsVo(); |
|
|
SupplierBankInfoDetailsVo vo = new SupplierBankInfoDetailsVo(); |
|
|
|
|
|
SupplierContractInfoDto contractInfo = new SupplierContractInfoDto(); |
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
String s1=baseMapper.selectSupplierFiles(sid,"1"); |
|
|
String s1=baseMapper.selectSupplierFiles(sid,"1"); |
|
|
if(StringUtils.isNotBlank(s1)){ |
|
|
if(StringUtils.isNotBlank(s1)){ |
|
@ -200,13 +219,14 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo |
|
|
}else{ |
|
|
}else{ |
|
|
vo.setBusinessLicenseFiles(new String[]{}); |
|
|
vo.setBusinessLicenseFiles(new String[]{}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String s2=baseMapper.selectSupplierFiles(sid,"2"); |
|
|
String s2=baseMapper.selectSupplierFiles(sid,"2"); |
|
|
if(StringUtils.isNotBlank(s2)){ |
|
|
if(StringUtils.isNotBlank(s2)){ |
|
|
vo.setContractFiles(s2.split(",")); |
|
|
contractInfo.setContractFiles(s2.split(",")); |
|
|
|
|
|
contractInfo.setContractFiles(s2.split(",")); |
|
|
}else{ |
|
|
}else{ |
|
|
vo.setContractFiles(new String[]{}); |
|
|
contractInfo.setContractFiles(new String[]{}); |
|
|
} |
|
|
} |
|
|
|
|
|
vo.setContractInfo(contractInfo); |
|
|
return vo; |
|
|
return vo; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|