81,092
社区成员
发帖
与我相关
我的任务
分享
//担保类型
String guaranteeType = apply.getGuaranteeType();
if(ObjectHelper.isNotEmpty(guaranteeType)){
List<String> guaranteeTypeList = new ArrayList<String>();
String[] guaranteeTypes = guaranteeType.split(",");
for (String c : guaranteeTypes) {
Dict dict = dictService.findByFullCode(c);
if(ObjectHelper.isNotEmpty(dict)){
guaranteeTypeList.add(dict.getLabelName());
}
}
apply.setGuaranteeType(String.join(",", guaranteeTypeList));
}
我把转码的方法也发一下
/**
*
* @Title: findByFullCode
* @Description: 根据fullcode 获取字典信息
* @author
* @param fullCode
* @return
*/
public Dict findByFullCode(String fullCode){
Dict entity= new Dict();
entity.setFullCode(fullCode);
List<Dict> list = dao.findList(entity);
if (ObjectHelper.isNotEmpty(list)) {
return list.get(0);
}
return null;
}
@RequestMapping("/initInspectionView")
public ModelAndView initInspectionView(HttpServletRequest req, String projectId, String id,
LoanOrderApplyVo loanOrderApplyVo) {
ModelMap map = new ModelMap();
try {
logger.debug("进入贷后察访查看页面");
logger.debug("projectId:{}", projectId);
// 常规检查Id
logger.debug("id:{}", id);
ProjectDailyInspection inspection = null;
if (ObjectHelper.isNotEmpty(id)) {
inspection = this.projectDailyInspectionService.findDailyInspectionById(id);
if (ObjectHelper.isNotEmpty(inspection)) {
// 使用数据库中的项目ID和业务Id
projectId = inspection.getProject().getId();
// 审批状态转为汉字
inspection.setApprState(ProjectDailyInspection.getApprStateMap().get(inspection.getApprState()));
inspection.proView();
}
}
Project projectInfo = projectService.getProjectInfo(projectId);
ProjectApplyVo projectApplyVo = projectApplyService.findApplyInfoByProjectId(projectId);
LoanOrderApplyVo apply = loanOrderApplyService.findApplyInfoByCommonApplyId(projectApplyVo.getId());
//担保类型
String guaranteeType = apply.getGuaranteeType();
if(ObjectHelper.isNotEmpty(guaranteeType)){
List<String> guaranteeTypeList = new ArrayList<String>();
String[] guaranteeTypes = guaranteeType.split(",");
for (String c : guaranteeTypes) {
Dict dict = dictService.findByFullCode(c);
if(ObjectHelper.isNotEmpty(dict)){
guaranteeTypeList.add(dict.getLabelName());
}
}
apply.setGuaranteeType(String.join(",", guaranteeTypeList));
}
projectInfo.proView();
// 项目基本信息
map.put("commonApply", projectApplyVo);
map.put("loanOrderApply", apply);
map.put("projectInfo", projectInfo);
map.put("info", inspection);
map.put("isProcess", req.getParameter("isProcess"));
} catch (Exception e) {
logger.error("小贷项目申请编辑出错,参数:{},异常:{}", loanOrderApplyVo, e);
e.printStackTrace();
} finally {
logger.info("end-小贷项目申请编辑");
}
return new ModelAndView("modules/business/inspection/inspection_apply_view", map);
}