|
@@ -3,21 +3,37 @@ 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.JSONObject;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
|
+import com.jeeplus.common.utils.StringUtils;
|
|
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.InvoiceTaskAliasEnum;
|
|
import com.jeeplus.modules.centerservice.enums.TaskAliasEnum;
|
|
import com.jeeplus.modules.centerservice.enums.TaskAliasEnum;
|
|
|
|
+import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
|
|
+import com.jeeplus.modules.sys.entity.User;
|
|
|
|
+import com.jeeplus.modules.sys.entity.Workattachment;
|
|
|
|
+import com.jeeplus.modules.sys.utils.DictUtils;
|
|
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.workclientinfo.entity.WorkClientAttachment;
|
|
|
|
+import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
|
|
|
|
+import com.jeeplus.modules.workinvoice.entity.WorkInvoiceProjectRelation;
|
|
|
|
+import com.jeeplus.modules.workinvoice.service.WorkInvoiceAllService;
|
|
|
|
+import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
|
|
|
|
+import com.jeeplus.modules.workinvoice.web.WorkInvoiceController;
|
|
|
|
+import com.jeeplus.modules.workinvoicedetail.entity.WorkInvoiceDetail;
|
|
|
|
+import com.jeeplus.modules.workinvoicedetail.service.WorkInvoiceDetailService;
|
|
|
|
+import com.jeeplus.modules.workinvoicedetail.web.WorkInvoiceDetailController;
|
|
import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
|
|
import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
|
|
import com.jeeplus.modules.workreimbursement.entity.WorkAccount;
|
|
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;
|
|
|
|
+import com.jeeplus.modules.workreimbursement.web.WorkReimbursementNewController;
|
|
import org.activiti.engine.HistoryService;
|
|
import org.activiti.engine.HistoryService;
|
|
import org.activiti.engine.history.HistoricProcessInstance;
|
|
import org.activiti.engine.history.HistoricProcessInstance;
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
import org.activiti.engine.task.Task;
|
|
import org.activiti.engine.task.Task;
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.ui.Model;
|
|
@@ -45,6 +61,14 @@ public class TranspondController extends BaseController {
|
|
private WorkReimbursementController workReimbursementController;
|
|
private WorkReimbursementController workReimbursementController;
|
|
@Autowired
|
|
@Autowired
|
|
private WorkReimbursementService workReimbursementService;
|
|
private WorkReimbursementService workReimbursementService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkInvoiceService workInvoiceService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkReimbursementNewController workReimbursementNewController;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkInvoiceController workInvoiceController;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkInvoiceDetailService workInvoiceDetailService;
|
|
|
|
|
|
@RequestMapping(value = "getById", method = RequestMethod.GET)
|
|
@RequestMapping(value = "getById", method = RequestMethod.GET)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -58,6 +82,24 @@ public class TranspondController extends BaseController {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "getInvoiceById", method = RequestMethod.GET)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public Object getInvoiceById(@RequestParam String id, @RequestParam String processDefKey) {
|
|
|
|
+ InvoiceTaskAliasEnum invoiceTaskAliasEnum = InvoiceTaskAliasEnum.getByCcpmContains(processDefKey);
|
|
|
|
+ // 报销
|
|
|
|
+ if (invoiceTaskAliasEnum.getCcpmTaskAlias().equals(InvoiceTaskAliasEnum.INVOICE.getCcpmTaskAlias())) {
|
|
|
|
+ WorkInvoice workInvoice = workInvoiceService.get(id);
|
|
|
|
+ return workInvoice;
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 报销
|
|
|
|
+ * @param id
|
|
|
|
+ * @param processDefKey
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@RequestMapping(value = "getByIdGenerate", method = RequestMethod.GET)
|
|
@RequestMapping(value = "getByIdGenerate", method = RequestMethod.GET)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public Map<String,Object> getByIdGenerate(@RequestParam String id, @RequestParam String processDefKey) {
|
|
public Map<String,Object> getByIdGenerate(@RequestParam String id, @RequestParam String processDefKey) {
|
|
@@ -182,6 +224,266 @@ public class TranspondController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 开票
|
|
|
|
+ * @param id
|
|
|
|
+ * @param processDefKey
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "getInvoiceByIdGenerate", method = RequestMethod.GET)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public Map<String,Object> getInvoiceByIdGenerate(@RequestParam String id, @RequestParam String processDefKey) {
|
|
|
|
+ InvoiceTaskAliasEnum taskAliasEnum = InvoiceTaskAliasEnum.getByCcpmContains(processDefKey);
|
|
|
|
+ Map<String,Object> res = new LinkedHashMap<>();
|
|
|
|
+ User user = UserUtils.getUser();
|
|
|
|
+ // 开票
|
|
|
|
+ if (taskAliasEnum.getCcpmTaskAlias().equals(InvoiceTaskAliasEnum.INVOICE.getCcpmTaskAlias())) {
|
|
|
|
+ WorkInvoice workInvoice = workInvoiceService.get(id);
|
|
|
|
+ if (StringUtils.isNotBlank(workInvoice.getId())) {
|
|
|
|
+ workInvoiceService.queryDetails(workInvoice);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(workInvoice.getNewDrawer())) {
|
|
|
|
+ if ("1".equals(workInvoice.getNewDrawer())){
|
|
|
|
+ workInvoice.setNewDrawerName("企业开票");
|
|
|
|
+ }else {
|
|
|
|
+ workInvoice.setNewDrawerName("个人开票");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<MainDictDetail> billingContentList = DictUtils.getMainDictList("billing_content");
|
|
|
|
+ for (MainDictDetail dictDetail: billingContentList) {
|
|
|
|
+ if(workInvoice.getBillingContent().equals(dictDetail.getValue())){
|
|
|
|
+ workInvoice.setBillingContent(dictDetail.getLabel());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<MainDictDetail> receiptTypeList = DictUtils.getMainDictList("receipt_type");
|
|
|
|
+ for (MainDictDetail dictDetail: receiptTypeList) {
|
|
|
|
+ if(workInvoice.getChargeType().equals(dictDetail.getValue())){
|
|
|
|
+ workInvoice.setChargeType(dictDetail.getLabel());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (Objects.nonNull(workInvoice)) {
|
|
|
|
+ // processInstanceId
|
|
|
|
+ Map<String,Object> procInsId = new HashMap<String,Object>();
|
|
|
|
+ procInsId.put("type", "processInstanceId");
|
|
|
|
+// res.put(JSON.toJSONString(procInsId),workInvoice.getProcessInstanceId());
|
|
|
|
+ res.put("processInstanceId",workInvoice.getProcessInstanceId());
|
|
|
|
+ // 基本信息
|
|
|
|
+ Map<String,Object> detailInfo = new HashMap<String,Object>();
|
|
|
|
+ detailInfo.put("type", "table");
|
|
|
|
+ detailInfo.put("label", "基本信息");
|
|
|
|
+ Map<String,String> detailInfoColumns = new LinkedHashMap<>();
|
|
|
|
+ detailInfoColumns.put("projectName","项目名称");
|
|
|
|
+ detailInfoColumns.put("workContractName","合同名称");
|
|
|
|
+ detailInfoColumns.put("projectNum","项目编号");
|
|
|
|
+ detailInfoColumns.put("clientName","委托方");
|
|
|
|
+ detailInfoColumns.put("reportDataNum","报告号");
|
|
|
|
+ detailInfo.put("tableColumns", detailInfoColumns);
|
|
|
|
+ List<Map<String,Object>> detailInfoList = new ArrayList<>();
|
|
|
|
+ if (Objects.nonNull(workInvoice.getWorkInvoiceProjectRelationList()) && workInvoice.getWorkInvoiceProjectRelationList().size() > 0) {
|
|
|
|
+ for (WorkInvoiceProjectRelation projectRelation : workInvoice.getWorkInvoiceProjectRelationList()) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("projectName", projectRelation.getProjectName());
|
|
|
|
+ map.put("workContractName", projectRelation.getWorkContractName());
|
|
|
|
+ map.put("projectNum", projectRelation.getProjectNum());
|
|
|
|
+ map.put("clientName", projectRelation.getClientName());
|
|
|
|
+ map.put("reportDataNum", projectRelation.getReportDataNum());
|
|
|
|
+ detailInfoList.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+// res.put(JSON.toJSONString(detailInfo),detailInfoList);
|
|
|
|
+ res.put("workInvoiceProjectRelationList",detailInfoList);
|
|
|
|
+ // 发票类型
|
|
|
|
+ Map<String,Object> invoiceTypeName = new HashMap<String,Object>();
|
|
|
|
+ invoiceTypeName.put("type", "input");
|
|
|
|
+ invoiceTypeName.put("label", "发票类型");
|
|
|
|
+ invoiceTypeName.put("disabled", "1"); // 1:禁用。其他或者不赋值则不禁用
|
|
|
|
+// res.put(JSON.toJSONString(invoiceTypeName),workInvoice.getInvoiceTypeStr());
|
|
|
|
+ res.put("invoiceTypeName",workInvoice.getInvoiceTypeStr());
|
|
|
|
+ // 开票类型
|
|
|
|
+ Map<String,Object> newDrawerName = new HashMap<String,Object>();
|
|
|
|
+ newDrawerName.put("type", "input");
|
|
|
|
+ newDrawerName.put("label", "开票类型");
|
|
|
|
+ newDrawerName.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(newDrawerName),workInvoice.getNewDrawerName());
|
|
|
|
+ res.put("newDrawerName",workInvoice.getNewDrawerName());
|
|
|
|
+ // 实际开票单位
|
|
|
|
+ Map<String,Object> clientName = new HashMap<String,Object>();
|
|
|
|
+ clientName.put("type", "input");
|
|
|
|
+ clientName.put("label", "实际开票单位");
|
|
|
|
+ clientName.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(clientName),workInvoice.getClient().getName());
|
|
|
|
+ res.put("clientName",workInvoice.getClient().getName());
|
|
|
|
+ // 纳税人识别号
|
|
|
|
+ Map<String,Object> orUnicode = new HashMap<String,Object>();
|
|
|
|
+ orUnicode.put("type", "input");
|
|
|
|
+ orUnicode.put("label", "纳税人识别号");
|
|
|
|
+ orUnicode.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(orUnicode),workInvoice.getOrUnicode());
|
|
|
|
+ res.put("taxpayerIdentificationNo",workInvoice.getOrUnicode());
|
|
|
|
+ // 注册地址
|
|
|
|
+ Map<String,Object> address = new HashMap<String,Object>();
|
|
|
|
+ address.put("type", "input");
|
|
|
|
+ address.put("label", "注册地址");
|
|
|
|
+ address.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(address),workInvoice.getAddress());
|
|
|
|
+ res.put("address",workInvoice.getAddress());
|
|
|
|
+ // 电话
|
|
|
|
+ Map<String,Object> telephone = new HashMap<String,Object>();
|
|
|
|
+ telephone.put("type", "input");
|
|
|
|
+ telephone.put("label", "电话");
|
|
|
|
+ telephone.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(telephone),workInvoice.getTelephone());
|
|
|
|
+ res.put("telephone",workInvoice.getTelephone());
|
|
|
|
+ // 开户银行
|
|
|
|
+ Map<String,Object> bank = new HashMap<String,Object>();
|
|
|
|
+ bank.put("type", "input");
|
|
|
|
+ bank.put("label", "开户银行");
|
|
|
|
+ bank.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(bank),workInvoice.getBank());
|
|
|
|
+ res.put("bank",workInvoice.getBank());
|
|
|
|
+ // 银行账号
|
|
|
|
+ Map<String,Object> bankNumber = new HashMap<String,Object>();
|
|
|
|
+ bankNumber.put("type", "input");
|
|
|
|
+ bankNumber.put("label", "银行账号");
|
|
|
|
+ bankNumber.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(bankNumber),workInvoice.getBankNumber());
|
|
|
|
+ res.put("bankNumber",workInvoice.getBankNumber());
|
|
|
|
+ // 收款类型
|
|
|
|
+ Map<String,Object> chargeType = new HashMap<String,Object>();
|
|
|
|
+ chargeType.put("type", "input");
|
|
|
|
+ chargeType.put("label", "收款类型");
|
|
|
|
+ chargeType.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(chargeType),workInvoice.getChargeType());
|
|
|
|
+ res.put("chargeType",workInvoice.getChargeType());
|
|
|
|
+ // 开票内容
|
|
|
|
+ Map<String,Object> billingContent = new HashMap<String,Object>();
|
|
|
|
+ billingContent.put("type", "input");
|
|
|
|
+ billingContent.put("label", "开票内容");
|
|
|
|
+ billingContent.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(billingContent),workInvoice.getBillingContent());
|
|
|
|
+ res.put("billingContent",workInvoice.getBillingContent());
|
|
|
|
+ // 开票金额
|
|
|
|
+ Map<String,Object> money = new HashMap<String,Object>();
|
|
|
|
+ money.put("type", "input");
|
|
|
|
+ money.put("label", "开票金额(元)");
|
|
|
|
+ money.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(money),workInvoice.getMoneyStr());
|
|
|
|
+ res.put("money",workInvoice.getMoneyStr());
|
|
|
|
+ // 开票内容要求
|
|
|
|
+ Map<String,Object> content = new HashMap<String,Object>();
|
|
|
|
+ content.put("type", "input");
|
|
|
|
+ content.put("label", "开票内容要求");
|
|
|
|
+ content.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(content),workInvoice.getContent());
|
|
|
|
+ res.put("content",workInvoice.getContent());
|
|
|
|
+ // 开票人
|
|
|
|
+ Map<String,Object> drawerName = new HashMap<String,Object>();
|
|
|
|
+ drawerName.put("type", "input");
|
|
|
|
+ drawerName.put("label", "开票人");
|
|
|
|
+ drawerName.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(drawerName),user.getName());
|
|
|
|
+ res.put("drawerName",user.getName());
|
|
|
|
+ // 开票时间
|
|
|
|
+ Map<String,Object> invoiceDate = new HashMap<String,Object>();
|
|
|
|
+ invoiceDate.put("type", "input");
|
|
|
|
+ invoiceDate.put("label", "开票时间");
|
|
|
|
+ invoiceDate.put("disabled", "");
|
|
|
|
+// res.put(JSON.toJSONString(invoiceDate),workInvoice.getInvoiceDate());
|
|
|
|
+ res.put("invoiceDate",workInvoice.getInvoiceDate());
|
|
|
|
+ // 领票时间
|
|
|
|
+ Map<String,Object> takeDate = new HashMap<String,Object>();
|
|
|
|
+ takeDate.put("type", "input");
|
|
|
|
+ takeDate.put("label", "领票时间");
|
|
|
|
+ takeDate.put("disabled", "");
|
|
|
|
+// res.put(JSON.toJSONString(takeDate),workInvoice.getTakeDate());
|
|
|
|
+ res.put("takeDate",workInvoice.getTakeDate());
|
|
|
|
+ // 实际开票人
|
|
|
|
+ Map<String,Object> actualDrawerName = new HashMap<String,Object>();
|
|
|
|
+ actualDrawerName.put("type", "input");
|
|
|
|
+ actualDrawerName.put("label", "实际开票人");
|
|
|
|
+ actualDrawerName.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(actualDrawerName),workInvoice.getActualDrawerName());
|
|
|
|
+ res.put("actualDrawerName",workInvoice.getActualDrawerName());
|
|
|
|
+ // 接收邮箱
|
|
|
|
+ Map<String,Object> actualDrawerEmailAddress = new HashMap<String,Object>();
|
|
|
|
+ actualDrawerEmailAddress.put("type", "input");
|
|
|
|
+ actualDrawerEmailAddress.put("label", "接收邮箱");
|
|
|
|
+ actualDrawerEmailAddress.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(actualDrawerEmailAddress),workInvoice.getActualDrawerEmailAddress());
|
|
|
|
+ res.put("actualDrawerEmailAddress",workInvoice.getActualDrawerEmailAddress());
|
|
|
|
+ // 对账人
|
|
|
|
+ Map<String,Object> accountCheckingUserName = new HashMap<String,Object>();
|
|
|
|
+ accountCheckingUserName.put("type", "input");
|
|
|
|
+ accountCheckingUserName.put("label", "对账人");
|
|
|
|
+ accountCheckingUserName.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(accountCheckingUserName),workInvoice.getAccountCheckingUserName());
|
|
|
|
+ res.put("accountCheckingUserName",workInvoice.getAccountCheckingUserName());
|
|
|
|
+ // 对账地区
|
|
|
|
+ Map<String,Object> area = new HashMap<String,Object>();
|
|
|
|
+ area.put("type", "input");
|
|
|
|
+ area.put("label", "对账地区");
|
|
|
|
+ area.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(area),workInvoice.getArea().getName());
|
|
|
|
+ res.put("area",workInvoice.getArea().getName());
|
|
|
|
+ // 备注
|
|
|
|
+ Map<String,Object> remarks = new HashMap<String,Object>();
|
|
|
|
+ remarks.put("type", "textarea");
|
|
|
|
+ remarks.put("label", "备注");
|
|
|
|
+ remarks.put("disabled", "1");
|
|
|
|
+// res.put(JSON.toJSONString(remarks),workInvoice.getRemarks());
|
|
|
|
+ res.put("remarks",workInvoice.getRemarks());
|
|
|
|
+ // 电子发票附件信息
|
|
|
|
+ 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(workInvoice.getWorkAttachments()) && workInvoice.getWorkAttachments().size() > 0) {
|
|
|
|
+ for (Workattachment workClientAttachment : workInvoice.getWorkAttachments()) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("attachmentName",workClientAttachment.getAttachmentName()); // 附件名称
|
|
|
|
+ map.put("createName",workClientAttachment.getAttachmentUser()); // 创建人
|
|
|
|
+ map.put("createDate",workClientAttachment.getCreateDate()); // 创建时间
|
|
|
|
+ map.put("url",workClientAttachment.getUrl()); // 文件地址
|
|
|
|
+ map.put("temporaryUrl",workClientAttachment.getTemporaryUrl()); // 文件临时地址
|
|
|
|
+ fileList.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+// res.put(JSON.toJSONString(files),fileList);
|
|
|
|
+ res.put("files",fileList);
|
|
|
|
+ // 发票明细
|
|
|
|
+ Map<String,Object> workAccount = new HashMap<String,Object>();
|
|
|
|
+ workAccount.put("type", "table");
|
|
|
|
+ workAccount.put("label", "发票明细");
|
|
|
|
+ Map<String,String> workAccountColumns = new LinkedHashMap<>();
|
|
|
|
+ workAccountColumns.put("code","发票代码");
|
|
|
|
+ workAccountColumns.put("number","发票号");
|
|
|
|
+ workAccountColumns.put("account","开票金额");
|
|
|
|
+ workAccountColumns.put("rate","税率");
|
|
|
|
+ workAccountColumns.put("amount","金额");
|
|
|
|
+ workAccountColumns.put("tax","税额");
|
|
|
|
+ workAccount.put("tableColumns", workAccountColumns);
|
|
|
|
+ List<Map<String,Object>> workAccountList = new ArrayList<>();
|
|
|
|
+ if (Objects.nonNull(workInvoice.getWorkAccountList()) && workInvoice.getWorkAccountList().size() > 0) {
|
|
|
|
+ for (WorkInvoiceDetail invoiceDetail : workInvoice.getWorkAccountList()) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("code",invoiceDetail.getCode());
|
|
|
|
+ map.put("number",invoiceDetail.getNumber());
|
|
|
|
+ map.put("account",workInvoice.getMoneyStr());
|
|
|
|
+ workAccountColumns.put("rate",invoiceDetail.getTax());
|
|
|
|
+ workAccountColumns.put("amount",invoiceDetail.getTaxMoneyStr());
|
|
|
|
+ workAccountColumns.put("tax",invoiceDetail.getTaxRateStr());
|
|
|
|
+ workAccountList.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+// res.put(JSON.toJSONString(workAccount),workAccountList);
|
|
|
|
+ res.put("workAccountList",workAccountList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 审核分发操作
|
|
* 审核分发操作
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -230,4 +532,135 @@ public class TranspondController extends BaseController {
|
|
}
|
|
}
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 报销审核分发操作
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "auditReimDistribute", method = RequestMethod.POST)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public Map<String,Object> auditReimDistribute(@RequestBody Object object) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ //判断是否为报销数据参数
|
|
|
|
+ WorkReimbursement workReimbursement = JSON.parseObject(JSON.toJSONString(object), WorkReimbursement.class);
|
|
|
|
+ ProcessInstance processInstance = actTaskService.getProcIns(workReimbursement.getProcessInstanceId());
|
|
|
|
+ if (processInstance!=null) {
|
|
|
|
+ List<Task> taskList = actTaskService.getCurrentTaskList(processInstance);
|
|
|
|
+ Act act = new Act();
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ RedirectAttributes redirectAttributes = new RedirectAttributesModelMap();
|
|
|
|
+ Model model = new BindingAwareModelMap();
|
|
|
|
+ workReimbursementNewController.saveAudit(workReimbursement, model, redirectAttributes);
|
|
|
|
+ Map<String, ?> flashAttributes = redirectAttributes.getFlashAttributes();
|
|
|
|
+ String message = (String)flashAttributes.get("message");
|
|
|
|
+ if(message.contains("成功")){
|
|
|
|
+ map.put("success", true);
|
|
|
|
+ map.put("message","操作成功");
|
|
|
|
+ }else{
|
|
|
|
+ map.put("success", false);
|
|
|
|
+ map.put("message","操作失败");
|
|
|
|
+ }
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 开票审核分发操作
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "auditInvoiceDistribute", method = RequestMethod.POST)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public Map<String,Object> auditInvoiceDistribute(@RequestBody Object object) {
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ //判断是否为发票数据参数
|
|
|
|
+ WorkInvoice workInvoice = JSON.parseObject(JSON.toJSONString(object), WorkInvoice.class);
|
|
|
|
+ ProcessInstance processInstance = actTaskService.getProcIns(workInvoice.getProcessInstanceId());
|
|
|
|
+ if (processInstance!=null) {
|
|
|
|
+ List<Task> taskList = actTaskService.getCurrentTaskList(processInstance);
|
|
|
|
+ Act act = new Act();
|
|
|
|
+ if(taskList!=null && taskList.size()>1){
|
|
|
|
+ for (Task taskInfok:taskList) {
|
|
|
|
+ if (UserUtils.getUser().getId().equals(taskInfok.getAssignee())) {
|
|
|
|
+ workInvoice.getAct().setTaskId(taskInfok.getId());
|
|
|
|
+ workInvoice.getAct().setTaskName(taskInfok.getName());
|
|
|
|
+ workInvoice.getAct().setTaskDefKey(taskInfok.getTaskDefinitionKey());
|
|
|
|
+ workInvoice.getAct().setProcDefId(taskInfok.getProcessDefinitionId());
|
|
|
|
+ workInvoice.getAct().setProcInsId(taskInfok.getProcessInstanceId());
|
|
|
|
+ workInvoice.getAct().setTask(taskInfok);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ Task task = actTaskService.getCurrentTaskInfo(processInstance);
|
|
|
|
+ workInvoice.getAct().setTaskId(task.getId());
|
|
|
|
+ workInvoice.getAct().setTaskName(task.getName());
|
|
|
|
+ workInvoice.getAct().setTaskDefKey(task.getTaskDefinitionKey());
|
|
|
|
+ workInvoice.getAct().setProcDefId(task.getProcessDefinitionId());
|
|
|
|
+ workInvoice.getAct().setProcInsId(task.getProcessInstanceId());
|
|
|
|
+ workInvoice.getAct().setTask(task);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ RedirectAttributes redirectAttributes = new RedirectAttributesModelMap();
|
|
|
|
+ Model model = new BindingAwareModelMap();
|
|
|
|
+ String showFlag = "";
|
|
|
|
+ String isProject = "";//是否是项目开票
|
|
|
|
+ for (WorkInvoiceProjectRelation projectRelation : workInvoice.getWorkInvoiceProjectRelationList()) {
|
|
|
|
+ if (projectRelation.getIsProject() == 2){
|
|
|
|
+ isProject = "no";
|
|
|
|
+ }else {
|
|
|
|
+ isProject = "yes";
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ("no".equals(isProject)){
|
|
|
|
+ //其他开票
|
|
|
|
+ workInvoiceController.saveWorkInvoiceNotProjectAudit(workInvoice, showFlag, model, redirectAttributes);
|
|
|
|
+ }else {
|
|
|
|
+ workInvoiceController.saveAudit(workInvoice, model, redirectAttributes);
|
|
|
|
+ }
|
|
|
|
+ Map<String, ?> flashAttributes = redirectAttributes.getFlashAttributes();
|
|
|
|
+ String message = (String)flashAttributes.get("message");
|
|
|
|
+ if(message.contains("成功")){
|
|
|
|
+ map.put("success", true);
|
|
|
|
+ map.put("message","操作成功");
|
|
|
|
+ }else{
|
|
|
|
+ map.put("success", false);
|
|
|
|
+ map.put("message","操作失败");
|
|
|
|
+ }
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 查询发票号是否存在
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "queryByNumber", method = RequestMethod.GET)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public boolean queryByNumber(@RequestParam String number) {
|
|
|
|
+ Integer res = workInvoiceDetailService.countByNumber(number);
|
|
|
|
+ if (res>0){
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|