|
|
@ -6,14 +6,18 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapply.BusVehicleApplyVo; |
|
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
|
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery; |
|
|
|
import com.yxt.anrui.flowable.api.flow2.FlowFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loandiff.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loandiff.flowable.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loandiffdetails.*; |
|
|
@ -64,6 +68,8 @@ public class LoanDiffService extends MybatisBaseService<LoanDiffMapper, LoanDiff |
|
|
|
private LoanDiffDetailsService loanDiffDetailsService; |
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
@Autowired |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断提交的流程是否被允许 |
|
|
@ -387,9 +393,50 @@ public class LoanDiffService extends MybatisBaseService<LoanDiffMapper, LoanDiff |
|
|
|
if (StringUtils.isNotBlank(query.getCreateByName())) { |
|
|
|
qw.like("ld.createByName", query.getCreateByName()); |
|
|
|
} |
|
|
|
//数据授权
|
|
|
|
|
|
|
|
//========================================数据授权开始
|
|
|
|
if (StringUtils.isNotBlank(query.getMenuUrl())) { |
|
|
|
//=======================
|
|
|
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
|
|
privilegeQuery.setOrgPath(query.getOrgPath()); |
|
|
|
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
|
|
|
privilegeQuery.setUserSid(query.getUserSid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
String orgSidPath = query.getOrgPath(); |
|
|
|
orgSidPath = orgSidPath + "/"; |
|
|
|
int i1 = orgSidPath.indexOf("/"); |
|
|
|
int i2 = orgSidPath.indexOf("/", i1 + 1); |
|
|
|
int i3 = orgSidPath.indexOf("/", i2 + 1); |
|
|
|
int i4 = orgSidPath.indexOf("/", i3 + 1); |
|
|
|
String orgLevelKey = defaultIdReltBean.getData(); |
|
|
|
if ("1".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i1); |
|
|
|
qw.like("ld.orgSidPath", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("ld.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("ld.orgSidPath", orgSidPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("ld.orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("ld.createBySid", query.getUserSid()); |
|
|
|
} else { |
|
|
|
PagerVo<LoanDiffVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<LoanDiffVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<LoanDiffVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
|
|
|
|
} |
|
|
|
//申请日期开始时间
|
|
|
|
String createTimeStart = query.getCreateTimeStart(); |
|
|
|
//申请日期结束时间
|
|
|
@ -431,6 +478,7 @@ public class LoanDiffService extends MybatisBaseService<LoanDiffMapper, LoanDiff |
|
|
|
if (loanDiff == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto,loanDiff,"sid"); |
|
|
|
List<LoanDiffDetailsDto> loanDiffDetailsList = dto.getLoanDiffDetails(); |
|
|
|
loanDiffDetailsList.removeAll(Collections.singleton(null)); |
|
|
|
if (!loanDiffDetailsList.isEmpty()) { |
|
|
@ -441,12 +489,18 @@ public class LoanDiffService extends MybatisBaseService<LoanDiffMapper, LoanDiff |
|
|
|
loanDiffDetailsService.updateById(loanDiffDetails1); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> filesList = dto.getFilesList(); |
|
|
|
filesList.removeAll(Collections.singleton(null)); |
|
|
|
if (!filesList.isEmpty()) { |
|
|
|
String fils = String.join(",", filesList).replaceAll(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
loanDiff.setFiles(fils); |
|
|
|
baseMapper.updateById(loanDiff); |
|
|
|
// List<String> filesList = dto.getFilesList();
|
|
|
|
List<DiffFile> fileLists = dto.getFilesList(); |
|
|
|
fileLists.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileLists.isEmpty()) { |
|
|
|
List<String> files = fileLists.stream().map(v->v.getUrl()).collect(Collectors.toList()); |
|
|
|
files.removeAll(Collections.singleton(null)); |
|
|
|
if(!files.isEmpty()){ |
|
|
|
String filss = String.join(",", files).replaceAll(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
loanDiff.setFiles(filss); |
|
|
|
baseMapper.updateById(loanDiff); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
@ -466,7 +520,13 @@ public class LoanDiffService extends MybatisBaseService<LoanDiffMapper, LoanDiff |
|
|
|
String files = loanDiff.getFiles(); |
|
|
|
if (StringUtils.isNotBlank(files)) { |
|
|
|
List<String> stringList = Arrays.asList(files.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
details.setFiles(stringList); |
|
|
|
List<DiffFile> fileList = new ArrayList<>(); |
|
|
|
for (int i = 0; i < stringList.size(); i++) { |
|
|
|
DiffFile diffFile = new DiffFile(); |
|
|
|
diffFile.setUrl(stringList.get(i)); |
|
|
|
fileList.add(diffFile); |
|
|
|
} |
|
|
|
details.setFilesList(fileList); |
|
|
|
} |
|
|
|
List<LoanDiffDetailssVo> detailssVoList = loanDiffDetailsService.selectByMainSid(sid); |
|
|
|
detailssVoList.removeAll(Collections.singleton(null)); |
|
|
@ -498,4 +558,12 @@ public class LoanDiffService extends MybatisBaseService<LoanDiffMapper, LoanDiff |
|
|
|
} |
|
|
|
return rb.success().setData(loanDiffDetailsssApp); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean delegate(DelegateQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FlowDelegateQuery delegateQuery = new FlowDelegateQuery(); |
|
|
|
BeanUtil.copyProperties(query, delegateQuery); |
|
|
|
flowFeign.delegate(delegateQuery); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
} |
|
|
|