|
|
@ -18,17 +18,24 @@ import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loancaseentrustlawyerapply.LoanCaseEntrustLawyerFile; |
|
|
|
import com.yxt.anrui.riskcenter.api.loancaseprogress.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loancaseprogress.tingshen.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loancaseprogressfees.LoanCaseProgressFees; |
|
|
|
import com.yxt.anrui.riskcenter.api.loancaseprogressguarantor.LoanCaseProgressGuarantor; |
|
|
|
import com.yxt.anrui.riskcenter.api.loancaseprogresspreserve.LoanCaseProgressPreserve; |
|
|
|
import com.yxt.anrui.riskcenter.api.loancaseprogresstrial.LoanCaseProgressTrial; |
|
|
|
import com.yxt.anrui.riskcenter.api.loancaseprogressveh.LoanCaseProgressVeh; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfile.LoanFile; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfile.LoanFileEnum; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.UrlQuery; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanreturnvehledger.LoanReturnVehLedger; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loancaseprogressfees.LoanCaseProgressFeesService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loancaseprogressguarantor.LoanCaseProgressGuarantorService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loancaseprogresspreserve.LoanCaseProgressPreserveService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loancaseprogresstrial.LoanCaseProgressTrialService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loancaseprogressveh.LoanCaseProgressVehService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -55,6 +62,8 @@ import java.util.stream.Collectors; |
|
|
|
@Service |
|
|
|
public class LoanCaseProgressService extends MybatisBaseService<LoanCaseProgressMapper, LoanCaseProgress> { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private LoanFileService loanFileService; |
|
|
|
@Autowired |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
@Autowired |
|
|
@ -77,6 +86,8 @@ public class LoanCaseProgressService extends MybatisBaseService<LoanCaseProgress |
|
|
|
private LoanCaseProgressPreserveService loanCaseProgressPreserveService; |
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
@Autowired |
|
|
|
private LoanCaseProgressTrialService loanCaseProgressTrialService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 生成交车资料确认单单据编号 |
|
|
@ -191,37 +202,37 @@ public class LoanCaseProgressService extends MybatisBaseService<LoanCaseProgress |
|
|
|
privilegeQuery.setMenuUrl(pagerQuery.getMenuUrl()); |
|
|
|
privilegeQuery.setUserSid(pagerQuery.getUserSid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
// if (StringUtils.isNotBlank(defaultIdReltBean.getData())) {
|
|
|
|
// //数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
// String orgSidPath = pagerQuery.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("p.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("2".equals(orgLevelKey)) {
|
|
|
|
// orgSidPath = orgSidPath.substring(0, i2);
|
|
|
|
// qw.like("p.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("3".equals(orgLevelKey)) {
|
|
|
|
// orgSidPath = orgSidPath.substring(0, i3);
|
|
|
|
// qw.like("p.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("4".equals(orgLevelKey)) {
|
|
|
|
// orgSidPath = orgSidPath.substring(0, i4);
|
|
|
|
// qw.like("p.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("5".equals(orgLevelKey)) {
|
|
|
|
// qw.eq("p.createBySid", pagerQuery.getUserSid());
|
|
|
|
// } else {
|
|
|
|
// PagerVo<LoanCaseProgressVo> p = new PagerVo<>();
|
|
|
|
// return p;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// PagerVo<LoanCaseProgressVo> p = new PagerVo<>();
|
|
|
|
// return p;
|
|
|
|
// }
|
|
|
|
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
String orgSidPath = pagerQuery.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("p.orgSidPath", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("p.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("p.orgSidPath", orgSidPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("p.orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("p.createBySid", pagerQuery.getUserSid()); |
|
|
|
} else { |
|
|
|
PagerVo<LoanCaseProgressVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<LoanCaseProgressVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
//=======================
|
|
|
|
//分公司
|
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getUseOrgName())) { |
|
|
@ -282,11 +293,11 @@ public class LoanCaseProgressService extends MybatisBaseService<LoanCaseProgress |
|
|
|
} |
|
|
|
//律师事务所
|
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getLawFirms())) { |
|
|
|
qw.like("b.lawyerFirm", pagerQuery.getLawFirms()); |
|
|
|
qw.like("p.lawFirms", pagerQuery.getLawFirms()); |
|
|
|
} |
|
|
|
//承办律师
|
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getLawer())) { |
|
|
|
qw.like("b.lawyerName", pagerQuery.getLawer()); |
|
|
|
qw.like("p.lawer", pagerQuery.getLawer()); |
|
|
|
} |
|
|
|
//是否全额诉讼
|
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getFull())) { |
|
|
@ -503,4 +514,387 @@ public class LoanCaseProgressService extends MybatisBaseService<LoanCaseProgress |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ReviewVo returnReviewVo(String sid, String caseStage) { |
|
|
|
ReviewVo vo = new ReviewVo(); |
|
|
|
vo.setSid(sid); |
|
|
|
DelegateInfo delegateInfo = new DelegateInfo();//委派情况
|
|
|
|
LoanCaseProgress progress = fetchBySid(sid); |
|
|
|
if (null != progress) { |
|
|
|
if (StringUtils.isNotBlank(progress.getLawFirms())) { |
|
|
|
delegateInfo.setLawFirms(progress.getLawFirms()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(progress.getLawerPhone())) { |
|
|
|
delegateInfo.setLawerPhone(progress.getLawerPhone()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(progress.getLawer())) { |
|
|
|
delegateInfo.setLawer(progress.getLawer()); |
|
|
|
} |
|
|
|
String lawyerSid = baseMapper.selLawyerSidBySid(sid); |
|
|
|
List<LoanFile> wtxy = loanFileService.selectByLinkSid(lawyerSid, LoanFileEnum.ENTRUSTLAWYER_WTXY.getAttachType()); |
|
|
|
List<UrlQuery> file = new ArrayList<>(); |
|
|
|
if (wtxy != null && wtxy.size() > 0) { |
|
|
|
for (LoanFile loanFile : wtxy) { |
|
|
|
UrlQuery loanCaseEntrustLawyerFile = new UrlQuery(); |
|
|
|
String filePath = loanFile.getFilePath(); |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
filePath = urlPrefix + filePath; |
|
|
|
loanCaseEntrustLawyerFile.setUrl(filePath); |
|
|
|
file.add(loanCaseEntrustLawyerFile); |
|
|
|
} |
|
|
|
} |
|
|
|
delegateInfo.setFile(file); |
|
|
|
vo.setDelegateInfo(delegateInfo); |
|
|
|
} |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
LoanCaseProgressTrial trial = loanCaseProgressTrialService.selByJdAndSid(sid, caseStage); |
|
|
|
if (null != trial) { |
|
|
|
//法官信息
|
|
|
|
JudgeInfo judgeInfo = new JudgeInfo(); |
|
|
|
BeanUtil.copyProperties(trial, judgeInfo); |
|
|
|
vo.setJudgeInfo(judgeInfo); |
|
|
|
//待立案
|
|
|
|
DaiLiAnInfo daiLiAnInfo = new DaiLiAnInfo(); |
|
|
|
BeanUtil.copyProperties(trial, daiLiAnInfo); |
|
|
|
if (null != trial.getSubmitTime()) { |
|
|
|
daiLiAnInfo.setSubmitTime(sdf.format(trial.getSubmitTime())); |
|
|
|
} |
|
|
|
String pendingFiles = trial.getPendingFiles(); |
|
|
|
List<UrlQuery> pf = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(pendingFiles)) { |
|
|
|
List<String> fileList = Arrays.asList(pendingFiles.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
for (int i = 0; i < fileList.size(); i++) { |
|
|
|
UrlQuery urlQuery = new UrlQuery(); |
|
|
|
urlQuery.setUrl(fileList.get(i)); |
|
|
|
pf.add(urlQuery); |
|
|
|
} |
|
|
|
daiLiAnInfo.setFile(pf); |
|
|
|
} |
|
|
|
vo.setDaiLiAnInfo(daiLiAnInfo); |
|
|
|
//已立案
|
|
|
|
YiLiAnInfo yiLiAnInfo = new YiLiAnInfo(); |
|
|
|
BeanUtil.copyProperties(trial, yiLiAnInfo); |
|
|
|
if (null != trial.getFiledTime()) { |
|
|
|
yiLiAnInfo.setFiledTime(sdf.format(trial.getFiledTime())); |
|
|
|
} |
|
|
|
String filedFiles = trial.getFiledFiles(); |
|
|
|
List<UrlQuery> ff = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(filedFiles)) { |
|
|
|
List<String> fileList = Arrays.asList(filedFiles.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
for (int i = 0; i < fileList.size(); i++) { |
|
|
|
UrlQuery urlQuery = new UrlQuery(); |
|
|
|
urlQuery.setUrl(fileList.get(i)); |
|
|
|
ff.add(urlQuery); |
|
|
|
} |
|
|
|
yiLiAnInfo.setFile(ff); |
|
|
|
} |
|
|
|
vo.setYiLiAnInfo(yiLiAnInfo); |
|
|
|
//待开庭
|
|
|
|
DaiKaiTingInfo daiKaiTingInfo = new DaiKaiTingInfo(); |
|
|
|
BeanUtil.copyProperties(trial, daiKaiTingInfo); |
|
|
|
if (null != trial.getTrialTime()) { |
|
|
|
daiKaiTingInfo.setTrialTime(sdf.format(trial.getTrialTime())); |
|
|
|
} |
|
|
|
if (null != trial.getTrialPreTime()) { |
|
|
|
daiKaiTingInfo.setTrialPreTime(sdf.format(trial.getTrialPreTime())); |
|
|
|
} |
|
|
|
String trialFiles = trial.getTrialFiles(); |
|
|
|
List<UrlQuery> tf = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(trialFiles)) { |
|
|
|
List<String> fileList = Arrays.asList(trialFiles.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
for (int i = 0; i < fileList.size(); i++) { |
|
|
|
UrlQuery urlQuery = new UrlQuery(); |
|
|
|
urlQuery.setUrl(fileList.get(i)); |
|
|
|
tf.add(urlQuery); |
|
|
|
} |
|
|
|
daiKaiTingInfo.setFile(tf); |
|
|
|
} |
|
|
|
vo.setDaiKaiTingInfo(daiKaiTingInfo); |
|
|
|
//已开庭
|
|
|
|
YiKaiTingInfo yiKaiTingInfo = new YiKaiTingInfo(); |
|
|
|
BeanUtil.copyProperties(trial, yiKaiTingInfo); |
|
|
|
if (null != trial.getAlreadyTime()) { |
|
|
|
yiKaiTingInfo.setAlreadyTime(sdf.format(trial.getAlreadyTime())); |
|
|
|
} |
|
|
|
if (null != trial.getSecondTime()) { |
|
|
|
yiKaiTingInfo.setSecondTime(sdf.format(trial.getSecondTime())); |
|
|
|
} |
|
|
|
String alreadyFiles = trial.getAlreadyFiles(); |
|
|
|
List<UrlQuery> af = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(alreadyFiles)) { |
|
|
|
List<String> fileList = Arrays.asList(alreadyFiles.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
for (int i = 0; i < fileList.size(); i++) { |
|
|
|
UrlQuery urlQuery = new UrlQuery(); |
|
|
|
urlQuery.setUrl(fileList.get(i)); |
|
|
|
af.add(urlQuery); |
|
|
|
} |
|
|
|
yiKaiTingInfo.setFile(af); |
|
|
|
} |
|
|
|
vo.setYiKaiTingInfo(yiKaiTingInfo); |
|
|
|
//已判决、调解
|
|
|
|
PanJueInfo panJueInfo = new PanJueInfo(); |
|
|
|
BeanUtil.copyProperties(trial, panJueInfo); |
|
|
|
if (null != trial.getVerdictTime()) { |
|
|
|
panJueInfo.setVerdictTime(sdf.format(trial.getVerdictTime())); |
|
|
|
} |
|
|
|
String verdictFiles = trial.getVerdictFiles(); |
|
|
|
List<UrlQuery> vf = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(verdictFiles)) { |
|
|
|
List<String> fileList = Arrays.asList(verdictFiles.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
for (int i = 0; i < fileList.size(); i++) { |
|
|
|
UrlQuery urlQuery = new UrlQuery(); |
|
|
|
urlQuery.setUrl(fileList.get(i)); |
|
|
|
vf.add(urlQuery); |
|
|
|
} |
|
|
|
panJueInfo.setFile(vf); |
|
|
|
} |
|
|
|
vo.setPanJueInfo(panJueInfo); |
|
|
|
//已生效
|
|
|
|
ShengXiaoInfo shengXiaoInfo = new ShengXiaoInfo(); |
|
|
|
BeanUtil.copyProperties(trial, shengXiaoInfo); |
|
|
|
if (null != trial.getEffectTime()) { |
|
|
|
shengXiaoInfo.setEffectTime(sdf.format(trial.getEffectTime())); |
|
|
|
} |
|
|
|
String effectFiles = trial.getEffectFiles(); |
|
|
|
List<UrlQuery> eff = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(effectFiles)) { |
|
|
|
List<String> fileList = Arrays.asList(effectFiles.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
for (int i = 0; i < fileList.size(); i++) { |
|
|
|
UrlQuery urlQuery = new UrlQuery(); |
|
|
|
urlQuery.setUrl(fileList.get(i)); |
|
|
|
eff.add(urlQuery); |
|
|
|
} |
|
|
|
shengXiaoInfo.setFile(eff); |
|
|
|
} |
|
|
|
vo.setShengXiaoInfo(shengXiaoInfo); |
|
|
|
//上诉
|
|
|
|
ShangSuInfo shangSuInfo = new ShangSuInfo(); |
|
|
|
BeanUtil.copyProperties(trial, shengXiaoInfo); |
|
|
|
if (null != trial.getAppealTime()) { |
|
|
|
shangSuInfo.setAppealTime(sdf.format(trial.getAppealTime())); |
|
|
|
} |
|
|
|
if (null != trial.getInfoTransferTime()) { |
|
|
|
shangSuInfo.setInfoTransferTime(sdf.format(trial.getInfoTransferTime())); |
|
|
|
} |
|
|
|
String appealFiles = trial.getAppealFiles(); |
|
|
|
List<UrlQuery> appealF = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(appealFiles)) { |
|
|
|
List<String> fileList = Arrays.asList(appealFiles.split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); |
|
|
|
for (int i = 0; i < fileList.size(); i++) { |
|
|
|
UrlQuery urlQuery = new UrlQuery(); |
|
|
|
urlQuery.setUrl(fileList.get(i)); |
|
|
|
appealF.add(urlQuery); |
|
|
|
} |
|
|
|
shangSuInfo.setFile(appealF); |
|
|
|
} |
|
|
|
vo.setShangSuInfo(shangSuInfo); |
|
|
|
} |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<ReviewVo> getFirstDetails(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ReviewVo vo = returnReviewVo(sid, "一审"); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveFirstJudge(ReviewVo dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
JudgeInfo judgeInfo = dto.getJudgeInfo(); |
|
|
|
LoanCaseProgressTrial trial = loanCaseProgressTrialService.selByJdAndSid(sid, "一审"); |
|
|
|
if (null != trial) { |
|
|
|
BeanUtil.copyProperties(judgeInfo, trial); |
|
|
|
loanCaseProgressTrialService.updateById(trial); |
|
|
|
} else { |
|
|
|
LoanCaseProgressTrial progressTrial = new LoanCaseProgressTrial(); |
|
|
|
BeanUtil.copyProperties(judgeInfo, progressTrial); |
|
|
|
progressTrial.setMainSid(sid); |
|
|
|
progressTrial.setCaseStage("一审"); |
|
|
|
progressTrial.setCaseStageNo("1"); |
|
|
|
loanCaseProgressTrialService.insert(progressTrial); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveFirstDaiLiAn(ReviewVo dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
DaiLiAnInfo daiLiAnInfo = dto.getDaiLiAnInfo(); |
|
|
|
LoanCaseProgressTrial trial = loanCaseProgressTrialService.selByJdAndSid(sid, "一审"); |
|
|
|
if (null != trial) { |
|
|
|
BeanUtil.copyProperties(daiLiAnInfo, trial); |
|
|
|
if (StringUtils.isBlank(trial.getCaseTache())) { |
|
|
|
trial.setCaseTacheNo("1"); |
|
|
|
trial.setCaseTache("待立案"); |
|
|
|
} |
|
|
|
//保存附件
|
|
|
|
List<UrlQuery> filss = daiLiAnInfo.getFile(); |
|
|
|
filss.removeAll(Collections.singleton(null)); |
|
|
|
if (!filss.isEmpty()) { |
|
|
|
List<String> filesList = filss.stream().map(v -> v.getUrl()).collect(Collectors.toList()); |
|
|
|
filesList.removeAll(Collections.singleton(null)); |
|
|
|
if (!filesList.isEmpty()) { |
|
|
|
String files = String.join(",", filesList).replaceAll(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
trial.setPendingFiles(files); |
|
|
|
} |
|
|
|
} |
|
|
|
loanCaseProgressTrialService.updateById(trial); |
|
|
|
LoanCaseProgress progress = fetchBySid(sid); |
|
|
|
if (null != progress) { |
|
|
|
if (StringUtils.isBlank(progress.getCaseStageNo())) { |
|
|
|
progress.setCaseStage("一审"); |
|
|
|
progress.setCaseStageNo("1"); |
|
|
|
progress.setCaseTacheNo("1"); |
|
|
|
progress.setCaseTache("待立案"); |
|
|
|
progress.setEnterDate(DateUtil.formatDate(new Date())); |
|
|
|
baseMapper.updateById(progress); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
LoanCaseProgressTrial progressTrial = new LoanCaseProgressTrial(); |
|
|
|
BeanUtil.copyProperties(daiLiAnInfo, progressTrial); |
|
|
|
progressTrial.setMainSid(sid); |
|
|
|
progressTrial.setCaseStage("一审"); |
|
|
|
progressTrial.setCaseStageNo("1"); |
|
|
|
progressTrial.setCaseTacheNo("1"); |
|
|
|
progressTrial.setCaseTache("待立案"); |
|
|
|
//保存附件
|
|
|
|
List<UrlQuery> filss = daiLiAnInfo.getFile(); |
|
|
|
filss.removeAll(Collections.singleton(null)); |
|
|
|
if (!filss.isEmpty()) { |
|
|
|
List<String> filesList = filss.stream().map(v -> v.getUrl()).collect(Collectors.toList()); |
|
|
|
filesList.removeAll(Collections.singleton(null)); |
|
|
|
if (!filesList.isEmpty()) { |
|
|
|
String files = String.join(",", filesList).replaceAll(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
progressTrial.setPendingFiles(files); |
|
|
|
} |
|
|
|
} |
|
|
|
loanCaseProgressTrialService.insert(progressTrial); |
|
|
|
LoanCaseProgress progress = fetchBySid(sid); |
|
|
|
if (null != progress) { |
|
|
|
if (StringUtils.isBlank(progress.getCaseStageNo())) { |
|
|
|
progress.setCaseStage("一审"); |
|
|
|
progress.setCaseStageNo("1"); |
|
|
|
progress.setCaseTacheNo("1"); |
|
|
|
progress.setCaseTache("待立案"); |
|
|
|
progress.setEnterDate(DateUtil.formatDate(new Date())); |
|
|
|
baseMapper.updateById(progress); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveFirstYiLiAn(ReviewVo dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
YiLiAnInfo yiLiAnInfo = dto.getYiLiAnInfo(); |
|
|
|
LoanCaseProgressTrial trial = loanCaseProgressTrialService.selByJdAndSid(sid, "一审"); |
|
|
|
if (null != trial) { |
|
|
|
BeanUtil.copyProperties(yiLiAnInfo, trial); |
|
|
|
if (StringUtils.isBlank(trial.getCaseTache())) { |
|
|
|
trial.setCaseTacheNo("2"); |
|
|
|
trial.setCaseTache("已立案"); |
|
|
|
} else { |
|
|
|
String caseTacheNo = trial.getCaseTacheNo(); |
|
|
|
int i = Integer.parseInt(caseTacheNo); |
|
|
|
if (i < 2) { |
|
|
|
trial.setCaseTacheNo("2"); |
|
|
|
trial.setCaseTache("已立案"); |
|
|
|
} |
|
|
|
} |
|
|
|
//保存附件
|
|
|
|
List<UrlQuery> filss = yiLiAnInfo.getFile(); |
|
|
|
filss.removeAll(Collections.singleton(null)); |
|
|
|
if (!filss.isEmpty()) { |
|
|
|
List<String> filesList = filss.stream().map(v -> v.getUrl()).collect(Collectors.toList()); |
|
|
|
filesList.removeAll(Collections.singleton(null)); |
|
|
|
if (!filesList.isEmpty()) { |
|
|
|
String files = String.join(",", filesList).replaceAll(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
trial.setFiledFiles(files); |
|
|
|
} |
|
|
|
} |
|
|
|
loanCaseProgressTrialService.updateById(trial); |
|
|
|
LoanCaseProgress progress = fetchBySid(sid); |
|
|
|
if (null != progress) { |
|
|
|
if (StringUtils.isBlank(progress.getCaseStageNo())) { |
|
|
|
progress.setCaseStage("一审"); |
|
|
|
progress.setCaseStageNo("1"); |
|
|
|
progress.setCaseTacheNo("2"); |
|
|
|
progress.setCaseTache("已立案"); |
|
|
|
progress.setEnterDate(DateUtil.formatDate(new Date())); |
|
|
|
baseMapper.updateById(progress); |
|
|
|
} else { |
|
|
|
String caseStageNo = progress.getCaseStageNo(); |
|
|
|
int i = Integer.parseInt(caseStageNo); |
|
|
|
if (i == 1) { |
|
|
|
String caseTacheNo = progress.getCaseTacheNo(); |
|
|
|
int t = Integer.parseInt(caseTacheNo); |
|
|
|
if (t < 2) { |
|
|
|
String enterDate = progress.getEnterDate(); |
|
|
|
try { |
|
|
|
Date star = sdf.parse(enterDate);//开始时间
|
|
|
|
Date endDay = new Date();//结束时间
|
|
|
|
Date nextDay = star; |
|
|
|
int days = 0; |
|
|
|
while (nextDay.before(endDay)) {//当明天不在结束时间之前是终止循环
|
|
|
|
Calendar cld = Calendar.getInstance(); |
|
|
|
cld.setTime(star); |
|
|
|
cld.add(Calendar.DATE, 1); |
|
|
|
star = cld.getTime(); |
|
|
|
//获得下一天日期字符串
|
|
|
|
nextDay = star; |
|
|
|
days++; |
|
|
|
} |
|
|
|
progress.setUseDays(String.valueOf(days)); |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
progress.setCaseTacheNo("2"); |
|
|
|
progress.setCaseTache("已立案"); |
|
|
|
progress.setEnterDate(DateUtil.formatDate(new Date())); |
|
|
|
baseMapper.updateById(progress); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
LoanCaseProgressTrial progressTrial = new LoanCaseProgressTrial(); |
|
|
|
BeanUtil.copyProperties(yiLiAnInfo, progressTrial); |
|
|
|
progressTrial.setMainSid(sid); |
|
|
|
progressTrial.setCaseStage("一审"); |
|
|
|
progressTrial.setCaseStageNo("1"); |
|
|
|
progressTrial.setCaseTacheNo("2"); |
|
|
|
progressTrial.setCaseTache("已立案"); |
|
|
|
//保存附件
|
|
|
|
List<UrlQuery> filss = yiLiAnInfo.getFile(); |
|
|
|
filss.removeAll(Collections.singleton(null)); |
|
|
|
if (!filss.isEmpty()) { |
|
|
|
List<String> filesList = filss.stream().map(v -> v.getUrl()).collect(Collectors.toList()); |
|
|
|
filesList.removeAll(Collections.singleton(null)); |
|
|
|
if (!filesList.isEmpty()) { |
|
|
|
String files = String.join(",", filesList).replaceAll(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
progressTrial.setFiledFiles(files); |
|
|
|
} |
|
|
|
} |
|
|
|
loanCaseProgressTrialService.insert(progressTrial); |
|
|
|
LoanCaseProgress progress = fetchBySid(sid); |
|
|
|
if (null != progress) { |
|
|
|
if (StringUtils.isBlank(progress.getCaseStageNo())) { |
|
|
|
progress.setCaseStage("一审"); |
|
|
|
progress.setCaseStageNo("1"); |
|
|
|
progress.setCaseTacheNo("2"); |
|
|
|
progress.setCaseTache("已立案"); |
|
|
|
progress.setEnterDate(DateUtil.formatDate(new Date())); |
|
|
|
baseMapper.updateById(progress); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
} |
|
|
|