|
@@ -1,11 +1,16 @@
|
|
package com.jeeplus.modules.centerservice.web;
|
|
package com.jeeplus.modules.centerservice.web;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.jeeplus.common.web.BaseController;
|
|
import com.jeeplus.common.web.BaseController;
|
|
import com.jeeplus.modules.act.entity.Act;
|
|
import com.jeeplus.modules.act.entity.Act;
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
import com.jeeplus.modules.centerservice.enums.TaskAliasEnum;
|
|
import com.jeeplus.modules.centerservice.enums.TaskAliasEnum;
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
|
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
|
|
+import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
|
|
|
|
+import com.jeeplus.modules.workreimbursement.entity.WorkAccount;
|
|
import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
|
|
import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
|
|
import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
|
|
import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
|
|
import com.jeeplus.modules.workreimbursement.web.WorkReimbursementController;
|
|
import com.jeeplus.modules.workreimbursement.web.WorkReimbursementController;
|
|
@@ -21,9 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributesModelMap;
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributesModelMap;
|
|
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* cpa系统流程审核转发controller
|
|
* cpa系统流程审核转发controller
|
|
@@ -55,6 +58,129 @@ public class TranspondController extends BaseController {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "getByIdGenerate", method = RequestMethod.GET)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public Map<String,Object> getByIdGenerate(@RequestParam String id, @RequestParam String processDefKey) {
|
|
|
|
+ TaskAliasEnum taskAliasEnum = TaskAliasEnum.getByCcpmContains(processDefKey);
|
|
|
|
+ Map<String,Object> res = new LinkedHashMap<>();
|
|
|
|
+ // 报销
|
|
|
|
+ if (taskAliasEnum.getCcpmTaskAlias().equals(TaskAliasEnum.REIMBURSEMENT.getCcpmTaskAlias())) {
|
|
|
|
+ WorkReimbursement workReimbursement = workReimbursementService.get(id);
|
|
|
|
+ if (Objects.nonNull(workReimbursement)) {
|
|
|
|
+ // processInstanceId
|
|
|
|
+ Map<String,Object> procInsId = new HashMap<String,Object>();
|
|
|
|
+ procInsId.put("type", "processInstanceId");
|
|
|
|
+ res.put(JSON.toJSONString(procInsId),workReimbursement.getProcessInstanceId());
|
|
|
|
+ // 经办人
|
|
|
|
+ Map<String,Object> submitterName = new HashMap<String,Object>();
|
|
|
|
+ submitterName.put("type", "input");
|
|
|
|
+ submitterName.put("label", "报销人");
|
|
|
|
+ submitterName.put("disabled", "1"); // 1:禁用。其他或者不赋值则不禁用
|
|
|
|
+ res.put(JSON.toJSONString(submitterName),workReimbursement.getSubmitterName());
|
|
|
|
+ // 报销编号
|
|
|
|
+ Map<String,Object> number = new HashMap<String,Object>();
|
|
|
|
+ number.put("type", "input");
|
|
|
|
+ number.put("label", "报销编号");
|
|
|
|
+ number.put("disabled", "1");
|
|
|
|
+ res.put(JSON.toJSONString(number),workReimbursement.getNumber());
|
|
|
|
+ // 所属部门
|
|
|
|
+ Map<String,Object> officeName = new HashMap<String,Object>();
|
|
|
|
+ officeName.put("type", "input");
|
|
|
|
+ officeName.put("label", "所属部门");
|
|
|
|
+ officeName.put("disabled", "1");
|
|
|
|
+ res.put(JSON.toJSONString(officeName),workReimbursement.getOfficeName());
|
|
|
|
+ // 报销日期
|
|
|
|
+ Map<String,Object> createDate = new HashMap<String,Object>();
|
|
|
|
+ createDate.put("type", "input");
|
|
|
|
+ createDate.put("label", "报销日期");
|
|
|
|
+ createDate.put("disabled", "1");
|
|
|
|
+ res.put(JSON.toJSONString(createDate),workReimbursement.getCreateDate());
|
|
|
|
+ // 备注
|
|
|
|
+ Map<String,Object> remarks = new HashMap<String,Object>();
|
|
|
|
+ remarks.put("type", "textarea");
|
|
|
|
+ remarks.put("label", "备注");
|
|
|
|
+ remarks.put("disabled", "1");
|
|
|
|
+ res.put(JSON.toJSONString(remarks),workReimbursement.getRemarks());
|
|
|
|
+ // 报销详情
|
|
|
|
+ Map<String,Object> detailInfo = new HashMap<String,Object>();
|
|
|
|
+ detailInfo.put("type", "table");
|
|
|
|
+ detailInfo.put("label", "报销详情");
|
|
|
|
+ Map<String,String> detailInfoColumns = new LinkedHashMap<>();
|
|
|
|
+ detailInfoColumns.put("reimbursementName","报销人");
|
|
|
|
+ detailInfoColumns.put("officeId","报销部门");
|
|
|
|
+ detailInfoColumns.put("typeName","报销类别");
|
|
|
|
+ detailInfoColumns.put("projectName","报销项目");
|
|
|
|
+ detailInfoColumns.put("projectReportNumber","报告号");
|
|
|
|
+ detailInfoColumns.put("money","费用(元)");
|
|
|
|
+ detailInfoColumns.put("bills","收据张数");
|
|
|
|
+ detailInfoColumns.put("evectionNumber","出差天数");
|
|
|
|
+ detailInfoColumns.put("remarks","内容");
|
|
|
|
+ detailInfo.put("tableColumns", detailInfoColumns);
|
|
|
|
+ List<Map<String,Object>> detailInfoList = new ArrayList<>();
|
|
|
|
+ if (Objects.nonNull(workReimbursement.getWorkAccountList()) && workReimbursement.getWorkAccountList().size() > 0) {
|
|
|
|
+ for (WorkAccount workAccount : workReimbursement.getWorkAccountList()) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("reimbursementName", workAccount.getReimbursementName());
|
|
|
|
+ map.put("officeId", workAccount.getOfficeId());
|
|
|
|
+ map.put("typeName", workAccount.getTypeName());
|
|
|
|
+ if (Objects.nonNull(workAccount.getProject())) {
|
|
|
|
+ map.put("projectName", workAccount.getProject().getProjectName());
|
|
|
|
+ }
|
|
|
|
+ map.put("projectReportNumber", workAccount.getProjectReportNumber());
|
|
|
|
+ map.put("money", workAccount.getMoney());
|
|
|
|
+ map.put("bills", workAccount.getBills());
|
|
|
|
+ map.put("evectionNumber", workAccount.getEvectionNumber());
|
|
|
|
+ map.put("remarks", workAccount.getRemarks());
|
|
|
|
+ detailInfoList.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ res.put(JSON.toJSONString(detailInfo),detailInfoList);
|
|
|
|
+ // 专用发票信息
|
|
|
|
+ Map<String,Object> vATTaxes = new HashMap<String,Object>();
|
|
|
|
+ vATTaxes.put("type", "table");
|
|
|
|
+ vATTaxes.put("label", "专用发票信息");
|
|
|
|
+ Map<String,String> vATTaxesInfoColumns = new LinkedHashMap<>();
|
|
|
|
+ vATTaxesInfoColumns.put("invoiceCode","发票代码");
|
|
|
|
+ vATTaxesInfoColumns.put("invoiceNumber","发票号");
|
|
|
|
+ vATTaxesInfoColumns.put("money","金额");
|
|
|
|
+ vATTaxesInfoColumns.put("taxAmount","税额");
|
|
|
|
+ vATTaxesInfoColumns.put("sumMoney","价税合计");
|
|
|
|
+ vATTaxes.put("tableColumns", vATTaxesInfoColumns);
|
|
|
|
+ List<Map<String,Object>> vATTaxesList = new ArrayList<>();
|
|
|
|
+ if (Objects.nonNull(workReimbursement.getReimbursementVATTaxes()) && workReimbursement.getReimbursementVATTaxes().size() > 0) {
|
|
|
|
+ for (ReimbursementVATTax reimbursementVATTax : workReimbursement.getReimbursementVATTaxes()) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("invoiceCode",reimbursementVATTax.getInvoiceCode());
|
|
|
|
+ map.put("invoiceNumber",reimbursementVATTax.getInvoiceNumber());
|
|
|
|
+ map.put("money",reimbursementVATTax.getMoney());
|
|
|
|
+ map.put("taxAmount",reimbursementVATTax.getTaxAmount());
|
|
|
|
+ map.put("sumMoney",reimbursementVATTax.getSumMoney());
|
|
|
|
+ vATTaxesList.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ res.put(JSON.toJSONString(vATTaxes),vATTaxesList);
|
|
|
|
+ // 附件
|
|
|
|
+ Map<String,Object> files = new HashMap<String,Object>();
|
|
|
|
+ files.put("type", "files");
|
|
|
|
+ files.put("label", "附件");
|
|
|
|
+ List<Map<String,Object>> fileList = new ArrayList<>();
|
|
|
|
+ if (Objects.nonNull(workReimbursement.getWorkAttachments()) && workReimbursement.getWorkAttachments().size() > 0) {
|
|
|
|
+ for (WorkClientAttachment workClientAttachment : workReimbursement.getWorkAttachments()) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("attachmentName",workClientAttachment.getAttachmentName()); // 附件名称
|
|
|
|
+ map.put("createName",workClientAttachment.getCreateName()); // 创建人
|
|
|
|
+ map.put("createDate",workClientAttachment.getCreateDate()); // 创建时间
|
|
|
|
+ map.put("url",workClientAttachment.getUrl()); // 文件地址
|
|
|
|
+ map.put("temporaryUrl",workClientAttachment.getTemporaryUrl()); // 文件临时地址
|
|
|
|
+ fileList.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ res.put(JSON.toJSONString(files),fileList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 审核分发操作
|
|
* 审核分发操作
|
|
* @return
|
|
* @return
|
|
@@ -72,24 +198,22 @@ public class TranspondController extends BaseController {
|
|
if(taskList!=null && taskList.size()>1){
|
|
if(taskList!=null && taskList.size()>1){
|
|
for (Task taskInfok:taskList) {
|
|
for (Task taskInfok:taskList) {
|
|
if (UserUtils.getUser().getId().equals(taskInfok.getAssignee())) {
|
|
if (UserUtils.getUser().getId().equals(taskInfok.getAssignee())) {
|
|
- act.setTaskId(taskInfok.getId());
|
|
|
|
- act.setTaskName(taskInfok.getName());
|
|
|
|
- act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
|
|
|
|
- act.setProcDefId(taskInfok.getProcessDefinitionId());
|
|
|
|
- act.setProcInsId(taskInfok.getProcessInstanceId());
|
|
|
|
- act.setTask(taskInfok);
|
|
|
|
- workReimbursement.setAct(act);
|
|
|
|
|
|
+ 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 {
|
|
}else {
|
|
Task task = actTaskService.getCurrentTaskInfo(processInstance);
|
|
Task task = actTaskService.getCurrentTaskInfo(processInstance);
|
|
- act.setTaskId(task.getId());
|
|
|
|
- act.setTaskName(task.getName());
|
|
|
|
- act.setTaskDefKey(task.getTaskDefinitionKey());
|
|
|
|
- act.setProcDefId(task.getProcessDefinitionId());
|
|
|
|
- act.setProcInsId(task.getProcessInstanceId());
|
|
|
|
- act.setTask(task);
|
|
|
|
- workReimbursement.setAct(act);
|
|
|
|
|
|
+ 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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
RedirectAttributes redirectAttributes = new RedirectAttributesModelMap();
|
|
RedirectAttributes redirectAttributes = new RedirectAttributesModelMap();
|