Explorar o código

访问其他系统

lizhenhao %!s(int64=2) %!d(string=hai) anos
pai
achega
4f0c7b3bcf
Modificáronse 19 ficheiros con 1603 adicións e 99 borrados
  1. 129 80
      src/main/java/com/jeeplus/modules/act/web/ActTaskController.java
  2. 42 0
      src/main/java/com/jeeplus/modules/centerservice/config/RestTemplateConfig.java
  3. 49 0
      src/main/java/com/jeeplus/modules/centerservice/service/cpa/reimbursement/ReimbursementRequest.java
  4. 234 0
      src/main/java/com/jeeplus/modules/centerservice/service/cpa/reimbursement/ReimbursementService.java
  5. 62 0
      src/main/java/com/jeeplus/modules/centerservice/service/cpa/task/TaskFlowRequest.java
  6. 43 0
      src/main/java/com/jeeplus/modules/centerservice/service/cpa/task/TaskFlowService.java
  7. 154 0
      src/main/java/com/jeeplus/modules/centerservice/utils/ConvertServiceUtil.java
  8. 95 0
      src/main/java/com/jeeplus/modules/centerservice/utils/RestTemplateService.java
  9. 60 0
      src/main/java/com/jeeplus/modules/centerservice/web/cpa/reimbursement/ReimbursementController.java
  10. 12 4
      src/main/java/com/jeeplus/modules/sys/web/LoginController.java
  11. 27 0
      src/main/java/com/jeeplus/modules/workprojectnotify/entity/WorkProjectNotify.java
  12. 5 0
      src/main/java/com/jeeplus/modules/workprojectnotify/service/WorkProjectNotifyService.java
  13. 80 3
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  14. 9 0
      src/main/java/com/jeeplus/modules/workreimbursement/entity/WorkReimbursement.java
  15. 78 0
      src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementController.java
  16. 8 0
      src/main/resources/jeeplus.properties
  17. 13 3
      src/main/webapp/webpage/modules/sys/sysHome.jsp
  18. 39 9
      src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp
  19. 464 0
      src/main/webapp/webpage/modules/workreimbursement/workReimbursementAuditCpa.jsp

+ 129 - 80
src/main/java/com/jeeplus/modules/act/web/ActTaskController.java

@@ -3,6 +3,10 @@
  */
 package com.jeeplus.modules.act.web;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.Collections3;
 import com.jeeplus.common.utils.DateUtils;
