|
@@ -23,7 +23,6 @@ import com.jeeplus.modules.projectcontentinfo.service.ProjectReportChangeService
|
|
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
|
|
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
|
|
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
|
|
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
|
|
import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
|
|
import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
|
|
-import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
|
|
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
|
|
import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
|
|
import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
|
|
import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
|
|
@@ -33,12 +32,12 @@ import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
|
|
|
|
+import com.jeeplus.modules.sys.entity.Area;
|
|
import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
import com.jeeplus.modules.sys.entity.User;
|
|
import com.jeeplus.modules.sys.entity.User;
|
|
import com.jeeplus.modules.sys.service.UserService;
|
|
import com.jeeplus.modules.sys.service.UserService;
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
-import com.jeeplus.modules.wexinpackage.access.util.access.RequestAccess;
|
|
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
|
|
import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
|
|
import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
|
|
import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
|
|
import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
|
|
@@ -50,8 +49,6 @@ import org.activiti.engine.runtime.ProcessInstance;
|
|
import org.activiti.engine.task.Task;
|
|
import org.activiti.engine.task.Task;
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
-import org.slf4j.Logger;
|
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.ui.Model;
|
|
@@ -1269,6 +1266,7 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ workStaffCertificate.setIdCard(workStaffBasicInfo.getIdCard());
|
|
return workStaffCertificate;
|
|
return workStaffCertificate;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1479,20 +1477,174 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
records.setReportData(projectReportData);
|
|
records.setReportData(projectReportData);
|
|
reported = ruralProjectMessageService.disposeData(records);
|
|
reported = ruralProjectMessageService.disposeData(records);
|
|
}
|
|
}
|
|
|
|
+ //根据上报id查询上报咨询员的信息
|
|
|
|
+ List<RuralReportConsultant> reportedConsultants=ruralProjectMessageService.getReportedConsultantsList(reported.getId());
|
|
//查询报告咨询员的信息
|
|
//查询报告咨询员的信息
|
|
List<RuralReportConsultant> consultants=ruralProjectMessageService.getConsultantsList(projectRecords.getId());
|
|
List<RuralReportConsultant> consultants=ruralProjectMessageService.getConsultantsList(projectRecords.getId());
|
|
- for (RuralReportConsultant consultant:consultants){
|
|
|
|
- User user=userService.get(consultant.getZixunyuan());
|
|
|
|
- consultant.setZixunyuanName(user.getName());
|
|
|
|
|
|
+ List<RuralReportConsultant> consultantList = Lists.newArrayList();
|
|
|
|
+ if(reportedConsultants.size() == 0){
|
|
|
|
+ //如果上报的咨询员信息为空 则处理报告咨询员信息
|
|
|
|
+ consultantList = disposeConsultant(consultants, projectRecords);
|
|
|
|
+ }else{
|
|
|
|
+ //对上报的咨询员进行处理
|
|
|
|
+ consultantList = disposereportedConsultant(consultants, projectRecords);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(reported.getProjectId());
|
|
|
|
+ reported.setProjectRecordId(records.getProjectId());
|
|
model.addAttribute("ruralProjectRecordsReported", reported);
|
|
model.addAttribute("ruralProjectRecordsReported", reported);
|
|
//查询项目信息
|
|
//查询项目信息
|
|
- RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(reported.getProjectId());
|
|
|
|
model.addAttribute("ruralProjectRecords", records);
|
|
model.addAttribute("ruralProjectRecords", records);
|
|
- model.addAttribute("consultantInfo", consultants);
|
|
|
|
|
|
+ model.addAttribute("consultantInfo", consultantList);
|
|
|
|
+ if(StringUtils.isBlank(reported.getS1())){
|
|
|
|
+ reported.setS1("1");
|
|
|
|
+ }
|
|
|
|
+ List<Area> areaList = ruralProjectMessageService.getProjectReportedAreaByParentId(reported.getS1());
|
|
|
|
+ model.addAttribute("cityList", areaList);
|
|
|
|
+ return "modules/ruralprojectrecords/cost/newReportedForm";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private List<RuralReportConsultant> disposereportedConsultant(List<RuralReportConsultant> consultants,RuralProjectRecords projectRecords){
|
|
|
|
+ List<RuralReportConsultant> consultantInfoList = Lists.newArrayList();
|
|
|
|
+ List<RuralReportConsultant> list = Lists.newArrayList();
|
|
|
|
+ Iterator<RuralReportConsultant> it = consultants.iterator();
|
|
|
|
+ while(it.hasNext()){
|
|
|
|
+ RuralReportConsultant consultant = it.next();
|
|
|
|
+ if("1".equals(consultant.getRoleFlag())){
|
|
|
|
+ list.add(consultant);
|
|
|
|
+ it.remove();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ list.addAll(consultants);
|
|
|
|
+ consultants = list;
|
|
|
|
+ //获取专业类型
|
|
|
|
+ List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
|
|
|
|
+ //创建负责人信息
|
|
|
|
+ RuralReportConsultant master = new RuralReportConsultant();
|
|
|
|
+ for (RuralReportConsultant consultant: consultants) {
|
|
|
|
+ //根据用户查询技能信息
|
|
|
|
+ List<WorkStaffCertificate> certificateList = ruralProjectMessageService.getCertificateByUser(consultant.getZixunyuan());
|
|
|
|
+ for (WorkStaffCertificate certificateInfo: certificateList) {
|
|
|
|
+ if(certificateInfo.getName().equals(consultant.getZhucezigezhKey())){
|
|
|
|
+ consultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
|
+ }
|
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
|
+ if(certificateInfo.getMajor().equals(type.getValue())){
|
|
|
|
+ consultant.setMajor(type.getLabel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ User user=userService.get(consultant.getZixunyuan());
|
|
|
|
+ //查询用户身份证号
|
|
|
|
+ WorkStaffBasicInfo userInfo = workStaffBasicInfoService.getByUserId(user.getId());
|
|
|
|
+ if(null != userInfo){
|
|
|
|
+ consultant.setIdCard(userInfo.getIdCard());
|
|
|
|
+ }
|
|
|
|
+ if("1".equals(consultant.getRoleFlag())){
|
|
|
|
+ consultant.setRole("负责人");
|
|
|
|
+ }else{
|
|
|
|
+ consultant.setRole("咨询员");
|
|
|
|
+ }
|
|
|
|
+ consultant.setZixunyuanName(user.getName());
|
|
|
|
+ consultantInfoList.add(consultant);
|
|
|
|
+ }
|
|
|
|
+ return consultantInfoList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 咨询员信息处理
|
|
|
|
+ * @param consultants
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private List<RuralReportConsultant> disposeConsultant(List<RuralReportConsultant> consultants,RuralProjectRecords projectRecords){
|
|
|
|
+ List<RuralReportConsultant> consultantInfoList = Lists.newArrayList();
|
|
|
|
+ //查询报告信息
|
|
|
|
+ Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectRecords.getId());
|
|
|
|
+ ProjectReportData projectReportData = projectReportDataService.getOnRural(projectcontentinfo1.getInfoId());
|
|
|
|
+ //创建负责人信息
|
|
|
|
+ RuralReportConsultant master = new RuralReportConsultant();
|
|
|
|
+ for (RuralReportConsultant consultant: consultants) {
|
|
|
|
+ //判断是否是负责人,如果是则挑出来
|
|
|
|
+ if(StringUtils.isNotBlank(consultant.getRoleFlag()) && "1".equals(consultant.getRoleFlag())){
|
|
|
|
+ master = consultant;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //如果没有负责人,则将项目负责人添加进去
|
|
|
|
+ if(StringUtils.isBlank(master.getId())){
|
|
|
|
+ //将自己添加到咨询员数据中
|
|
|
|
+ //根据用户查询技能信息
|
|
|
|
+ RuralReportConsultant currentConsultant = new RuralReportConsultant();
|
|
|
|
+ List<WorkStaffCertificate> userCertificateList = Lists.newArrayList();
|
|
|
|
+ if(StringUtils.isNotBlank(projectRecords.getProjectMasterId())){
|
|
|
|
+ userCertificateList = ruralProjectMessageService.getCertificateByUser(projectRecords.getProjectMasterId());
|
|
|
|
+ }
|
|
|
|
+ //获取专业类型
|
|
|
|
+ List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
|
|
|
|
+ for (WorkStaffCertificate certificateInfo: userCertificateList) {
|
|
|
|
+ currentConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
|
+ currentConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
|
+ if(certificateInfo.getMajor().equals(type.getValue())){
|
|
|
|
+ currentConsultant.setMajor(type.getLabel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ User currentUser=userService.get(projectRecords.getProjectMasterId());
|
|
|
|
+ currentConsultant.setZixunyuanName(currentUser.getName());
|
|
|
|
+ currentConsultant.setZixunyuan(currentUser.getId());
|
|
|
|
+ currentConsultant.setRole("负责人");
|
|
|
|
+ currentConsultant.setRoleFlag("1");
|
|
|
|
+ //查询用户身份证号
|
|
|
|
+ WorkStaffBasicInfo userInfo = workStaffBasicInfoService.getByUserId(currentUser.getId());
|
|
|
|
+ if(null != userInfo){
|
|
|
|
+ currentConsultant.setIdCard(userInfo.getIdCard());
|
|
|
|
+ }
|
|
|
|
+ consultantInfoList.add(currentConsultant);
|
|
|
|
+ }
|
|
|
|
+ //根据项目id查找报告咨询员信息
|
|
|
|
+ List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(projectRecords.getId());
|
|
|
|
+ //使用迭代器去除重复信息
|
|
|
|
+ //排除 重新申请|撤销
|
|
|
|
+ Iterator<RuralReportConsultant> it = consultantList.iterator();
|
|
|
|
+ while(it.hasNext()){
|
|
|
|
+ RuralReportConsultant consultant = it.next();
|
|
|
|
+ if(consultant.getZixunyuan().equals(currentConsultant.getZixunyuan())){
|
|
|
|
+ try {
|
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, currentConsultant);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ it.remove();
|
|
|
|
+ }else{
|
|
|
|
+ //根据用户查询技能信息
|
|
|
|
+ List<WorkStaffCertificate> certificateList = ruralProjectMessageService.getCertificateByUser(consultant.getZixunyuan());
|
|
|
|
+ for (WorkStaffCertificate certificateInfo: certificateList) {
|
|
|
|
+ if(certificateInfo.getName().equals(consultant.getZhucezigezhKey())){
|
|
|
|
+ consultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
|
+ }
|
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
|
+ if(certificateInfo.getMajor().equals(type.getValue())){
|
|
|
|
+ consultant.setMajor(type.getLabel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ User user=userService.get(consultant.getZixunyuan());
|
|
|
|
+ consultant.setRole("咨询员");
|
|
|
|
+ consultant.setZixunyuanName(user.getName());
|
|
|
|
+ //查询用户身份证号
|
|
|
|
+ WorkStaffBasicInfo userInfo = workStaffBasicInfoService.getByUserId(user.getId());
|
|
|
|
+ if(null != userInfo){
|
|
|
|
+ consultant.setIdCard(userInfo.getIdCard());
|
|
|
|
+ }
|
|
|
|
+ if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
|
|
|
|
+ it.remove();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ consultantInfoList.addAll(consultantList);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
- return "modules/ruralprojectrecords/cost/reportedForm";
|
|
|
|
|
|
+ return consultantInfoList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|