浏览代码

访问ccpm_cloud系统,进行客户,合同,项目数据同步,并执行发票的审核流程

sangwenwei 10 月之前
父节点
当前提交
93521ef225
共有 51 个文件被更改,包括 5342 次插入42 次删除
  1. 5 0
      pom.xml
  2. 4 1
      src/main/java/com/jeeplus/common/config/Global.java
  3. 134 0
      src/main/java/com/jeeplus/common/szCcpm/controller/CcpmList.java
  4. 9 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/entity/ProjectReportRecord.java
  5. 33 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/web/ProjectReportRecordController.java
  6. 4 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
  7. 18 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  8. 44 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/ProjectPaperFilingController.java
  9. 38 4
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewController.java
  10. 34 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewTwoController.java
  11. 44 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java
  12. 50 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageNewController.java
  13. 43 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageNewTwoController.java
  14. 42 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsController.java
  15. 9 0
      src/main/java/com/jeeplus/modules/sys/entity/User.java
  16. 24 2
      src/main/java/com/jeeplus/modules/sys/web/LoginController.java
  17. 71 0
      src/main/java/com/jeeplus/modules/szCenterservice/controller/szCloud/CpaFinanceInvoiceController.java
  18. 72 0
      src/main/java/com/jeeplus/modules/szCenterservice/enums/SzTaskAliasEnum.java
  19. 71 0
      src/main/java/com/jeeplus/modules/szCenterservice/service/szCloud/FinanceInvoiceRequest.java
  20. 327 0
      src/main/java/com/jeeplus/modules/szCenterservice/service/szCloud/FinanceInvoiceService.java
  21. 124 0
      src/main/java/com/jeeplus/modules/szCenterservice/service/szCloud/SzFlowRequest.java
  22. 45 0
      src/main/java/com/jeeplus/modules/szCenterservice/task/SzTaskFlowRequest.java
  23. 40 0
      src/main/java/com/jeeplus/modules/szCenterservice/task/SzTaskFlowService.java
  24. 410 0
      src/main/java/com/jeeplus/modules/szCenterservice/utils/SzConvertServiceUtil.java
  25. 249 0
      src/main/java/com/jeeplus/modules/szCenterservice/utils/SzRestTemplateService.java
  26. 2 0
      src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientInfoDao.java
  27. 1 0
      src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientInfo.java
  28. 27 0
      src/main/java/com/jeeplus/modules/workclientinfo/web/WorkClientInfoController.java
  29. 3 0
      src/main/java/com/jeeplus/modules/workcontractinfo/dao/WorkContractInfoDao.java
  30. 66 0
      src/main/java/com/jeeplus/modules/workcontractinfo/web/WorkContractInfoController.java
  31. 66 1
      src/main/java/com/jeeplus/modules/workcontractrecord/web/WorkContractRecordController.java
  32. 38 0
      src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoice.java
  33. 9 0
      src/main/java/com/jeeplus/modules/workprojectnotify/entity/WorkProjectNotify.java
  34. 89 0
      src/main/java/com/jeeplus/modules/workprojectnotify/vo/ActionType.java
  35. 215 0
      src/main/java/com/jeeplus/modules/workprojectnotify/vo/HisTaskVo.java
  36. 66 0
      src/main/java/com/jeeplus/modules/workprojectnotify/vo/ProcessStatus.java
  37. 174 0
      src/main/java/com/jeeplus/modules/workprojectnotify/vo/ProcessVo.java
  38. 110 0
      src/main/java/com/jeeplus/modules/workprojectnotify/vo/TaskVo.java
  39. 304 20
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  40. 16 2
      src/main/resources/jeeplus.properties
  41. 2 1
      src/main/resources/mappings/modules/projectcontentinfo/ProjectReportRecordDao.xml
  42. 82 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  43. 1 1
      src/main/resources/mappings/modules/sys/OfficeDao.xml
  44. 11 0
      src/main/resources/mappings/modules/workclientinfo/WorkClientInfoDao.xml
  45. 79 0
      src/main/resources/mappings/modules/workcontractinfo/WorkContractInfoDao.xml
  46. 1 0
      src/main/resources/spring-context-shiro.xml
  47. 7 0
      src/main/webapp/webpage/modules/sys/sysHome.jsp
  48. 1033 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAuditCpa.jsp
  49. 955 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceViewCpa.jsp
  50. 21 5
      src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp
  51. 20 4
      src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyReadBacklogList.jsp

+ 5 - 0
pom.xml

@@ -297,6 +297,11 @@
             <version>1.1.2</version>
             <type>jar</type>
         </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.13</version>
+        </dependency>
 
 
         <!--<dependency>-->

+ 4 - 1
src/main/java/com/jeeplus/common/config/Global.java

@@ -316,7 +316,10 @@ public class Global {
 		String dm = getConfig("demoMode");
 		return "true".equals(dm) || "1".equals(dm);
 	}
-
+	/**
+	 * 获取公共密码
+	 */
+	public static String getPublicPassword(){return getConfig("publicPassword");}
 	/**
 	 * 在修改系统用户和岗位时是否同步到Activiti
 	 */

+ 134 - 0
src/main/java/com/jeeplus/common/szCcpm/controller/CcpmList.java

@@ -0,0 +1,134 @@
+package com.jeeplus.common.szCcpm.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientBankDao;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientInfoDao;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientBank;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workcontractinfo.dao.WorkContractInfoDao;
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.*;
+@Controller
+@RequestMapping(value = "${adminPath}/ccpmList/ccpmList")
+public class CcpmList{
+
+    @Autowired
+    private RuralProjectRecordsService projectRecordsService;
+
+    @Autowired
+    private WorkContractInfoDao workContractInfoDao;
+
+    @Autowired
+    private OfficeDao officeDao;
+
+    @Autowired
+    private WorkClientInfoDao workClientInfoDao;
+
+    @Autowired
+    private WorkClientLinkmanDao workClientLinkmanDao;
+
+    @Autowired
+    private WorkClientBankDao workClientBankDao;
+
+
+    /**
+     * 获取苏州分公司下的部门
+     * @return
+     */
+    public List<Office> getList(){
+        Office office = officeDao.getByName("苏州分公司");
+        List<Office> byCompany = officeDao.getChildrenOfficeById(office.getId());
+        return byCompany;
+    }
+
+
+    //获取苏州分公司下的所有项目信息
+    @RequestMapping(value = "/getAllProject",method = RequestMethod.GET)
+    @ResponseBody
+    public  List<RuralProjectRecords> getAllProject(){
+        List<Office> list = getList();
+        List<RuralProjectRecords> maps = new ArrayList<>();
+        //根据部门获取项目信息
+        for (Office office : list) {
+            List<RuralProjectRecords> projectRecords=projectRecordsService.getListByOffice(office.getId());
+            maps.addAll(projectRecords);
+        }
+        return maps;
+    }
+
+
+    /**
+     * 获取苏州分公司下的所有合同信息
+     */
+    @RequestMapping(value = "/getAllWorkContract",method = RequestMethod.GET)
+    @ResponseBody
+    public List<WorkContractInfo> getWorkContract(){
+        List<Office> list = getList();
+        List<WorkContractInfo> maps = new ArrayList<>();
+        //根据部门获取合同信息
+        for (Office office : list) {
+            List<WorkContractInfo> projectRecords=workContractInfoDao.getListByOffice(office.getId());
+            maps.addAll(projectRecords);
+        }
+        return maps;
+    }
+
+    //获取所有的客户信息
+    @RequestMapping(value = "/getAllClient",method = RequestMethod.GET)
+    @ResponseBody
+    public List<WorkClientInfo> getClient(){
+        List<WorkClientInfo> clientInfoList=workClientInfoDao.getAllClient();
+        //根据客户id查询客户的相关客户类型
+        for (WorkClientInfo clientInfo: clientInfoList) {
+            clientInfo.setJobTypeStr(workClientInfoDao.getJobTypeStr(clientInfo.getId()));
+            if (StringUtils.isBlank(clientInfo.getClientType())){
+                clientInfo.setClientType("");
+                clientInfo.setClientTypeLables("");
+            }
+        }
+        if(clientInfoList!=null && clientInfoList.size()>0){
+            for (int i = 0; i < clientInfoList.size(); i++) {
+                WorkClientInfo entity = clientInfoList.get(i);
+                List<WorkClientLinkman> linkmanList = workClientLinkmanDao.findList(new WorkClientLinkman(entity));
+                entity.setWorkClientLinkmanList(linkmanList);
+                if(linkmanList!=null && linkmanList.size()>0){
+                    StringBuilder builder = new StringBuilder();
+                    for (int j = 0; j < linkmanList.size(); j++) {
+                        builder.append(linkmanList.get(j).getName());
+                        if(j<linkmanList.size()-1){
+                            builder.append(",");
+                        }
+                    }
+                    entity.setLinkManNames(builder.toString());
+                }
+                List<WorkClientBank> bankList = workClientBankDao.findListByClient(new WorkClientBank(entity));
+                entity.setWorkClientBankList(bankList);
+            }
+        }
+        List<WorkClientInfo> maps = new ArrayList<>();
+
+        maps.addAll(clientInfoList);
+        return maps;
+    }
+
+
+
+}

+ 9 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/entity/ProjectReportRecord.java