@@ -30,16 +34,14 @@ import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 流程个人任务相关Controller
@@ -105,6 +107,30 @@ public class ActTaskController extends BaseController {
 	 */
 	@RequestMapping(value = "histoicFlow")
 	public String histoicFlow(Act act, String startAct, String endAct, Model model){
+		List<Act> histoicFlows = histoicFlowList(act, startAct, endAct);
+		model.addAttribute("histoicFlowList", histoicFlows);
+		return "modules/act/actTaskHistoricFlow";
+	}
+
+	/**
+	 * 获取流转历史列表
+	 * @param startAct 开始活动节点名称
+	 * @param endAct 结束活动节点名称
+	 */
+	@RequestMapping(value = "getHistoicFlowList", method = RequestMethod.GET)
+	@ResponseBody
+	public String getHistoicFlowList(Act act, String startAct, String endAct){
+		// 这里不直接返回 List<Act> ,这个Act类直接responseBody返回会报错 ,由于不了解有哪里在使用Act类 ,所以选择下面这种方式返回数据
+		List<Act> histoicFlows = histoicFlowList(act, startAct, endAct);
+		if (Objects.nonNull(histoicFlows)) {
+			String jsonString = JSON.toJSONString(histoicFlows, SerializerFeature.IgnoreNonFieldGetter);
+			return jsonString;
+		}
+		return new String();
+	}
+
+	public List<Act> histoicFlowList(Act act, String startAct, String endAct) {
+		List<Act> histoicFlows = new ArrayList<>();
 		if (StringUtils.isNotBlank(act.getProcInsId())){
 			WorkActivityProcess workActivityProcess = new WorkActivityProcess();
 			workActivityProcess.setProcessInstanceId(act.getProcInsId());
@@ -115,7 +141,6 @@ public class ActTaskController extends BaseController {
 			workActivityProcess.setIsApproval("0");
 			List<WorkActivityProcess> lists = workActivityProcessService.findByProcInsIdAudit(workActivityProcess);
 			List<WorkActivityProcess> beginList = workActivityProcessService.findByProcInsIdAndIsApproval(workActivityProcess);
-			List<Act> histoicFlows = new ArrayList<>();
 			Date beginDate = new Date();
 			String userName = "";
 			Date endDate = new Date();
@@ -296,7 +321,7 @@ public class ActTaskController extends BaseController {
 							a.setRoleName("签约人");
 						}else if("sqr".equals(role.getEnname())){
 							a.setRoleName("申请人");
-                            a.setAssigneeName(UserUtils.get(lists.get(lists.size() - 1).getCreateBy().getId()).getName());
+							a.setAssigneeName(UserUtils.get(lists.get(lists.size() - 1).getCreateBy().getId()).getName());
 						}else {
 							if (role.getEnname().contains(buffer)){
 								SysRoleActivity r = systemService.getRoleActivityByEnname(role.getEnname());
@@ -324,9 +349,8 @@ public class ActTaskController extends BaseController {
 					}
 				}
 			}
-			model.addAttribute("histoicFlowList", histoicFlows);
 		}
-		return "modules/act/actTaskHistoricFlow";
+		return histoicFlows;
 	}
 
 
@@ -573,84 +597,92 @@ public class ActTaskController extends BaseController {
 	@RequestMapping(value = "flowChart")
 	public String flowChart(Act act, String startAct, String endAct, Model model){
 		if (StringUtils.isNotBlank(act.getProcInsId())){
-			WorkActivityProcess workActivityProcess = new WorkActivityProcess();
-			workActivityProcess.setProcessInstanceId(act.getProcInsId());
+			List<Act> histoicFlows = getFlowChart(act, startAct, endAct);
+			model.addAttribute("histoicFlowList", histoicFlows);
+		}
+		return "modules/act/actTaskFlowChart";
+	}
+
+	/**
+	 * 获取流程流向图
+	 * @param act 流程实例
+	 * @param startAct 开始活动节点名称
+	 * @param endAct 结束活动节点名称
+	 */
+	@RequestMapping(value = "getFlowChart",method = RequestMethod.GET)
+	@ResponseBody
+	public String getFlowChartList(Act act, String startAct, String endAct){
+		// 这里不直接返回 List<Act> ,这个Act类直接responseBody返回会报错 ,由于不了解有哪里在使用Act类 ,所以选择下面这种方式返回数据
+		if (StringUtils.isNotBlank(act.getProcInsId())){
+			List<Act> histoicFlows = getFlowChart(act, startAct, endAct);
+			if (Objects.nonNull(histoicFlows)) {
+				String jsonString = JSON.toJSONString(histoicFlows, SerializerFeature.IgnoreNonFieldGetter);
+				return jsonString;
+			}
+		}
+		return new String();
+	}
+
+	public List<Act> getFlowChart(Act act, String startAct, String endAct) {
+		WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+		workActivityProcess.setProcessInstanceId(act.getProcInsId());
 			/*List<Act> histoicFlows = new ArrayList<>();
 			List<Act> histoicFlowList = actTaskService.histoicFlowList(act.getProcInsId(), startAct, endAct);
 			histoicFlows = getList(histoicFlowList);*/
-			List<WorkActivityProcess> list = workActivityProcessService.findByProcInsId(workActivityProcess);
-			workActivityProcess.setIsApproval("0");
-			List<WorkActivityProcess> lists = workActivityProcessService.findByProcInsId(workActivityProcess);
-			List<Act> histoicFlows = new ArrayList<>();
-			if (lists!=null && lists.size()!=0){
-				if (list!=null && list.size()!=0){
-					WorkActivityProcess activityProcess = list.get(list.size()-1);
-					Act a = new Act();
-					if (activityProcess.getActivity() ==null){
-						a.setTaskName("重申|撤销");
-					}else if (activityProcess.getActivity().getUser()!=null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())){
-						a.setTaskName(activityProcess.getActivity().getName());
-					}else{
-						a.setTaskName(activityProcess.getActivity().getName());
-					}
-					a.setComment(activityProcess.getRemarks());
-					histoicFlows.add(a);
-				}else {
-					Act act1 = new Act();
-					act1.setTaskName("开始");
-					histoicFlows.add(act1);
+		List<WorkActivityProcess> list = workActivityProcessService.findByProcInsId(workActivityProcess);
+		workActivityProcess.setIsApproval("0");
+		List<WorkActivityProcess> lists = workActivityProcessService.findByProcInsId(workActivityProcess);
+		List<Act> histoicFlows = new ArrayList<>();
+		if (lists!=null && lists.size()!=0){
+			if (list!=null && list.size()!=0){
+				WorkActivityProcess activityProcess = list.get(list.size()-1);
+				Act a = new Act();
+				if (activityProcess.getActivity() ==null){
+					a.setTaskName("重申|撤销");
+				}else if (activityProcess.getActivity().getUser()!=null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())){
+					a.setTaskName(activityProcess.getActivity().getName());
+				}else{
+					a.setTaskName(activityProcess.getActivity().getName());
+				}
+				a.setComment(activityProcess.getRemarks());
+				histoicFlows.add(a);
+			}else {
+				Act act1 = new Act();
+				act1.setTaskName("开始");
+				histoicFlows.add(act1);
+			}
+			if (lists.size()==1){
+				WorkActivityProcess activityProcess = lists.get(0);
+				Act a = new Act();
+				if (activityProcess.getActivity() ==null) {
+					a.setTaskName("重申|撤销");
+				}else if (activityProcess.getActivity().getUser()!=null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())){
+					a.setTaskName(activityProcess.getActivity().getName());
+				}else{
+					a.setTaskName(activityProcess.getActivity().getName());
 				}
-				if (lists.size()==1){
-					WorkActivityProcess activityProcess = lists.get(0);
+				histoicFlows.add(a);
+				Act act1 = new Act();
+				act1.setTaskName("结束");
+				histoicFlows.add(act1);
+			}else {
+				for (int i = 0; i < 2; i++) {
+					WorkActivityProcess activityProcess = lists.get(i);
 					Act a = new Act();
-					if (activityProcess.getActivity() ==null) {
+					if (activityProcess.getActivity() == null) {
 						a.setTaskName("重申|撤销");
-					}else if (activityProcess.getActivity().getUser()!=null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())){
+					} else if (activityProcess.getActivity().getUser() != null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())) {
 						a.setTaskName(activityProcess.getActivity().getName());
-					}else{
+					} else {
 						a.setTaskName(activityProcess.getActivity().getName());
 					}
 					histoicFlows.add(a);
-					Act act1 = new Act();
-					act1.setTaskName("结束");
-					histoicFlows.add(act1);
-				}else {
-					for (int i = 0; i < 2; i++) {
-						WorkActivityProcess activityProcess = lists.get(i);
-						Act a = new Act();
-						if (activityProcess.getActivity() == null) {
-							a.setTaskName("重申|撤销");
-						} else if (activityProcess.getActivity().getUser() != null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())) {
-							a.setTaskName(activityProcess.getActivity().getName());
-						} else {
-							a.setTaskName(activityProcess.getActivity().getName());
-						}
-						histoicFlows.add(a);
-					}
 				}
-			}else {
-				if (list!=null && list.size()>2){
-					for (int i = list.size()-2;i<list.size();i++){
-						WorkActivityProcess activityProcess = list.get(i);
-						Act a = new Act();
-						if (activityProcess.getActivity() ==null){
-							a.setTaskName("重申|撤销");
-						}else if (activityProcess.getActivity().getUser()!=null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())){
-							a.setTaskName(activityProcess.getActivity().getName());
-						}else{
-							a.setTaskName(activityProcess.getActivity().getName());
-						}
-						a.setComment(activityProcess.getRemarks());
-						histoicFlows.add(a);
-					}
-					Act act2 = new Act();
-					act2.setTaskName("结束");
-					histoicFlows.add(act2);
-				}else if (list!=null && list.size()==1){
-					Act act1 = new Act();
-					act1.setTaskName("开始");
-					histoicFlows.add(act1);
-					WorkActivityProcess activityProcess = list.get(list.size()-1);
+			}
+		}else {
+			if (list!=null && list.size()>2){
+				for (int i = list.size()-2;i<list.size();i++){
+					WorkActivityProcess activityProcess = list.get(i);
 					Act a = new Act();
 					if (activityProcess.getActivity() ==null){
 						a.setTaskName("重申|撤销");
@@ -661,14 +693,31 @@ public class ActTaskController extends BaseController {
 					}
 					a.setComment(activityProcess.getRemarks());
 					histoicFlows.add(a);
-					Act act2 = new Act();
-					act2.setTaskName("结束");
-					histoicFlows.add(act2);
 				}
+				Act act2 = new Act();
+				act2.setTaskName("结束");
+				histoicFlows.add(act2);
+			}else if (list!=null && list.size()==1){
+				Act act1 = new Act();
+				act1.setTaskName("开始");
+				histoicFlows.add(act1);
+				WorkActivityProcess activityProcess = list.get(list.size()-1);
+				Act a = new Act();
+				if (activityProcess.getActivity() ==null){
+					a.setTaskName("重申|撤销");
+				}else if (activityProcess.getActivity().getUser()!=null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())){
+					a.setTaskName(activityProcess.getActivity().getName());
+				}else{
+					a.setTaskName(activityProcess.getActivity().getName());
+				}
+				a.setComment(activityProcess.getRemarks());
+				histoicFlows.add(a);
+				Act act2 = new Act();
+				act2.setTaskName("结束");
+				histoicFlows.add(act2);
 			}
-			model.addAttribute("histoicFlowList", histoicFlows);
 		}
-		return "modules/act/actTaskFlowChart";
+		return histoicFlows;
 	}
 
 	public List getList(List<Act> list){

+ 42 - 0
src/main/java/com/jeeplus/modules/centerservice/config/RestTemplateConfig.java

@@ -0,0 +1,42 @@
+package com.jeeplus.modules.centerservice.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.client.ClientHttpRequestFactory;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Configuration
+public class RestTemplateConfig {
+
+    @Bean
+    public RestTemplate restTemplate(ClientHttpRequestFactory factory) {
+        RestTemplate restTemplate = new RestTemplate(factory);
+        restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter());
+        return restTemplate;
+    }
+
+    @Bean
+    public ClientHttpRequestFactory simpleClientHttpRequestFactory() {
+        SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
+        factory.setConnectTimeout(15000); // 连接超时时间 (两端连接时间) 15秒
+        factory.setReadTimeout(50000); // 访问超时时间 (建立连接后从另一端读取资源所用时间) 5秒
+        // 设置代理
+        //factory.setProxy(null);
+        return factory;
+    }
+
+    public class WxMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter {
+        public WxMappingJackson2HttpMessageConverter(){
+            List<MediaType> mediaTypes = new ArrayList<>();
+            mediaTypes.add(MediaType.TEXT_PLAIN);
+            mediaTypes.add(MediaType.TEXT_HTML);
+            setSupportedMediaTypes(mediaTypes);
+        }
+    }
+}

+ 49 - 0
src/main/java/com/jeeplus/modules/centerservice/service/cpa/reimbursement/ReimbursementRequest.java

@@ -0,0 +1,49 @@
+package com.jeeplus.modules.centerservice.service.cpa.reimbursement;
+
+import com.jeeplus.modules.centerservice.utils.RestTemplateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.client.RestTemplate;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class ReimbursementRequest {
+
+    @Autowired
+    private RestTemplateService restTemplateService;
+
+    /**
+     * 查询评估报销详情
+     * @param id
+     * @return
+     */
+    public Object getById(String id) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("id", id);
+        Object res = restTemplateService.getCPA("/reimbursement/info/findById", token, paramMap);
+        return res;
+    }
+
+    /**
+     * 报销审核
+     * @param id
+     * @param flag
+     * @return
+     */
+    public Object auditFunc(String id, String flag) {
+        String token = "";
+        Map<String, Object> bodyMap = new HashMap<>();
+        bodyMap.put("id", id);
+        bodyMap.put("flag", flag);
+        Object res = restTemplateService.postCPA("/reimbursement/info/auditFunc", token, null, bodyMap);
+        return res;
+    }
+
+
+}

