|
@@ -18,7 +18,9 @@ import com.jeeplus.common.web.BaseController;
|
|
import com.jeeplus.modules.contractclient.entity.WorkContractClient;
|
|
import com.jeeplus.modules.contractclient.entity.WorkContractClient;
|
|
import com.jeeplus.modules.contractclient.service.WorkContractClientService;
|
|
import com.jeeplus.modules.contractclient.service.WorkContractClientService;
|
|
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportDataTwo;
|
|
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
|
|
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
|
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataTwoService;
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewService;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewService;
|
|
@@ -32,6 +34,8 @@ 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.tools.utils.TwoDimensionCode;
|
|
import com.jeeplus.modules.tools.utils.TwoDimensionCode;
|
|
import com.jeeplus.modules.utils.SftpClientUtil;
|
|
import com.jeeplus.modules.utils.SftpClientUtil;
|
|
|
|
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
|
|
|
|
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
|
|
@@ -97,6 +101,8 @@ public class WorkFullManageController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private RuralProjectMessageNewService ruralProjectMessageService;
|
|
private RuralProjectMessageNewService ruralProjectMessageService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private WorkActivityProcessService workActivityProcessService;
|
|
|
|
+ @Autowired
|
|
private UserService userService;
|
|
private UserService userService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -107,6 +113,8 @@ public class WorkFullManageController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private ProjectReportDataService projectReportDataService;
|
|
private ProjectReportDataService projectReportDataService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private ProjectReportDataTwoService projectReportDataTwoService;
|
|
|
|
+ @Autowired
|
|
private RuralProjectRecordsService ruralProjectRecordsService;
|
|
private RuralProjectRecordsService ruralProjectRecordsService;
|
|
@Autowired
|
|
@Autowired
|
|
private RuralProjectRecordsService projectRecordsService;
|
|
private RuralProjectRecordsService projectRecordsService;
|
|
@@ -935,6 +943,35 @@ public class WorkFullManageController extends BaseController {
|
|
ResponseUtil.docResponse("工程造价咨询质量控制流程单.doc",docFile,response);
|
|
ResponseUtil.docResponse("工程造价咨询质量控制流程单.doc",docFile,response);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 下载工程造价咨询质量控制流程单信息
|
|
|
|
+ * @param response
|
|
|
|
+ * @param projectReportData
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value="downloadMassControl1")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public void downloadMassControl1(HttpServletResponse response, ProjectReportData projectReportData) {
|
|
|
|
+ Map data = consultationReportData(projectReportData);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //模板对象
|
|
|
|
+ Template template=null;
|
|
|
|
+ //freemaker模板路径
|
|
|
|
+ File path = new File(this.getClass().getResource("/").getPath()+"/freemarker");
|
|
|
|
+ Configuration cfg = new Configuration();
|
|
|
|
+ try {
|
|
|
|
+ cfg.setDirectoryForTemplateLoading(path);
|
|
|
|
+ //选择对应的ftl文件
|
|
|
|
+ template = cfg.getTemplate("issueProcess.ftl","UTF-8");
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ File docFile = new File("咨询报告书(底稿)签发流程表.doc");
|
|
|
|
+ FreemarkerUtil.generateFile(data,template,docFile);
|
|
|
|
+ ResponseUtil.docResponse("咨询报告书(底稿)签发流程表.doc",docFile,response);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 质量流程控制单文件数据处理
|
|
* 质量流程控制单文件数据处理
|
|
@@ -1233,6 +1270,277 @@ public class WorkFullManageController extends BaseController {
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private Map<String,Object> consultationReportData(ProjectReportData projectReportData){
|
|
|
|
+ //获取报告信息
|
|
|
|
+ projectReportData=projectReportDataService.get(projectReportData.getId());
|
|
|
|
+ //获取报告签发
|
|
|
|
+ ProjectReportDataTwo projectReportDataTwo =projectReportDataTwoService.findTwoByProjectId(projectReportData.getProject().getId());
|
|
|
|
+ //获取项目信息
|
|
|
|
+ RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectReportDataTwo.getProject().getId());
|
|
|
|
+ projectRecordsService.queryUserNames(ruralProjectRecords);
|
|
|
|
+ projectRecordsService.queryProjectDetail(ruralProjectRecords);
|
|
|
|
+ // 将项目负责人替换为项目中的负责人
|
|
|
|
+ if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
|
+ User user = UserUtils.get(ruralProjectRecords.getProjectMasterId());
|
|
|
|
+ projectReportDataTwo.setPrincipal(user);
|
|
|
|
+ }
|
|
|
|
+ //获取合同信息
|
|
|
|
+ WorkContractInfo workContractInfo = workContractInfoService.get(ruralProjectRecords.getWorkContractInfo().getId());
|
|
|
|
+ //无合同状态下,获取委托方的名称
|
|
|
|
+ if (workContractInfo == null) {
|
|
|
|
+ projectRecordsService.queryLinkmanInfos(ruralProjectRecords);
|
|
|
|
+ if (ruralProjectRecords.getWorkClientLinkmanList() != null && ruralProjectRecords.getWorkClientLinkmanList().size() > 0) {
|
|
|
|
+ WorkClientLinkman linkman = ruralProjectRecords.getWorkClientLinkmanList().get(0);
|
|
|
|
+ workContractInfo = new WorkContractInfo();
|
|
|
|
+ workContractInfo.setClient(linkman.getClientId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<RuralReportConsultant> consultants = Lists.newArrayList();
|
|
|
|
+ //将自己添加到咨询员数据中
|
|
|
|
+ //根据用户查询技能信息(项目负责人信息)
|
|
|
|
+ RuralReportConsultant currentConsultant = new RuralReportConsultant();
|
|
|
|
+ //查询总审人员信息
|
|
|
|
+ RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
|
|
|
|
+ List<WorkStaffCertificate> userCertificateList = Lists.newArrayList();
|
|
|
|
+ if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
|
+ userCertificateList = ruralProjectMessageService.getCertificateByUser(ruralProjectRecords.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(ruralProjectRecords.getProjectMasterId());
|
|
|
|
+ currentConsultant.setZixunyuanName(currentUser.getName());
|
|
|
|
+ currentConsultant.setZixunyuan(currentUser.getId());
|
|
|
|
+ currentConsultant.setRole("负责人");
|
|
|
|
+ consultants.add(currentConsultant);
|
|
|
|
+ }
|
|
|
|
+ //根据项目id查找报告咨询员信息
|
|
|
|
+ List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(ruralProjectRecords.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 if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
|
|
|
|
+ List<WorkStaffCertificate> bzshbCertificateList = ruralProjectMessageService.getCertificateByUser(projectReportData.getBzshbUserId());
|
|
|
|
+ for (WorkStaffCertificate certificateInfo: bzshbCertificateList) {
|
|
|
|
+ bzshbConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
|
+ bzshbConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
|
+ for (MainDictDetail dictType : certificateMajor) {
|
|
|
|
+ if(certificateInfo.getMajor().equals(dictType.getValue())){
|
|
|
|
+ bzshbConsultant.setMajor(dictType.getLabel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ User bzshbUser=userService.get(projectReportData.getBzshbUserId());
|
|
|
|
+ bzshbConsultant.setZixunyuanName(bzshbUser.getName());
|
|
|
|
+ bzshbConsultant.setZixunyuan(bzshbUser.getId());
|
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
|
|
|
|
+ } 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.setZixunyuanName(user.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ consultants.addAll(consultantList);
|
|
|
|
+ //如果项目负责人名称为空
|
|
|
|
+ if(StringUtils.isBlank(bzshbConsultant.getZixunyuanName())){
|
|
|
|
+ User user=userService.get(projectReportData.getBzshbUserId());
|
|
|
|
+ bzshbConsultant.setZixunyuanName(user.getName());
|
|
|
|
+ }
|
|
|
|
+ //根据 职业资格名称查询字典表并比对当前人员是否已添加该职业资格信息
|
|
|
|
+ List<MainDictDetail> certificateType = DictUtils.getMainDictList("certificate_type");
|
|
|
|
+ for (RuralReportConsultant entity: consultants) {
|
|
|
|
+ for (MainDictDetail type : certificateType) {
|
|
|
|
+ if(entity.getZhucezigezhKey().equals(type.getValue())){
|
|
|
|
+ entity.setZhucezigezh(type.getLabel());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isBlank(entity.getZhucezigezh())){
|
|
|
|
+ entity.setZhucezigezh("");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //freemarker参数值准备
|
|
|
|
+ Map<String,Object> data = new LinkedHashMap<>();
|
|
|
|
+ //主送--委托单位
|
|
|
|
+ if(null != workContractInfo){
|
|
|
|
+ if (null != workContractInfo.getClient()) {
|
|
|
|
+ data.put("entrustOrganization",workContractInfo.getClient().getName());
|
|
|
|
+ }else{
|
|
|
|
+ data.put("entrustOrganization","");
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ data.put("entrustOrganization", "");
|
|
|
|
+ }
|
|
|
|
+ //抄送--施工单位
|
|
|
|
+ String constructionUnitsName="";
|
|
|
|
+ for (WorkClientLinkman clientLinkman:ruralProjectRecords.getWorkConstructionLinkmanList()){
|
|
|
|
+ if (null != clientLinkman.getClientId()){
|
|
|
|
+ constructionUnitsName=constructionUnitsName+clientLinkman.getClientId().getName()+",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ data.put("constructionUnitsName",constructionUnitsName);
|
|
|
|
+ //项目名称
|
|
|
|
+ if (StringUtils.isNotBlank(ruralProjectRecords.getProjectName())){
|
|
|
|
+ data.put("projectName",ruralProjectRecords.getProjectName());
|
|
|
|
+ }else {
|
|
|
|
+ data.put("projectName","");
|
|
|
|
+ }
|
|
|
|
+ //文号
|
|
|
|
+ if(StringUtils.isBlank(projectReportData.getNumber())){
|
|
|
|
+ data.put("projectReportNumber","");
|
|
|
|
+ }else{
|
|
|
|
+ data.put("projectReportNumber",projectReportData.getNumber()+" 号");
|
|
|
|
+ }
|
|
|
|
+ //承办部门
|
|
|
|
+ User user=UserUtils.get(ruralProjectRecords.getProjectMasterId());
|
|
|
|
+ if (StringUtils.isNotBlank(user.getOffice().getTopCompany())){
|
|
|
|
+ data.put("officeName",user.getOffice().getTopCompany());
|
|
|
|
+ }else{
|
|
|
|
+ data.put("officeName","");
|
|
|
|
+ }
|
|
|
|
+ //拟稿人
|
|
|
|
+ if (StringUtils.isNotBlank(user.getUserName())){
|
|
|
|
+ data.put("projectMaster",user.getUserName());
|
|
|
|
+ }else{
|
|
|
|
+ data.put("projectMaster","");
|
|
|
|
+ }
|
|
|
|
+ //咨询员信息
|
|
|
|
+ if(null != consultants){
|
|
|
|
+ for (int i = 0; i<consultants.size(); i++){
|
|
|
|
+ if (i >=6){
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ data.put("consultantName"+i,consultants.get(i).getZixunyuanName());
|
|
|
|
+ if(StringUtils.isBlank(consultants.get(i).getMajor())){
|
|
|
|
+ data.put("consultantProfession"+i,"");
|
|
|
|
+ }else{
|
|
|
|
+ data.put("consultantProfession"+i,consultants.get(i).getMajor());
|
|
|
|
+ }
|
|
|
|
+ data.put("consultantQualification"+i,consultants.get(i).getZhucezigezh());
|
|
|
|
+ }
|
|
|
|
+ if(consultants.size()<6){
|
|
|
|
+ for (int i = consultants.size(); i<6; i++){
|
|
|
|
+ data.put("consultantName"+i,"");
|
|
|
|
+ data.put("consultantProfession"+i,"");
|
|
|
|
+ data.put("consultantQualification"+i,"");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ for (int i = 0; i<6; i++){
|
|
|
|
+ data.put("consultantName"+i,"");
|
|
|
|
+ data.put("consultantProfession"+i,"");
|
|
|
|
+ data.put("consultantQualification"+i,"");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //专业咨询员处理(添加序号)
|
|
|
|
+ for(int i = 1; i <=consultantList.size();i++){
|
|
|
|
+ consultantList.get(i-1).setId(i+"");
|
|
|
|
+ }
|
|
|
|
+ for (RuralReportConsultant info: consultantList) {
|
|
|
|
+ if(StringUtils.isBlank(info.getAuditOpinion())){
|
|
|
|
+ info.setAuditOpinion("");
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isBlank(info.getZixunyuanName())){
|
|
|
|
+ info.setZixunyuanName("");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ data.put("list",consultantList);
|
|
|
|
+ if(null != projectReportData.getPrincipalDate()){
|
|
|
|
+ //项目负责人
|
|
|
|
+ data.put("projectMaster",currentConsultant.getZixunyuanName());
|
|
|
|
+ if(StringUtils.isBlank(currentConsultant.getAuditOpinion())){
|
|
|
|
+ data.put("projectMasterRemarks","");
|
|
|
|
+ }else{
|
|
|
|
+ data.put("projectMasterRemarks",currentConsultant.getAuditOpinion());
|
|
|
|
+ }
|
|
|
|
+ data.put("projectYear","");
|
|
|
|
+ data.put("projectMonth","");
|
|
|
|
+ data.put("projectDay","");
|
|
|
|
+ }else{
|
|
|
|
+ //项目负责人
|
|
|
|
+ data.put("projectMaster","");
|
|
|
|
+ data.put("projectMasterRemarks","");
|
|
|
|
+ data.put("projectYear","");
|
|
|
|
+ data.put("projectMonth","");
|
|
|
|
+ data.put("projectDay","");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(null != projectReportData.getTechnicistDate()){
|
|
|
|
+ //技术负责人
|
|
|
|
+ if(StringUtils.isBlank(bzshbConsultant.getZixunyuanName())){
|
|
|
|
+ data.put("technicistName","");
|
|
|
|
+ }else{
|
|
|
|
+ data.put("technicistName",bzshbConsultant.getZixunyuanName());
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isBlank(bzshbConsultant.getAuditOpinion())){
|
|
|
|
+ data.put("technicistRemarks","");
|
|
|
|
+ }else{
|
|
|
|
+ data.put("technicistRemarks",bzshbConsultant.getAuditOpinion());
|
|
|
|
+ }
|
|
|
|
+ data.put("technicistYear","");
|
|
|
|
+ data.put("technicistMonth","");
|
|
|
|
+ data.put("technicistDay","");
|
|
|
|
+ }else{
|
|
|
|
+ //技术负责人
|
|
|
|
+ data.put("technicistName","");
|
|
|
|
+ data.put("technicistRemarks","");
|
|
|
|
+ data.put("technicistYear","");
|
|
|
|
+ data.put("technicistMonth","");
|
|
|
|
+ data.put("technicistDay","");
|
|
|
|
+ }
|
|
|
|
+ WorkActivityProcess selectProcess = new WorkActivityProcess();
|
|
|
|
+ selectProcess.setProcessInstanceId(projectReportDataTwo.getProcessInstanceId());
|
|
|
|
+ List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
|
|
|
|
+ if (workActivityProcesses.size()!=0){
|
|
|
|
+ WorkActivityProcess workActivityProcess=workActivityProcesses.get(0);
|
|
|
|
+ if (null!=workActivityProcess){
|
|
|
|
+ String str=workActivityProcess.getRemarks().split("]")[1];
|
|
|
|
+ data.put("signRemarks",str);
|
|
|
|
+ }else{
|
|
|
|
+ data.put("signRemarks","");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ data.put("signRemarks","");
|
|
|
|
+ }
|
|
|
|
+ User user1=UserUtils.get(projectReportDataTwo.getBzshbUserId());
|
|
|
|
+ if (StringUtils.isNotBlank(user1.getUserName())){
|
|
|
|
+ data.put("signName",user1.getUserName());
|
|
|
|
+ }else{
|
|
|
|
+ data.put("signName","");
|
|
|
|
+ }
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* date转String
|
|
* date转String
|
|
* @param date
|
|
* @param date
|