@@ -74,6 +74,15 @@ public class ProjectReportRecord extends ActEntity<ProjectReportRecord> {
 	private Integer type;//(1:ProjectReportRecord  2:RuralProjectReportRecord)
 	private Integer recordAuditType;//归档状态(1:总审驳回,2:归档管理员驳回)
 	private String infoId;
+	private String projectId;
+
+	public String getProjectId() {
+		return projectId;
+	}
+
+	public void setProjectId(String projectId) {
+		this.projectId = projectId;
+	}
 
 	public Integer getType() {
 		return type;

+ 33 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/web/ProjectReportRecordController.java

@@ -22,6 +22,7 @@ import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.projectrecord.service.early.ProjectEarlyReviewService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.dao.UserDao;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
@@ -41,9 +42,13 @@ import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
@@ -105,6 +110,10 @@ public class ProjectReportRecordController extends BaseController {
 	private ProjectResultsFileTemplateService projectResultsFileTemplateService;
 	@Autowired
 	private ActivityService activityService;
+	@Autowired
+	private RestTemplate restTemplate;
+	@Autowired
+	private OfficeDao officeDao;
 
 	@ModelAttribute
 	public ProjectReportRecord get(@RequestParam(required=false) String id) {
@@ -580,6 +589,17 @@ public class ProjectReportRecordController extends BaseController {
 			logger.error("Exception e:"+e);
 			addMessage(redirectAttributes, "报告归档流程审批失败");
 		}
+		//根据项目id获取苏州分公司人员发起的线上归档信息
+		Office info = officeDao.getByName("苏州分公司");
+		List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+		for (Office office1 : officeList) {
+			if (office1.getId().equals(projectReportRecord.getOfficeId())){
+				ProjectReportRecord reportRecord = projectReportRecordService.getprojectReportRecord(projectReportRecord.getReport().getId());//从数据库取出记录的值
+				//将该数据保存到ccpm cloud项目中
+				sendProjectInfoDataToCloud(reportRecord);
+			}
+		}
+
 		if (StringUtils.isNotBlank(projectReportRecord.getHome()) && projectReportRecord.getHome().equals("home")){
 			return "redirect:" + Global.getAdminPath() + "/home/?repage";
 		}else if (StringUtils.isNotBlank(projectReportRecord.getHome()) && "notifyList".equals(projectReportRecord.getHome())){
@@ -606,6 +626,19 @@ public class ProjectReportRecordController extends BaseController {
 		}
 	}
 
+	public void sendProjectInfoDataToCloud(ProjectReportRecord reportData){
+		String path = Global.getConfig("SZ_PATH");
+
+		RuralProjectRecords records = new RuralProjectRecords();
+		records.setId(reportData.getProjectId());
+		records.setPrrId(reportData.getId());
+		records.setProjectReportRecordStatus(Integer.parseInt(reportData.getStatus()));
+		HttpHeaders headers = new HttpHeaders();
+		String url = path+"/ccpmData/data/saveProjectReportOnline";
+		HttpEntity<RuralProjectRecords> httpEntity = new HttpEntity<>(records,headers);
+		restTemplate.exchange(url, HttpMethod.POST,httpEntity,RuralProjectRecords.class);
+	}
+
 	/**
 	 * 删除报告归档
 	 */

+ 4 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java

@@ -481,4 +481,8 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
     //公司级 查询项目超期信息的总条数
     Integer selectThisMonthReportPageOverdueCount(@Param("ruralProjectRecords") RuralProjectRecords ruralProjectRecords, @Param("statementCompanyComprehensiveInfo")StatementCompanyComprehensiveInfo statementCompanyComprehensiveInfo,@Param("beginDate")String beginDate,@Param("endDate") String endDate);
 
+    List<RuralProjectRecords> getListByOffice(@Param("officeId") String officeId);
+
+    //根据项目名称查询项目信息
+    RuralProjectRecords findUseableByProjectName(@Param("projectName")String projectName);
 }

+ 18 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -5942,4 +5942,22 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	public void updateProjectPaperFiling(RuralProjectRecords records){
 		dao.updateProjectPaperFiling(records.getId(),records.getPaperFilingStatus());
 	}
+
+	/**
+	 * 获取苏州分公司下的所有项目信息
+	 * @param id
+	 * @return
+	 */
+    public List<RuralProjectRecords> getListByOffice(String officeId) {
+    	return dao.getListByOffice(officeId);
+    }
+
+	/**
+	 * 根据项目名称获取项目信息
+	 * @param projectName
+	 * @return
+	 */
+	public RuralProjectRecords findUseableByProjectName(String projectName) {
+    	return dao.findUseableByProjectName(projectName);
+	}
 }

+ 44 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/ProjectPaperFilingController.java

@@ -19,7 +19,9 @@ import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.service.ProjectPaperFilingService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.utils.DictUtils;
@@ -30,9 +32,13 @@ import org.activiti.engine.history.HistoricProcessInstance;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import java.util.HashMap;
@@ -66,6 +72,10 @@ public class ProjectPaperFilingController extends BaseController {
     private HistoryService historyService;
     @Autowired
     private ProjectReportRecordService projectReportRecordService;
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private OfficeDao officeDao;
     /**
      * 查看,增加,编辑项目表单页面
      */
@@ -158,12 +168,36 @@ public class ProjectPaperFilingController extends BaseController {
             logger.error("纸质归档流程创建异常:",e);
             addMessage(redirectAttributes, "纸质归档流程创建异常:"+e.getMessage());
         }
+        //根据项目id获取苏州分公司人员发起的线上归档信息
+        Office info = officeDao.getByName("苏州分公司");
+        List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+        for (Office office1 : officeList) {
+            if (office1.getId().equals(paperFiling.getOfficeId())){
+                ProjectPaperFiling projectPaperFiling = service.findByProjectId(paperFiling.getProjectId());//从数据库取出记录的值
+                //将该数据保存到ccpm cloud项目中
+                sendProjectInfoDataToCloud(projectPaperFiling);
+            }
+        }
+
         if (StringUtils.isNotBlank(paperFiling.getView()) && paperFiling.getView().equals("filing")){
             return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessage/?repage";
         }
         return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
     }
 
+    public void sendProjectInfoDataToCloud(ProjectPaperFiling paperFiling){
+        String path = Global.getConfig("SZ_PATH");
+
+        RuralProjectRecords records = new RuralProjectRecords();
+        records.setId(paperFiling.getProjectId());
+        records.setPrrdId(paperFiling.getId());
+        records.setDownProjectReportRecordStatus(paperFiling.getStatus());
+        HttpHeaders headers = new HttpHeaders();
+        String url = path+"/ccpmData/data/saveProjectReportPaper";
+        HttpEntity<RuralProjectRecords> httpEntity = new HttpEntity<>(records,headers);
+        restTemplate.exchange(url, HttpMethod.POST,httpEntity,RuralProjectRecords.class);
+    }
+
     /**
      * 纸质归档:强制撤回
      */
@@ -225,7 +259,16 @@ public class ProjectPaperFilingController extends BaseController {
             addMessage(redirectAttributes, "线下归档流程审批失败");
             logger.error("Exception e:"+e);
         }
-
+        //根据项目id获取苏州分公司人员发起的线上归档信息
+        Office info = officeDao.getByName("苏州分公司");
+        List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+        for (Office office1 : officeList) {
+            if (office1.getId().equals(t.getOfficeId())){
+                ProjectPaperFiling projectPaperFiling = service.findByProjectId(t.getProjectId());//从数据库取出记录的值
+                //将该数据保存到ccpm cloud项目中
+                sendProjectInfoDataToCloud(projectPaperFiling);
+            }
+        }
         if (StringUtils.isNotBlank(home) && "home".equals(home)){
             return "redirect:" + Global.getAdminPath() + "/home/?repage";
         }else if(StringUtils.isNotBlank(home) && home.equals("filingAll")){

+ 38 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewController.java

@@ -30,11 +30,9 @@ import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.dao.UserDao;
-import com.jeeplus.modules.sys.entity.Area;
-import com.jeeplus.modules.sys.entity.MainDictDetail;
-import com.jeeplus.modules.sys.entity.User;
-import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.entity.*;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
@@ -51,11 +49,15 @@ import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
@@ -109,6 +111,10 @@ public class RuralCostProjectMessageNewController extends BaseController {
     private WorkattachmentService workattachmentService;
     @Autowired
     private WorkStaffBasicInfoService workStaffBasicInfoService;
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private OfficeDao officeDao;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -767,6 +773,17 @@ public class RuralCostProjectMessageNewController extends BaseController {
             }else{
                 addMessage(redirectAttributes, "发起质量复核失败。失败原因:"+str);
             }
+            //根据项目id获取苏州分公司人员发起的质量复核信息
+            Office info = officeDao.getByName("苏州分公司");
+            List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+            for (Office office1 : officeList) {
+                if (office1.getId().equals(projectcontentinfo.getProjectOnRural().getOffice().getId())){
+                    ProjectReportData reportDateByProjectId = ruralProjectMessageService.getProjectReportDateByProjectId(projectcontentinfo.getProjectOnRural().getId());
+                    //将该数据保存到ccpm cloud项目中
+                    sendProjectInfoDataToCloud(reportDateByProjectId);
+                }
+            }
+
             ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
             if (projectReportData!=null){
                 if (StringUtils.isNotBlank(projectcontentinfo.getEdit()) && projectcontentinfo.getEdit().equals("edit")){
@@ -785,6 +802,23 @@ public class RuralCostProjectMessageNewController extends BaseController {
         return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectMessage/?repage";
     }
 
+    /**
+     * 将该项目信息保存到cloud项目中
+     * @param reportData
+     */
+    public void sendProjectInfoDataToCloud(ProjectReportData reportData){
+        String path = Global.getConfig("SZ_PATH");
+
+        RuralProjectRecords records = new RuralProjectRecords();
+        records.setId(reportData.getProject().getId());
+        records.setPrdId(reportData.getId());
+        records.setProjectReportStatus(Integer.parseInt(reportData.getStatus()));
+        records.setProjectReportNumber(reportData.getNumber());
+        HttpHeaders headers = new HttpHeaders();
+        String url = path+"/ccpmData/data/saveProjectReview";
+        HttpEntity<RuralProjectRecords> httpEntity = new HttpEntity<>(records,headers);
+        restTemplate.exchange(url, HttpMethod.POST,httpEntity,RuralProjectRecords.class);
+    }
 
 
     /**

+ 34 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewTwoController.java

@@ -12,6 +12,7 @@ import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportDataTwo;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
 import com.jeeplus.modules.projectcontentinfo.service.*;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
@@ -22,8 +23,10 @@ import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewSer
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordTwoService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.dao.UserDao;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.utils.DictUtils;
@@ -34,9 +37,13 @@ import org.activiti.engine.HistoryService;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import java.util.*;
@@ -83,6 +90,10 @@ public class RuralCostProjectMessageNewTwoController extends BaseController {
     private UserDao userDao;
     @Autowired
     private RuralProjectRecordTwoService ruralProjectRecordTwoService;
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private OfficeDao officeDao;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -870,6 +881,16 @@ public class RuralCostProjectMessageNewTwoController extends BaseController {
             addMessage(redirectAttributes, "保存报告归档失败");
             logger.error("保存报告归档失败",e);
         }
+        //根据项目id获取苏州分公司人员发起的线上归档信息
+        Office info = officeDao.getByName("苏州分公司");
+        List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+        for (Office office1 : officeList) {
+            if (office1.getId().equals(ruralProjectRecords.getOffice().getId())){
+                ProjectReportRecord reportRecord = projectReportRecordService.getprojectReportRecord(projectReportRecord.getReport().getId());//从数据库取出记录的值
+                //将该数据保存到ccpm cloud项目中
+                sendProjectInfoDataToCloud(reportRecord);
+            }
+        }
         if("1".equals(ruralProjectRecords.getProjectType())){
             return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessage/?repage";
         }else if("2".equals(ruralProjectRecords.getProjectType())){
@@ -877,4 +898,17 @@ public class RuralCostProjectMessageNewTwoController extends BaseController {
         }
         return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
     }
+
+    public void sendProjectInfoDataToCloud(ProjectReportRecord reportData){
+        String path = Global.getConfig("SZ_PATH");
+
+        RuralProjectRecords records = new RuralProjectRecords();
+        records.setId(reportData.getProjectId());
+        records.setPrrId(reportData.getId());
+        records.setProjectReportRecordStatus(Integer.parseInt(reportData.getStatus()));
+        HttpHeaders headers = new HttpHeaders();
+        String url = path+"/ccpmData/data/saveProjectReportOnline";
+        HttpEntity<RuralProjectRecords> httpEntity = new HttpEntity<>(records,headers);
+        restTemplate.exchange(url, HttpMethod.POST,httpEntity,RuralProjectRecords.class);
+    }
 }

+ 44 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -31,6 +31,7 @@ import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -54,9 +55,13 @@ import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
@@ -106,6 +111,11 @@ public class RuralCostProjectRecordsController extends BaseController {
 	@Autowired
 	private WorkReimbursementService workReimbursementService;
 
+	@Autowired
+	private RestTemplate restTemplate;
+	@Autowired
+	private OfficeDao officeDao;
+
 	private static String template_path = Global.getProjectTemplatePath()+"咨询工作方案.xlsx";
 	private static String template_name = "咨询工作方案.xlsx";
 
@@ -421,8 +431,42 @@ public class RuralCostProjectRecordsController extends BaseController {
 		    logger.error("保存项目异常:",e);
             addMessage(redirectAttributes, "保存项目异常:"+e.getMessage());
         }
+		//判断项目创建人所属部门是否是苏州分公司
+		RuralProjectRecords records=projectRecordsService.findUseableByProjectName(projectRecords.getProjectName());
+		Office info = officeDao.getByName("苏州分公司");
+		List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+		for (Office office1 : officeList) {
+			if (office1.getId().equals(records.getOffice().getId())){
+				//将该数据保存到ccpm cloud项目中
+				sendProjectInfoDataToCloud(records);
+			}
+		}
 		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
 	}
+
+	/**
+	 * 将该项目信息保存到cloud项目中
+	 * @param ruralProjectRecords
+	 */
+	public void sendProjectInfoDataToCloud(RuralProjectRecords ruralProjectRecords){
+		String path = Global.getConfig("SZ_PATH");
+
+		RuralProjectRecords records = new RuralProjectRecords();
+		records.setId(ruralProjectRecords.getId());
+		records.setProjectId(ruralProjectRecords.getProjectId());
+		records.setProjectName(ruralProjectRecords.getProjectName());
+		records.setProjectType(ruralProjectRecords.getProjectType());
+		records.setArea(ruralProjectRecords.getArea());
+		WorkContractInfo workContractInfo = new WorkContractInfo();
+		workContractInfo.setId(ruralProjectRecords.getWorkContractInfo().getId());
+		records.setWorkContractInfo(workContractInfo);
+		HttpHeaders headers = new HttpHeaders();
+		String url = path+"/ccpmData/data/saveProjectInfo";
+		HttpEntity<RuralProjectRecords> httpEntity = new HttpEntity<>(records,headers);
+		restTemplate.exchange(url, HttpMethod.POST,httpEntity,RuralProjectRecords.class);
+	}
+
+
 	/**
 	 * 保存项目
 	 */

+ 50 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageNewController.java

@@ -30,9 +30,11 @@ import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.dao.UserDao;
 import com.jeeplus.modules.sys.entity.Area;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.utils.DictUtils;
@@ -52,11 +54,15 @@ import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
@@ -116,6 +122,10 @@ public class RuralProjectMessageNewController extends BaseController {
     private ProjectPlanService projectPlanService;
     @Autowired
     private WorkStaffBasicInfoService workStaffBasicInfoService;
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private OfficeDao officeDao;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -738,6 +748,16 @@ public class RuralProjectMessageNewController extends BaseController {
             } else{
                 addMessage(redirectAttributes, str);
             }
+            //根据项目id获取苏州分公司人员发起的质量复核信息
+            Office info = officeDao.getByName("苏州分公司");
+            List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+            for (Office office1 : officeList) {
+                if (office1.getId().equals(projectcontentinfo1.getOfficeId())){
+                    ProjectReportData reportDateByProjectId = ruralProjectMessageService.getProjectReportDateByProjectId(projectcontentinfo.getProject().getId());
+                    //将该数据保存到ccpm cloud项目中
+                    sendProjectInfoDataToCloud(reportDateByProjectId);
+                }
+            }
             ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
             if (projectReportData!=null){
                 if (StringUtils.isNotBlank(projectcontentinfo.getEdit()) && projectcontentinfo.getEdit().equals("edit")){
@@ -999,6 +1019,18 @@ public class RuralProjectMessageNewController extends BaseController {
             String str = ruralProjectMessageService.auditSave(t, users);
             addMessage(redirectAttributes, str);
         }
+
+        //根据项目id获取苏州分公司人员发起的质量复核信息
+        Office info = officeDao.getByName("苏州分公司");
+        List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+        for (Office office1 : officeList) {
+            if (office1.getId().equals(records.getOffice().getId())){
+                ProjectReportData reportDateByProjectId = ruralProjectMessageService.getProjectReportDateByProjectId(records.getId());
+                //将该数据保存到ccpm cloud项目中
+                sendProjectInfoDataToCloud(reportDateByProjectId);
+            }
+        }
+
         if (StringUtils.isNotBlank(projectcontentinfo.getHome()) && projectcontentinfo.getHome().equals("home")){
             return "redirect:" + Global.getAdminPath() + "/home/?repage";
         }else if (StringUtils.isNotBlank(projectcontentinfo.getHome()) && "notifyList".equals(projectcontentinfo.getHome())){
@@ -1012,6 +1044,24 @@ public class RuralProjectMessageNewController extends BaseController {
 
     }
 
+    /**
+     * 将该项目信息保存到cloud项目中
+     * @param reportData
+     */
+    public void sendProjectInfoDataToCloud(ProjectReportData reportData){
+        String path = Global.getConfig("SZ_PATH");
+
+        RuralProjectRecords records = new RuralProjectRecords();
+        records.setId(reportData.getProject().getId());
+        records.setPrdId(reportData.getId());
+        records.setProjectReportStatus(Integer.parseInt(reportData.getStatus()));
+        records.setProjectReportNumber(reportData.getNumber());
+        HttpHeaders headers = new HttpHeaders();
+        String url = path+"/ccpmData/data/saveProjectReview";
+        HttpEntity<RuralProjectRecords> httpEntity = new HttpEntity<>(records,headers);
+        restTemplate.exchange(url, HttpMethod.POST,httpEntity,RuralProjectRecords.class);
+    }
+
     @RequestMapping(value = "revoke")
     public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) throws Exception {
         HashMap<String, String> requestMap = findRequestMap(request);

+ 43 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageNewTwoController.java

@@ -26,7 +26,9 @@ import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewSer
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewTwoService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.utils.DictUtils;
@@ -43,12 +45,16 @@ import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
@@ -96,6 +102,10 @@ public class RuralProjectMessageNewTwoController  extends BaseController {
     private ProjectEngineeringService engineeringService;
     @Autowired
     private ProjectReportRecordService projectReportRecordService;
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private OfficeDao officeDao;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -399,6 +409,16 @@ public class RuralProjectMessageNewTwoController  extends BaseController {
             } else{
                 addMessage(redirectAttributes, str);
             }
+            //根据项目id获取苏州分公司人员发起的报告签发信息
+            Office info = officeDao.getByName("苏州分公司");
+            List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+            for (Office office1 : officeList) {
+                if (office1.getId().equals(projectcontentinfo.getProjectOnRural().getOffice().getId())){
+                    ProjectReportDataTwo reportData1 =projectReportDataService.findTwoByProjectId(projectcontentinfo.getProject().getId());
+                    //将该数据保存到ccpm cloud项目中
+                    sendProjectInfoDataToCloud1(reportData1);
+                }
+            }
             ProjectReportDataTwo projectReportData = projectcontentinfo.getProjectReportDataTwo();
             if (projectReportData!=null){
                 if (StringUtils.isNotBlank(projectcontentinfo.getEdit()) && projectcontentinfo.getEdit().equals("edit")){
@@ -421,6 +441,19 @@ public class RuralProjectMessageNewTwoController  extends BaseController {
         return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectMessage/?repage";
     }
 
+    public void sendProjectInfoDataToCloud1(ProjectReportDataTwo reportData){
+        String path = Global.getConfig("SZ_PATH");
+
+        RuralProjectRecords records = new RuralProjectRecords();
+        records.setId(reportData.getProject().getId());
+        records.setPrdtId(reportData.getId());
+        records.setProjectReportStatusTwo(Integer.parseInt(reportData.getStatus()));
+        HttpHeaders headers = new HttpHeaders();
+        String url = path+"/ccpmData/data/saveProjectReportTwo";
+        HttpEntity<RuralProjectRecords> httpEntity = new HttpEntity<>(records,headers);
+        restTemplate.exchange(url, HttpMethod.POST,httpEntity,RuralProjectRecords.class);
+    }
+
     /**
      * 暂存报告信息
      * @param projectcontentinfo
@@ -579,6 +612,16 @@ public class RuralProjectMessageNewTwoController  extends BaseController {
             String str = ruralProjectMessageService.auditSave(t, users);
             addMessage(redirectAttributes, str);
         }
+        //根据项目id获取苏州分公司人员发起的报告签发信息
+        Office info = officeDao.getByName("苏州分公司");
+        List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+        for (Office office1 : officeList) {
+            if (office1.getId().equals(projectRecord.getOffice().getId())){
+                ProjectReportDataTwo reportData1 =projectReportDataService.findTwoByProjectId(projectRecord.getId());
+                //将该数据保存到ccpm cloud项目中
+                sendProjectInfoDataToCloud1(reportData1);
+            }
+        }
         if (StringUtils.isNotBlank(projectcontentinfo.getHome()) && projectcontentinfo.getHome().equals("home")){
             return "redirect:" + Global.getAdminPath() + "/home/?repage";
         }else if (StringUtils.isNotBlank(projectcontentinfo.getHome()) && "notifyList".equals(projectcontentinfo.getHome())){

+ 42 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsController.java

@@ -30,6 +30,7 @@ import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -54,9 +55,13 @@ import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.json.JSONArray;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
@@ -103,6 +108,10 @@ public class RuralProjectRecordsController extends BaseController {
 	private WorkInvoiceService workInvoiceService;
 	@Autowired
 	private WorkReimbursementService workReimbursementService;
+	@Autowired
+	private RestTemplate restTemplate;
+	@Autowired
+	private OfficeDao officeDao;
 
 	private static String template_path = Global.getProjectTemplatePath()+"咨询工作方案.xlsx";
 	private static String template_name = "咨询工作方案.xlsx";
@@ -379,8 +388,41 @@ public class RuralProjectRecordsController extends BaseController {
 		    logger.error("保存项目异常:",e);
             addMessage(redirectAttributes, "保存项目异常:"+e.getMessage());
         }
+		//判断项目创建人所属部门是否是苏州分公司
+		RuralProjectRecords records=projectRecordsService.findUseableByProjectName(projectRecords.getProjectName());
+		Office info = officeDao.getByName("苏州分公司");
+		List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+		for (Office office1 : officeList) {
+			if (office1.getId().equals(records.getOffice().getId())){
+				//将该数据保存到ccpm cloud项目中
+				sendProjectInfoDataToCloud(records);
+			}
+		}
 		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
 	}
+
+	/**
+	 * 将该项目信息保存到cloud项目中
+	 * @param ruralProjectRecords
+	 */
+	public void sendProjectInfoDataToCloud(RuralProjectRecords ruralProjectRecords){
+		String path = Global.getConfig("SZ_PATH");
+
+		RuralProjectRecords records = new RuralProjectRecords();
+		records.setId(ruralProjectRecords.getId());
+		records.setProjectId(ruralProjectRecords.getProjectId());
+		records.setProjectName(ruralProjectRecords.getProjectName());
+		records.setProjectType(ruralProjectRecords.getProjectType());
+		records.setArea(ruralProjectRecords.getArea());
+		WorkContractInfo workContractInfo = new WorkContractInfo();
+		workContractInfo.setId(ruralProjectRecords.getWorkContractInfo().getId());
+		records.setWorkContractInfo(workContractInfo);
+		HttpHeaders headers = new HttpHeaders();
+		String url = path+"/ccpmData/data/saveProjectInfo";
+		HttpEntity<RuralProjectRecords> httpEntity = new HttpEntity<>(records,headers);
+		restTemplate.exchange(url, HttpMethod.POST,httpEntity,RuralProjectRecords.class);
+	}
+
 	/**
 	 * 保存项目
 	 */

+ 9 - 0
src/main/java/com/jeeplus/modules/sys/entity/User.java

@@ -107,6 +107,15 @@ public class User extends DataEntity<User> {
     private String areaRemark;  //部门地区备注(永不标注部门中所在的城市,比如一部中有 苏州、安徽的等等)
 	private String areaPrincipal; //是否为地区负责人	1:是;0:不是
 	private String isTemplate; //长期/临时  0:临时 1:长期
+	private String username;
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
 
 	public String getIsTemplate() {
 		return isTemplate;

+ 24 - 2
src/main/java/com/jeeplus/modules/sys/web/LoginController.java

@@ -3,6 +3,8 @@
  */
 package com.jeeplus.modules.sys.web;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.jeeplus.common.config.Global;
@@ -41,6 +43,8 @@ import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.sysuseroffice.entity.Useroffice;
 import com.jeeplus.modules.sysuseroffice.service.UserofficeService;
+import com.jeeplus.modules.szCenterservice.service.szCloud.SzFlowRequest;
+import com.jeeplus.modules.szCenterservice.utils.SzConvertServiceUtil;
 import com.jeeplus.modules.utils.ErrorCode;
 import com.jeeplus.modules.workbidproject.service.WorkBidProjectService;
 import com.jeeplus.modules.workcalendar.entity.WorkCalendar;
@@ -48,7 +52,6 @@ import com.jeeplus.modules.workcalendar.service.WorkCalendarService;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authz.UnauthorizedException;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -111,6 +114,9 @@ public class LoginController extends BaseController{
 	@Autowired
 	private TaskFlowService centerCpaTaskService;
 
+	@Autowired
+	private SzFlowRequest szFlowRequest;
+
 	/**
 	 * 管理登录
 	 * @throws IOException
@@ -549,7 +555,23 @@ public class LoginController extends BaseController{
 			workProjectNotifyPage.setPageSize(10);
 			// 查询中台待办数据
 			List<WorkProjectNotify> notifyList = centerCpaTaskService.getNotifyList(workProjectNotify);
-			if (notifyList.size() > 0) {
+			//苏州分公司cloud数据
+			List<Map<String, Object>> result = new ArrayList<>();
+			Object sz = szFlowRequest.getNotifyList(workProjectNotify, "sz", user);
+			List<Map<String, Object>> res = (List) JSONObject.parseArray(JSON.toJSONString(sz));
+			result.addAll((List) JSON.parseArray(JSON.toJSONString(res)));
+			List<WorkProjectNotify> processVos = SzConvertServiceUtil.convertWorkProjectNotifyList(result);
+			if (processVos.size()>0){
+				Page<WorkProjectNotify> notifyPage = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(1, 10), workProjectNotify);
+				List<WorkProjectNotify> list = notifyPage.getList();
+				processVos.addAll(list);
+				disposePageResp(processVos); // 查询结果处理
+				workProjectNotifyPage.getList().addAll(processVos);
+				Page<WorkProjectNotify> resultPage = ConvertServiceUtil.getSortAndPaging(workProjectNotifyPage, workProjectNotifyPage.getList());
+				model.addAttribute("notifyPage", resultPage.getList());
+				model.addAttribute("notifyCount", workProjectNotifyPage.getList().size());//未读通知条数
+				model.addAttribute("notifyCount1", workProjectNotifyPage.getCount());//未读通知条数
+			} else if (notifyList.size() > 0) {
 				disposePageResp(notifyList); // 查询结果处理
 				workProjectNotifyPage.getList().addAll(notifyList);
 				Page<WorkProjectNotify> resultPage = ConvertServiceUtil.getSortAndPaging(workProjectNotifyPage, workProjectNotifyPage.getList());

+ 71 - 0
src/main/java/com/jeeplus/modules/szCenterservice/controller/szCloud/CpaFinanceInvoiceController.java

@@ -0,0 +1,71 @@
+package com.jeeplus.modules.szCenterservice.controller.szCloud;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.ObjectUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.szCenterservice.service.szCloud.FinanceInvoiceRequest;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
+import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
+import org.apache.commons.collections.MapUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+@Controller
+@RequestMapping(value = "${adminPath}/cpa_finance")
+public class CpaFinanceInvoiceController {
+
+    @Autowired
+    private FinanceInvoiceRequest financeInvoiceRequest;
+
+
+    @RequestMapping(value = "saveAudit")
+    public String saveAudit(WorkInvoice workInvoice, RedirectAttributes redirectAttributes) throws ParseException {
+        if (Objects.nonNull(workInvoice.getAct())) {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            Date parse = simpleDateFormat.parse(workInvoice.getInvoiceDateCpa());
+            workInvoice.setInvoiceDate(parse);
+            Date parse1 = simpleDateFormat.parse(workInvoice.getTakeDateCpa());
+            workInvoice.setTakeDate(parse1);
+            Object res = financeInvoiceRequest.auditFunc(workInvoice);
+            if (Objects.nonNull(res)) {
+                addMessage(redirectAttributes, "操作失败");
+            }
+            addMessage(redirectAttributes, "审核成功");
+        } else {
+            addMessage(redirectAttributes, "操作失败");
+        }
+        if (StringUtils.isNotBlank(workInvoice.getHome()) && "home".equals(workInvoice.getHome())) {
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else if (StringUtils.isNotBlank(workInvoice.getHome()) && "notifyList".equals(workInvoice.getHome())){
+            return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+        } else {
+            return "redirect:" + Global.getAdminPath() + "/workInvoice/workInvoice/?repage";
+        }
+    }
+
+
+    /**
+     * 添加Flash消息
+     * @param messages
+     */
+    protected void addMessage(RedirectAttributes redirectAttributes, String... messages) {
+        StringBuilder sb = new StringBuilder();
+        for (String message : messages){
+            sb.append(message).append(messages.length>1?"<br/>":"");
+        }
+        redirectAttributes.addFlashAttribute("message", sb.toString());
+    }
+
+
+}

+ 72 - 0
src/main/java/com/jeeplus/modules/szCenterservice/enums/SzTaskAliasEnum.java

@@ -0,0 +1,72 @@
+package com.jeeplus.modules.szCenterservice.enums;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 流程枚举
+ */
+public enum SzTaskAliasEnum {
+    //开票 Process_1669275081328
+    REIMBURSEMENT ("21,212,213", "Process_1669275081328");
+
+    /**
+     *  ccpm
+     */
+    private String ccpmTaskAlias;
+
+    /**
+     *  cpa
+     */
+    private String cpaTaskAlias;
+
+    SzTaskAliasEnum(String ccpmTaskAlias, String cpaTaskAlias) {
+        this.ccpmTaskAlias = ccpmTaskAlias;
+        this.cpaTaskAlias = cpaTaskAlias;
+    }
+
+    public String getCcpmTaskAlias() {
+        return ccpmTaskAlias;
+    }
+
+    public String getCpaTaskAlias() {
+        return cpaTaskAlias;
+    }
+
+    /**
+     * 根据ccpm流程key查询枚举
+     * @param value
+     * @return
+     */
+    public static SzTaskAliasEnum getByCcpmContains(String value) {
+        SzTaskAliasEnum result = null;
+        for (SzTaskAliasEnum s : values()) {
+            List<String> stringList = Arrays.asList(s.getCcpmTaskAlias().split(","));
+            if (stringList.contains(value)) {
+                result = s;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 根据cpa流程key查询枚举
+     * @param value
+     * @return
+     */
+    public static SzTaskAliasEnum getByCpa(String value) {
+        SzTaskAliasEnum result = null;
+        for (SzTaskAliasEnum s : values()) {
+            if (s.getCpaTaskAlias().equals(value)) {
+                result = s;
+                break;
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "ccpm:" + this.ccpmTaskAlias + ", cpa:" + this.cpaTaskAlias;
+    }
+}

+ 71 - 0
src/main/java/com/jeeplus/modules/szCenterservice/service/szCloud/FinanceInvoiceRequest.java

@@ -0,0 +1,71 @@
+package com.jeeplus.modules.szCenterservice.service.szCloud;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.szCenterservice.utils.SzRestTemplateService;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.*;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class FinanceInvoiceRequest {
+
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private SzRestTemplateService szRestTemplateService;
+
+    /**
+     * 查询发票详情
+     * @param id
+     * @return
+     */
+    public String getById(String id, String processDefKey) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("id", id);
+        paramMap.put("processDefKey", processDefKey);
+        String path=Global.getConfig("SZ_PATH");
+        String url = szRestTemplateService.getUrl(path,"/transpond/detailFinance",paramMap);
+        ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.GET, null, String.class);
+        String res = null;
+        res = exchange.getBody();
+        return res ;
+    }
+
+    /**
+     * 报销审核
+     * @return
+     */
+    public Object auditFunc(WorkInvoice workInvoice) {
+        Map<String, Object> bodyMap = new HashMap<>();
+        bodyMap.put("id", workInvoice.getId());
+        bodyMap.put("flag", workInvoice.getAct().getFlag());
+        bodyMap.put("comment", workInvoice.getComment());
+        bodyMap.put("processDefKey", workInvoice.getType());
+        bodyMap.put("workInvoice",workInvoice);
+        String path=Global.getConfig("SZ_PATH");
+        String url = path + "/transpond/auditDistribute";
+        HttpHeaders headers = new HttpHeaders();
+        User user = UserUtils.getUser();
+        String cookie = szRestTemplateService.ccpmValidatePassword(user);
+        headers.add("cookie", cookie);
+        headers.add("Accept", MediaType.ALL_VALUE);
+        headers.add("domain","127.0.0.17");
+        headers.setContentType(new MediaType("application", "json", Charset.forName("UTF-8")));
+        HttpEntity<Object> httpEntity = new HttpEntity<>(bodyMap,headers);
+        Object res = restTemplate.exchange(url, HttpMethod.POST, httpEntity, Object.class);
+        return res;
+    }
+
+
+}

+ 327 - 0
src/main/java/com/jeeplus/modules/szCenterservice/service/szCloud/FinanceInvoiceService.java

@@ -0,0 +1,327 @@
+package com.jeeplus.modules.szCenterservice.service.szCloud;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.sys.entity.Area;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoiceProjectRelation;
+import com.jeeplus.modules.workinvoicedetail.entity.WorkInvoiceDetail;
+import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
+import com.jeeplus.modules.workreimbursement.entity.WorkAccount;
+import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class FinanceInvoiceService {
+
+    @Autowired
+    private FinanceInvoiceRequest financeInvoiceRequest;
+
+    /**
+     * 查询发票详情
+     * @param id
+     * @return
+     * @throws Exception
+     */
+    public WorkInvoice getFinanceInvoiceById(String id, String processDefKey) throws Exception{
+        WorkInvoice workInvoice = new WorkInvoice();
+        if (StringUtils.isNotBlank(id)) {
+            String res = financeInvoiceRequest.getById(id, processDefKey);
+            if(Objects.nonNull(res)) {
+//                Map<String,Object> map = new ObjectMapper().convertValue(res, Map.class);
+//                String string = JSON.toJSONString(res);
+                Map<String, Object> reim = JSONObject.parseObject(res);
+                workInvoice = convertFinance(reim); // 格式转换
+                workInvoice.setType(processDefKey);
+            }
+        }
+        return workInvoice;
+    }
+
+    /**
+     * 将cpa的发票详情字段转换为当前系统字段
+     * @param resp
+     * @return
+     */
+    public WorkInvoice convertFinance(Map<String,Object> resp) throws Exception{
+        WorkInvoice result = new WorkInvoice();
+        if (Objects.nonNull(resp)) {
+            // id
+            if (Objects.nonNull(resp.get("id"))) {
+                result.setId(resp.get("id").toString());
+            }
+            // processInstanceId
+            if (Objects.nonNull(resp.get("procInsId"))) {
+                result.setProcessInstanceId(resp.get("procInsId").toString());
+            }
+            // 基本信息
+            if (Objects.nonNull(resp.get("financeInvoiceBaseDTOList"))){
+                String data = JSON.toJSONString(resp.get("financeInvoiceBaseDTOList"));
+                List<Object> baseList = JSON.parseArray(data,Object.class);
+                ArrayList<WorkInvoiceProjectRelation> projectRelations = new ArrayList<>();
+                if (Objects.nonNull(baseList)){
+                    for (Object base : baseList) {
+                        WorkInvoiceProjectRelation projectRelation = new WorkInvoiceProjectRelation();
+                        Map<String, Object> baseMap = JSONObject.parseObject(JSON.toJSONString(base));
+                        if (Objects.nonNull(baseMap.get("programName"))){
+                            projectRelation.setProjectName(baseMap.get("programName").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("contractName"))){
+                            projectRelation.setWorkContractName(baseMap.get("contractName").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("programNo"))){
+                            projectRelation.setProjectNum(baseMap.get("programNo").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("clientName"))){
+                            projectRelation.setClientName(baseMap.get("clientName").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("reportNo"))){
+                            projectRelation.setReportDataNum(baseMap.get("reportNo").toString());
+                        }
+                        projectRelations.add(projectRelation);
+                    }
+
+                }
+                result.setWorkInvoiceProjectRelationList(projectRelations);
+            }
+
+            // 发票类型
+            if (Objects.nonNull(resp.get("type"))) {
+                result.setInvoiceType(resp.get("type").toString());
+            }
+            //发票编号
+            if (Objects.nonNull(resp.get("no"))) {
+                result.setNumber(resp.get("no").toString());
+            }
+            //开票类型
+            if (Objects.nonNull(resp.get("billingType"))) {
+                result.setNewDrawer(resp.get("billingType").toString());
+            }
+            //实际开票单位
+            if (Objects.nonNull(resp.get("billingWorkplaceReal"))) {
+                WorkClientInfo workClientInfo = new WorkClientInfo();
+                workClientInfo.setName(resp.get("billingWorkplaceReal").toString());
+                result.setClient(workClientInfo);
+            }
+            //纳税人识别号
+            if (Objects.nonNull(resp.get("taxpayerIdentificationNo"))) {
+                result.setOrUnicode(resp.get("taxpayerIdentificationNo").toString());
+            }
+            //地址
+            if (Objects.nonNull(resp.get("address"))) {
+                result.setAddress(resp.get("address").toString());
+            }
+            //电话
+            if (Objects.nonNull(resp.get("telPhone"))) {
+                result.setTelephone(resp.get("telPhone").toString());
+            }
+            //开户银行
+            if (Objects.nonNull(resp.get("openBank"))) {
+                result.setBank(resp.get("openBank").toString());
+            }
+            //银行账号
+            if (Objects.nonNull(resp.get("bankAccount"))) {
+                result.setBankNumber(resp.get("bankAccount").toString());
+            }
+            //收款类型
+            if (Objects.nonNull(resp.get("receivablesTypeLabel"))) {
+                result.setChargeType(resp.get("receivablesTypeLabel").toString());
+            }
+            //开票内容
+            if (Objects.nonNull(resp.get("billingContentLabel"))) {
+                result.setBillingContent(resp.get("billingContentLabel").toString());
+            }
+            //开票金额
+            if (Objects.nonNull(resp.get("account"))) {
+                result.setMoney(Double.parseDouble(resp.get("account").toString()));
+            }
+            //开票内容要求
+            if (Objects.nonNull(resp.get("billingContentTerms"))) {
+                result.setContent(resp.get("billingContentTerms").toString());
+            }
+            //开票人
+            if (Objects.nonNull(resp.get("billingPeople"))) {
+                result.setDrawerName(resp.get("billingPeople").toString());
+            }
+            //实际开票人
+            if (Objects.nonNull(resp.get("billingPeopleRealName"))) {
+                result.setActualDrawerName(resp.get("billingPeopleRealName").toString());
+            }
+            //接收邮箱
+            if (Objects.nonNull(resp.get("actualDrawerEmailAddress"))) {
+                result.setActualDrawerEmailAddress(resp.get("actualDrawerEmailAddress").toString());
+            }
+            //对账人
+            if (Objects.nonNull(resp.get("reconciliationPeopleName"))) {
+                result.setAccountCheckingUserName(resp.get("reconciliationPeopleName").toString());
+            }
+            //对账地区
+            if (Objects.nonNull(resp.get("reconciliationAreaName"))) {
+                Area area = new Area();
+                area.setName(resp.get("reconciliationAreaName").toString());
+                result.setArea(area);
+            }
+            //备注
+            if (Objects.nonNull(resp.get("remarks"))) {
+                result.setRemarks(resp.get("remarks").toString());
+            }
+            //开票时间
+            if (Objects.nonNull(resp.get("billingDate"))) {
+                String billingDate = resp.get("billingDate").toString();
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                Date date = sdf.parse(billingDate);
+                result.setInvoiceDate(date);
+            }
+            //领票时间
+            if (Objects.nonNull(resp.get("collectDate"))) {
+                String billingDate = resp.get("collectDate").toString();
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                Date date = sdf.parse(billingDate);
+                result.setTakeDate(date);
+            }
+            //发票明细
+            if (Objects.nonNull(resp.get("financeInvoiceDetailDTOList"))){
+                String data = JSON.toJSONString(resp.get("financeInvoiceDetailDTOList"));
+                List<Object> baseList = JSON.parseArray(data,Object.class);
+                ArrayList<WorkInvoiceDetail> workInvoiceDetails = new ArrayList<>();
+                if (Objects.nonNull(baseList)){
+                    for (Object base : baseList) {
+                        WorkInvoiceDetail workInvoiceDetail = new WorkInvoiceDetail();
+                        Map<String, Object> baseMap = JSONObject.parseObject(JSON.toJSONString(base));
+                        if (Objects.nonNull(baseMap.get("code"))){
+                            workInvoiceDetail.setCode(baseMap.get("code").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("number"))){
+                            workInvoiceDetail.setNumber(baseMap.get("number").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("account"))){
+                            workInvoiceDetail.setTotalMoney(baseMap.get("account").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("amount"))){
+                            workInvoiceDetail.setTaxMoney(baseMap.get("amount").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("rate"))){
+                            workInvoiceDetail.setTax(baseMap.get("rate").toString());
+                        }
+                        if (Objects.nonNull(baseMap.get("tax"))){
+                            workInvoiceDetail.setTaxRate(baseMap.get("tax").toString());
+                        }
+                        workInvoiceDetails.add(workInvoiceDetail);
+                    }
+
+                }
+                result.setWorkAccountList(workInvoiceDetails);
+            }
+
+            // 附件
+            if (Objects.nonNull(resp.get("workAttachmentDtoList"))) {
+                String jsonString = JSON.toJSONString(resp.get("workAttachmentDtoList"));
+                List<Object> attachmentList = JSON.parseArray(jsonString, Object.class);
+                List<Workattachment> attachments = new ArrayList<>();
+                if (Objects.nonNull(attachmentList)) {
+                    for (Object attachment : attachmentList) {
+                        Workattachment attachmentDto = new Workattachment();
+                        Map<String, Object> fileMap = JSONObject.parseObject(JSON.toJSONString(attachment));
+                        User u = new User();
+                        if (Objects.nonNull(fileMap.get("name"))) { // 附件名称
+                            attachmentDto.setAttachmentName(fileMap.get("name").toString());
+                        }
+                        if (Objects.nonNull(fileMap.get("createBy"))) { // 创建人
+                            Map<String, Object> createBy = JSONObject.parseObject(JSON.toJSONString(fileMap.get("createBy")));
+                            if (Objects.nonNull(createBy.get("name"))) {
+                                u.setName(createBy.get("name").toString());
+                            }
+                        }
+                        if (Objects.nonNull(fileMap.get("createTime"))) { // 创建时间
+                            attachmentDto.setCreateDate((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(fileMap.get("createTime").toString()));
+                        }
+                        if (Objects.nonNull(fileMap.get("url"))) { // 文件地址
+                            attachmentDto.setUrl(fileMap.get("url").toString());
+                        }
+                        attachmentDto.setCreateBy(u); // 创建人
+                        attachments.add(attachmentDto);
+                    }
+                }
+                result.setWorkAttachments(attachments);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 报销详情转换为当前系统字段
+     * @param res
+     * @return
+     */
+    public List<WorkAccount> convertWorkAccount(Object res) {
+        String jsonString = JSON.toJSONString(res);
+        List<Object> detailInfoList = JSON.parseArray(jsonString, Object.class);
+        List<WorkAccount> workAccounts = new ArrayList<>();
+        if (Objects.nonNull(detailInfoList)) {
+            detailInfoList.stream().forEach(detail -> {
+                Map<String, Object> detailMap = JSONObject.parseObject(JSON.toJSONString(detail));
+                WorkAccount workAccount = new WorkAccount();
+                ProjectRecords project = new ProjectRecords();
+                if (Objects.nonNull(detailMap.get("userName"))) { // 报销人
+                    workAccount.setReimbursementName(detailMap.get("userName").toString());
+                }
+                if (Objects.nonNull(detailMap.get("deptName"))) { // 报销部门
+                    workAccount.setOfficeId(detailMap.get("deptName").toString());
+                }
+                if (Objects.nonNull(detailMap.get("typeName"))) { // 报销类别
+                    workAccount.setTypeName(detailMap.get("typeName").toString());
+                }
+                if (Objects.nonNull(detailMap.get("projectName"))) { // 报销项目
+                    project.setProjectName(detailMap.get("projectName").toString());
+                }
+                if (Objects.nonNull(detailMap.get("reportNumber"))) { // 报告号
+                    workAccount.setProjectReportNumber(detailMap.get("reportNumber").toString());
+                }
+                if (Objects.nonNull(detailMap.get("number"))) { // 费用(元)
+                    workAccount.setMoney(new BigDecimal(detailMap.get("number").toString()));
+                }
+                if (Objects.nonNull(detailMap.get("receiptNumber"))) { // 收据张数
+                    workAccount.setBills(Integer.valueOf(detailMap.get("receiptNumber").toString()));
+                }
+                if (Objects.nonNull(detailMap.get("days"))) { // 出差天数
+                    workAccount.setEvectionNumber(Double.parseDouble(detailMap.get("days").toString()));
+                }
+                if (Objects.nonNull(detailMap.get("content"))) { // 内容
+                    workAccount.setRemarks(detailMap.get("content").toString());
+                }
+                workAccount.setProject(project);
+                workAccounts.add(workAccount);
+            });
+        }
+        return workAccounts;
+    }
+
+    /**
+     * 报销审核
+     * @return
+     */
+    public Map<String,Object> auditFunc(String id,String flag,String comment, String processDefKey) {
+        Map<String,Object> res = new HashMap<>();
+//        Object o = reimbursementRequest.auditFunc(id, flag, comment, processDefKey);
+//        if (Objects.nonNull(o)) {
+//            res.putAll(JSONObject.parseObject(JSON.toJSONString(o)));
+//        }
+        return res;
+    }
+
+}

+ 124 - 0
src/main/java/com/jeeplus/modules/szCenterservice/service/szCloud/SzFlowRequest.java

@@ -0,0 +1,124 @@
+package com.jeeplus.modules.szCenterservice.service.szCloud;
+
+
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.szCenterservice.utils.SzRestTemplateService;
+
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class SzFlowRequest {
+
+    @Resource
+    private SzRestTemplateService szRestTemplateService;
+
+    /**
+     * 根据procInsId查询流程流向图
+     * @param procInsId
+     * @return
+     */
+    public Object getFlowChart(String procInsId) {
+        String token = "";
+        Map<String, Object> param = new HashMap<>();
+        param.put("procInsId", procInsId);
+        Object flowChart = szRestTemplateService.getCPA("/a/act/task/getFlowChart", token, param);
+        return flowChart;
+    }
+
+    /**
+     * 根据procInsId查询流程历史
+     * @param procInsId
+     * @return
+     */
+    public Object getHistoicFlowList(String procInsId) {
+        String token = "";
+        Map<String, Object> param = new HashMap<>();
+        param.put("procInsId", procInsId);
+        Object histoicFlow = szRestTemplateService.getCPA("/a/act/task/getHistoicFlowList", token, param);
+        return histoicFlow;
+    }
+
+    /**
+     * 根据待办id及类型  删除待办信息
+     * @param notifyId
+     * @param type
+     * @return
+     */
+    public Object deleteNotify(String notifyId, String type) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("notifyId", notifyId);
+        paramMap.put("type", type);
+        Object result = szRestTemplateService.getCPA("/a/workprojectnotify/workProjectNotify/deleteNotify", token, paramMap);
+        return result;
+    }
+
+    /**
+     * 查询待办信息
+     * @param flow
+     * @return
+     */
+    public Object getNotifyList(WorkProjectNotify flow, String belongProject, User userDTO) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        // 设置查询条件
+        if (flow.getCreateDate () != null) { // 创建时间
+            SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            paramMap.put("startDate", formatter.format(flow.getCreateDate ()));
+        }
+        if (flow.getEndDate () != null) { // 创建时间
+            SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            paramMap.put("endDate", formatter.format(flow.getEndDate ()));
+        }
+        if (StringUtils.isNotBlank (flow.getTitle ())) { // 标题
+            paramMap.put("title", flow.getTitle ());
+        }
+        if (StringUtils.isNotEmpty(flow.getInitiator())) { // 流程发起人
+            paramMap.put("userName", flow.getInitiator());
+        }
+        paramMap.put("belongProject", belongProject);
+        paramMap.put("size", -1);
+        paramMap.put("count", -1);
+        Object response = szRestTemplateService.getCPAMultithreading("/flowable/task/getList", token, paramMap,userDTO);
+        return response;
+    }
+
+    /**
+     * 查询已办信息
+     * @param flow
+     * @return
+     */
+    public Object getBackLogList(WorkProjectNotify flow, String belongProject, User userDTO) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        // 设置查询条件
+        if (flow.getCreateDate () != null) { // 创建时间
+            SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            paramMap.put("startDate", formatter.format(flow.getCreateDate ()));
+        }
+        if (flow.getEndDate () != null) { // 创建时间
+            SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            paramMap.put("endDate", formatter.format(flow.getEndDate ()));
+        }
+        if (StringUtils.isNotBlank (flow.getTitle ())) { // 标题
+            paramMap.put("title", flow.getTitle ());
+        }
+        if (StringUtils.isNotEmpty(flow.getInitiator())) { // 流程发起人
+            paramMap.put("userName", flow.getInitiator());
+        }
+        paramMap.put("belongProject", belongProject);
+        paramMap.put("size", -1);
+        paramMap.put("count", -1);
+        Object response = szRestTemplateService.getCPAMultithreading("/flowable/task/getBackLogList", token, paramMap,userDTO);
+        return response;
+    }
+}

+ 45 - 0
src/main/java/com/jeeplus/modules/szCenterservice/task/SzTaskFlowRequest.java

@@ -0,0 +1,45 @@
+package com.jeeplus.modules.szCenterservice.task;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.szCenterservice.utils.SzRestTemplateService;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.client.RestTemplate;
+
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class SzTaskFlowRequest {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Autowired
+    private SzRestTemplateService restTemplateService;
+
+
+    /**
+     * 根据procInsId查询流程历史
+     * @param procInsId
+     * @return
+     */
+    public Object getHisTaskListById(String procInsId) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("procInsId", procInsId);
+        String path=Global.getConfig("SZOA_PATH");
+        String url = restTemplateService.getUrl(path,"/flowable/task/historicTaskList",paramMap);
+        ResponseEntity<Object> exchange = restTemplate.exchange(url, HttpMethod.GET, null, Object.class);
+        Object res = null;
+        res = exchange.getBody();
+        return res;
+    }
+}

+ 40 - 0
src/main/java/com/jeeplus/modules/szCenterservice/task/SzTaskFlowService.java

@@ -0,0 +1,40 @@
+package com.jeeplus.modules.szCenterservice.task;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jeeplus.modules.centerservice.utils.ConvertServiceUtil;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class SzTaskFlowService {
+
+    @Autowired
+    private SzTaskFlowRequest taskRequest;
+
+
+    /**
+     * 根据procInsId获取流程历史
+     * @param procInsId
+     * @return
+     */
+    public List<Map<String,Object>> getHisTaskListById(String procInsId) {
+        List<Map<String,Object>> resp = new ArrayList<>();
+        Object hisTaskListById = taskRequest.getHisTaskListById(procInsId);
+        if (Objects.nonNull(hisTaskListById)) {
+            String jsonString = JSON.toJSONString(hisTaskListById);
+            resp.addAll((List)JSONArray.parseArray(jsonString));
+
+        }
+        return resp;
+    }
+}

+ 410 - 0
src/main/java/com/jeeplus/modules/szCenterservice/utils/SzConvertServiceUtil.java

@@ -0,0 +1,410 @@
+package com.jeeplus.modules.szCenterservice.utils;
+
+import afu.org.checkerframework.checker.oigj.qual.O;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.centerservice.enums.TaskAliasEnum;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.szCenterservice.enums.SzTaskAliasEnum;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.vo.HisTaskVo;
+import com.jeeplus.modules.workprojectnotify.vo.ProcessVo;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+public class SzConvertServiceUtil {
+
+    @Autowired
+    private RuralProjectRecordsService ruralProjectRecordsService;
+
+    /**
+     * 批量将cpa系统待办返回的字段转换为当前系统待办需要的字段
+     * @param res
+     * @return
+     */
+    public static List<WorkProjectNotify> convertWorkProjectNotifyList(List<Map<String, Object>> res) throws Exception {
+        List<WorkProjectNotify> resp = new ArrayList<>();
+        List<ProcessVo> workProjectNotifyList = JSON.parseArray(JSON.toJSONString(res), ProcessVo.class);
+        String cpa_task = Global.getConfig("SZ_TASK"); // 获取cpa可查看的待办数据
+        for (ProcessVo workProjectNotify : workProjectNotifyList) {
+            if ("sz".equals(workProjectNotify.getBelongProject())) {
+                if (StringUtils.isNotBlank(workProjectNotify.getType())) {
+                    if (StringUtils.isNotBlank(cpa_task)) {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setType(workProjectNotify.getType());
+                        notify.setProcessInstanceId(workProjectNotify.getTask().getProcessInstanceId());
+                        notify.setTitle((String) workProjectNotify.getVars().get("title"));
+                        notify.setInitiator((String) workProjectNotify.getVars().get("userName"));
+                        notify.setAuditUserName(UserUtils.getUser().getName());
+                        notify.setCreateDate(workProjectNotify.getTask().getCreateTime());
+                        notify.setType(workProjectNotify.getType());
+                        if (workProjectNotify.getStatus().equals("todo")){
+                            notify.setRemarks("待审批");
+                        }
+                        notify.setNotifyRole(workProjectNotify.getTask().getName());
+                        notify.setBelongProject(workProjectNotify.getBelongProject());
+                        resp.add(notify);
+                    }
+                }
+            }
+        }
+        return resp;
+    }
+
+    /**
+     * 将本系统待办信息字段改为center字段(批量)
+     * @param workProjectNotifyList
+     * @return
+     */
+    public static List<Map<String,Object>> copyNotifyListToCenter(List<WorkProjectNotify> workProjectNotifyList) {
+        List<Map<String, Object>> res = new ArrayList<>();
+        for (WorkProjectNotify workProjectNotify : workProjectNotifyList) {
+            Map<String, Object> stringObjectMap = copyNotifyToCenter(workProjectNotify);
+            res.add(stringObjectMap);
+        }
+        return res;
+    }
+
+    /**
+     * 将本系统待办信息字段改为center字段
+     * @param workProjectNotify
+     * @return
+     */
+    public static Map<String,Object> copyNotifyToCenter(WorkProjectNotify workProjectNotify) {
+        Map<String, Object> res = new HashMap<>();
+        Map<String, Object> vars = new HashMap<>();
+        Map<String, Object> task = new HashMap<>();
+        if (Objects.nonNull(workProjectNotify)) {
+            // 所属系统
+            if (Objects.nonNull(workProjectNotify.getBelongProject())) {
+                res.put("belongProject", workProjectNotify.getBelongProject());
+            } else {
+                res.put("belongProject", "ccpm");
+            }
+            // 标题
+            if (Objects.nonNull(workProjectNotify.getTitle())){
+                vars.put("title", workProjectNotify.getTitle());
+            }
+            // 流程名称
+            if (Objects.nonNull(workProjectNotify.getTypeLabel())){
+                res.put("processDefinitionName", workProjectNotify.getTypeLabel());
+            }
+            // 流程类型
+            if (Objects.nonNull(workProjectNotify.getType())){
+                task.put("processDefKey", workProjectNotify.getType());
+            }
+            // 当前环节
+            if (Objects.nonNull(workProjectNotify.getNotifyRole())){
+                task.put("name", workProjectNotify.getNotifyRole());
+            }
+            // 流程发起人
+            if (Objects.nonNull(workProjectNotify.getCreateUserName())){
+                vars.put("userName", workProjectNotify.getCreateUserName());
+            }
+            // 创建时间
+            if (Objects.nonNull(workProjectNotify.getCreateDate())){
+                task.put("createTime", workProjectNotify.getCreateDate());
+//                task.setCreateTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(map.get("createDate").toString()));
+            }
+            // 流程id
+            if (Objects.nonNull(workProjectNotify.getId())){
+                task.put("id", workProjectNotify.getId());
+            }
+            // 数据id
+            if (Objects.nonNull(workProjectNotify.getNotifyId())){
+                vars.put("notifyId", workProjectNotify.getNotifyId());
+            }
+            // 审批状态
+            if (Objects.nonNull(workProjectNotify.getRemarks())){
+                vars.put("remarks", workProjectNotify.getRemarks());
+            }
+        }
+        res.put("vars", vars);
+        res.put("task", task);
+        res.put("status", "todo");
+        return res;
+    }
+
+    /**
+     * 批量将cpa系统待办返回的字段转换为当前系统待办需要的字段 old
+     * @param res
+     * @return
+     */
+    @Deprecated
+    public static List<WorkProjectNotify> convertWorkProjectNotifyListOld(List<Map<String, Object>> res) throws Exception {
+        ArrayList<WorkProjectNotify> workProjectNotifyList = new ArrayList<>();
+        String cpa_task = Global.getConfig("CPA_TASK"); // 获取cpa可查看的待办数据
+        if (StringUtils.isNotBlank(cpa_task)) {
+            String[] taskAliasArrray = cpa_task.split(","); // 获取到cpa待办类型
+            List<String> taskAliasList = new ArrayList<>(); // cpa待办类型去重
+            if(Objects.nonNull(res) && Objects.nonNull(taskAliasArrray)) {
+                for(String s:taskAliasArrray){
+                    if(taskAliasList.indexOf(s) == -1) {
+                        taskAliasList.add(s);
+                    }
+                }
+                for (Map<String, Object> item : res) {
+                    Map<String, Object> vars = JSON.parseObject(JSON.toJSONString(item.get("vars")), Map.class);
+                    Map<String, Object> task = JSON.parseObject(JSON.toJSONString(item.get("task")), Map.class);
+                    for (String taskAlias : taskAliasList) {
+                        // vars.get("agree") 的值为false时,此流程为驳回状态。值为null或其他时,此流程为待审批状态
+                        if (taskAlias.equals(task.get("processDefKey").toString()) &&
+                                (Objects.isNull(vars.get("agree")) || Boolean.parseBoolean(vars.get("agree").toString()))) {
+                            WorkProjectNotify workProjectNotify = convertWorkProjectNotify(item);
+                            workProjectNotifyList.add(workProjectNotify);
+                        }
+                    }
+                }
+            }
+        }
+        return workProjectNotifyList;
+    }
+    /**
+     * cpa系统待办返回的字段转换为当前系统待办需要的字段
+     * @param map
+     * @return
+     */
+    @Deprecated
+    public static WorkProjectNotify convertWorkProjectNotify(Map<String, Object> map) throws Exception {
+        WorkProjectNotify workProjectNotify = new WorkProjectNotify();
+
+        Map<String, Object> vars = JSON.parseObject(JSON.toJSONString(map.get("vars")), Map.class);
+        Map<String, Object> task = JSON.parseObject(JSON.toJSONString(map.get("task")), Map.class);
+        if (Objects.nonNull(map)) {
+            // 标题
+            if (Objects.nonNull(vars.get("title"))){
+                workProjectNotify.setTitle("cpa " + vars.get("title").toString()); // 标题
+                workProjectNotify.setContent(vars.get("title").toString()); // 内容
+            }
+            // 流程名称
+            if (StringUtils.isNotBlank(map.get("processDefinitionName").toString())){
+                workProjectNotify.setTypeLabel(map.get("processDefinitionName").toString());
+                if ("评估-报销审批".equals(map.get("processDefinitionName").toString())) {
+                    workProjectNotify.setType("13");
+                }
+            }
+            // 当前环节
+            if (Objects.nonNull(task.get("name"))){
+                workProjectNotify.setNotifyRole(task.get("name").toString());
+            }
+            // 流程发起人
+            if (Objects.nonNull(vars.get("userName"))){
+                workProjectNotify.setCreateUserName(vars.get("userName").toString());
+            }
+            // 创建时间
+            if (Objects.nonNull(task.get("createTime"))){
+                workProjectNotify.setCreateDate((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(task.get("createTime").toString()));
+            }
+            // 流程id
+            if (Objects.nonNull(task.get("id"))){
+                workProjectNotify.setId(task.get("id").toString());
+            }
+            // 数据id
+            if (Objects.nonNull(vars.get("id"))){
+                workProjectNotify.setNotifyId(vars.get("id").toString());
+            }
+            // 审批状态
+            workProjectNotify.setRemarks("待审批");
+            if (Objects.nonNull(vars.get("agree"))) {
+                if (!Boolean.parseBoolean(vars.get("agree").toString())) {
+                    workProjectNotify.setRemarks("重新发起"); // vars.get("agree")的值为false时,此流程为驳回状态,其他值为待审批状态
+                }
+            }
+            // 审核人
+            if (Objects.nonNull(task.get("assignee"))){
+                workProjectNotify.setAuditUserName(task.get("assignee").toString());
+            }
+        }
+        workProjectNotify.setBelongProject("cpa");
+        return workProjectNotify;
+    }
+
+    /**
+     * 将结果排序后分页
+     * 由于是根据数据中的createDate字段来进行排序,所以此字段不可以为空,否则会报空指针
+     * @param page
+     * @param list
+     * @return
+     */
+    public static Page getSortAndPaging(Page<WorkProjectNotify> page, List<WorkProjectNotify> list) {
+        List<WorkProjectNotify> records = new ArrayList<>();
+        if (list.size() > 0) {
+            // 将数据按照createDate倒序排序
+            list.sort(new Comparator<WorkProjectNotify>() {
+                @Override
+                public int compare(WorkProjectNotify o1, WorkProjectNotify o2) {
+                    return o2.getCreateDate().compareTo(o1.getCreateDate());
+                }
+            });
+            // 将数据分页
+            page.setCount(list.size());
+            int startIndex = 0;
+            if(page.getPageNo() > 0){
+                startIndex = (int) ((page.getPageNo() - 1) * page.getPageSize());
+            }else{
+                startIndex = 0;
+            }
+            if (startIndex > list.size()) {
+                startIndex = 0;
+                page.setPageNo(1);
+            }
+            for (int i = 0; i < page.getPageSize() ; i ++) {
+                if (startIndex == list.size() || Objects.isNull(list.get(startIndex))) {
+                    break;
+                }
+                records.add(list.get(startIndex));
+                startIndex++;
+            }
+        }
+        page.setList(records);
+        return page;
+    }
+
+    /**
+     * 将结果排序后分页
+     * 由于是根据数据中的createDate字段来进行排序,所以此字段不可以为空,否则会报空指针
+     * @param page
+     * @param list
+     * @return
+     */
+    public static Page getBackSortAndPaging(Page<WorkProjectNotify> page, List<WorkProjectNotify> list) {
+        List<WorkProjectNotify> records = new ArrayList<>();
+        if (list.size() > 0) {
+            // 将数据按照createDate倒序排序
+            list.sort(new Comparator<WorkProjectNotify>() {
+                @Override
+                public int compare(WorkProjectNotify o1, WorkProjectNotify o2) {
+                    return o2.getWapCreateDate().compareTo(o1.getWapCreateDate());
+                }
+            });
+            // 将数据分页
+            page.setCount(list.size());
+            int startIndex = 0;
+            if(page.getPageNo() > 0){
+                startIndex = (int) ((page.getPageNo() - 1) * page.getPageSize());
+            }else{
+                startIndex = 0;
+            }
+            if (startIndex > list.size()) {
+                startIndex = 0;
+                page.setPageNo(1);
+            }
+            for (int i = 0; i < page.getPageSize() ; i ++) {
+                if (startIndex == list.size() || Objects.isNull(list.get(startIndex))) {
+                    break;
+                }
+                records.add(list.get(startIndex));
+                startIndex++;
+            }
+        }
+        page.setList(records);
+        return page;
+    }
+
+    /**
+     * 将Long类型时间转换为String时间格式
+     * @param date
+     * @return
+     */
+    public static String formatLongDate (Long date) {
+        Date dt=new Date(date);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
+        String format = sdf.format(dt);
+        return format;
+    }
+
+    /**
+     * 将本系统“已办”信息字段改为center字段(批量)
+     * @param workProjectNotifyList
+     * @return
+     */
+    public static List<WorkProjectNotify> copyHisTaskListToCenter(List<Map<String, Object>> workProjectNotifyList) {
+        List<WorkProjectNotify> resp = new ArrayList<>();
+        String string = JSON.toJSONString(workProjectNotifyList);
+        List<HisTaskVo> workProjectNotifys = JSON.parseArray(string, HisTaskVo.class);
+        for (HisTaskVo workProjectNotify : workProjectNotifys) {
+            WorkProjectNotify notify = new WorkProjectNotify();
+            notify.setType(workProjectNotify.getProcessDefinitionName());
+            notify.setProcessInstanceId(workProjectNotify.getProcessInstanceId());
+            notify.setTitle((String) workProjectNotify.getVars().get("title"));
+            notify.setInitiator((String) workProjectNotify.getVars().get("userName"));
+            notify.setWapCreateDate(workProjectNotify.getCreateTime());
+            notify.setWapEndDate(workProjectNotify.getEndTime());
+            notify.setNotifyRole(workProjectNotify.getName());
+            notify.setDefKey(workProjectNotify.getDefKeyCcpm());
+            notify.setBelongProject(workProjectNotify.getBelongProject());
+            resp.add(notify);
+        }
+        return resp;
+    }
+
+    /**
+     * 将本系统“已办”信息字段改为center字段
+     * @param workProjectNotify
+     * @return
+     */
+    public static Map<String,Object> copyHisTaskToCenter(WorkProjectNotify workProjectNotify) {
+        Map<String, Object> res = new HashMap<>();
+        Map<String, Object> vars = new HashMap<>();
+        if (Objects.nonNull(workProjectNotify)) {
+            // 所属系统
+            if (Objects.nonNull(workProjectNotify.getBelongProject())) {
+                res.put("belongProject", workProjectNotify.getBelongProject());
+            } else {
+                res.put("belongProject", "ccpm");
+            }
+            // 标题
+            if (Objects.nonNull(workProjectNotify.getTitle())){
+                vars.put("title", workProjectNotify.getTitle());
+                res.put("title", workProjectNotify.getTitle());
+            }
+            // 流程名称
+            if (Objects.nonNull(workProjectNotify.getTypeLabel())){
+                res.put("processDefinitionName", workProjectNotify.getTypeLabel());
+            }
+            // 流程类型
+            if (Objects.nonNull(workProjectNotify.getType())){
+                res.put("processDefKey", workProjectNotify.getType());
+            }
+            // 当前环节
+            if (Objects.nonNull(workProjectNotify.getNotifyRole())){
+                res.put("name", workProjectNotify.getNotifyRole());
+            }
+            // 流程发起人
+            if (Objects.nonNull(workProjectNotify.getCreateUserName())){
+                vars.put("userName", workProjectNotify.getCreateUserName());
+            }
+            // 开始时间
+            if (Objects.nonNull(workProjectNotify.getWapCreateDate())){
+                res.put("createTime", workProjectNotify.getWapCreateDate());
+//                task.setCreateTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(map.get("createDate").toString()));
+            }
+            // 结束时间
+            if (Objects.nonNull(workProjectNotify.getWapEndDate())){
+                res.put("endTime", workProjectNotify.getWapEndDate());
+            }
+            // 流程id
+            if (Objects.nonNull(workProjectNotify.getId())){
+                res.put("executionId", workProjectNotify.getId());
+            }
+            // 数据id
+            if (Objects.nonNull(workProjectNotify.getNotifyId())){
+                res.put("businessId", workProjectNotify.getNotifyId());
+            }
+            // 审批状态
+            if (Objects.nonNull(workProjectNotify.getRemarks())){
+                res.put("status", workProjectNotify.getRemarks());
+            }
+        }
+        res.put("vars", vars);
+        return res;
+    }
+}

+ 249 - 0
src/main/java/com/jeeplus/modules/szCenterservice/utils/SzRestTemplateService.java

@@ -0,0 +1,249 @@
+package com.jeeplus.modules.szCenterservice.utils;
+
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.StringUtils;
+
+import com.jeeplus.modules.sys.entity.User;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.StringTokenizer;
+
+
+@Component
+public class SzRestTemplateService {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    /**
+     * 访问post接口 - CPA 系统
+     * @param path 接口路径
+     * @param token token
+     * @param paramMap 请求参数-路径后
+     * @param bodyMap 请求参数-请求体
+     * @return
+     */
+    public Object postCPA(String path, String token, Map<String, Object> paramMap, Map<String, Object> bodyMap) {
+        return httpRequest(HttpMethod.POST, token, paramMap, bodyMap, Global.getConfig("SZOA_PATH"), path);
+    }
+
+    /**
+     * 访问get接口 - CPA 系统
+     * @param path 接口路径
+     * @param token token
+     * @param paramMap 请求参数-路径后
+     * @return
+     */
+    public Object getCPA(String path, String token, Map<String, Object> paramMap) {
+        return httpRequest(HttpMethod.GET, token, paramMap, null, Global.getConfig("SZOA_PATH"), path);
+    }
+
+    /**
+     * 访问get接口 - CCPM 系统
+     * @param path 接口路径
+     * @param token token
+     * @param paramMap 请求参数-路径后
+     * @return
+     */
+    public Object getCPAMultithreading(String path, String token, Map<String, Object> paramMap, User userDTO) {
+        return httpRequestMultithreading(HttpMethod.GET, token, paramMap, null, Global.getConfig("SZOA_PATH"), path,"sz",userDTO);
+    }
+
+    /**
+     * 访问远程接口方法
+     * @param method 请求类型
+     * @param token token
+     * @param paramMap 请求参数-路径后
+     * @param bodyMap 请求参数-请求体
+     * @param hostAddress 服务host地址
+     * @param path 接口路径
+     * @param flag 接口路径
+     * @return
+     */
+    public Object httpRequestMultithreading(HttpMethod method, String token, Map<String, Object> paramMap, Map<String, Object> bodyMap, String hostAddress, String path, String flag,User  userDTO) {
+        Object res = null;
+        try {
+            JSONObject jsonObject = new JSONObject();
+            if (CollectionUtil.isNotEmpty(bodyMap)) {
+                jsonObject = new JSONObject(bodyMap); // 另一端接口需要使用@RequestBody来接收此参数
+            }
+            String url = getUrl(hostAddress, path, paramMap);
+            HttpHeaders httpHeaders = new HttpHeaders();
+            if("sz".equals(flag)){
+                String cookie = ccpmValidatePassword(userDTO);
+                httpHeaders.add("cookie", cookie);
+            }else{
+                //        httpHeaders.add("token",token);
+            }
+            httpHeaders.add("Accept", MediaType.ALL_VALUE);
+            httpHeaders.add("domain","127.0.0.17");
+            httpHeaders.setContentType(new MediaType("application", "json", Charset.forName("UTF-8")));
+            HttpEntity<Object> entity = new HttpEntity<>(jsonObject, httpHeaders);
+            ResponseEntity<Object> responseEntity = restTemplate.exchange(url, method, entity, Object.class);
+            res = responseEntity.getBody();
+        } catch (Exception e) {
+            System.out.println("远程调用失败");
+            e.printStackTrace();
+        }
+        return res;
+    }
+
+    /**
+     * 判定人员信息是否有效
+     * @param user
+     * @return
+     * @throws IOException
+     */
+    public String ccpmValidatePassword(User user) {
+        StringBuffer response = new StringBuffer();
+        //请求地址
+        String url = Global.getConfig("SZUSER_PATH") + "/sys/user/validatePasswordPublic";
+        HttpClient client = new HttpClient();
+        //post请求方式
+        PostMethod postMethod = new PostMethod(url);
+        //推荐的数据存储方式,类似key-value形式
+        Map telPair = new HashMap();
+        telPair.put("loginName",user.getName());
+        telPair.put("password",Global.getPublicPassword());
+        //封装请求参数
+        postMethod.setRequestBody(telPair.toString());
+        //这里是设置请求内容为json格式,根据站点的格式决定
+        //因为这个网站会将账号密码转为json格式,所以需要这一步
+        postMethod.setRequestHeader("Content-Type","application/json; charset=UTF-8;");
+        //执行请求
+        try {
+            client.executeMethod(postMethod);
+            // 读取为 InputStream
+            BufferedReader reader = new BufferedReader(new InputStreamReader(postMethod.getResponseBodyAsStream()));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                response.append(line);
+            }
+            reader.close();
+        } catch (IOException e) {
+            System.out.println("远程调用失败");
+        } finally {
+            postMethod.releaseConnection();
+        }
+        if("true".equals(response.toString())){
+            String cookie = getCcpmCookie(user);
+            return cookie;
+        }
+        return null;
+    }
+
+    /**
+     * 获取ccpm登录用户cookie信息
+     * @param user
+     * @return
+     * @throws IOException
+     */
+    public String getCcpmCookie(User user) {
+        //请求地址
+        String url = Global.getConfig("SZAUTH_PATH") + "/api/auth-server/user/login";
+        HttpClient client = new HttpClient();
+        //post请求方式
+        PostMethod postMethod = new PostMethod(url);
+        //封装请求参数
+        User user1 = new User();
+        user1.setUsername(user.getName());
+        user1.setPassword(Global.getPublicPassword());
+        postMethod.setRequestBody(JSONObject.toJSONString(user1));
+        //这里是设置请求内容为json格式,根据站点的格式决定
+        postMethod.setRequestHeader("domain","127.0.0.17");
+        //因为这个网站会将账号密码转为json格式,所以需要这一步
+        postMethod.setRequestHeader("Content-Type","application/json; charset=UTF-8;");
+        //执行请求
+        try {
+            client.executeMethod(postMethod);
+            //通过Post/GetMethod对象获取响应头信息
+            String cookies = postMethod.getResponseBodyAsString();
+            org.json.JSONObject jsonObject = new org.json.JSONObject(cookies);
+            String token = jsonObject.getString("token");
+            return token;
+        } catch (IOException e) {
+            System.out.println("远程调用失败");
+        } finally {
+            postMethod.releaseConnection();
+        }
+        return null;
+    }
+
+
+    /**
+     * 访问远程接口方法
+     * @param method 请求类型
+     * @param token token
+     * @param paramMap 请求参数-路径后
+     * @param bodyMap 请求参数-请求体
+     * @param hostAddress 服务host地址
+     * @param path 接口路径
+     * @return
+     */
+    public Object httpRequest(HttpMethod method, String token, Map<String, Object> paramMap, Map<String, Object> bodyMap, String hostAddress, String path) {
+        Object res = null;
+        try {
+            JSONObject jsonObject = new JSONObject();
+            if (Objects.nonNull(bodyMap)) {
+                jsonObject = new JSONObject(bodyMap); // 另一端接口需要使用@RequestBody来接收此参数
+            }
+            String url = getUrl(hostAddress, path, paramMap);
+            HttpHeaders httpHeaders = new HttpHeaders();
+            httpHeaders.add("token", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODMyNTM4NTYsInVzZXJuYW1lIjoi5r2Y5LitIn0.fWlfAzHkyscE-_09kLWvJJLVKHPT1PW64r6wFkVXqcM");
+            httpHeaders.add("Accept", MediaType.ALL_VALUE);
+            //        httpHeaders.add("cookie", "jeeplus.session.id=0635611b0f5a4401836262c7d23ae98e");
+            httpHeaders.setContentType(new MediaType("application", "json", Charset.forName("UTF-8")));
+            HttpEntity<Object> entity = new HttpEntity<>(jsonObject, httpHeaders);
+            ResponseEntity<Object> responseEntity = restTemplate.exchange(url, method, entity, Object.class);
+            res = responseEntity.getBody();
+        }catch (Exception e) {
+            System.out.println("远程调用失败");
+            e.printStackTrace();
+        }
+        return res;
+    }
+
+    /**
+     * 将参数拼接到请求路径中
+     * @param hostAddress 服务host地址
+     * @param path 接口路径
+     * @param map 请求参数
+     * @return
+     */
+    public String getUrl(String hostAddress, String path, Map<String, Object> map) {
+        String url = hostAddress + path;
+        StringBuilder paramStr = new StringBuilder();
+        if (Objects.nonNull(map)) {
+            for (String key : map.keySet()) {
+                Object o = map.get(key);
+                if (Objects.nonNull(o)) {
+//                    String value = URLEncoder.encode(o.toString(), "utf-8");
+                    paramStr.append("&").append(key).append("=").append(o);
+                }
+            }
+        }
+        if (StringUtils.isNotBlank(paramStr.toString())){
+            String param = paramStr.substring(1).toString(); // 去掉第一个&
+            url = url + "?" + param;
+        }
+        return url;
+    }
+}

+ 2 - 0
src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientInfoDao.java

@@ -60,4 +60,6 @@ public interface WorkClientInfoDao extends CrudDao<WorkClientInfo> {
      * @return
      */
     WorkClientInfo getByName(String name);
+
+    List<WorkClientInfo> getAllClient();
 }

+ 1 - 0
src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientInfo.java

@@ -84,6 +84,7 @@ public class WorkClientInfo extends DataEntity<WorkClientInfo> {
 
 	private int hasUscc; //是否拥有统一社会信用代码
 	private String uscCode; //统一社会信用代码
+	@JsonIgnore
 	private String clientTypeLables;
 
 	private Date beginDate;

+ 27 - 0
src/main/java/com/jeeplus/modules/workclientinfo/web/WorkClientInfoController.java

@@ -36,9 +36,12 @@ import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.*;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
+import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.commons.CommonsMultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@@ -48,6 +51,7 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
 import java.io.*;
 import java.net.URLDecoder;
+import java.nio.charset.Charset;
 import java.util.*;
 
 /**
@@ -64,6 +68,8 @@ public class WorkClientInfoController extends BaseController {
 	@Autowired
 	private SysImportInfoService sysImportInfoService;
 
+	@Autowired
+	private RestTemplate restTemplate;
 
 	@Autowired
 	private HttpServletRequest request;
@@ -239,9 +245,30 @@ public class WorkClientInfoController extends BaseController {
 			workClientInfoService.save(workClientInfo);//保存
 		}
 		addMessage(redirectAttributes, "保存客户管理成功");
+        //将新增的这条数据发送到cloud项目中,实现数据同步
+		WorkClientInfo clientInfo = workClientInfoService.getByName(workClientInfo.getName());
+		sendDataToCloud(clientInfo);
+
 		return "redirect:"+Global.getAdminPath()+"/workclientinfo/workClientInfo/?repage";
 	}
 
+	private void sendDataToCloud(WorkClientInfo workClientInfo) {
+		String path = Global.getConfig("SZ_PATH");
+		WorkClientInfo info = new WorkClientInfo();
+		info.setId(workClientInfo.getId());
+		info.setName(workClientInfo.getName());
+		info.setHasUscc(workClientInfo.getHasUscc());
+		info.setUscCode(workClientInfo.getUscCode());
+		info.setRegisterAddress(workClientInfo.getRegisterAddress());
+		info.setTelephone(workClientInfo.getTelephone());
+		info.setCompanyIndustry(workClientInfo.getCompanyIndustry());
+		info.setWorkClientBankList(workClientInfo.getWorkClientBankList());
+		HttpHeaders headers = new HttpHeaders();
+		String url = path+"/ccpmData/data/saveClient";
+		HttpEntity<WorkClientInfo> httpEntity = new HttpEntity<>(info,headers);
+ 		restTemplate.exchange(url, HttpMethod.POST,httpEntity,WorkClientInfo.class);
+	}
+
 	/**
 	 * 保存客户和联系人类型
 	 */

+ 3 - 0
src/main/java/com/jeeplus/modules/workcontractinfo/dao/WorkContractInfoDao.java

@@ -6,6 +6,7 @@ package com.jeeplus.modules.workcontractinfo.dao;
 import afu.org.checkerframework.checker.igj.qual.I;
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.statement.entity.StatementCompanyComprehensiveInfo;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
@@ -135,4 +136,6 @@ public interface WorkContractInfoDao extends CrudDao<WorkContractInfo> {
     List<WorkContractInfo> getWorkContractStatisticDetailList(@Param("workContractInfo")WorkContractInfo workContractInfo);
 
     Integer getWorkContractStatisticDetailListCount(WorkContractInfo workContractInfo);
+
+    List<WorkContractInfo> getListByOffice(@Param("officeId")String officeId);
 }

+ 66 - 0
src/main/java/com/jeeplus/modules/workcontractinfo/web/WorkContractInfoController.java

@@ -23,6 +23,7 @@ import com.jeeplus.modules.act.utils.ActUtils;
 import com.jeeplus.modules.alterinfo.entity.AlterInfo;
 import com.jeeplus.modules.alterinfo.service.AlterInfoService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
 import com.jeeplus.modules.sys.entity.User;
@@ -57,9 +58,13 @@ import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.commons.CommonsMultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@@ -112,6 +117,10 @@ public class WorkContractInfoController extends BaseController {
     private WorkProjectNotifyService workProjectNotifyService;
     @Autowired
     private WorkContractRecordService workContractRecordService;
+    @Autowired
+    private RestTemplate restTemplate;
+    @Autowired
+    private OfficeDao officeDao;
 
     @ModelAttribute
     public WorkContractInfo get(@RequestParam(required = false) String id) {
@@ -1168,9 +1177,46 @@ public class WorkContractInfoController extends BaseController {
             logger.error("Exception e:"+e);
             e.printStackTrace();
         }
+        //判断当前登录人所属部门是否是苏州分公司
+        WorkContractInfo contractInfo = workContractInfoService.getByContractNum(workContractInfo.getContractNum());
+        Office info = officeDao.getByName("苏州分公司");
+        List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+        for (Office office1 : officeList) {
+            if (office1.getId().equals(contractInfo.getChargeCompany())){
+                //将该数据保存到ccpm cloud项目中
+                sendContractInfoDataToCloud(contractInfo);
+            }
+        }
+
         return "redirect:" + Global.getAdminPath() + "/workcontractinfo/workContractInfo/?repage";
     }
 
+    /**
+     * 保存数据到ccpm cloud中
+     * @param contractInfo
+     */
+    public void sendContractInfoDataToCloud(WorkContractInfo contractInfo){
+        String path = Global.getConfig("SZ_PATH");
+
+        WorkContractInfo info = new WorkContractInfo();
+        info.setId(contractInfo.getId());
+        info.setName(contractInfo.getName());
+        info.setRecordNum(contractInfo.getFileNum());
+
+        WorkClientInfo workClientInfo = new WorkClientInfo();
+        workClientInfo.setId(contractInfo.getClient().getId());
+        info.setClient(workClientInfo);
+
+        info.setContractState(contractInfo.getContractState());
+        info.setRecordNum(contractInfo.getFileNum());
+        info.setContractRecordState(contractInfo.getContractRecordState());
+
+        HttpHeaders headers = new HttpHeaders();
+        String url = path+"/ccpmData/data/saveContractInfo";
+        HttpEntity<WorkContractInfo> httpEntity = new HttpEntity<>(info,headers);
+        restTemplate.exchange(url, HttpMethod.POST,httpEntity,WorkContractInfo.class);
+    }
+
    /* public WorkContractInfo getSort(WorkContractInfo workContractInfo){
         if (StringUtils.isNotBlank(workContractInfo.getTotalContractId()) && 30 == workContractInfo.getSort()){
             // 获取排序号,最末节点排序号+30
@@ -1818,6 +1864,16 @@ public class WorkContractInfoController extends BaseController {
             logger.error("Exception e:"+e);
             addMessage(redirectAttributes, "审批失败");
         }
+        //判断合同创建人所属部门是否是苏州分公司
+        WorkContractInfo contractInfo = workContractInfoService.getByContractNum(workContractInfo.getContractNum());
+        Office info = officeDao.getByName("苏州分公司");
+        List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+        for (Office office1 : officeList) {
+            if (office1.getId().equals(contractInfo.getChargeCompany())){
+                //将该数据保存到ccpm cloud项目中
+                sendContractInfoDataToCloud(contractInfo);
+            }
+        }
         if (StringUtils.isNotBlank(workContractInfo.getHome()) && "home".equals(workContractInfo.getHome())){
             return "redirect:" + Global.getAdminPath() + "/home/?repage";
         }else if (StringUtils.isNotBlank(workContractInfo.getHome()) && "notifyList".equals(workContractInfo.getHome())){
@@ -1873,6 +1929,16 @@ public class WorkContractInfoController extends BaseController {
             logger.error("Exception e:"+e);
             addMessage(redirectAttributes, "审批失败");
         }
+        //判断合同创建人所属部门是否是苏州分公司
+        WorkContractInfo contractInfo = workContractInfoService.getByContractNum(workContractInfo.getContractNum());
+        Office info = officeDao.getByName("苏州分公司");
+        List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+        for (Office office1 : officeList) {
+            if (office1.getId().equals(contractInfo.getChargeCompany())){
+                //将该数据保存到ccpm cloud项目中
+                sendContractInfoDataToCloud(contractInfo);
+            }
+        }
         if (StringUtils.isNotBlank(workContractInfo.getHome()) && "home".equals(workContractInfo.getHome())){
             return "redirect:" + Global.getAdminPath() + "/home/?repage";
         }else if (StringUtils.isNotBlank(workContractInfo.getHome()) && "notifyList".equals(workContractInfo.getHome())){

+ 66 - 1
src/main/java/com/jeeplus/modules/workcontractrecord/web/WorkContractRecordController.java

@@ -16,11 +16,13 @@ import com.google.common.collect.Maps;
 import com.jeeplus.common.mapper.JsonMapper;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.sys.dao.OfficeDao;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
@@ -30,9 +32,13 @@ import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
@@ -68,6 +74,10 @@ public class WorkContractRecordController extends BaseController {
 	private WorkContractInfoService workContractInfoService;
 	@Autowired
 	protected WorkProjectNotifyService workProjectNotifyService;
+	@Autowired
+	private RestTemplate restTemplate;
+	@Autowired
+	private OfficeDao officeDao;
 
 	private static byte[] SYN_BYTE = new byte[0];
 	@ModelAttribute
@@ -202,6 +212,32 @@ public class WorkContractRecordController extends BaseController {
 		addMessage(redirectAttributes, "保存合同归档成功");
 		return "redirect:"+Global.getAdminPath()+"/workcontractrecord/workContractRecord/?repage";
 	}
+
+	/**
+	 * 保存数据到ccpm cloud中
+	 * @param contractInfo
+	 */
+	public void sendContractInfoDataToCloud(WorkContractInfo contractInfo){
+		String path = Global.getConfig("SZ_PATH");
+
+		WorkContractInfo info = new WorkContractInfo();
+		info.setId(contractInfo.getId());
+		info.setName(contractInfo.getName());
+		info.setRecordNum(contractInfo.getFileNum());
+
+		WorkClientInfo workClientInfo = new WorkClientInfo();
+		workClientInfo.setId(contractInfo.getClient().getId());
+		info.setClient(workClientInfo);
+
+		info.setContractState(contractInfo.getContractState());
+		info.setRecordNum(contractInfo.getFileNum());
+		info.setContrractRecordStatus(contractInfo.getContrractRecordStatus());
+
+		HttpHeaders headers = new HttpHeaders();
+		String url = path+"/ccpmData/data/saveContractInfo";
+		HttpEntity<WorkContractInfo> httpEntity = new HttpEntity<>(info,headers);
+		restTemplate.exchange(url, HttpMethod.POST,httpEntity,WorkContractInfo.class);
+	}
 	/**
 	 * 保存合同归档
 	 */
@@ -261,6 +297,16 @@ public class WorkContractRecordController extends BaseController {
 			addMessage(redirectAttributes, "合同归档申请提交失败!");
 			addMessage(redirectAttributes, "系统内部错误");
 		}
+		//判断合同创建人所属部门是否是苏州分公司
+		WorkContractInfo contractInfo = workContractInfoService.getByContractNum(workContractRecord.getWorkContractInfo().getContractNum());
+		Office info = officeDao.getByName("苏州分公司");
+		List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+		for (Office office1 : officeList) {
+			if (office1.getId().equals(contractInfo.getChargeCompany())){
+				//将该数据保存到ccpm cloud项目中
+				sendContractInfoDataToCloud(contractInfo);
+			}
+		}
 		return "redirect:"+Global.getAdminPath()+"/workcontractinfo/workContractInfo/?repage";
 	}
 	/**
@@ -301,7 +347,16 @@ public class WorkContractRecordController extends BaseController {
 			}
 			addMessage(redirectAttributes, "审批失败");
 		}
-
+		//判断合同创建人所属部门是否是苏州分公司
+		WorkContractInfo contractInfo = workContractInfoService.getByContractNum(workContractRecord.getWorkContractInfo().getContractNum());
+		Office info = officeDao.getByName("苏州分公司");
+		List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+		for (Office office1 : officeList) {
+			if (office1.getId().equals(contractInfo.getChargeCompany())){
+				//将该数据保存到ccpm cloud项目中
+				sendContractInfoDataToCloud(contractInfo);
+			}
+		}
 		if (StringUtils.isNotBlank(workContractRecord.getHome()) && "home".equals(workContractRecord.getHome())){
 			return "redirect:" + Global.getAdminPath() + "/home/?repage";
 		}else if (StringUtils.isNotBlank(workContractRecord.getHome()) && "notifyList".equals(workContractRecord.getHome())){
@@ -442,6 +497,16 @@ public class WorkContractRecordController extends BaseController {
 		}else{
 			addMessage(redirectAttributes, "该合同归档不是送审状态,无法撤回");
 		}
+		//判断合同创建人所属部门是否是苏州分公司
+		WorkContractInfo contractInfo = workContractInfoService.getByContractNum(workContractRecord.getWorkContractInfo().getContractNum());
+		Office info = officeDao.getByName("苏州分公司");
+		List<Office> officeList = officeDao.getChildrenOfficeById(info.getId());
+		for (Office office1 : officeList) {
+			if (office1.getId().equals(contractInfo.getChargeCompany())){
+				//将该数据保存到ccpm cloud项目中
+				sendContractInfoDataToCloud(contractInfo);
+			}
+		}
 		return "redirect:"+Global.getAdminPath()+"/workcontractinfo/workContractInfo/?repage";
 	}
 	/**

+ 38 - 0
src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoice.java

@@ -117,9 +117,31 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	private Date cancellationAuditPassDate;
 	private Integer adventDate; 	//未收款天数
 	private Integer year; 	//年份信息
+	private String type; //发票所属系统
+	private String comment; // 意见
+
+
+	private String invoiceDateCpa;		// 开票日期
+	private String takeDateCpa;          //领票日期
 
 	private Integer electronicInvoiceFlag ;	//是否已经上传电子发票信息(0:未上传;1:已上传)
 
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
 	public String getCancellationProcessInstanceId() {
 		return cancellationProcessInstanceId;
 	}
@@ -854,4 +876,20 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	public void setYear(Integer year) {
 		this.year = year;
 	}
+
+	public String getInvoiceDateCpa() {
+		return invoiceDateCpa;
+	}
+
+	public void setInvoiceDateCpa(String invoiceDateCpa) {
+		this.invoiceDateCpa = invoiceDateCpa;
+	}
+
+	public String getTakeDateCpa() {
+		return takeDateCpa;
+	}
+
+	public void setTakeDateCpa(String takeDateCpa) {
+		this.takeDateCpa = takeDateCpa;
+	}
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/entity/WorkProjectNotify.java

@@ -70,6 +70,15 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	private String belongProject; // 所属系统
 	private String pageFlag; // 回跳页面判定
 	private String reject; //判定已办中是否驳回
+	private String defKey; //流程键
+
+	public String getDefKey() {
+		return defKey;
+	}
+
+	public void setDefKey(String defKey) {
+		this.defKey = defKey;
+	}
 
 	public String getReject() {
 		return reject;

+ 89 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/vo/ActionType.java

@@ -0,0 +1,89 @@
+package com.jeeplus.modules.workprojectnotify.vo;
+
+public enum ActionType {
+    BEGIN ( "开始", "_flow_start", "primary" ),
+    END ( "结束", "_flow_end", "primary" ),
+    SAVE ( "暂存", "_flow_save", "primary" ),
+    AGREE ( "同意", "_flow_agree", "success" ),
+    REJECT ( "驳回", "_flow_reject", "danger" ),
+    BACK ( "指定回退", "_flow_back", "danger" ),
+    ADD_MULTI_INSTANCE ( "加签", "_flow_add_multi_instance", "primary" ),
+    DEL_MULTI_INSTANCE ( "减签", "_flow_add_multi_instance", "primary" ),
+    TRANSFER ( "转办", "_flow_transfer", "primary" ),
+    DELEGATE ( "委派", "_flow_delegate", "primary" ),
+    STOP ( "终止", "_flow_stop", "info" ),
+    PRINT ( "打印", "_flow_print", "primary" ),
+    ADD_BEFORE_MULTI_INSTANCE ( "前加签", "_flow_before_add_multi_instance", "primary" ),
+    ADD_AFTER_MULTI_INSTANCE ( "后加签", "_flow_after_add_multi_instance", "primary" ),
+    COMMIT ( "提交", "_flow_commit", "success" ),
+    Audit ( "审批", "_flow_audit", "success" ),
+    WAITING ( "等待审核", "_flow_waiting", "primary" ),
+    RECOMMIT ( "重新提交", "_flow_recommit", "warning" ),
+    DELETED ( "作废流程", "_flow_delete", "danger" ),
+    REVOKE ( "撤销流程", "_flow_revoke", "warning" );
+    // 成员变量
+    private String status; // 评论描述
+    private String type; //编码
+    private String level; //描述级别
+
+    // 构造方法
+    private ActionType(String status, String type, String level) {
+        this.type = type;
+        this.status = status;
+        this.level = level;
+    }
+
+    // 普通方法
+    public static String getStatus(String type) {
+        for (ActionType c : ActionType.values ( )) {
+            if ( c.getType ( ).equals ( type ) ) {
+                return c.status;
+            }
+        }
+        return null;
+    }
+
+    // 普通方法
+    public static String getLevel(String type) {
+        for (ActionType c : ActionType.values ( )) {
+            if ( c.getType ( ).equals ( type ) ) {
+                return c.level;
+            }
+        }
+        return "primary"; //如果不存在返回 primary
+    }
+
+    public static ActionType value(String type) {
+        for (ActionType c : ActionType.values ( )) {
+            if ( c.getType ( ).equals ( type ) ) {
+                return c;
+            }
+        }
+        return null;
+    }
+
+    // get set 方法
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getLevel() {
+        return level;
+    }
+
+    public void setLevel(String level) {
+        this.level = level;
+    }
+}

+ 215 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/vo/HisTaskVo.java

@@ -0,0 +1,215 @@
+package com.jeeplus.modules.workprojectnotify.vo;
+
+
+
+import org.activiti.engine.history.HistoricTaskInstance;
+
+import java.util.Date;
+import java.util.Map;
+
+/*
+    历史任务节点
+ */
+
+public class HisTaskVo {
+    private String id;
+    private String name;
+    private String assignee;
+    private String executionId;
+    private String taskDefinitionKey;
+    private Date createTime;
+    private Date endTime;
+    private String processDefinitionId;
+    private String processInstanceId;
+    private String processDefinitionName; // 流程名称
+    private boolean isBack; // 流程是否可以撤回到该节点
+    private String code; //任务办理状态:1,2
+    private String comment; //任务评论
+    private String type; // 操作类型编码
+    private String status; // 任务办理描述: 同意,驳回
+    private String level; // 文字颜色
+    private Map vars;
+
+    private TaskVo currentTask; // 当前流程节点
+
+    private String belongProject; // 所属系统
+    private String processDefKey; // 流程key
+    private String businessId; // 数据详情id
+    private String defKeyCcpm;
+
+    public String getDefKeyCcpm() {
+        return defKeyCcpm;
+    }
+
+    public void setDefKeyCcpm(String defKeyCcpm) {
+        this.defKeyCcpm = defKeyCcpm;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAssignee() {
+        return assignee;
+    }
+
+    public void setAssignee(String assignee) {
+        this.assignee = assignee;
+    }
+
+    public String getExecutionId() {
+        return executionId;
+    }
+
+    public void setExecutionId(String executionId) {
+        this.executionId = executionId;
+    }
+
+    public String getTaskDefinitionKey() {
+        return taskDefinitionKey;
+    }
+
+    public void setTaskDefinitionKey(String taskDefinitionKey) {
+        this.taskDefinitionKey = taskDefinitionKey;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getProcessDefinitionId() {
+        return processDefinitionId;
+    }
+
+    public void setProcessDefinitionId(String processDefinitionId) {
+        this.processDefinitionId = processDefinitionId;
+    }
+
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
+
+    public String getProcessDefinitionName() {
+        return processDefinitionName;
+    }
+
+    public void setProcessDefinitionName(String processDefinitionName) {
+        this.processDefinitionName = processDefinitionName;
+    }
+
+    public boolean isBack() {
+        return isBack;
+    }
+
+    public void setBack(boolean back) {
+        isBack = back;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getLevel() {
+        return level;
+    }
+
+    public void setLevel(String level) {
+        this.level = level;
+    }
+
+    public Map getVars() {
+        return vars;
+    }
+
+    public void setVars(Map vars) {
+        this.vars = vars;
+    }
+
+    public TaskVo getCurrentTask() {
+        return currentTask;
+    }
+
+    public void setCurrentTask(TaskVo currentTask) {
+        this.currentTask = currentTask;
+    }
+
+    public String getBelongProject() {
+        return belongProject;
+    }
+
+    public void setBelongProject(String belongProject) {
+        this.belongProject = belongProject;
+    }
+
+    public String getProcessDefKey() {
+        return processDefKey;
+    }
+
+    public void setProcessDefKey(String processDefKey) {
+        this.processDefKey = processDefKey;
+    }
+
+    public String getBusinessId() {
+        return businessId;
+    }
+
+    public void setBusinessId(String businessId) {
+        this.businessId = businessId;
+    }
+}

+ 66 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/vo/ProcessStatus.java

@@ -0,0 +1,66 @@
+package com.jeeplus.modules.workprojectnotify.vo;
+
+public enum ProcessStatus {
+    SUSPENDED ( "已挂起", 0, "danger" ),
+    WAITING ( "等待审核", 1, "primary" ),
+    AGREE ( "审核通过", 2, "success" ),
+    REVOKE ( "流程撤回", 3, "warning" ),
+    REJECT ( "审核驳回", 4, "danger" ),
+    STOP ( "审核终止", 5, "info" ),
+    DELETED ( "流程作废", 6, "danger" );
+    // 成员变量
+    private String status;
+    private int code;
+    private String level;
+
+    // 构造方法
+    ProcessStatus(String status, int code, String level) {
+        this.code = code;
+        this.status = status;
+        this.level = level;
+    }
+
+    // 普通方法
+    public static String getStatus(int code) {
+        for (ProcessStatus c : ProcessStatus.values ( )) {
+            if ( c.getCode ( ) == code ) {
+                return c.status;
+            }
+        }
+        return null;
+    }
+
+    public static ProcessStatus value(int code) {
+        for (ProcessStatus c : ProcessStatus.values ( )) {
+            if ( c.getCode ( ) == code ) {
+                return c;
+            }
+        }
+        return null;
+    }
+
+    // get set 方法
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getLevel() {
+        return level;
+    }
+
+    public void setLevel(String level) {
+        this.level = level;
+    }
+}

+ 174 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/vo/ProcessVo.java

@@ -0,0 +1,174 @@
+package com.jeeplus.modules.workprojectnotify.vo;
+
+
+import java.util.Date;
+import java.util.Map;
+
+public class ProcessVo {
+    private String processInstanceId; // 流程实例ID
+    private String processDefinitionId; // 流程定义ID
+    private String processDefinitionName; // 流程名称
+    private String activityId;
+    private int version; // 流程版本
+    private Map vars; // 流程变量
+    private Date startTime; // 流程开始时间
+    private Date endTime; //流程结束时间
+    private String taskName; //流程当前节点名称
+    private String deleteReason; //流程作废原因
+    private HisTaskVo hisTask; // 历史流程节点
+    private TaskVo task; //流程当前节点
+
+
+    private int code; // 流程状态码
+    private String status; //流程状态
+    private String level; //状态级别,用于控制在前台显示的颜色
+
+    private String belongProject; // 所属系统 ccpm cpa ...
+    private String type; //ccpm系统流程类型
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getId() { // 流程实例id 作为列表的id
+        return processInstanceId;
+    }
+
+    public void setProcessStatus(ProcessStatus processStatus) {
+        this.code = processStatus.getCode ( );
+        this.status = processStatus.getStatus ( );
+        this.level = processStatus.getLevel ( );
+    }
+
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
+
+    public String getProcessDefinitionId() {
+        return processDefinitionId;
+    }
+
+    public void setProcessDefinitionId(String processDefinitionId) {
+        this.processDefinitionId = processDefinitionId;
+    }
+
+    public String getProcessDefinitionName() {
+        return processDefinitionName;
+    }
+
+    public void setProcessDefinitionName(String processDefinitionName) {
+        this.processDefinitionName = processDefinitionName;
+    }
+
+    public String getActivityId() {
+        return activityId;
+    }
+
+    public void setActivityId(String activityId) {
+        this.activityId = activityId;
+    }
+
+    public int getVersion() {
+        return version;
+    }
+
+    public void setVersion(int version) {
+        this.version = version;
+    }
+
+    public Map getVars() {
+        return vars;
+    }
+
+    public void setVars(Map vars) {
+        this.vars = vars;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getTaskName() {
+        return taskName;
+    }
+
+    public void setTaskName(String taskName) {
+        this.taskName = taskName;
+    }
+
+    public String getDeleteReason() {
+        return deleteReason;
+    }
+
+    public void setDeleteReason(String deleteReason) {
+        this.deleteReason = deleteReason;
+    }
+
+    public HisTaskVo getHisTask() {
+        return hisTask;
+    }
+
+    public void setHisTask(HisTaskVo hisTask) {
+        this.hisTask = hisTask;
+    }
+
+    public TaskVo getTask() {
+        return task;
+    }
+
+    public void setTask(TaskVo task) {
+        this.task = task;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getLevel() {
+        return level;
+    }
+
+    public void setLevel(String level) {
+        this.level = level;
+    }
+
+    public String getBelongProject() {
+        return belongProject;
+    }
+
+    public void setBelongProject(String belongProject) {
+        this.belongProject = belongProject;
+    }
+}

+ 110 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/vo/TaskVo.java

@@ -0,0 +1,110 @@
+package com.jeeplus.modules.workprojectnotify.vo;
+
+
+
+import org.activiti.engine.task.TaskInfo;
+
+import java.util.Date;
+
+/**
+ * 当前活动任务节点
+ */
+
+public class TaskVo {
+    private String id;
+    private String name;
+    private String assignee;
+    private String executionId;
+    private String taskDefinitionKey;
+    private Date createTime;
+    private String processDefinitionId;
+    private String processInstanceId;
+    private String processDefKey;
+
+
+    public TaskVo(TaskInfo task) {
+        this.id = task.getId ( );
+        this.name = task.getName ( );
+        this.assignee = task.getAssignee ( );
+        this.executionId = task.getExecutionId ( );
+        this.taskDefinitionKey = task.getTaskDefinitionKey ( );
+        this.createTime = task.getCreateTime ( );
+        this.processDefinitionId = task.getProcessDefinitionId ( );
+        this.processInstanceId = task.getProcessInstanceId ( );
+    }
+
+    public TaskVo() {
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAssignee() {
+        return assignee;
+    }
+
+    public void setAssignee(String assignee) {
+        this.assignee = assignee;
+    }
+
+    public String getExecutionId() {
+        return executionId;
+    }
+
+    public void setExecutionId(String executionId) {
+        this.executionId = executionId;
+    }
+
+    public String getTaskDefinitionKey() {
+        return taskDefinitionKey;
+    }
+
+    public void setTaskDefinitionKey(String taskDefinitionKey) {
+        this.taskDefinitionKey = taskDefinitionKey;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getProcessDefinitionId() {
+        return processDefinitionId;
+    }
+
+    public void setProcessDefinitionId(String processDefinitionId) {
+        this.processDefinitionId = processDefinitionId;
+    }
+
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
+
+    public String getProcessDefKey() {
+        return processDefKey;
+    }
+
+    public void setProcessDefKey(String processDefKey) {
+        this.processDefKey = processDefKey;
+    }
+}

+ 304 - 20
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -3,8 +3,10 @@
  */
 package com.jeeplus.modules.workprojectnotify.web;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
@@ -23,7 +25,6 @@ import com.jeeplus.modules.businessQuestions.entity.BusinessQuestionsContentsUse
 import com.jeeplus.modules.businessQuestions.service.BusinessQuestionsService;
 import com.jeeplus.modules.caseinfo.entity.CaseInfo;
 import com.jeeplus.modules.caseinfo.service.CaseInfoService;
-import com.jeeplus.modules.centerservice.service.cpa.reimbursement.ReimbursementRequest;
 import com.jeeplus.modules.centerservice.service.cpa.reimbursement.ReimbursementService;
 import com.jeeplus.modules.centerservice.service.cpa.task.TaskFlowService;
 import com.jeeplus.modules.centerservice.utils.ConvertServiceUtil;
@@ -81,7 +82,6 @@ import com.jeeplus.modules.ruralprojectrecords.service.*;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
 import com.jeeplus.modules.signature.dailyOfficeWork.entity.DailyOfficeWork;
 import com.jeeplus.modules.signature.dailyOfficeWork.service.DailyOfficeWorkService;
-import com.jeeplus.modules.signature.projectReportSignatureWork.entity.ProjectReportSignatureWork;
 import com.jeeplus.modules.signature.projectReportSignatureWork.entity.ReportSignature;
 import com.jeeplus.modules.signature.projectReportSignatureWork.service.ProjectReportSignatureWorkService;
 import com.jeeplus.modules.signatureManagement.businessSignature.entity.BusinessSignatureInfo;
@@ -101,7 +101,10 @@ import com.jeeplus.modules.sysuseroffice.entity.Useroffice;
 import com.jeeplus.modules.sysuseroffice.service.UserofficeService;
 import com.jeeplus.modules.syswarning.entity.SysWarning;
 import com.jeeplus.modules.syswarning.service.SysWarningService;
-import com.jeeplus.modules.test.entity.act.ActTest;
+import com.jeeplus.modules.szCenterservice.service.szCloud.FinanceInvoiceService;
+import com.jeeplus.modules.szCenterservice.service.szCloud.SzFlowRequest;
+import com.jeeplus.modules.szCenterservice.task.SzTaskFlowService;
+import com.jeeplus.modules.szCenterservice.utils.SzConvertServiceUtil;
 import com.jeeplus.modules.test.service.act.ActTestService;
 import com.jeeplus.modules.workadministrativeatamp.entity.WorkAdministrativeAtamp;
 import com.jeeplus.modules.workadministrativeatamp.service.WorkAdministrativeAtampService;
@@ -256,7 +259,6 @@ import org.activiti.engine.HistoryService;
 import org.activiti.engine.history.HistoricProcessInstance;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
-import org.json.JSONString;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -267,7 +269,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
+import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.concurrent.*;
 
 /**
  * 通知Controller
@@ -559,8 +563,12 @@ public class WorkProjectNotifyController extends BaseController {
 	@Autowired
 	private ReimbursementService reimbursementService;
 	@Autowired
+	private FinanceInvoiceService financeInvoiceService;
+	@Autowired
 	private TaskFlowService taskFlowService;
 	@Autowired
+	private SzTaskFlowService szTaskFlowService;
+	@Autowired
 	private FilialeWorkInvoiceService filialeWorkInvoiceService;
 
 	@Autowired
@@ -580,6 +588,9 @@ public class WorkProjectNotifyController extends BaseController {
 	@Autowired
 	private DistrictDirectorApplicationService directorApplicationService;
 
+	@Autowired
+	private SzFlowRequest flowRequest;
+
 	@ModelAttribute
 	public WorkProjectNotify get(@RequestParam(required = false) String id) {
 		WorkProjectNotify entity = null;
@@ -596,7 +607,9 @@ public class WorkProjectNotifyController extends BaseController {
 	 * 通知列表页面
 	 */
 	@RequestMapping(value = {"list", ""})
-	public String list(WorkProjectNotify workProjectNotify, HttpServletRequest request, HttpServletResponse response, Model model) {
+	public String list(WorkProjectNotify workProjectNotify, HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
+		//获取当前登录人信息
+		User user = UserUtils.getUser();
 		//进行查询之后进行任何操作,返回还是查询之后的数据页面
 		if (StringUtils.isNotBlank(workProjectNotify.getToflag())) {
 			request.getSession().removeAttribute("searchWorkProjectNotifylist");
@@ -608,29 +621,165 @@ public class WorkProjectNotifyController extends BaseController {
 				model.addAttribute("workProjectNotify", workProjectNotify);
 			}
 		}
-		User user = UserUtils.getUser();
 		workProjectNotify.setUser(user);
 		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
 		workProjectNotify.setRemarks("待审批");
-		Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
-		if (pageList.getList().size() > 0) {
-			for (WorkProjectNotify info : pageList.getList()) {
-				//对项目进行处理,工程咨询,造价审核可添加作废按钮
-				if ("39".equals(info.getType())) {
-					RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(info.getNotifyId());
-					if (null != ruralProjectRecords) {
-						info.setProjectType(ruralProjectRecords.getProjectType());
-					} else {
-						info.setProjectType("");
+		//判断当前登录人是否有访问其他系统的权限
+		if (user.getOtherServiceFlag().equals("1")){
+			//中台数据查询
+			List<Map<String, Object>> cpa = queryTodoListCenter(new Page<WorkProjectNotify>(request, response),workProjectNotify, "sz", Global.getConfig("SZCLOUD_STATUS"),request,response);
+			if (cpa.size() > 0) {
+				List<WorkProjectNotify> processVos = SzConvertServiceUtil.convertWorkProjectNotifyList(cpa);
+				Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+				List<WorkProjectNotify> list = pageList.getList();
+				processVos.addAll(list);
+				// 将整合后的结果排序后分页
+				Page sortAndPaging = SzConvertServiceUtil.getSortAndPaging(new Page<WorkProjectNotify>(request, response), processVos);
+				model.addAttribute("page", sortAndPaging);
+			} else {
+				// 如果中台没有返回任何数据,就去查询本系统分页待办数据
+				Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+				if (pageList.getList().size() > 0) {
+					for (WorkProjectNotify info : pageList.getList()) {
+						//对项目进行处理,工程咨询,造价审核可添加作废按钮
+						if ("39".equals(info.getType())) {
+							RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(info.getNotifyId());
+							if (null != ruralProjectRecords) {
+								info.setProjectType(ruralProjectRecords.getProjectType());
+							} else {
+								info.setProjectType("");
+							}
+						}
+					}
+				}
+				model.addAttribute("page", pageList);
+			}
+		}else {
+			Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+			if (pageList.getList().size() > 0) {
+				for (WorkProjectNotify info : pageList.getList()) {
+					//对项目进行处理,工程咨询,造价审核可添加作废按钮
+					if ("39".equals(info.getType())) {
+						RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(info.getNotifyId());
+						if (null != ruralProjectRecords) {
+							info.setProjectType(ruralProjectRecords.getProjectType());
+						} else {
+							info.setProjectType("");
+						}
 					}
 				}
 			}
+			model.addAttribute("page", pageList);
 		}
-		model.addAttribute("page", pageList);
+
 		return "modules/workprojectnotify/workProjectNotifyList";
 	}
 
 	/**
+	 * 查询待办信息后分发给所属系统
+	 *
+	 * @param flow
+	 * @param belongProject 所属系统
+	 * @param inquireStatus 各服务引用状态 =》 (若包含,则进行获取该服务的流程信息)
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "queryTodoListCenter")
+	public List<Map<String, Object>> queryTodoListCenter(Page<WorkProjectNotify> page,WorkProjectNotify workProjectNotify, String belongProject, String inquireStatus,HttpServletRequest request, HttpServletResponse response) throws Exception {
+		List<Map<String, Object>> result = new ArrayList<>();
+		List<WorkProjectNotify> processVoList = new ArrayList<>();
+		// 任务数量(线程池的线程数量、计数器的值)
+		int taskVolume = 2;
+		// 创建线程池
+		ExecutorService executorService = Executors.newFixedThreadPool(taskVolume);
+		// 创建单次计数器(事实上就是创建多个锁,每次.countDown()会释放一把锁,使用.await()就是等待全部锁被释放,所以这个计数器是线程安全的)
+		CountDownLatch countDownLatch = new CountDownLatch(taskVolume);
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		User user = UserUtils.getUser();
+		// cpa线程任务
+		Future<?> cpa = executorService.submit(new Runnable() {
+			@Override
+			public void run() {
+				System.out.println("查询ccpm待办开始" + sdf.format(new Date()));
+				try {
+					// cpa系统待办数据查询
+					if (inquireStatus.contains("ccpm") || ("ccpm").equals(belongProject)) {
+						workProjectNotify.setUser(user);
+						workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
+						workProjectNotify.setRemarks("待审批");
+						Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+						if (pageList.getList().size() > 0) {
+							for (WorkProjectNotify info : pageList.getList()) {
+								//对项目进行处理,工程咨询,造价审核可添加作废按钮
+								if ("39".equals(info.getType())) {
+									RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(info.getNotifyId());
+									if (null != ruralProjectRecords) {
+										info.setProjectType(ruralProjectRecords.getProjectType());
+									} else {
+										info.setProjectType("");
+									}
+								}
+							}
+						}
+						List<WorkProjectNotify> processVos = pageList.getList();
+						processVoList.addAll(processVos);
+					}
+				} catch (Exception e) {
+					System.out.println("ccpm系统待办查询失败");
+					e.printStackTrace();
+				}
+				// 当前线程执行完毕,计数器 -1
+				countDownLatch.countDown();
+				System.out.println("查询ccpm待办结束" + sdf.format(new Date()));
+			}
+		});
+		// ccpm线程任务
+		Future<?> ccpm = executorService.submit(new Runnable() {
+			@Override
+			public void run() {
+				System.out.println("查询szcloud待办开始" + sdf.format(new Date()));
+				try {
+					// szcloud系统待办数据查询
+					if (inquireStatus.contains("sz") || ("sz").equals(belongProject)) {
+						// 访问ccpm
+						Object response = flowRequest.getNotifyList(workProjectNotify, belongProject, user);
+						if (Objects.nonNull(response)) {
+							List<Map<String, Object>> res = (List) JSONObject.parseArray(JSON.toJSONString(response));
+							if (("sz").equals(belongProject)) { // 如果是ccpm系统查询,则直接返回
+								result.addAll(res);
+							} else { // 如果是其他系统查询,则将结果格式化后返回
+								if (CollectionUtil.isNotEmpty(res)) {
+									List<WorkProjectNotify> processVos = JSON.parseArray(JSON.toJSONString(res), WorkProjectNotify.class);
+									processVoList.addAll(processVos);
+								}
+							}
+						}
+					}
+				} catch (Exception e) {
+					System.out.println("szcloud系统待办查询失败");
+					e.printStackTrace();
+				}
+				// 当前线程执行完毕,计数器 -1
+				countDownLatch.countDown();
+				System.out.println("查询szcloud待办结束" + sdf.format(new Date()));
+			}
+		});
+		// 阻塞 等待线程池任务执行完后再执行后面代码
+		// 设置最大等待时间 5秒
+		countDownLatch.await(5, TimeUnit.SECONDS);
+		// 关闭线程池
+		executorService.shutdown();
+		// 根据不同系统返回不同字段值
+		if ("sz".equals(belongProject)) {
+			result.addAll((List) JSON.parseArray(JSON.toJSONString(processVoList)));
+		} else if ("ccpm".equals(belongProject)) {
+			result.addAll(SzConvertServiceUtil.copyNotifyListToCenter(processVoList));
+		}
+		return result;
+	}
+
+
+	/**
 	 * 本系统待办分页数据查询
 	 *
 	 * @param user
@@ -730,7 +879,7 @@ public class WorkProjectNotifyController extends BaseController {
 	 * 已审批待办列表页面
 	 */
 	@RequestMapping(value = {"backlogListReadShow"})
-	public String backlogListReadShow(WorkProjectNotify workProjectNotify, HttpServletRequest request, HttpServletResponse response, Model model) {
+	public String backlogListReadShow(WorkProjectNotify workProjectNotify, HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
 		//进行查询之后进行任何操作,返回还是查询之后的数据页面
 		if (StringUtils.isNotBlank(workProjectNotify.getToflag())) {
 			request.getSession().removeAttribute("searchbacklogListReadShow");
@@ -748,12 +897,126 @@ public class WorkProjectNotifyController extends BaseController {
 		workProjectNotify.setStatus("2");
 		workProjectNotify.setRemarks("待通知");
 		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
-		Page<WorkProjectNotify> pageList = workProjectNotifyService.findReadPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
-		model.addAttribute("page", pageList);
+		//判定当前登录人是否有访问其他系统的权限
+		if (user.getOtherServiceFlag().equals("1")){
+			//中台数据查询
+			List<Map<String, Object>> cpa = queryBackLogListCenter(new Page<WorkProjectNotify>(request, response),workProjectNotify, "sz", Global.getConfig("SZCLOUD_STATUS"),request,response);
+			if (cpa.size() > 0) {
+				List<WorkProjectNotify> processVos = SzConvertServiceUtil.copyHisTaskListToCenter(cpa);
+				Page<WorkProjectNotify> pageList = workProjectNotifyService.findReadPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+				List<WorkProjectNotify> list = pageList.getList();
+				processVos.addAll(list);
+				// 将整合后的结果排序后分页
+				Page sortAndPaging = SzConvertServiceUtil.getBackSortAndPaging(new Page<WorkProjectNotify>(request, response), processVos);
+				model.addAttribute("page", sortAndPaging);
+			} else {
+				// 如果中台没有返回任何数据,就去查询本系统分页待办数据
+				Page<WorkProjectNotify> pageList = workProjectNotifyService.findReadPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+				model.addAttribute("page", pageList);
+			}
+		}else {
+			Page<WorkProjectNotify> pageList = workProjectNotifyService.findReadPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+			model.addAttribute("page", pageList);
+
+		}
+
 		return "modules/workprojectnotify/workProjectNotifyReadBacklogList";
 	}
 
 	/**
+	 * 查询已办
+	 * @param page
+	 * @param workProjectNotify
+	 * @param belongProject
+	 * @param inquireStatus
+	 * @param request
+	 * @param response
+	 * @return
+	 * @throws Exception
+	 */
+	public List<Map<String, Object>> queryBackLogListCenter(Page<WorkProjectNotify> page,WorkProjectNotify workProjectNotify, String belongProject, String inquireStatus,HttpServletRequest request, HttpServletResponse response) throws Exception {
+		List<Map<String, Object>> result = new ArrayList<>();
+		List<WorkProjectNotify> processVoList = new ArrayList<>();
+		// 任务数量(线程池的线程数量、计数器的值)
+		int taskVolume = 2;
+		// 创建线程池
+		ExecutorService executorService = Executors.newFixedThreadPool(taskVolume);
+		// 创建单次计数器(事实上就是创建多个锁,每次.countDown()会释放一把锁,使用.await()就是等待全部锁被释放,所以这个计数器是线程安全的)
+		CountDownLatch countDownLatch = new CountDownLatch(taskVolume);
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		User user = UserUtils.getUser();
+		// cpa线程任务
+		Future<?> cpa = executorService.submit(new Runnable() {
+			@Override
+			public void run() {
+				System.out.println("查询ccpm待办开始" + sdf.format(new Date()));
+				try {
+					// ccpm系统已办数据查询
+					if (inquireStatus.contains("ccpm") || ("ccpm").equals(belongProject)) {
+						workProjectNotify.setCreateBy(user);
+						workProjectNotify.setUser(user);
+						workProjectNotify.setStatus("2");
+						workProjectNotify.setRemarks("待通知");
+						workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
+						Page<WorkProjectNotify> pageList = workProjectNotifyService.findReadPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+						List<WorkProjectNotify> processVos = pageList.getList();
+						processVoList.addAll(processVos);
+					}
+				} catch (Exception e) {
+					System.out.println("ccpm系统待办查询失败");
+					e.printStackTrace();
+				}
+				// 当前线程执行完毕,计数器 -1
+				countDownLatch.countDown();
+				System.out.println("查询ccpm待办结束" + sdf.format(new Date()));
+			}
+		});
+		// ccpm线程任务
+		Future<?> ccpm = executorService.submit(new Runnable() {
+			@Override
+			public void run() {
+				System.out.println("查询szcloud待办开始" + sdf.format(new Date()));
+				try {
+					// szcloud系统已办数据查询
+					if (inquireStatus.contains("sz") || ("sz").equals(belongProject)) {
+						// 访问ccpm
+						Object response = flowRequest.getBackLogList(workProjectNotify, belongProject, user);
+						if (Objects.nonNull(response)) {
+							List<Map<String, Object>> res = (List) JSONObject.parseArray(JSON.toJSONString(response));
+							if (("sz").equals(belongProject)) { // 如果是ccpm系统查询,则直接返回
+								result.addAll(res);
+							} else { // 如果是其他系统查询,则将结果格式化后返回
+								if (CollectionUtil.isNotEmpty(res)) {
+									List<WorkProjectNotify> processVos = JSON.parseArray(JSON.toJSONString(res), WorkProjectNotify.class);
+									processVoList.addAll(processVos);
+								}
+							}
+						}
+					}
+				} catch (Exception e) {
+					System.out.println("szcloud系统待办查询失败");
+					e.printStackTrace();
+				}
+				// 当前线程执行完毕,计数器 -1
+				countDownLatch.countDown();
+				System.out.println("查询szcloud待办结束" + sdf.format(new Date()));
+			}
+		});
+		// 阻塞 等待线程池任务执行完后再执行后面代码
+		// 设置最大等待时间 5秒
+		countDownLatch.await(5, TimeUnit.SECONDS);
+		// 关闭线程池
+		executorService.shutdown();
+		// 根据不同系统返回不同字段值
+		if ("sz".equals(belongProject)) {
+			result.addAll((List) JSON.parseArray(JSON.toJSONString(processVoList)));
+		} else if ("ccpm".equals(belongProject)) {
+			result.addAll(SzConvertServiceUtil.copyNotifyListToCenter(processVoList));
+		}
+		return result;
+	}
+
+	/**
 	 * 已审批待办(全部已办数据)
 	 */
 	@RequestMapping(value = {"backlogListReadAll"}, method = RequestMethod.GET)
@@ -1305,6 +1568,27 @@ public class WorkProjectNotifyController extends BaseController {
 	public String form(WorkProjectNotify workProjectNotify, Model model, HttpServletRequest request) {
 		try {
 			if (StringUtils.isNotBlank(workProjectNotify.getBelongProject())) {
+				if ("sz".equals(workProjectNotify.getBelongProject())) {
+					if ("212".equals(workProjectNotify.getType())) {
+						model.addAttribute("projectNotifyType", "发票申请");
+						WorkInvoice workInvoice = financeInvoiceService.getFinanceInvoiceById(workProjectNotify.getNotifyId(), workProjectNotify.getType());
+						if (StringUtils.isNotBlank(workProjectNotify.getHome())) {
+							workInvoice.setHome(workProjectNotify.getHome());
+						} else {
+							workInvoice.setHome("home");
+						}
+						model.addAttribute("workInvoice", workInvoice);
+						// 流程历史
+						if (Objects.nonNull(workInvoice) && StringUtils.isNotBlank(workInvoice.getProcessInstanceId())) {
+							List<Map<String, Object>> hisTaskList = szTaskFlowService.getHisTaskListById(workInvoice.getProcessInstanceId());
+							model.addAttribute("hisTaskList", hisTaskList);
+						}
+						if ("view".equals(workProjectNotify.getView())){
+							return "modules/workinvoice/workInvoiceViewCpa";
+						}
+						return "modules/workinvoice/workInvoiceAuditCpa";
+					}
+				}
 				if ("cpa".equals(workProjectNotify.getBelongProject())) {
 					if ("13".equals(workProjectNotify.getType())) {
 						model.addAttribute("projectNotifyType", "评估-报销审批");

+ 16 - 2
src/main/resources/jeeplus.properties

@@ -376,12 +376,26 @@ signature_project_approval_work = 3245192847945704016
 
 
 #其他系统的地址
-CPA_PATH:   http://localhost:8084
+CPA_PATH:   http://localhost:2800
+#苏州分公司 发票
+SZ_PATH: http://localhost:9527
+#flowable
+SZOA_PATH: http://localhost:9221
+#system校验用户有效
+SZUSER_PATH:http://localhost:9213
+
+SZAUTH_PATH:http://127.0.0.17:2800
 
 #待办中展示其他系统的流程
 #cpa =》
 #Process_1665383385070 评估-报销审批
 CPA_TASK:   Process_1665383385070
+#Process_1669275081328 苏州分公司 发票申请
+SZ_TASK: Process_1669275081328
 
 #各服务引用状态 =》 (若包含,则进行获取该服务的流程信息)
-INQUIRE_STATUS: cpa
+INQUIRE_STATUS: cpa
+SZCLOUD_STATUS: sz
+
+# 公共密码
+publicPassword: jsxgpassword

+ 2 - 1
src/main/resources/mappings/modules/projectcontentinfo/ProjectReportRecordDao.xml

@@ -424,7 +424,8 @@
 
 	<select id="getprojectReportRecord" resultType="ProjectReportRecord">
 		SELECT
-		<include refid="projectReportRecordColumns"/>
+		<include refid="projectReportRecordColumns"/>,
+		d.project_id as "projectId"
 		FROM rural_project_report_record a
 		<include refid="projectReportRecordJoins"/>
 		WHERE a.report_id = #{reportId}

+ 82 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -6756,6 +6756,88 @@ GROUP BY
 	</select>
 
 
+	<select id="getListByOffice" resultType="RuralProjectRecords">
+		SELECT
+		<include refid="newProjectRecordsColumns"/>
+		,concat(ifnull( pfp.STATUS, 0 ),ifnull( ppf.STATUS, 0 )) as "downProjectReportRecordPaperFilingStatus"
+		,su.name as "leaderNameStr"
+		,su.id as "leaderNameIds"
+		,a.submit_money as "submitMoney"
+		,a.project_type as projectType,
+		wci.name AS "workContractInfo.name",
+		wct.id AS "workContractInfo.client.id",
+		wct.name AS "workContractInfo.client.name",
+		o.top_company AS "office.name",
+		ifnull(prd.number ,"") as "projectReportNumber"
+		,(case when ifnull(prd.number ,"") = '' then '0' when ifnull(prd.number ,"") != '' then '1' else '' end) as reportDataFlag
+		,ifnull(prd.status,0) as "projectReportStatus"
+		,ifnull(prd.name,"") as "projectReportName"
+		,a.project_material_storage_status as "projectMaterialStorageStatus"
+		,prr.status as "projectReportRecordStatus"
+		,prr.process_instance_id as prrProcessInstanceId
+		,prd.id as prdId
+		,prr.id as prrId
+		,prd.audit_pass_date as auditPassDate
+		,ifnull(rprr.report_status,0) as "reportStatus"
+		,ifnull(rprr.sync_status,0) as "syncStatus"
+		,rprr.process_instance_id as "reportedProcessInstanceId"
+		,ifnull(prdt.status,0) as "projectReportStatusTwo"
+		,prdt.id as prdtId
+		,prdt.process_instance_id as prdtProcessinstanceId
+		,ifnull(pmdr.status,0) as "defectRecordStatus"
+		,pmdr.process_instance_id as "pmdrProcessInstanceId"
+		,pmdr.id as pmdrId
+		,ifnull(ppf.status,0) as "paperFilingStatus"
+		,ppf.process_instance_id as "ppfProcessInstanceId"
+		,ppf.id as "ppfId"
+		,pfb.process_instance_id AS "filingProcessinstanceId"
+		,ifnull(pfp.status,0) as "filingProjectStatus"
+		,prd.audit_pass_date as "prdAuditDate"
+		,prd.ZiXunShouRu as "money"
+		,cb.case_process_id as "caseProcessId"
+		,cb.case_type as "caseType"
+		,cb.case_create_by as "caseCreateBy"
+		,if(case_status > 0 ,case_status,"0") as "caseStatus"
+		,ifnull(prrd.status,0) as "downProjectReportRecordStatus"
+		,prrd.id as "prrdId"
+		FROM rural_project_records a
+		LEFT JOIN sys_area area ON area.id = a.area_id
+		left join rural_project_records_reported rprr on rprr.id = a.id
+		left join case_base cb on a.id = cb.project_id
+		left join
+		(select id,status,project_id,filing_batch from
+		(
+		select id,create_date,status,project_id,filing_batch
+		from project_flingbatch_relation order by create_date desc
+		)z
+		group by z.project_id desc
+		) pfp ON pfp.project_id = a.id
+
+		LEFT JOIN project_filingbatch pfb on pfb.id=pfp.filing_batch
+		LEFT JOIN sys_user sua on a.create_by = sua.id
+		LEFT JOIN work_project_user w1 on a.id = w1.project_id
+		LEFT JOIN sys_user su on w1.user_id = su.id
+		LEFT JOIN work_contract_info wci on a.contract_id = wci.id
+		LEFT JOIN work_client_info wct on wci.client_id = wct.id
+		LEFT JOIN sys_office o ON o.id = a.office_id
+		left join project_report_data prd on prd.project_id = a.id
+		left join project_report_data_two prdt on prdt.project_id = a.id
+		left join rural_project_report_record prr on prr.report_id = prd.id
+		LEFT JOIN project_material_defect_record pmdr on prd.id = pmdr.report_id
+		left join project_paper_filing ppf on ppf.project_id = a.id
+		left join rural_project_report_record_down prrd on prrd.report_id = prd.id
+		where a.office_id = #{officeId} and a.del_flag = '0'
+	</select>
+	<select id="findUseableByProjectName" resultType="RuralProjectRecords">
+		select
+		<include refid="projectRecordsColumns"/>
+		,prd.number AS "projectReportNumber"
+		FROM rural_project_records a
+		left join project_report_data prd on prd.project_id = a.id
+		<include refid="projectRecordsJoins"/>
+		WHERE a.project_name = #{projectName}
+	</select>
+
 
 
 </mapper>

+ 1 - 1
src/main/resources/mappings/modules/sys/OfficeDao.xml

@@ -155,7 +155,7 @@
 			<include refid="officeColumns"/>
 		FROM sys_office a
 		<include refid="officeJoins"/>
-		WHERE a.name = #{name}
+		WHERE a.name = #{name} and a.del_flag = '0'
 	</select>
 	<select id="findList" resultType="Office">
 		SELECT

+ 11 - 0
src/main/resources/mappings/modules/workclientinfo/WorkClientInfoDao.xml

@@ -161,6 +161,17 @@
 		</choose>
 	</select>
 
+	<select id="getAllClient" resultType="WorkClientInfo">
+		SELECT
+		<include refid="workClientInfoColumns"/>
+		,su.name as "userName"
+		FROM work_client_info a
+		<include refid="workClientInfoJoinsLink"/>
+		left join sys_user su on su.id = a.create_by
+		left join sys_office so on so.id = su.office_id
+		where a.del_flag = '0'
+	</select>
+
 	<select id="findAll" resultType="WorkClientInfo" >
 		SELECT
 		<include refid="workClientInfoColumns"/>

+ 79 - 0
src/main/resources/mappings/modules/workcontractinfo/WorkContractInfoDao.xml

@@ -376,6 +376,84 @@
 	</select>
 
 
+	<select id="getListByOffice" resultType="WorkContractInfo">
+		SELECT
+		distinct a.id AS "id",
+		u.name AS "createBy.name",
+		u.name AS "createUser",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.remarks AS "remarks",
+		a.client_id AS "client.id",
+		a.contract_date AS "contractDate",
+		a.effective_date AS "effectiveDate",
+		a.closing_date AS "closingDate",
+		a.name AS "name",
+		a.contract_num_path AS "contractNumPath",
+		a.create_name AS "createName",
+		a.contract_category AS "contractCategory",
+		a.contract_num AS "contractNum",
+		a.contract_price AS "contractPrice",
+		a.contract_opposite AS "contractOpposite",
+		a.contract_type AS "contractType",
+		a.contract_fee AS "contractFee",
+		a.contract_special AS "contractSpecial",
+		a.contract_state AS "contractState",
+		a.office_id AS "chargeCompany",
+		a.charge_company_name AS "chargeCompanyName",
+		a.contract_file_id AS "contractFileId",
+		a.contract_role AS "contractRole",
+		a.apply_view AS "applyView",
+		a.process_instance_id AS "processInstanceId",
+		a.company_id as companyId,
+		a.contractFeeDoc AS "contractFeeDoc",
+		a.contractTypeDoc AS "contractTypeDoc",
+		a.another_contract_num AS "anotherContractNum",
+		client.name AS "client.name",
+		client.name as "clientName",
+		a.is_total AS "isTotal",
+		a.total_contract_id AS "totalContractId",
+		a.status AS "status",
+		a.investment_scale AS "investmentScale",
+		a.summary_payment AS "summaryPayment",
+		a.investment_amount AS "investmentAmount",
+		a.create_bys AS "createBys",
+		a.construction_project_type AS "constructionProjectType",
+		a.invalidate_process_instance_id AS "invalidateProcessInstanceId",
+		a.alter_process_instance_id AS "alterProcessInstanceId",
+		a.invalidate_status AS "invalidateStatus",
+		a.invalidate_user AS "invalidateUserId",
+		a.alter_state AS "alterState",
+		a.alter_sign AS "alterSign",
+		a.record_state AS "recordState",
+		a.alterbefore_id AS "alterBeforeId",
+		a.completion_status AS "completionStatus",
+		a.common_flag AS "commonFlag",
+		a.signature_status as "signatureStatus",
+		a.charge_criterion as "chargeCriterion",
+		a.other_details as "otherDetails",
+		a.contract_information AS "contractInformation",
+		a.letter_of_acceptance_remarks AS "letterOfAcceptanceRemarks",
+		(CASE a.contract_information
+		WHEN '0' THEN '金额合同'
+		WHEN '1' THEN '费率合同'
+		ELSE '' END) as "contractInformationStr",
+		ifnull(a.contract_record_state,0) as "contrractRecordStatus",
+		ifnull(wcr.file_num,"") as "recordNum",
+		wcr.id as "contrractRecordId",
+		a.describe_content AS "describeContent",
+		o.name as "createUserOfficeName"
+		FROM work_contract_info a
+		<include refid="workContractInfoJoins"/>
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
+		left join work_attachment wa on wa.attachment_id = a.id
+		where a.office_id = #{officeId}
+	</select>
+
+
 	<select id="queryCount" resultType="int" >
 		SELECT count(distinct a.id)
 		FROM work_contract_info a
@@ -1482,6 +1560,7 @@
 		a.contract_information as "contractInformation",
 		wcr.file_num as "fileNum",
 		wcr.file_num_tow as "fileNumTow",
+		a.contract_record_state as "contrractRecordStatus"
 		a.describe_content AS "describeContent"
 		FROM work_contract_info a
 		<include refid="workContractInfoJoins"/>

+ 1 - 0
src/main/resources/spring-context-shiro.xml

@@ -16,6 +16,7 @@
             <value>
                 /static/** = anon
                 /userfiles/** = anon
+                ${adminPath}/ccpmList/ccpmList/** = anon
                 ${adminPath}/workMaterialCollect/total/** = anon
                 ${adminPath}/ruralProject/signatureOldMessageDispose/** = anon
                 ${adminPath}/weChatCallBack/** = anon

+ 7 - 0
src/main/webapp/webpage/modules/sys/sysHome.jsp

@@ -947,6 +947,9 @@
         <c:forEach items="${notifyPage}" var="workProjectNotify" varStatus="status">
         <c:if test="${status.index < 8}">
         <c:choose>
+        <c:when test="${workProjectNotify.belongProject eq 'sz'}">
+        xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogre('${workProjectNotify.typeLabel} 待审批', '${ctx}/workprojectnotify/workProjectNotify/form?notifyId=${workProjectNotify.processInstanceId}&type=${workProjectNotify.type}&belongProject=${workProjectNotify.belongProject}','95%','95%')\">";
+        </c:when>
         <c:when test="${workProjectNotify.belongProject eq 'cpa'}">
         xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogre('${workProjectNotify.typeLabel} 待审批', '${ctx}/workprojectnotify/workProjectNotify/form?notifyId=${workProjectNotify.notifyId}&type=${workProjectNotify.type}&belongProject=${workProjectNotify.belongProject}','95%','95%')\">";
         </c:when>
@@ -1076,6 +1079,10 @@
         </c:otherwise>
         </c:choose>
         <c:choose>
+            <c:when test="${workProjectNotify.belongProject eq 'sz'}">
+                elem.append('<li>' + xml + "<span class=\"bord-record-type\" title=\"${fns:getDictLabel(workProjectNotify.type, 'project_notify_type', '')}\">${fns:getDictLabel(workProjectNotify.type, 'project_notify_type', '')}</span><span class=\"bord-record\" title=\"${workProjectNotify.title}\">${workProjectNotify.title}</span>" +
+                    '<span class="bord-record-time">' + '<fmt:formatDate value="${workProjectNotify.createDate}" pattern="yyyy-MM-dd"/>' + '</span></a></li>');
+            </c:when>
             <c:when test="${workProjectNotify.belongProject eq 'cpa'}">
                 elem.append('<li>' + xml + "<span class=\"bord-record-type\" title=\"${workProjectNotify.typeLabel}\">${workProjectNotify.typeLabel}</span><span class=\"bord-record\" title=\"${workProjectNotify.title}\">${workProjectNotify.title}</span>" +
                     '<span class="bord-record-time">' + '<fmt:formatDate value="${workProjectNotify.createDate}" pattern="yyyy-MM-dd"/>' + '</span></a></li>');

文件差异内容过多而无法显示
+ 1033 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceAuditCpa.jsp


+ 955 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceViewCpa.jsp

@@ -0,0 +1,955 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>发票审批</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+	<style>
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+        var count = 0;
+        var numcount=0;//验证导入发票号是否重复
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  // var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+			  // $("#opinion").val(ss);
+              if(obj == 1) {
+              	//非空验证
+				  var ff=true;
+				  $(".judgment").each(function(){
+					  var zhi=$(this).val();
+					  if (''==zhi || null == zhi){
+						  $(this).css("border","1px solid red")
+						  ff=false;
+					  }else{
+						  $(this).css("border","1px solid #f1f1f1")
+					  }
+				  });
+				  if (!ff){
+					  parent.layer.msg("发票号或开票金额未填写完整!", {icon: 5});
+					  return;
+				  }
+                  $("#flag").val("yes");
+              }else {
+				  $("#flag").val("no");
+              }
+              if(  obj == 1 && $("#workAccountList tr").length==0){
+                  top.layer.alert('请添加发票明细!', {icon: 0});
+                  return;
+              }
+
+              var m = ${workInvoice.money};
+              var money = "0.00";
+              //自动计算出结果并填充在相应的输入框中
+              var size = $("#workAccountList tr").length+count;
+              for (var i = 0;i<size;i++){
+                  var _totalMoney = $("#workAccountList"+i+"_totalMoney").val();
+
+                  var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                  if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
+                      if(money==""){
+                          money = parseFloat(_totalMoney).toFixed(2);
+                      }else {
+                          money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
+                      }
+                  }
+              }
+              if(obj == 1 && money != m ){
+                  top.layer.alert('发票明细总开票金额与主信息开票金额不等,请重新填写!', {icon: 0});
+                  return;
+              }
+				var form = $("#inputForm").val()
+			  console.log('form',form)
+			  $("#inputForm").submit();
+			  return true;
+		  }
+		  return false;
+		}
+		$(document).ready(function() {
+
+			//初始化截图功能子页面。
+			$('#orgContent').attr("src","${ctx}/workinvoice/workInvoice/workInvoiceImageEdit");
+
+			layui.use('form', function () {
+				var form = layui.form;
+				form.render();
+			});
+			$("#name").focus();
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+
+            laydate.render({
+                elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+
+            laydate.render({
+                elem: '#takeDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+
+			var radioVal = '${workInvoice.newDrawer}';
+			//专票必填
+			if(radioVal == 1){
+				$(".count2").hide();
+				$(".count1").show();
+			}else if(radioVal == 2){
+				$(".count1").hide();
+				$(".count2").show();
+			}
+
+
+			$("#userImageBtn").click(function () {
+				top.layer.open({
+					type: 2,
+					area: ["750px", "500px"],
+					title: "上传图片",
+					btn: ['提交', '关闭'],
+					content: "${ctx}/sys/user/imageEdit", //  btn: ['确定', '关闭'],
+					yes: function (index, layero) {
+						console.log(1232131)
+						var body = top.layer.getChildFrame('body', index);
+						var inputForm = body.find('#inputForm');
+						console.log(inputForm)
+						var top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+						inputForm.attr("target", top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+						inputForm.validate();
+						if (inputForm.valid()) {
+							loading("正在提交,请稍等...");
+							inputForm.submit();
+						} else {
+							return;
+						}
+
+						top.layer.close(index);//关闭对话框。
+
+					},
+					cancel: function (index) {
+					}
+				});
+			});
+
+
+
+		});
+
+        function addRow(list, idx, tpl, row,flag){
+            var idx1 = $("#workAccountList tr").length;
+            if(list == '#workAccountList' && idx1 < 100){
+                bornTemplete(list, idx, tpl, row, idx1);
+                if($("#invoiceType").val()=="专票"){
+                    $("#workAccountList"+idx+"_code").attr("minlength","10");
+                    $("#workAccountList"+idx+"_code").attr("maxlength","10");
+                }else if($("#invoiceType").val()=="普票"){
+                    $("#workAccountList"+idx+"_code").attr("minlength","12");
+                    $("#workAccountList"+idx+"_code").attr("maxlength","12");
+                }
+                if (idx==0 && flag){
+					$("#workAccountList"+idx+"_totalMoney").val(row);
+				}
+                //$("#workAccountList"+idx+"_number").val(("0000000" + 100000000 * Math.random()).match(/(\d{8})(\.|$)/)[1]);
+                // if(idx>0){
+                //     var i = idx-1;
+                //     var code = $("#workAccountList"+i+"_code").val();
+                //     if(code == null || code == undefined || code == ""){
+				// 		i = idx-2;
+				// 		code = $("#workAccountList"+i+"_code").val();
+                //     }
+                //     $("#workAccountList"+idx+"_code").val(code);
+				//
+				// }
+            }
+        }
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function delRow(obj, prefix) {
+            count++;
+            var id = $(prefix + "_id");
+            var delFlag = $(prefix + "_delFlag");
+            if (id.val() == "") {
+                $(obj).parent().parent().remove();
+            } else if (delFlag.val() == "0") {
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            } else if (delFlag.val() == "1") {
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+            // var idx1 = $("#workAccountList tr").length; //tr 总数
+            // for (var i = 0; i < idx1; i++) {
+            //     $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
+            // }
+        }
+        function isNumber(val){
+            if(val === "" || val ==null){
+                return false;
+            }
+            var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+            if(regPos.test(val) || regNeg.test(val)){
+                return true;
+            }else{
+                return false;
+            }
+
+        }
+        function setVs(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('allPrice','proportion');
+            var value = obj.value;
+            var p = $("#price").val() || 0;
+            if(!p || p == 0){
+                parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+                return;
+            }
+            var num = value/p ;
+            if(!/^\d+(\.\d{1,2})?$/.test( value )){
+                parent.layer.msg("合价必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+            }
+        }
+        function setTaxMoney(obj){
+            var a = $(obj).attr("id");
+            //金额
+            var b = a.replace('tax','taxMoney');
+            //开票金额
+            var t = a.replace('tax','totalMoney');
+            //税额
+            var tr = a.replace('tax','taxRate');
+            var value = obj.value || 0;
+            if(!value){
+                parent.layer.msg("请正确填写税率",{icon:5});
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                return;
+			}
+            var m = ${workInvoice.money};
+            var t2 = $("#" +  t ).val();
+            if(!/^\d+(\.\d{1,4})?$/.test( t2 )){
+                parent.layer.msg("请正确填写开票金额",{icon:5});
+                return;
+            }/*else if(t2 > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }*/
+            var tax = 1 + value/100;
+            var p = $("#" +  t ).val() || 0;//获取开票金额
+            if(!p || p == 0){
+                parent.layer.msg("请先填写开票金额,且不能为零",{icon:5});
+                return;
+            }
+            var num = p/tax || 0;
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+                var taxRate = p - num;
+                $("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+        }
+        function setCheck(obj){
+            var aa = $(obj).attr("id");
+			//金额
+            var b = aa.replace('totalMoney','taxMoney');
+			//税额
+            var tr = aa.replace('totalMoney','taxRate');
+			//开票金额
+			var t = aa.replace('totalMoney','totalMoney');
+			var tm = $("#" +  t ).val();
+			//税率
+			var sl = aa.replace('totalMoney','tax');
+			var sc = $("#" +  sl ).val();
+			//处理百分比税率
+			var tax = 1 + sc/100;
+
+            $("#" +  b ).val("");
+            $("#" +  tr ).val("");
+            var m = ${workInvoice.money};
+            var a = obj.value;
+            /*if(a > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }else{*/
+				var num = tm/tax || 0;
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = tm - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			/*}*/
+        }
+        function getMoney(value,obj){
+			/*var aa = $(obj).attr("id");
+            //金额
+            var b = aa.replace('totalMoney','taxMoney');
+            console.log("b====="+b);
+            //税额
+            var tr = aa.replace('totalMoney','taxRate');
+            //开票金额
+            var t = aa.replace('totalMoney','totalMoney');
+            var tm = $("#" +  t ).val();
+            //税率
+            var sl = aa.replace('totalMoney','tax');
+            var sc = $("#" +  sl ).val();
+            //处理百分比税率
+            var tax = 1 + sc/100;
+
+            var m = ${workInvoice.money};
+            var money = "0.00";
+            //自动计算出结果并填充在相应的输入框中
+            var size = $("#workAccountList tr").length+count;
+            for (var i = 0;i<size;i++){
+                var _totalMoney = $("#workAccountList"+i+"_totalMoney").val();
+
+                var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
+                    if(money==""){
+                        money = parseFloat(_totalMoney).toFixed(2);
+                    }else {
+                        money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
+                    }
+                }
+            }
+            if(money >m){
+                console.log("money--------"+money);
+                $("#" + aa ).val("");
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("发票明细开票金额总值大于主申请发票开票金额",{icon:5});
+                return;
+			}else{
+				var num = tm/tax || 0;
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = tm - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			}*/
+        }
+        function setV(obj){
+            var a =  $(obj).attr("id");
+            var c = "京";
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+            var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }
+        function checkSame(obj){
+            var value =obj.value;
+            var a = $(obj).attr("id");
+            var idx = a.replace('_number','');
+            var idxx = idx.replace('workAccountList','')
+            var b = a.replace('number','oldNumber');
+            var oldValue = $("#" +  b ).val();
+            var size = $("#workAccountList tr").length+count;
+            for (var i = 0;i<size;i++){
+                var _number = $("#workAccountList"+i+"_number").val();
+                var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                if (_number!=undefined&& delFlag==0 && i!= idxx ){
+                    if(_number == value){
+                        $("#" +  a ).val("");
+                        numcount++;
+                        parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+                        return;
+                    }
+                }
+            }
+                $.ajax({
+                    type:'post',
+                    url:'${ctx}/workinvoicedetail/workInvoiceDetail/checkSame',
+                    data:{
+                        "number":value,"oldNumber":oldValue
+                    },
+                    success:function(data){
+                        if("false" == data){
+                            $("#" +  a ).val("");
+                            numcount++;
+                            parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+                            return;
+                        }
+                    }
+                })
+        }
+        function openDialogreExcel(title,url,width,height,target){
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 1,
+                area: [500,300],
+                title:"导入数据",
+                skin: 'three-btns with-demo',
+                content:$("#import").html() ,
+                btn: ['导入全部','仅导入当前纳税人识别号', '关闭'],
+                btn1: function(index, layero){
+                    var impType='0';
+                    importExcel(impType,url)
+                    top.layer.close(index);
+                },
+                btn2: function(index, layero){
+                    var impType='1';
+                    importExcel(impType,url)
+                    top.layer.close(index);
+                },
+                btn3: function(index){
+                    top.layer.close(index);
+                }
+
+
+            });
+        }
+        function importExcel(impType,url){
+            var orUnicode=$("#orUnicode").val();
+            var invoiceType=$("#invoiceType").val();
+            url=url+"?impType="+encodeURIComponent(impType)+"&orUnicode="+encodeURIComponent(orUnicode)+"&invoiceType="+encodeURIComponent(invoiceType);
+            var formData = new FormData();
+            formData.append("file",top.$("#uploadFile")[0].files[0]);
+            var obj =top.$("#uploadFile")[0].files[0];
+            if(obj==undefined){
+                parent.layer.alert('请选择上传文件',{icon:0,title:'系统提示'});
+                return;
+            }
+            var fileType = obj.name;
+            if(!fileType.endWith("xml")){
+                top.layer.alert('请上传*.xml格式的文件',{icon:0,title:'系统提示'});
+                return;
+            }
+
+            $.ajax({
+                type: 'post',
+                url:url,
+                data: formData,
+                dataType: "json",
+                cache: false,
+                processData: false,
+                contentType: false,
+            }).success(function (data) {
+                for (var i = 0; i < data.data.length; i++) {
+                    addExcelRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data.data[i]);
+                    if($("#invoiceType").val()=="专票"){
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","10");
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","10");
+					}else if($("#invoiceType").val()=="普票"){
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","12");
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","12");
+					}
+                    workAccountListRowIdx=workAccountListRowIdx+1;
+                }
+                if(numcount>0){
+                    top.layer.alert(data.message+" 存在发票号重复数据!",{icon:5});
+				}else{
+                    top.layer.alert(data.message,{icon:5});
+				}
+
+            }).error(function () {
+                top.layer.msg("导入文件失败!");
+            });
+		}
+        function addExcelRow(list, idx, tpl, row){
+            var idx1 = $("#workAccountList tr").length;
+			bornTemplete(list, idx, tpl, row, idx1);
+			$("#workAccountList"+idx+"_number").change();
+        }
+
+
+		function insertTemporaryFile(tValue,fileName){
+			var list = "${workInvoice.workAttachments}";
+			var size = (list.split('url')).length-1;
+
+			var temporaryFilePath = tValue;
+			const file = new File([temporaryFilePath], fileName); // 创建File对象
+			var attachmentId = "";
+			var attachmentFlag = "115";
+			var timestamp = new Date().getTime();
+
+			var storeAs = "workInvoice";
+			var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+			/*将这段字符串存到数据库即可*/
+			var divId = "_attachment";
+			$("#addFile" + divId).show();
+			temporaryMultitest(storeAs, file,temporaryFilePath, attachmentId, attachmentFlag, uploadPath, divId, size);
+		}
+
+
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+	<form:form id="inputForm" modelAttribute="workInvoice" enctype="multipart/form-data" action="${ctx}/cpa_finance/saveAudit" method="post" class="form-horizontal layui-form">
+		<form:hidden path="id"/>
+		<form:hidden path="home"/>
+<%--		<form:hidden path="act.taskId"/>--%>
+<%--		<form:hidden path="act.taskName"/>--%>
+<%--		<form:hidden path="act.taskDefKey"/>--%>
+		<form:hidden path="processInstanceId"/>
+<%--		<form:hidden path="act.procDefId"/>--%>
+		<form:hidden id="flag" path="act.flag"/>
+		<form:hidden id="type" path="type"/>
+<%--		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">--%>
+		<div class="form-group layui-row first lw14">
+			<div class="form-group-label"><h2>基本信息</h2></div>
+			<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+				<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="200px"><font color="red">*</font>项目名称</th>
+						<th width="200px">合同名称</th>
+						<th width="200px">项目编号</th>
+						<th width="200px">委托方</th>
+						<th width="200px">报告号</th>
+<%--						<th width="100px">操作</th>--%>
+					</tr>
+					</thead>
+					<tbody id="workInvoiceProjectRelationList">
+						<c:forEach items="${workInvoice.workInvoiceProjectRelationList}" var="list">
+							<tr>
+								<td>
+									<input type="text" value="${list.projectName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.workContractName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td style="text-align:center;">
+									<input type="text" value="${list.projectNum}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.clientName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.reportDataNum}" readonly="readonly"  class="form-control"/>
+								</td>
+<%--								<td class="text-center op-td" >--%>
+<%--									{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}--%>
+<%--								</td>--%>
+							</tr>
+						</c:forEach>
+					</tbody>
+				</table>
+			</div>
+		</div>
+		<div class="form-group layui-row first lw14">
+			<div class="form-group-label"><h2>发票详情</h2></div>
+			<%--<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item">*</span>上级/本公司开票:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+				</div>
+			</div>--%>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item" style=" font-weight: bold;">*<c:choose><c:when test="${workInvoice.invoiceType eq '2'}">发票类型:</c:when></c:choose></span><c:choose><c:when test="${workInvoice.invoiceType eq '1'}">发票类型:</c:when></c:choose></label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true" id="invoiceType"  class="form-control layui-input" <c:choose><c:when test="${workInvoice.invoiceType eq '2'}"> style=" font-weight: bold;color: red;" </c:when></c:choose> value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item">*</span>开票类型:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true" id="newDrawer"  class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.newDrawer eq '1'}">企业开票</c:when><c:when test="${workInvoice.newDrawer eq '2'}">个人开票</c:when></c:choose>"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 count1">
+				<label class="layui-form-label"><span class="require-item">*</span>实际开票单位:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.client.name}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 count1">
+				<label class="layui-form-label">纳税人识别号:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true" id="orUnicode"   class="form-control layui-input" value="${workInvoice.orUnicode}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 count1">
+				<label class="layui-form-label">地址:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.address}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 count1">
+				<label class="layui-form-label">电话:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.telephone}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 count1">
+				<label class="layui-form-label">开户银行:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.bank}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6 count1">
+				<label class="layui-form-label">银行账号:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.bankNumber}"/>
+				</div>
+			</div>
+
+			<div class="layui-item layui-col-sm6 count2">
+				<label class="layui-form-label">姓名:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.newDrawerName}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">收款类型:</label>
+				<div class="layui-input-block">
+					<input id="chargeType" htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.chargeType}" />
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开票内容:</label>
+				<div class="layui-input-block">
+					<input id="billingContent" htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.billingContent}" />
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item">*</span>开票金额(元):</label>
+				<div class="layui-input-block">
+					<input id="kaipiao" htmlEscape="false" readonly="true"   class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="##00.00"/>"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开票内容要求:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.content}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开票人:</label>
+				<div class="layui-input-block">
+					<form:input   path="drawerName" value="${workInvoice.drawerName}" htmlEscape="false" readonly="true"  class="form-control layui-input"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开票时间:</label>
+				<div class="layui-input-block">
+					<input readonly="true" class="form-control layer-date laydate-icon layui-input laydate-icondate" id="invoiceDate" name="invoiceDateCpa" value="<fmt:formatDate
+							value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>">
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">领票时间:</label>
+				<div class="layui-input-block">
+					<input readonly="true" placeholder="请选择领票时间" class="form-control layer-date laydate-icon layui-input laydate-icondate" id="takeDate" name="takeDateCpa" value="<fmt:formatDate
+							value="${workInvoice.takeDate}" pattern="yyyy-MM-dd"/>">
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">实际开票人:</label>
+				<div class="layui-input-block  with-icon">
+					<input type="text"  readonly="true" value="${workInvoice.actualDrawerName}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">接收邮箱:</label>
+				<div class="layui-input-block  with-icon">
+					<input type="text"  readonly="true" value="${workInvoice.actualDrawerEmailAddress}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">对账人:</label>
+				<div class="layui-input-block  with-icon">
+					<input type="text"  readonly="true" value="${workInvoice.accountCheckingUserName}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">对账地区:</label>
+				<div class="layui-input-block  with-icon">
+					<input type="text"  readonly="true" value="${workInvoice.area.name}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm12 with-textarea">
+				<label class="layui-form-label double-line">备注:</label>
+				<div class="layui-input-block">
+					<form:textarea path="remarks" value="${workInvoice.remarks}" readonly="true" htmlEscape="false" rows="4" class="form-control" style="background-color: #f1f1f1" />
+				</div>
+			</div>
+
+			<div>
+
+			</div>
+		</div>
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>附件信息</h2></div>
+			<span id="attachment_title"></span>
+			<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+				<table id="upTable" class="table table-bordered table-condensed details">
+					<thead>
+					<tr>
+							<%-- <th>序号</th>--%>
+						<th>文件预览</th>
+						<th>上传人</th>
+						<th>上传时间</th>
+						<th width="200px">操作</th>
+					</tr>
+					</thead>
+					<tbody id="file_attachment">
+					<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+						<tr>
+								<%-- <td>${status.index + 1}</td>--%>
+							<c:choose>
+								<c:when test="${workInvoice.uploadMode == 2}">
+									<c:choose>
+										<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+											<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+										</c:when>
+										<c:otherwise>
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+													<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+												</c:when>
+												<c:otherwise>
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+															<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+														</c:when>
+														<c:otherwise>
+															<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+														</c:otherwise>
+													</c:choose>
+												</c:otherwise>
+											</c:choose>
+										</c:otherwise>
+									</c:choose>
+								</c:when>
+								<c:otherwise>
+									<c:choose>
+										<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+											<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+										</c:when>
+										<c:otherwise>
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+													<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+												</c:when>
+												<c:otherwise>
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+															<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+														</c:when>
+														<c:otherwise>
+															<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+														</c:otherwise>
+													</c:choose>
+												</c:otherwise>
+											</c:choose>
+										</c:otherwise>
+									</c:choose>
+								</c:otherwise>
+							</c:choose>
+							<td>${workClientAttachment.createBy.name}</td>
+							<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+							<td class="op-td">
+								<div class="op-btn-box" >
+										<%--附件下载删除--%>
+									<c:choose>
+										<c:when test="${workInvoice.uploadMode == 2}">
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+													<a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+												</c:when>
+												<c:otherwise>
+													<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+												</c:otherwise>
+											</c:choose>
+										</c:when>
+										<c:otherwise>
+											<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+										</c:otherwise>
+									</c:choose>
+									<c:if test="${workClientAttachment.collectFlag != 1}">
+										<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
+									</c:if>
+
+
+								</div>
+							</td>
+						</tr>
+					</c:forEach>
+					</tbody>
+				</table>
+			</div>
+		</div>
+
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>发票明细</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container">
+				<table id="contentTable" class="table table-bordered table-condensed details">
+					<thead>
+					<tr>
+						<th>发票代码</th>
+						<th><span class="require-item">*</span>发票号</th>
+						<th><span class="require-item">*</span>开票金额</th>
+						<th>税率</th>
+						<th>金额</th>
+						<th>税额</th>
+							<%--<th>累计登记金额</th>--%>
+<%--						<th>发票状态</th>&lt;%&ndash;正常&ndash;%&gt;--%>
+<%--						<th>被退标记</th>--%>
+							<%--<th><span class="require-item">*</span>被退票号</th>
+							<th><span class="require-item">*</span>开票日期</th>--%>
+					</tr>
+					</thead>
+					<tbody id="workAccountList">
+					<c:if test="${not empty workInvoice.workAccountList}">
+						<c:forEach items="${workInvoice.workAccountList}" var="workAccount" varStatus="index">
+							<tr id="workAccountList${index.index}">
+								<td title="${workAccount.code}">
+										${workAccount.code}
+								</td>
+								<td title="${workAccount.number}">
+										${workAccount.number}
+								</td>
+
+								<td title="<fmt:formatNumber value="${workAccount.totalMoney}" pattern="##00.00"/>">
+									<fmt:formatNumber value="${workAccount.totalMoney}" pattern="##00.00"/>
+								</td>
+								<td title="${workAccount.tax}">
+										${workAccount.tax}
+								</td>
+								<td title="<fmt:formatNumber value="${workAccount.taxMoney}" pattern="#,#00.00"/>">
+									<fmt:formatNumber value="${workAccount.taxMoney}" pattern="##00.00"/>
+								</td>
+								<td title="<fmt:formatNumber value="${workAccount.taxRate}" pattern="#,#00.00"/>">
+									<fmt:formatNumber value="${workAccount.taxRate}" pattern="##00.00"/>
+								</td>
+
+							</tr>
+						</c:forEach>
+					</c:if>
+					</tbody>
+				</table>
+			</div>
+		</div>
+
+
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>${projectNotifyType}&nbsp;审批流程</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<table id="hisTaskTable" class="table table-bordered table-condensed no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="200px">执行环节</th>
+						<th width="160px">执行人</th>
+						<th width="200px">开始时间</th>
+						<th width="200px">结束时间</th>
+						<th width="180px">审批意见</th>
+						<th width="180px">任务历时</th>
+					</tr>
+					</thead>
+					<tbody id="hisTaskList">
+					<c:if test="${not empty hisTaskList}">
+						<c:forEach items="${hisTaskList}" var="task" varStatus="index">
+							<tr>
+								<td class="hide">
+								</td>
+								<c:choose>
+									<c:when test="${task.histIns.endTime != null && task.histIns.endTime != '' && task.histIns.endTime != undefined}">
+										<td>
+											<span title="${task.histIns.activityName}" class="bluetd">${task.histIns.activityName}</span>
+										</td>
+									</c:when>
+									<c:otherwise>
+										<td>
+											<span title="${task.histIns.activityName}" class="redtd">${task.histIns.activityName}</span>
+										</td>
+									</c:otherwise>
+								</c:choose>
+								<td>
+										${task.assigneeName}
+								</td>
+								<td>
+										${task.histIns.startTime}
+								</td>
+								<td>
+										${task.histIns.endTime}
+								</td>
+								<td>
+									[${task.comment.status}]${task.comment.message}
+								</td>
+								<td>
+										${
+												task.durationTime == "" || task.durationTime == null || task.durationTime == undefined
+														? "0秒"
+														: task.durationTime
+												}
+								</td>
+							</tr>
+						</c:forEach>
+					</c:if>
+					</tbody>
+				</table>
+			</div>
+		</div>
+		<div class="form-group layui-row page-end"></div>
+	</form:form>
+
+	</div>
+</div>
+</body>
+</html>

+ 21 - 5
src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp

@@ -648,7 +648,11 @@
                         return "<span title='"+ d.step +"'>" + d.step + "</span>";
                     }}
                 ,{align:'center', title: '标题', minWidth:150,templet:function(d){
-					if(d.belongProject == "cpa") {
+						if(d.belongProject == "sz") {
+							return "<a class=\"attention-info\"  href=\"javascript:void(0)\" onclick=\"openDialogre('"+ d.typeLabel +"待审批', '${ctx}/workprojectnotify/workProjectNotify/form?type="+d.type+"&notifyId="+d.processInstanceId+"&belongProject="+d.belongProject+"&home=notifyList','95%','95%')\">" +
+									"<span title=\""+ d.title +"\">"+ d.title +"</span>" +
+									"</a>";
+						}else if(d.belongProject == "cpa") {
 						return "<a class=\"attention-info\"  href=\"javascript:void(0)\" onclick=\"openDialogre('"+ d.typeLabel +"待审批', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&type="+d.type+"&notifyId="+d.notifyId+"&belongProject="+d.belongProject+"&home=notifyList','95%','95%')\">" +
 								"<span title=\""+ d.title +"\">"+ d.title +"</span>" +
 								"</a>";
@@ -1169,14 +1173,18 @@
 						}
                     }}
                 ,{align:'center',title: '审核人', width:80,templet:function(d){
-						if (d.belongProject == "cpa") {
+						if (d.belongProject == "sz") {
+							return "<span title='"+ d.auditUserName +"'>" + d.auditUserName + "</span>";
+						} else if (d.belongProject == "cpa") {
 							return "<span title='"+ d.auditUserName +"'>" + d.auditUserName + "</span>";
 						} else {
 							return "<span title='"+ d.submit +"'>" + d.submit + "</span>";
 						}
                     }}
                 ,{align:'center',title: '审批状态',width:100,templet:function(d){
-						if (d.belongProject == "cpa") {
+						if (d.belongProject == "sz") {
+							return "<span title='"+ d.remarks +"'>" + d.remarks + "</span>";
+						} else if (d.belongProject == "cpa") {
 							return "<span title='"+ d.remarks +"'>" + d.remarks + "</span>";
 						} else {
 							return "<span title='"+ d.status1 +"'>" + d.status1 + "</span>";
@@ -1186,7 +1194,9 @@
                         return "<span title='"+ d.date +"'>" + d.ymddate + "</span>";
                     }}*/
                 ,{align:'center', title: '开始时间', width:180,templet:function(d){
-						if (d.belongProject == "cpa") {
+						if (d.belongProject == "sz") {
+							return "<span title='"+ d.createDate +"'>" + d.createDate + "</span>";
+						} else if (d.belongProject == "cpa") {
 							return "<span title='"+ d.createDate +"'>" + d.createDate + "</span>";
 						} else {
 							return "<span title='"+ d.wapCreateDate +"'>" + d.wapCreateDate + "</span>";
@@ -1211,7 +1221,12 @@
 					,"isreply":"2"
 					</c:if>
                     ,"content":"${workProjectNotify.content}"
-                    ,"initiator":"${fns:getUserById(workProjectNotify.initiator).name}"
+					<c:if test="${workProjectNotify.belongProject == 'sz'}">
+					,"initiator":"${workProjectNotify.initiator}"
+					</c:if>
+					<c:if test="${workProjectNotify.belongProject != 'sz'}">
+					,"initiator":"${fns:getUserById(workProjectNotify.initiator).name}"
+					</c:if>
                     ,"auditorName":"${fns:getUserById(workProjectNotify.auditor).name}"
                     ,"submit":"${fns:getUserById(workProjectNotify.createBy.id).name}"
 					,"status":"${workProjectNotify.status}"
@@ -1228,6 +1243,7 @@
 					,"createUserName":"${workProjectNotify.createUserName}"
 					,"notifyId":"${workProjectNotify.notifyId}"
 					,"auditUserName":"${workProjectNotify.auditUserName}"
+					,"processInstanceId":"${workProjectNotify.processInstanceId}"
                 }
                 </c:forEach>
                 </c:if>

+ 20 - 4
src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyReadBacklogList.jsp

@@ -523,13 +523,21 @@
                 // {checkbox: true, fixed: true},
                 {field:'index',align:'center',  width:40,title: '序号'}
                 ,{align:'center', title: '类型', width:100,templet:function(d){
-                        return "<span title='"+ d.type1 +"'>" + d.type1 + "</span>";
+                	if (d.belongProject == 'sz'){
+						return "<span title='"+ d.type +"'>" + d.type + "</span>";
+					}else {
+						return "<span title='"+ d.type1 +"'>" + d.type1 + "</span>";
+					}
                     }}
                 ,{align:'center', title: '环节', width:120,templet:function(d){
                         return "<span title='"+ d.step +"'>" + d.step + "</span>";
                     }}
                 ,{align:'center', title: '标题', minWidth:150,templet:function(d){
-                	if (d.isreply == "1"){
+						if (d.belongProject == "sz"){
+							return "<a class=\"attention-info\"  href=\"javascript:void(0)\" onclick=\"openDialogView('"+ d.type +"', '${ctx}/workprojectnotify/workProjectNotify/form?notifyId="+d.processInstanceId+"&belongProject="+d.belongProject+"&type="+d.ccpmKey+"&view=view','95%','95%')\">" +
+									"<span title=\""+ d.title +"\">"+"【通过】"+ d.title +"</span>" +
+									"</a>";
+						} else if (d.isreply == "1"){
 						return "<a class=\"attention-info\"  href=\"javascript:void(0)\" onclick=\"openDialogView('"+ d.type1 +"', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&view=view','95%','95%')\">" +
 								"<span title=\""+ d.title +"\" style=\"color: red;\">"+"【驳回】"+ d.title +"</span>" +
 								"</a>";
@@ -547,7 +555,11 @@
                         return "<span title='"+ d.content +"'>" + d.content + "</span>";
                     }}
                 ,{align:'center',title: '提交人', width:80,templet:function(d){
-                        return "<span title='"+ d.submit +"'>" + d.submit + "</span>";
+                		if (d.belongProject == 'sz'){
+							return "<span title='"+ d.cpaSubmit +"'>" + d.cpaSubmit + "</span>";
+						}else {
+							return "<span title='"+ d.submit +"'>" + d.submit + "</span>";
+						}
                     }}
                 /*,{field:'op',align:'center', title: '创建时间', width:140,templet:function(d){
                         return "<span title='"+ d.date +"'>" + d.ymddate + "</span>";
@@ -566,6 +578,9 @@
                 {
                     "index":"${index.index+1}"
                     ,"id":"${workProjectNotify.id}"
+                    ,"belongProject":"${workProjectNotify.belongProject}"
+                    ,"processInstanceId":"${workProjectNotify.processInstanceId}"
+                    ,"ccpmKey":"${workProjectNotify.defKey}"
                     ,"type":"${workProjectNotify.type}"
                     ,"type1":"${fns:getDictLabel(workProjectNotify.type, 'project_notify_type', '')}"
                     ,"step":"${workProjectNotify.notifyRole}"
@@ -577,7 +592,8 @@
 					,"isreply":"2"
 					</c:if>
                     ,"content":"${workProjectNotify.content}"
-                    ,"submit":"${fns:getUserById(workProjectNotify.createBy.id).name}"
+					,"cpaSubmit":"${workProjectNotify.initiator}"
+					,"submit":"${fns:getUserById(workProjectNotify.createBy.id).name}"
 					,"status":"${workProjectNotify.status}"
                     ,"status1":"${fns:getDictLabel(workProjectNotify.status, 'project_notify_class', '')}"
                     ,"date":"<fmt:formatDate value="${workProjectNotify.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"