+ 234 - 0
src/main/java/com/jeeplus/modules/centerservice/service/cpa/reimbursement/ReimbursementService.java

@@ -0,0 +1,234 @@
+package com.jeeplus.modules.centerservice.service.cpa.reimbursement;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jeeplus.common.sms.sdk.utils.DateUtil;
+import com.jeeplus.modules.centerservice.utils.ConvertServiceUtil;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+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 javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class ReimbursementService {
+
+    @Autowired
+    private ReimbursementRequest reimbursementRequest;
+
+    /**
+     * 查询评估-报销详情
+     * @param id
+     * @return
+     * @throws Exception
+     */
+    public WorkReimbursement getReimbursementById(String id) throws Exception{
+        WorkReimbursement workReimbursement = new WorkReimbursement();
+        if (StringUtils.isNotBlank(id)) {
+            Object res = reimbursementRequest.getById(id);
+            if(Objects.nonNull(res)) {
+                Map<String,Object> reim = JSONObject.parseObject(JSON.toJSONString(res));
+                workReimbursement = convertReimbursement(reim); // 格式转换
+            }
+        }
+        return workReimbursement;
+    }
+
+    /**
+     * 将cpa的评估-报销详情字段转换为当前系统字段
+     * @param resp
+     * @return
+     */
+    public WorkReimbursement convertReimbursement(Map<String,Object> resp) throws Exception{
+        WorkReimbursement result = new WorkReimbursement();
+        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("userName"))) { // 报销人
+                result.setSubmitterName(resp.get("userName").toString());
+            }
+            // 报销编号
+            if (Objects.nonNull(resp.get("no"))) { // 报销编号
+                result.setNumber(resp.get("no").toString());
+            }
+            // 所属部门
+            if (Objects.nonNull(resp.get("departmentName"))) { // 所属部门
+                result.setOfficeName(resp.get("departmentName").toString());
+            }
+            // 报销日期
+            if (Objects.nonNull(resp.get("reimDate"))) { // 报销日期、创建时间
+                result.setSubmitterDate((new SimpleDateFormat("yyyy-MM-dd")).parse(resp.get("reimDate").toString()));
+            }
+            // 报销类型
+            if (Objects.nonNull(resp.get("sourceType"))) { // 报销类型
+                String sourceType = resp.get("sourceType").toString();
+                if ("1".equals(sourceType)) {
+                    result.setSourceType("项目报销");
+                } else if ("4".equals(sourceType)) {
+                    result.setSourceType("其他报销");
+                }
+            }
+            // 备注
+            if (Objects.nonNull(resp.get("remarks"))) { // 备注
+                result.setRemarks(resp.get("remarks").toString());
+            }
+            // 附件
+            if (Objects.nonNull(resp.get("files"))) {
+                String jsonString = JSON.toJSONString(resp.get("files"));
+                List<Object> attachmentList = JSON.parseArray(jsonString, Object.class);
+                List<WorkClientAttachment> attachments = new ArrayList<>();
+                if (Objects.nonNull(attachmentList)) {
+                    for (Object attachment : attachmentList) {
+                        WorkClientAttachment attachmentDto = new WorkClientAttachment();
+                        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("createDate"))) { // 创建时间
+                            attachmentDto.setCreateDate((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(fileMap.get("createDate").toString()));
+                        }
+                        if (Objects.nonNull(fileMap.get("url"))) { // 文件地址
+                            attachmentDto.setUrl(fileMap.get("url").toString());
+                        }
+                        if (Objects.nonNull(fileMap.get("lsUrl"))) { // 文件临时地址
+                            attachmentDto.setTemporaryUrl(fileMap.get("lsUrl").toString());
+                        }
+                        attachmentDto.setCreateBy(u); // 创建人
+                        attachments.add(attachmentDto);
+                    }
+                }
+                result.setWorkAttachments(attachments);
+            }
+            // 专用发票信息
+            if (Objects.nonNull(resp.get("amountInfos"))) {
+                String jsonString = JSON.toJSONString(resp.get("amountInfos"));
+                List<Object> amountInfolist = JSON.parseArray(jsonString, Object.class);
+                List<ReimbursementVATTax> reimbursementVATTaxes = new ArrayList<>();
+                if (Objects.nonNull(amountInfolist)) {
+                    amountInfolist.stream().forEach(amount -> {
+                        ReimbursementVATTax reimbursementVATTax = new ReimbursementVATTax();
+                        Map<String, Object> amountMap = JSONObject.parseObject(JSON.toJSONString(amount));
+                        if (Objects.nonNull(amountMap.get("code"))) { // 发票代码
+                            reimbursementVATTax.setInvoiceCode(amountMap.get("code").toString());
+                        }
+                        if (Objects.nonNull(amountMap.get("number"))) { // 发票号
+                            reimbursementVATTax.setInvoiceNumber(amountMap.get("number").toString());
+                        }
+                        if (Objects.nonNull(amountMap.get("amount"))) { // 金额
+                            reimbursementVATTax.setMoney(new BigDecimal(amountMap.get("amount").toString()));
+                        }
+                        if (Objects.nonNull(amountMap.get("taxAmount"))) { // 税额
+                            reimbursementVATTax.setTaxAmount(new BigDecimal(amountMap.get("taxAmount").toString()));
+                        }
+                        if (Objects.nonNull(amountMap.get("count"))) { // 价税合计
+                            reimbursementVATTax.setSumMoney(new BigDecimal(amountMap.get("count").toString()));
+                        }
+                        reimbursementVATTaxes.add(reimbursementVATTax);
+                    });
+                }
+                result.setReimbursementVATTaxes(reimbursementVATTaxes);
+            }
+            // 报销详情
+            if (Objects.nonNull(resp.get("sourceType"))) {
+                if ("1".equals(resp.get("sourceType").toString())) { // 项目报销
+                    if (Objects.nonNull(resp.get("detailInfos"))) {
+                        List<WorkAccount> workAccounts = convertWorkAccount(resp.get("detailInfos"));
+                        result.setWorkAccountList(workAccounts);
+                    }
+                } else if ("4".equals(resp.get("sourceType").toString())) { // 其他报销
+                    if (Objects.nonNull(resp.get("detailInfoOthers"))) {
+                        List<WorkAccount> workAccounts = convertWorkAccount(resp.get("detailInfoOthers"));
+                        result.setWorkAccountList(workAccounts);
+                    }
+                }
+            }
+        }
+        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) {
+        Object o = reimbursementRequest.auditFunc(id, flag);
+        Map<String,Object> res = JSONObject.parseObject(JSON.toJSONString(o));
+        return res;
+    }
+
+}

+ 62 - 0
src/main/java/com/jeeplus/modules/centerservice/service/cpa/task/TaskFlowRequest.java

@@ -0,0 +1,62 @@
+package com.jeeplus.modules.centerservice.service.cpa.task;
+
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.centerservice.utils.RestTemplateService;
+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 javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TaskFlowRequest {
+
+    @Autowired
+    private RestTemplateService restTemplateService;
+
+    /**
+     * 查询待办信息
+     * @param workProjectNotify
+     * @return
+     */
+    public Object getNotifyList(WorkProjectNotify workProjectNotify) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        // 设置查询条件
+        if (workProjectNotify.getStartDate () != null) { // 创建时间
+            SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            paramMap.put("beginDate", formatter.format(workProjectNotify.getStartDate ()));
+        }
+        if (workProjectNotify.getEndDate () != null) { // 创建时间
+            SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            paramMap.put("endDate", formatter.format(workProjectNotify.getEndDate ()));
+        }
+        if (StringUtils.isNotBlank (workProjectNotify.getTitle ())) { // 标题
+            paramMap.put("title", workProjectNotify.getTitle ());
+        }
+        if (StringUtils.isNotBlank(workProjectNotify.getUserName())) { // 流程发起人
+            paramMap.put("assigneeName", workProjectNotify.getUserName());
+        }
+        Object response = restTemplateService.getCPA("/flowable/task/allTodo", token, paramMap);
+        return response;
+    }
+
+    /**
+     * 根据procInsId查询流程历史
+     * @param procInsId
+     * @return
+     */
+    public Object getHisTaskListById(String procInsId) {
+        String token = "";
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("procInsId", procInsId);
+        Object res = restTemplateService.getCPA("/flowable/task/historicTaskList", token, paramMap);
+        return res;
+    }
+}

+ 43 - 0
src/main/java/com/jeeplus/modules/centerservice/service/cpa/task/TaskFlowService.java

@@ -0,0 +1,43 @@
+package com.jeeplus.modules.centerservice.service.cpa.task;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+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.List;
+import java.util.Map;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TaskFlowService {
+
+    @Autowired
+    private TaskFlowRequest taskRequest;
+
+    /**
+     * 查询待办信息
+     * @param workProjectNotify
+     * @return
+     */
+    public List<WorkProjectNotify> getNotifyList(WorkProjectNotify workProjectNotify) throws Exception{
+        Object res = taskRequest.getNotifyList(workProjectNotify);
+        List<Map<String,Object>> notifys = (List)JSONArray.parseArray(JSON.toJSONString(res));
+        List<WorkProjectNotify> notifyList = ConvertServiceUtil.convertWorkProjectNotifyList(notifys); // 格式转换
+        return notifyList;
+    }
+
+    /**
+     * 根据procInsId获取流程历史
+     * @param procInsId
+     * @return
+     */
+    public List<Map<String,Object>> getHisTaskListById(String procInsId) {
+        Object hisTaskListById = taskRequest.getHisTaskListById(procInsId);
+        List<Map<String,Object>> resp = (List)JSONArray.parseArray(JSON.toJSONString(hisTaskListById));
+        return resp;
+    }
+}

+ 154 - 0
src/main/java/com/jeeplus/modules/centerservice/utils/ConvertServiceUtil.java

@@ -0,0 +1,154 @@
+package com.jeeplus.modules.centerservice.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.workprojectnotify.entity.WorkProjectNotify;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+public class ConvertServiceUtil {
+
+    /**
+     * 批量将cpa系统待办返回的字段转换为当前系统待办需要的字段
+     * @param res
+     * @return
+     */
+    public static List<WorkProjectNotify> convertWorkProjectNotifyList(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);
+                    if (Objects.nonNull(vars.get("agree"))) {
+                        boolean agree = Boolean.parseBoolean(vars.get("agree").toString());
+                        String s = new String();
+                    }
+                    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
+     */
+    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) {
+        // 将数据按照createDate倒序排序
+        list.sort(new Comparator<WorkProjectNotify>() {
+            @Override
+            public int compare(WorkProjectNotify o1, WorkProjectNotify o2) {
+                return o2.getCreateDate().compareTo(o1.getCreateDate());
+            }
+        });
+        // 将数据分页
+        page.setCount(list.size());
+        List<WorkProjectNotify> records = new ArrayList<>();
+        int startIndex = (int) ((page.getPageNo() - 1) * page.getPageSize());
+        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;
+    }
+}

+ 95 - 0
src/main/java/com/jeeplus/modules/centerservice/utils/RestTemplateService.java

@@ -0,0 +1,95 @@
+package com.jeeplus.modules.centerservice.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.Charset;
+import java.util.Map;
+import java.util.Objects;
+
+@Component
+public class RestTemplateService {
+
+    @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("CPA_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("CPA_PATH"), path);
+    }
+
+    /**
+     * 访问远程接口方法
+     * @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) {
+        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.eyJleHAiOjE2ODIzOTAzMDIsInVzZXJuYW1lIjoi6Zu357qiIn0.4HBW6oSC42D1YeDIyenjI7nt94SFR_s0vyNEHu8wpWA");
+        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);
+        return responseEntity.getBody();
+    }
+
+    /**
+     * 将参数拼接到请求路径中
+     * @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;
+    }
+}

+ 60 - 0
src/main/java/com/jeeplus/modules/centerservice/web/cpa/reimbursement/ReimbursementController.java

@@ -0,0 +1,60 @@
+package com.jeeplus.modules.centerservice.web.cpa.reimbursement;
+
+import afu.org.checkerframework.checker.oigj.qual.O;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.centerservice.service.cpa.reimbursement.ReimbursementService;
+import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
+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.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+@Controller
+@RequestMapping(value = "${adminPath}/cpa_reimbursement")
+public class ReimbursementController {
+
+    @Autowired
+    private ReimbursementService reimbursementService;
+
+    /**
+     * 报销审核
+     * @param workReimbursement
+     * @return
+     */
+    @RequestMapping(value = "saveAudit",method = RequestMethod.POST)
+    public String saveAudit(WorkReimbursement workReimbursement, RedirectAttributes redirectAttributes) {
+        Map<String, Object> res = new HashMap<>();
+        if (Objects.nonNull(workReimbursement.getAct())) {
+            res = reimbursementService.auditFunc(workReimbursement.getId(), workReimbursement.getAct().getFlag());
+            addMessage(redirectAttributes, res.get("message").toString());
+        } else {
+            addMessage(redirectAttributes, "操作失败");
+        }
+        if (StringUtils.isNotBlank(workReimbursement.getHome()) && "home".equals(workReimbursement.getHome())) {
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else if (StringUtils.isNotBlank(workReimbursement.getHome()) && "notifyList".equals(workReimbursement.getHome())){
+            return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+        } else {
+            return "redirect:" + Global.getAdminPath() + "/workreimbursement/workReimbursement/?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());
+    }
+}

+ 12 - 4
src/main/java/com/jeeplus/modules/sys/web/LoginController.java

@@ -13,6 +13,8 @@ import com.jeeplus.common.servlet.ValidateCodeServlet;
 import com.jeeplus.common.utils.*;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.common.websocket.onchat.ChatServerPool;
+import com.jeeplus.modules.centerservice.service.cpa.task.TaskFlowService;
+import com.jeeplus.modules.centerservice.utils.ConvertServiceUtil;
 import com.jeeplus.modules.iim.entity.MailBox;
 import com.jeeplus.modules.iim.entity.MailPage;
 import com.jeeplus.modules.iim.service.MailBoxService;
@@ -106,6 +108,9 @@ public class LoginController extends BaseController{
 	@Autowired
 	private KnowledgeSharingTypeService typeService;
 
+	@Autowired
+	private TaskFlowService centerCpaTaskService;
+
 	/**
 	 * 管理登录
 	 * @throws IOException
@@ -417,10 +422,10 @@ public class LoginController extends BaseController{
 
 	/**
 	 * 首页
-	 * @throws IOException
+	 * @throws Exception
 	 */
 	@RequestMapping(value = "${adminPath}/home")
-	public String home(String type, HttpServletRequest request, HttpServletResponse response, Model model) throws IOException {
+	public String home(String type, HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
 		long s1 = System.currentTimeMillis();
 		User user = UserUtils.getUser();
 		OaNotify oaNotify = new OaNotify();
@@ -532,7 +537,7 @@ public class LoginController extends BaseController{
 		Page<WorkProjectNotify> workProjectNotifyPage = new Page<>(request, response);
 		workProjectNotifyPage.setPageNo(1);
 		workProjectNotifyPage.setPageSize(10);
-		Page<WorkProjectNotify> notifyPage = workProjectNotifyService.findPage(workProjectNotifyPage, workProjectNotify);
+		Page<WorkProjectNotify> notifyPage = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(1, -1), workProjectNotify);
 		if(notifyPage.getList().size()>0){
 			for (WorkProjectNotify info: notifyPage.getList()) {
 				//对项目进行处理,工程咨询,造价审核可添加作废按钮
@@ -547,7 +552,10 @@ public class LoginController extends BaseController{
 				}
 			}
 		}
-		model.addAttribute("notifyPage", notifyPage.getList());
+		List<WorkProjectNotify> notifyList = centerCpaTaskService.getNotifyList(workProjectNotify);
+		notifyPage.getList().addAll(notifyList);
+		Page<WorkProjectNotify> resultPage = ConvertServiceUtil.getSortAndPaging(workProjectNotifyPage, notifyPage.getList());
+		model.addAttribute("notifyPage", resultPage.getList());
 		model.addAttribute("notifyCount", notifyPage.getList().size());//未读通知条数
 		model.addAttribute("notifyCount1", notifyPage.getCount());//未读通知条数
 		workProjectNotify.setStatus("0");

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

@@ -65,6 +65,9 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	private Date endOverDate;	//结束审核时间(结束)
 	private String initiator;	//发起人
 	private String auditor;	//审核人
+	private String typeLabel; // 类型label
+	private String auditUserName; // 审核人name
+	private String belongProject; // 所属系统
 
 	public WorkProjectNotify() {
 		super();
@@ -360,4 +363,28 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setAuditor(String auditor) {
 		this.auditor = auditor;
 	}
+
+	public String getTypeLabel() {
+		return typeLabel;
+	}
+
+	public void setTypeLabel(String typeLabel) {
+		this.typeLabel = typeLabel;
+	}
+
+	public String getAuditUserName() {
+		return auditUserName;
+	}
+
+	public void setAuditUserName(String auditUserName) {
+		this.auditUserName = auditUserName;
+	}
+
+	public String getBelongProject() {
+		return belongProject;
+	}
+
+	public void setBelongProject(String belongProject) {
+		this.belongProject = belongProject;
+	}
 }

+ 5 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/service/WorkProjectNotifyService.java

@@ -143,6 +143,11 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 		return page;
 	}
 
+	public List<WorkProjectNotify> findDataList(WorkProjectNotify workProjectNotify) {
+		List<WorkProjectNotify> list = findList(workProjectNotify);
+		return list;
+	}
+
 	public Page<WorkProjectNotify> notifyFindPage(Page<WorkProjectNotify> page, WorkProjectNotify workProjectNotify) {
 		Integer count = dao.queryCount(workProjectNotify);
 		if(null == count){

+ 80 - 3
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -3,6 +3,8 @@
  */
 package com.jeeplus.modules.workprojectnotify.web;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
@@ -20,6 +22,10 @@ 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;
 import com.jeeplus.modules.iim.entity.MailBox;
 import com.jeeplus.modules.iim.entity.MailPage;
 import com.jeeplus.modules.iim.service.MailBoxService;
@@ -526,6 +532,12 @@ public class WorkProjectNotifyController extends BaseController {
 	private WorkProjectNotifyRecoverService workProjectNotifyRecoverService;
 	@Autowired
 	private ProjectResultsFileTemplateService projectResultsFileTemplateService;
+	@Autowired
+	private TaskFlowService centerCpaTaskService;
+	@Autowired
+	private ReimbursementService reimbursementService;
+	@Autowired
+	private TaskFlowService taskFlowService;
 
 	@ModelAttribute
 	public WorkProjectNotify get(@RequestParam(required=false) String id) {
@@ -543,7 +555,7 @@ 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 {
 		//进行查询之后进行任何操作,返回还是查询之后的数据页面
 		if (StringUtils.isNotBlank(workProjectNotify.getToflag())){
 			request.getSession().removeAttribute("searchWorkProjectNotifylist");
@@ -559,7 +571,7 @@ public class WorkProjectNotifyController extends BaseController {
 		workProjectNotify.setUser(user);
 		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
 		workProjectNotify.setRemarks("待审批");
-		Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response),workProjectNotify);
+		Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(1, -1),workProjectNotify);
 		if(pageList.getList().size()>0){
 			for (WorkProjectNotify info: pageList.getList()) {
 				//对项目进行处理,工程咨询,造价审核可添加作废按钮
@@ -574,10 +586,54 @@ public class WorkProjectNotifyController extends BaseController {
 				}
 			}
 		}
-		model.addAttribute("page", pageList);
+		List<WorkProjectNotify> notifyList = centerCpaTaskService.getNotifyList(workProjectNotify);
+		pageList.getList().addAll(notifyList);
+		Page<WorkProjectNotify> resultPage = ConvertServiceUtil.getSortAndPaging(new Page<WorkProjectNotify>(request, response), pageList.getList());
+		model.addAttribute("page", resultPage);
 		return "modules/workprojectnotify/workProjectNotifyList";
 	}
 
+	@RequestMapping(value = "getList",method = RequestMethod.GET)
+	@ResponseBody
+	public List<WorkProjectNotify> getList(WorkProjectNotify workProjectNotify, Page<WorkProjectNotify> page) {
+		User user = UserUtils.getUser();
+		workProjectNotify.setUser(user);
+		if (StringUtils.isNotBlank(workProjectNotify.getUserName())) {
+			workProjectNotify.setUserName(workProjectNotify.getUserName());
+		}
+		if (StringUtils.isNotBlank(workProjectNotify.getTitle())) {
+			workProjectNotify.setTitle(workProjectNotify.getTitle());
+		}
+		if (Objects.nonNull(workProjectNotify.getStartDate())) {
+			workProjectNotify.setStartDate(workProjectNotify.getStartDate());
+		}
+		if (Objects.nonNull(workProjectNotify.getEndDate())) {
+			workProjectNotify.setEndDate(workProjectNotify.getEndDate());
+		}
+		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
+		workProjectNotify.setRemarks("待审批");
+		List<WorkProjectNotify> list = workProjectNotifyService.findDataList(workProjectNotify);
+		if(list.size()>0){
+			for (WorkProjectNotify info: list) {
+				// 获取流程类型
+				String typeLabel = DictUtils.getDictLabel(info.getType(),"project_notify_type","");
+				info.setTypeLabel(typeLabel);
+				// 获取流程提交人
+				User cUser = UserUtils.getByUserId(info.getInitiator());
+				if (Objects.nonNull(cUser)) {
+					info.setCreateUserName(cUser.getName());
+				}
+				// 获取流程审核人
+				User audit = UserUtils.getByUserId(info.getAuditor());
+				if (Objects.nonNull(audit)) {
+					info.setAuditUserName(audit.getName());
+				}
+			}
+		}
+		return list;
+	}
+
+
 
 	/**
 	 * 已审批待办列表页面
@@ -1144,6 +1200,26 @@ public class WorkProjectNotifyController extends BaseController {
 	@RequestMapping(value = "form")
 	public String form(WorkProjectNotify workProjectNotify, Model model,HttpServletRequest request) {
 		try {
+			if (StringUtils.isNotBlank(workProjectNotify.getBelongProject())) {
+				if ("cpa".equals(workProjectNotify.getBelongProject())) {
+					if ("13".equals(workProjectNotify.getType())) {
+						model.addAttribute("projectNotifyType", "评估-报销审批");
+						WorkReimbursement workReimbursement = reimbursementService.getReimbursementById(workProjectNotify.getNotifyId());
+						if(StringUtils.isNotBlank(workProjectNotify.getHome())){
+							workReimbursement.setHome(workProjectNotify.getHome());
+						}else{
+							workReimbursement.setHome("home");
+						}
+						model.addAttribute("workReimbursement", workReimbursement);
+						// 流程历史
+						if (Objects.nonNull(workReimbursement) && StringUtils.isNotBlank(workReimbursement.getProcessInstanceId())) {
+							List<Map<String, Object>> hisTaskList = taskFlowService.getHisTaskListById(workReimbursement.getProcessInstanceId());
+							model.addAttribute("hisTaskList", hisTaskList);
+						}
+						return "modules/workreimbursement/workReimbursementAuditCpa";
+					}
+				}
+			}
 			if (workProjectNotify.getRemarks().equals("待通知")){
 			/*	List<WebSocket> toUserConnList = ChatServerPool.getWebSocketByUser(UserUtils.getUser().getId());
 				for (WebSocket toUserConn:toUserConnList) {
@@ -1157,6 +1233,7 @@ public class WorkProjectNotifyController extends BaseController {
 			}
 			workProjectNotify.preUpdate();
 			workProjectNotifyService.save(workProjectNotify);
+
 			if (StringUtils.isNotBlank(workProjectNotify.getType())) {
 				String projectNotifyType = DictUtils.getDictLabel(workProjectNotify.getType(), "project_notify_type", "");
 				model.addAttribute("projectNotifyType", projectNotifyType);

+ 9 - 0
src/main/java/com/jeeplus/modules/workreimbursement/entity/WorkReimbursement.java

@@ -73,6 +73,7 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	private String beginReimbursementPrice;		//报销开始金额
 	private String endReimbursementPrice;		//报销结束金额
 	private Date accomplishDate;		//审核通过时间
+	private String sourceType;		// 报销类型
 	public String getCreateOffice() {
 		return createOffice;
 	}
@@ -611,4 +612,12 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	public void setAccomplishDate(Date accomplishDate) {
 		this.accomplishDate = accomplishDate;
 	}
+
+	public String getSourceType() {
+		return sourceType;
+	}
+
+	public void setSourceType(String sourceType) {
+		this.sourceType = sourceType;
+	}
 }

+ 78 - 0
src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementController.java

@@ -3,6 +3,8 @@
  */
 package com.jeeplus.modules.workreimbursement.web;
 
+import com.alibaba.fastjson.JSON;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.jeeplus.common.config.Global;
@@ -44,8 +46,10 @@ import com.jeeplus.modules.workreimbursementback.entity.WorkReimbursementBack;
 import com.jeeplus.modules.workreimbursementback.service.WorkReimbursementBackService;
 import com.jeeplus.modules.worksupplier.entity.WorkSupplier;
 import com.jeeplus.modules.worksupplier.service.WorkSupplierService;
+import org.activiti.engine.HistoryService;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.TaskService;
+import org.activiti.engine.history.HistoricProcessInstance;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -112,6 +116,8 @@ public class WorkReimbursementController extends BaseController {
 	private WorkReimbursementTypeService workReimbursementTypeService;
 	@Autowired
 	protected WorkProjectNotifyService workProjectNotifyService;
+	@Autowired
+	protected HistoryService historyService;
 
 	@ModelAttribute
 	public WorkReimbursement get(@RequestParam(required=false) String id) {
@@ -126,6 +132,13 @@ public class WorkReimbursementController extends BaseController {
 		return entity;
 	}
 
+	@RequestMapping(value = "getById", method = RequestMethod.GET)
+	@ResponseBody
+	public WorkReimbursement getById(String id) {
+		WorkReimbursement entity = workReimbursementService.get(id);
+		return entity;
+	}
+
 	/**
 	 * 报销单列表页面
 	 */
@@ -445,6 +458,71 @@ public class WorkReimbursementController extends BaseController {
 		}
 	}
 
+	/**
+	 * 报销审核操作
+	 * @return
+	 */
+	@RequestMapping(value = "saveAuditFunc", method = RequestMethod.POST)
+	@ResponseBody
+	public Map<String,Object> saveAuditFunc(@RequestBody Object object) {
+		Map<String,Object> map = new HashMap<>();
+		WorkReimbursement workReimbursement = JSON.parseObject(JSON.toJSONString(object), WorkReimbursement.class);
+		HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(workReimbursement.getProcessInstanceId()).singleResult();
+		ProcessInstance processInstance = actTaskService.getProcIns(workReimbursement.getProcessInstanceId());
+		if (processInstance!=null) {
+			List<Task> taskList = actTaskService.getCurrentTaskList(processInstance);
+			if(taskList!=null && taskList.size()>1){
+				for (Task taskInfok:taskList) {
+					if (UserUtils.getUser().getId().equals(taskInfok.getAssignee())) {
+						workReimbursement.getAct().setTaskId(taskInfok.getId());
+						workReimbursement.getAct().setTaskName(taskInfok.getName());
+						workReimbursement.getAct().setTaskDefKey(taskInfok.getTaskDefinitionKey());
+						workReimbursement.getAct().setProcDefId(taskInfok.getProcessDefinitionId());
+						workReimbursement.getAct().setProcInsId(taskInfok.getProcessInstanceId());
+						workReimbursement.getAct().setTask(taskInfok);
+					}
+				}
+			}else {
+				Task task = actTaskService.getCurrentTaskInfo(processInstance);
+				workReimbursement.getAct().setTaskId(task.getId());
+				workReimbursement.getAct().setTaskName(task.getName());
+				workReimbursement.getAct().setTaskDefKey(task.getTaskDefinitionKey());
+				workReimbursement.getAct().setProcDefId(task.getProcessDefinitionId());
+				workReimbursement.getAct().setProcInsId(task.getProcessInstanceId());
+				workReimbursement.getAct().setTask(task);
+			}
+		}
+		try {
+			// 对不同环节的业务逻辑进行操作
+			String taskDefKey = workReimbursement.getAct().getTaskDefKey();
+			List<User> users = null;
+			if ("bmzr".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),2);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwzg", 3, workReimbursement.getOfficeId(), "8", workReimbursement.getCreateBy());
+			}else  if ("cw".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
+			}else if ("modifyApply".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
+			}
+			String flag = workReimbursement.getAct().getFlag();
+			if ("yes".equals(flag) &&(users==null || users.size()==0)){
+				map.put("success", false);
+				map.put("message","操作失败,审批人为空,请联系管理员!");
+			}else {
+				String str = workReimbursementService.auditSave(workReimbursement,users);
+				map.put("success", true);
+				map.put("message","操作成功");
+			}
+		}catch (Exception e){
+			logger.info("Exception e:"+e);
+			map.put("success", false);
+			map.put("message","操作失败");
+		}
+		return map;
+	}
 
 	/**
 	 * 删除报销单

+ 8 - 0
src/main/resources/jeeplus.properties

@@ -348,3 +348,11 @@ approval_YC_category_id = 2932214418853044239
 #报告用印流程id(盐城)
 report_YC_category_id = 2933233458312618324
 
+
+#其他系统的地址
+CPA_PATH:   http://localhost:8084
+
+#待办中展示其他系统的流程
+#cpa =》
+#Process_1665383385070 评估-报销审批
+CPA_TASK:   Process_1665383385070

+ 13 - 3
src/main/webapp/webpage/modules/sys/sysHome.jsp

@@ -934,6 +934,9 @@
         <c:forEach items="${notifyPage}" var="workProjectNotify" varStatus="status">
         <c:if test="${status.index < 8}">
         <c:choose>
+        <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>
         <c:when test="${workProjectNotify.type == 6}">
         <c:if test="${workProjectNotify.status != 1}">
         xml = "<a href=\"javascript:void(0)\" onclick=\"openDialog('确认定投标', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%')\">";
@@ -1059,9 +1062,16 @@
         xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogView('${fns:getDictLabel(workProjectNotify.type, 'project_notify_type', '')}', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%')\">";
         </c:otherwise>
         </c:choose>
-
-        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.updateDate}" pattern="yyyy-MM-dd"/>' + '</span></a></li>');
+        <c:choose>
+            <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>');
+            </c:when>
+            <c:otherwise>
+                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.updateDate}" pattern="yyyy-MM-dd"/>' + '</span></a></li>');
+            </c:otherwise>
+        </c:choose>
         </c:if>
         </c:forEach>
 

+ 39 - 9
src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp

@@ -631,14 +631,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 == "cpa") {
+							return "<span title='"+ d.typeLabel +"'>" + d.typeLabel + "</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.type == "6")
+					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>";
+					}else if(d.type == "6")
 					{
 					    if( d.status != 1 )
 						{
@@ -823,7 +830,6 @@
                             "<span title=\""+ d.title +"\">"+ d.title +"</span>" +
                             "</a>";
                     }
-
                     else{
                         return "<a class=\"attention-info\"  href=\"javascript:void(0)\" onclick=\"openDialogView('"+ d.type1 +"', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&home=notifyList','95%','95%')\">" +
                             "<span title=\""+ d.title +"\">"+ d.title +"</span>" +
@@ -834,17 +840,35 @@
                         return "<span title='"+ d.content +"'>" + d.content + "</span>";
                     }}
                 ,{align:'center',title: '提交人', width:80,templet:function(d){
-                        return "<span title='"+ d.initiator +"'>" + d.initiator + "</span>";
+						if (d.belongProject == "cpa") {
+							return "<span title='"+ d.createUserName +"'>" + d.createUserName + "</span>";
+						} else {
+							return "<span title='"+ d.initiator +"'>" + d.initiator + "</span>";
+						}
                     }}
                 ,{align:'center',title: '审核人', width:80,templet:function(d){
-                        return "<span title='"+ d.submit +"'>" + d.submit + "</span>";
+						if (d.belongProject == "cpa") {
+							return "<span title='"+ d.auditUserName +"'>" + d.auditUserName + "</span>";
+						} else {
+							return "<span title='"+ d.submit +"'>" + d.submit + "</span>";
+						}
                     }}
-                ,{field:'status1', align:'center',title: '审批状态',width:100}
+                ,{align:'center',title: '审批状态',width:100,templet:function(d){
+						if (d.belongProject == "cpa") {
+							return "<span title='"+ d.remarks +"'>" + d.remarks + "</span>";
+						} else {
+							return "<span title='"+ d.status1 +"'>" + d.status1 + "</span>";
+						}
+					}}
                 /*,{field:'op',align:'center', title: '创建时间', width:140,templet:function(d){
                         return "<span title='"+ d.date +"'>" + d.ymddate + "</span>";
                     }}*/
-                ,{field:'wapCreateDate',align:'center', title: '开始时间', width:180,templet:function(d){
-                        return "<span title='"+ d.wapCreateDate +"'>" + d.wapCreateDate + "</span>";
+                ,{align:'center', title: '开始时间', width:180,templet:function(d){
+						if (d.belongProject == "cpa") {
+							return "<span title='"+ d.createDate +"'>" + d.createDate + "</span>";
+						} else {
+							return "<span title='"+ d.wapCreateDate +"'>" + d.wapCreateDate + "</span>";
+						}
                     }}
             ]]
             ,data: [
@@ -870,6 +894,12 @@
                     ,"wapEndDate":"<fmt:formatDate value="${workProjectNotify.wapEndDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
 					,"remarks":"${workProjectNotify.remarks}"
 					,"projectType":"${workProjectNotify.projectType}"
+					,"belongProject":"${workProjectNotify.belongProject}"
+					,"typeLabel":"${workProjectNotify.typeLabel}"
+					,"createDate":"<fmt:formatDate value="${workProjectNotify.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
+					,"createUserName":"${workProjectNotify.createUserName}"
+					,"notifyId":"${workProjectNotify.notifyId}"
+					,"auditUserName":"${workProjectNotify.auditUserName}"
                 }
                 </c:forEach>
                 </c:if>

+ 464 - 0
src/main/webapp/webpage/modules/workreimbursement/workReimbursementAuditCpa.jsp

@@ -0,0 +1,464 @@
+<%@ 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"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  // var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+			  // $("#opinion").val(ss);
+		      if(obj == 1){
+                  $('#flag').val('yes');
+              }else{
+                  $('#flag').val('no');
+              }
+			  $("#inputForm").submit();
+			  return true;
+		  }else {
+              parent.layer.msg("信息未填写完整!", {icon: 5});
+          }
+
+		  return false;
+		}
+		$(document).ready(function() {
+			layui.use('form', function () {
+				var form = layui.form;
+				form.render();
+			});
+            if (${workReimbursement.ext == 0}){
+                $(".td1").removeClass("hide");
+                $(".project_reimbursement_div").show();
+                $(".not_project_reimbursement_div").hide();
+            }else {
+                $(".td1").addClass("hide");
+                $(".project_reimbursement_div").hide();
+                $(".not_project_reimbursement_div").show();
+            }
+            if (${workReimbursement.isPublic =='0'}){
+                $(".isPublic").addClass("hide");
+            }else {
+                $(".isPublic").removeClass("hide");
+            }
+			$("#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);
+					}
+				}
+			});
+		});
+	</script>
+	<style>
+		/*超过5个汉字,调整label的长度,以下是配套的*/
+		.layui-item .layui-form-label{
+			width:90px;
+		}
+		.form-group .layui-item .layui-input-block,
+		.query .layui-input-block {
+			margin-left: 116px;
+		}
+		.bluetd	{
+			color: dodgerblue;
+		}
+		.redtd	{
+			color: red;
+		}
+	</style>
+</head>
+<body>
+<div class="single-form">
+	<div class="container view-form">
+	<form:form id="inputForm" modelAttribute="workReimbursement" enctype="multipart/form-data" action="${ctx}/cpa_reimbursement/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"/>
+<%--		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">--%>
+		<div class="form-group layui-row first ">
+			<div class="form-group-label"><h2>基础信息</h2></div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销人:</label>
+				<div class="layui-input-block">
+					<form:input path="submitterName" cssStyle="background-color: #f1f1f1" htmlEscape="false" readonly="true"  id="submitterName"  class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销编号:</label>
+				<div class="layui-input-block">
+					<div class="input-group">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true"  class="form-control layui-input" value="${workReimbursement.number}"/>
+						<span class="input-group-btn">
+                        <label class="form-status"><c:choose><c:when test="${not empty workReimbursement.status}">${fns:getDictLabel(workReimbursement.status, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
+                     </span>
+					</div>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">所属部门:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value = "${workReimbursement.officeName}"/>
+				</div>
+			</div>
+
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销日期:</label>
+				<div class="layui-input-block">
+					<input readonly="readonly" style="background-color: #f1f1f1" class="form-control layui-input" value="<fmt:formatDate value="${workReimbursement.submitterDate}"/>"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报销类型:</label>
+				<div class="layui-input-block">
+					<form:input path="sourceType" cssStyle="background-color: #f1f1f1" htmlEscape="false" readonly="true"  id="sourceType"  class="form-control layui-input" value = "${workReimbursement.sourceType}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm12 with-textarea">
+				<label class="layui-form-label ">备注:</label>
+				<div class="layui-input-block">
+					<form:textarea path="remarks" placeholder="请输入备注" htmlEscape="false" rows="4"  maxlength="255" value="${workReimbursement.remarks}"  class="form-control "/>
+				</div>
+			</div>
+		</div>
+		<div class="form-group layui-row">
+			<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="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="200px">报销人</th>
+						<th width="200px">报销部门</th>
+						<th width="200px">报销类型</th>
+						<th width="200px">报销项目</th>
+<%--						<th width="200px">报告号</th>--%>
+						<th width="200px">费用(元)</th>
+						<th width="200px">收据张数</th>
+						<th width="200px">出差天数</th>
+						<th width="200px">内容</th>
+					</tr>
+					</thead>
+					<tbody id="workAccountList">
+					<c:if test="${not empty workReimbursement.workAccountList}">
+						<c:forEach items="${workReimbursement.workAccountList}" var="workAccount" varStatus="index">
+							<tr id="workAccountList${index.index}">
+								<td class="hide">
+								</td>
+								<td style="text-align: center; vertical-align: middle">
+										${workAccount.reimbursementName}
+								</td>
+								<td style="text-align: center; vertical-align: middle">
+										${workAccount.officeId}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
+										${workAccount.typeName}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.project.projectName}">
+										${workAccount.project.projectName}
+								</td>
+<%--								<td style="text-align: center; vertical-align: middle" title="${workAccount.projectReportNumber}">--%>
+<%--										${workAccount.projectReportNumber}--%>
+<%--								</td>--%>
+
+								<td style="text-align: center; vertical-align: middle">
+									<fmt:formatNumber value="${workAccount.money}" pattern="#,#00.00"/>
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.bills}">
+										${workAccount.bills}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.evectionNumber}">
+										${workAccount.evectionNumber}
+								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.remarks}">
+										${workAccount.remarks}
+								</td>
+							</tr>
+						</c:forEach>
+
+					</c:if>
+					</tbody>
+				</table>
+				<table id="contentMoneys" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+					<thead>
+					<tr style="border: 0px">
+						<td width="200px" style="vertical-align:middle;text-align: center;background-color: #ffffff;"><label>总报销费用(元):</label></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+<%--						<td width="200px" style="background-color: #ffffff;"></td>--%>
+						<td width="200px" style="border: 0px;font-weight: bold;text-align: center;background-color: #ffffff;">
+							<fmt:formatNumber value="${workReimbursement.money}" pattern="#,#00.00"/>
+						</td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+						<td width="200px" style="background-color: #ffffff;"></td>
+					</tr>
+					</thead>
+				</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="contentTable2" class="table table-bordered table-condensed no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="300px">发票代码</th>
+						<th width="200px">发票号</th>
+						<th width="200px">金额</th>
+						<th width="200px">税额</th>
+						<th width="200px">价税合计</th>
+					</tr>
+					</thead>
+					<tbody id="reimbursementVATTaxes">
+					<c:if test="${not empty workReimbursement.reimbursementVATTaxes}">
+						<c:forEach items="${workReimbursement.reimbursementVATTaxes}" var="reimbursementVATTaxe" varStatus="index">
+							<tr>
+								<td class="hide">
+								</td>
+								<td>
+										${reimbursementVATTaxe.invoiceCode}
+								</td>
+
+								<td>
+										${reimbursementVATTaxe.invoiceNumber}
+								</td>
+								<td>
+										${reimbursementVATTaxe.money}
+								</td>
+								<td>
+										${reimbursementVATTaxe.taxAmount}
+								</td>
+								<td>
+										${reimbursementVATTaxe.sumMoney}
+								</td>
+							</tr>
+						</c:forEach>
+					</c:if>
+					</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="upTable" class="table table-bordered table-condensed details">
+					<thead>
+					<tr>
+							<%-- <th>序号</th>--%>
+						<th>文件预览</th>
+						<th>上传人</th>
+						<th>上传时间</th>
+						<th width="150px">操作</th>
+					</tr>
+					</thead>
+					<tbody id="file_attachment">
+						<c:forEach items="${workReimbursement.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workReimbursement.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}">
+											</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="${workReimbursement.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>${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>
+<script>
+	function f1(row) {
+		// window.parent.document.getElementById('opinion').value = row;
+		$("#opinion").val(row)
+	}
+	function openDialogre(title,url,width,height,target,buttons) {
+		if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+			width = 'auto';
+			height = 'auto';
+		} else {//如果是PC端,根据用户设置的width和height显示。
+		}
+		var split = buttons.split(",");
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			maxmin: true, //开启最大化最小化按钮
+			skin: 'three-btns',
+			content: url,
+			btn: split,
+			btn1: function(index, layero){
+				top.layer.close(index)
+				document.getElementById('iframe').contentWindow.location.reload();
+			}
+		});
+	}
+
+</script>
+</body>
+</html>
+