Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

[user3] 3 yıl önce
ebeveyn
işleme
069bafd3b3
16 değiştirilmiş dosya ile 3682 ekleme ve 95 silme
  1. 8 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
  2. 9 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/Action.java
  3. 96 25
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java
  4. 27 44
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  5. 9 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  6. 71 13
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java
  7. 3 9
      src/main/java/com/jeeplus/modules/tools/utils/SignaturePostUtil.java
  8. 531 0
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java
  9. 54 0
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceController.java
  10. 29 2
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java
  11. 60 0
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  12. 13 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  13. 737 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceExamineAudit.jsp
  14. 911 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceExamineAuditEnd.jsp
  15. 1122 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceExamineModify.jsp
  16. 2 2
      src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoList.jsp

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

@@ -252,4 +252,12 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
      * @return
      */
     RuralProjectRecords getProjectRecordsByContractId(String contractId);
+
+
+    /**
+     * 根据项目id查询造假审核项目的项目类别
+     * @param projectIdList
+     * @return
+     */
+    String getProjectSortCostInfo(@Param("projectIdList") List<String> projectIdList);
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/Action.java

@@ -11,6 +11,7 @@ public class Action {
     private String name;
     private String serialNo;
     private String sealId;
+    private String autoSign;
     private List<ActionOperatorInfo> actionOperators; //签署人信息
     private List<Location> locations; //位置信息
 
@@ -38,6 +39,14 @@ public class Action {
         this.serialNo = serialNo;
     }
 
+    public String getAutoSign() {
+        return autoSign;
+    }
+
+    public void setAutoSign(String autoSign) {
+        this.autoSign = autoSign;
+    }
+
     public List<ActionOperatorInfo> getActionOperators() {
         return actionOperators;
     }

+ 96 - 25
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java

@@ -1,5 +1,6 @@
 package com.jeeplus.modules.ruralprojectrecords.service;
 
+import com.alibaba.fastjson.JSON;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.jeeplus.common.config.Global;
@@ -162,7 +163,11 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
 
     @Transactional(readOnly = false)
     public void approvalSave(ProjectApprovalSignature projectApprovalSignature) throws Exception {
-
+        RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectApprovalSignature.getProjectId());
+        ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(ruralProjectRecords.getId());
+        if(null == projectReportData){
+            throw new Exception("报告号为空,无法提交审定单!");
+        }
         if(projectApprovalSignature.getStatus()== ProjectStatusEnum.IN_APRL.getValue() && StringUtils.isBlank(projectApprovalSignature.getId())){
             projectApprovalSignature.setOffice(UserUtils.getSelectOffice());
             projectApprovalSignature.setCompany(UserUtils.getSelectCompany());
@@ -524,9 +529,19 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                                     return "请上传doc、docx或者pdf的文件进行签章操作";
                                 }
                                 //获取真签单的documentId
-                                String documentId = SignaturePostUtil.getDocument(srcFile);
-                                if("".equals(documentId)){
-                                    return "签章文件创建失败";
+                                HashMap hashMap = SignaturePostUtil.getDocument(srcFile);
+                                String code = hashMap.get("code").toString();
+                                String documentId = "";
+                                if("0".equals(code)){
+                                    String result = hashMap.get("result").toString();
+                                    HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                                    documentId =  documentIdMap.get("documentId").toString();
+                                    if("".equals(documentId)){
+                                        return "签章文件创建失败";
+                                    }
+                                }else{
+                                    String message = hashMap.get("message").toString();
+                                    return message;
                                 }
                                 //获取竖版假(空白)签单的documentId
                                 String verticalInvalidDocumentId = SignaturePostUtil.getVerticalInvalidDocument(verticalInvalidFile.getName(),verticalInvalidFile);
@@ -543,12 +558,25 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                                 //将空白单的documentId存入数据库种
                                 projectReportData.setSignatureInvalidDocumentId(String.join(",", invalidDocumentList));
                                 //根据项目id 和 documentId生成合同id
-                                String contractId = ruralProjectMessageService.getSignatureContractId(ruralProjectRecords.getId(), documentList,ruralProjectRecords.getProjectMasterId(),"");
-                                if("".equals(contractId)){
-                                    return "签章文件创建失败";
+                                HashMap contractIdHashMap = ruralProjectMessageService.getSignatureContractId(ruralProjectRecords.getId(), documentList,ruralProjectRecords.getProjectMasterId(),"");
+                                String contractIdCode = contractIdHashMap.get("code").toString();
+                                String contractId = "";
+                                if("0".equals(contractIdCode)){
+                                    contractId = contractIdHashMap.get("contractId").toString();
+                                    if("".equals(contractId)){
+                                        return "签章文件创建失败";
+                                    }
+                                }else{
+                                    return contractIdHashMap.get("message").toString();
                                 }
                                 //进行静默签署
-                                ruralProjectMessageService.signbyCompany(contractId,documentList);
+                                HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompany(contractId, documentList);
+                                if(null != signbyCompanyHashMap){
+                                    String signbyCompany = signbyCompanyHashMap.get("code").toString();
+                                    if(!"0".equals(signbyCompany)){
+                                        return signbyCompanyHashMap.get("message").toString();
+                                    }
+                                }
                                 //将documentId 和contractId存储到质量复核对应的数据种
                                 //签章完成则进行数据的保存
                                 projectReportData.setSignatureFlag(1);
@@ -1230,16 +1258,50 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                                     return "请上传doc、docx或者pdf的文件进行签章操作";
                                 }
                                 //获取真签单的documentId
-                                String documentId = SignaturePostUtil.getDocument(srcFile);
+                                HashMap hashMap = SignaturePostUtil.getDocument(srcFile);
+                                String code = hashMap.get("code").toString();
+                                String documentId = "";
+                                if("0".equals(code)){
+                                    String result = hashMap.get("result").toString();
+                                    HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                                    documentId =  documentIdMap.get("documentId").toString();
+                                    if("".equals(documentId)){
+                                        return "签章文件创建失败";
+                                    }
+                                }else{
+                                    String message = hashMap.get("message").toString();
+                                    return message;
+                                }
                                 List<String> documentList = Lists.newArrayList();
                                 documentList.add(documentId);
                                 //根据项目id 和 documentId生成合同id
-                                String contractId = ruralProjectMessageService.getReportSignatureContractId(ruralProjectRecords.getId(), documentList,ruralProjectRecords.getProjectMasterId(),"");
-                                if("".equals(contractId)){
-                                    return "签章文件创建失败";
+                                long s1 = System.currentTimeMillis();
+                                HashMap contractIdHashMap = ruralProjectMessageService.getReportSignatureContractId(ruralProjectRecords.getId(), documentList,ruralProjectRecords.getProjectMasterId(),"");
+                                String contractIdCode = contractIdHashMap.get("code").toString();
+                                String contractId = "";
+                                if("0".equals(contractIdCode)){
+                                    contractId = contractIdHashMap.get("contractId").toString();
+                                    if("".equals(contractId)){
+                                        return "签章文件创建失败";
+                                    }
+                                }else{
+                                    return contractIdHashMap.get("message").toString();
                                 }
+                                long s2 = System.currentTimeMillis();
+                                System.out.println("创建签章合同用时:" + (s2-s1));
+
                                 //进行静默签署
-                                ruralProjectMessageService.signbyCompanyByKeyWord(contractId,documentList);
+                                long s3 = System.currentTimeMillis();
+                                HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompanyByKeyWord(contractId,documentList);
+                                if(null != signbyCompanyHashMap){
+                                    String signbyCompanyCode = signbyCompanyHashMap.get("code").toString();
+                                    String signbyCompanyMessage = signbyCompanyHashMap.get("message").toString();
+                                    if(!"0".equals(signbyCompanyCode) && (!"3001009".equals(signbyCompanyCode) || !"文件状态不是“签署中”".equals(signbyCompanyMessage))){
+                                        return signbyCompanyMessage;
+                                    }
+                                }
+                                long s4 = System.currentTimeMillis();
+                                System.out.println("进行静默签署用时:" + (s4-s3));
                                 //将documentId 和contractId存储到质量复核对应的数据种
                                 //签章完成则进行数据的保存
                                 ruralProjectRecords.setReportSignatureFlag(1);
@@ -2063,23 +2125,32 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         }
         //送审金额
         if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getSubmitFee())){
-            // 四舍五入
-            BigDecimal value = new BigDecimal(projectReportSignatureInfo.getSubmitFee()).setScale(2,BigDecimal.ROUND_HALF_UP);
-            // 不足两位小数补0
-            DecimalFormat decimalFormat = new DecimalFormat("0.00#");
-            String strVal = decimalFormat.format(value);
-            data.put("submitFee",strVal);
+            if(isNumeric(projectReportSignatureInfo.getSubmitFee())){
+                // 四舍五入
+                BigDecimal value = new BigDecimal(projectReportSignatureInfo.getSubmitFee()).setScale(2,BigDecimal.ROUND_HALF_UP);
+                // 不足两位小数补0
+                DecimalFormat decimalFormat = new DecimalFormat("0.00#");
+                String strVal = decimalFormat.format(value);
+                data.put("submitFee",strVal);
+            }else{
+                data.put("submitFee",projectReportSignatureInfo.getSubmitFee());
+            }
         }else{
             data.put("submitFee","");
         }
         //审定金额
         if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getAuthorizeFee())){
-            // 四舍五入
-            BigDecimal value = new BigDecimal(projectReportSignatureInfo.getAuthorizeFee()).setScale(2,BigDecimal.ROUND_HALF_UP);
-            // 不足两位小数补0
-            DecimalFormat decimalFormat = new DecimalFormat("0.00#");
-            String strVal = decimalFormat.format(value);
-            data.put("examineAndApproveFee",strVal);
+            if(isNumeric(projectReportSignatureInfo.getAuthorizeFee())){
+
+                // 四舍五入
+                BigDecimal value = new BigDecimal(projectReportSignatureInfo.getAuthorizeFee()).setScale(2,BigDecimal.ROUND_HALF_UP);
+                // 不足两位小数补0
+                DecimalFormat decimalFormat = new DecimalFormat("0.00#");
+                String strVal = decimalFormat.format(value);
+                data.put("examineAndApproveFee",strVal);
+            }else{
+                data.put("examineAndApproveFee",projectReportSignatureInfo.getAuthorizeFee());
+            }
         }else{
             data.put("examineAndApproveFee","");
         }

+ 27 - 44
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -3867,7 +3867,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
      * @param documentList
      * @return
      */
-    public String getSignatureContractId(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
+    public HashMap getSignatureContractId(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
         //根据项目id查询项目信息
         RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
         //创建签署方信息
@@ -3970,12 +3970,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(signatureContract);
         String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
         HashMap hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
-        String code = hashMap.get("code").toString();
-        if("0".equals(code)){
-            String contractId = hashMap.get("contractId").toString();
-            return contractId;
-        }
-        return "";
+
+        return hashMap;
     }
 
     /**
@@ -4011,7 +4007,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
      * @param contractId
      * @return
      */
-    public String signbyCompany (String contractId,List<String> invalidDocumentIdList){
+    public HashMap signbyCompany (String contractId,List<String> invalidDocumentIdList){
 
         //根据合同id查询坐标
         Map map = new HashMap();
@@ -4042,6 +4038,16 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             signByCompanyInfo.setContractId(contractId);
             signByCompanyInfo.setTenantName("江苏兴光项目管理有限公司");
 
+            Iterator iterator = locations.iterator();
+            while (iterator.hasNext()) {
+                Location data = (Location) iterator.next();
+                if (null == data.getPage()){
+                    iterator.remove();
+                }else if(!"1".equals(data.getPage())){
+                    iterator.remove();
+                }
+            }
+
             for (Location location : locations) {
                 List<Stamper> stampers = Lists.newArrayList();
                 for (String invalidDocumentId : invalidDocumentIdList) {
@@ -4063,11 +4069,11 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 HashMap signByCompanyStrMap = JSON.parseObject(signByCompanyStr, HashMap.class);
                 String signByCompanyStrResult = signByCompanyStrMap.get("code").toString();
                 if (!"0".equals(signByCompanyStrResult)) {
-                    return null;
+                    return signByCompanyStrMap;
                 }
             }
         }
-        return "";
+        return null;
     }
 
     /**
@@ -4075,7 +4081,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
      * @param contractId
      * @return
      */
-    public String signbyCompanyByKeyWord (String contractId,List<String> invalidDocumentIdList){
+    public HashMap signbyCompanyByKeyWord (String contractId,List<String> invalidDocumentIdList){
 
         //根据合同id查询坐标
         Map map = new HashMap();
@@ -4124,11 +4130,11 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 HashMap signByCompanyStrMap = JSON.parseObject(signByCompanyStr, HashMap.class);
                 String signByCompanyStrResult = signByCompanyStrMap.get("code").toString();
                 if (!"0".equals(signByCompanyStrResult)) {
-                    return null;
+                    return signByCompanyStrMap;
                 }
             }
         }
-        return "";
+        return null;
     }
 
 
@@ -4139,7 +4145,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
      * @param documentList
      * @return
      */
-    public String getReportSignatureContractId(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
+    public HashMap getReportSignatureContractId(String projectId, List<String> documentList ,String principalUserId,String generalManagerUserId){
         //根据项目id查询项目信息
         RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
         //查询到显示信息
@@ -4212,18 +4218,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     /*principalLocation.setOffsetX(0.7759);
                     principalLocation.setOffsetY(0.1934);*/
                     principalLocations.add(principalLocation);
-                    actionUser.setLocations(principalLocations);
-                    actions.add(actionUser);
-
-
-                    Action actionUserSign = new Action();
-                    actionUserSign.setType("CORPORATE");
-                    actionUserSign.setName(user.getName() + "印章");    //填写人员信息
-                    actionUserSign.setSerialNo("1");
-                    actionUserSign.setSealId(userSealId);   //人员印章id
 
                     //添加盖章位置
-                    List<Location> principalLocationSigns = Lists.newArrayList();
                     Location principalLocationSign = new Location();
                     principalLocationSign.setDocumentId(documentList.get(0));
                     //principalLocation.setPage(0);
@@ -4232,19 +4228,9 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     principalLocationSign.setKeywordIndex(1);
                     /*principalLocation.setOffsetX(0.7759);
                     principalLocation.setOffsetY(0.1934);*/
-                    principalLocationSigns.add(principalLocationSign);
-                    actionUserSign.setLocations(principalLocationSigns);
-                    actions.add(actionUserSign);
-
-
-                    Action actionUserSignFirst = new Action();
-                    actionUserSignFirst.setType("CORPORATE");
-                    actionUserSignFirst.setName(user.getName() + "印章");    //填写人员信息
-                    actionUserSignFirst.setSerialNo("1");
-                    actionUserSignFirst.setSealId(userSealId);   //人员印章id
+                    principalLocations.add(principalLocationSign);
 
                     //添加盖章位置
-                    List<Location> principalLocationSignFirsts = Lists.newArrayList();
                     Location principalLocationSignFirst = new Location();
                     principalLocationSignFirst.setDocumentId(documentList.get(0));
                     //principalLocation.setPage(0);
@@ -4253,9 +4239,10 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     principalLocationSignFirst.setKeywordIndex(1);
                     /*principalLocation.setOffsetX(0.7759);
                     principalLocation.setOffsetY(0.1934);*/
-                    principalLocationSignFirsts.add(principalLocationSignFirst);
-                    actionUserSignFirst.setLocations(principalLocationSignFirsts);
-                    actions.add(actionUserSignFirst);
+                    principalLocations.add(principalLocationSignFirst);
+
+                    actionUser.setLocations(principalLocations);
+                    actions.add(actionUser);
                 }
             }
         }
@@ -4338,11 +4325,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(signatureContract);
         String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
         HashMap hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
-        String code = hashMap.get("code").toString();
-        if("0".equals(code)){
-            String contractId = hashMap.get("contractId").toString();
-            return contractId;
-        }
-        return "";
+
+        return hashMap;
     }
 }

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

@@ -2800,4 +2800,13 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	public RuralProjectRecords getProjectRecordsByContractId(String contractId) {
 		return dao.getProjectRecordsByContractId(contractId);
 	}
+
+	/**
+	 * 根据项目id查询造假审核项目的项目类别
+	 * @param projectIdList
+	 * @return
+	 */
+	public String getProjectSortCostInfo(List<String> projectIdList){
+		return dao.getProjectSortCostInfo(projectIdList);
+	}
 }

+ 71 - 13
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java

@@ -1819,7 +1819,23 @@ public class RuralProjectMessageController extends BaseController {
                 return map;
             }
             //获取真签单的documentId
-            String documentId = SignaturePostUtil.getDocument(srcFile);
+            HashMap hashMap = SignaturePostUtil.getDocument(srcFile);
+            String code = hashMap.get("code").toString();
+            String documentId = "";
+            if("0".equals(code)){
+                String result = hashMap.get("result").toString();
+                HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                documentId =  documentIdMap.get("documentId").toString();
+
+                if("".equals(documentId)){
+                    map.put("str","签章文件创建失败");
+                    return map;
+                }
+            }else{
+                String message = hashMap.get("message").toString();
+                map.put("str",message);
+                return map;
+            }
             //获取竖版假(空白)签单的documentId
             String verticalInvalidDocumentId = SignaturePostUtil.getVerticalInvalidDocument(verticalInvalidFile.getName(),verticalInvalidFile);
             if("".equals(verticalInvalidDocumentId)){
@@ -1842,13 +1858,28 @@ public class RuralProjectMessageController extends BaseController {
             //将空白单的documentId存入数据库种
             projectReportData.setSignatureInvalidDocumentId(String.join(",", invalidDocumentList));
             //根据项目id 和 documentId生成合同id
-            String contractId = ruralProjectMessageService.getSignatureContractId(projectId, documentList,principalUserId,generalManagerUserId);
-            if("".equals(contractId)){
-                map.put("str","签章文件创建失败");
+            HashMap contractIdHashMap = ruralProjectMessageService.getSignatureContractId(projectId, documentList,principalUserId,generalManagerUserId);
+            String contractIdCode = contractIdHashMap.get("code").toString();
+            String contractId = "";
+            if("0".equals(contractIdCode)){
+                contractId = contractIdHashMap.get("contractId").toString();
+                if("".equals(contractId)){
+                    map.put("str","签章文件创建失败");
+                    return map;
+                }
+            }else{
+                map.put("str",contractIdHashMap.get("message").toString());
                 return map;
             }
             //进行静默签署
-            ruralProjectMessageService.signbyCompany(contractId,documentList);
+            HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompany(contractId,documentList);
+            if(null != signbyCompanyHashMap){
+                String signbyCompany = signbyCompanyHashMap.get("code").toString();
+                if(!"0".equals(signbyCompany)){
+                    map.put("str",signbyCompanyHashMap.get("message").toString());
+                    return map;
+                }
+            }
 
             //获取contractUrl路径
             /*String contractUrl = ruralProjectMessageService.getSignatureContractUrl(contractId);
@@ -1935,22 +1966,49 @@ public class RuralProjectMessageController extends BaseController {
             }
 
             //获取真签单的documentId
-            String documentId = SignaturePostUtil.getDocument(srcFile);
+            HashMap hashMap = SignaturePostUtil.getDocument(srcFile);
+            String code = hashMap.get("code").toString();
+            String documentId = "";
+            if("0".equals(code)){
+                String result = hashMap.get("result").toString();
+                HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
+                documentId =  documentIdMap.get("documentId").toString();
+                if("".equals(documentId)){
+                    map.put("str","签章文件创建失败");
+                    return map;
+                }
+            }else{
+                String message = hashMap.get("message").toString();
+                map.put("str",message);
+                return map;
+            }
             List<String> documentList = Lists.newArrayList();
             documentList.add(documentId);
 
 
             //根据项目id 和 documentId生成合同id
-            String contractId = ruralProjectMessageService.getReportSignatureContractId(projectId, documentList,principalUserId,"");
-            if("".equals(contractId)){
-                map.put("str","签章文件创建失败");
+            HashMap contractIdHashMap = ruralProjectMessageService.getReportSignatureContractId(projectId, documentList,principalUserId,"");
+            String contractIdCode = contractIdHashMap.get("code").toString();
+            String contractId = "";
+            if("0".equals(contractIdCode)){
+                contractId = contractIdHashMap.get("contractId").toString();
+                if("".equals(contractId)){
+                    map.put("str","签章文件创建失败");
+                    return map;
+                }
+            }else{
+                map.put("str",contractIdHashMap.get("message").toString());
                 return map;
             }
+
             //进行静默签署
-            String signbyCompany = ruralProjectMessageService.signbyCompanyByKeyWord(contractId, documentList);
-            if(StringUtils.isNotBlank(signbyCompany)){
-                map.put("str",signbyCompany);
-                return map;
+            HashMap signbyCompanyHashMap = ruralProjectMessageService.signbyCompanyByKeyWord(contractId, documentList);
+            if(null != signbyCompanyHashMap){
+                String signbyCompany = signbyCompanyHashMap.get("code").toString();
+                if(!"0".equals(signbyCompany)){
+                    map.put("str",signbyCompanyHashMap.get("message").toString());
+                    return map;
+                }
             }
 
             //获取contractUrl路径

+ 3 - 9
src/main/java/com/jeeplus/modules/tools/utils/SignaturePostUtil.java

@@ -423,7 +423,7 @@ public class SignaturePostUtil {
      * @param srcFile
      * @return
      */
-    public static String getDocument(File srcFile) {
+    public static HashMap getDocument(File srcFile) {
         //截取文件后缀名
         String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
         //添加请求头
@@ -440,14 +440,8 @@ public class SignaturePostUtil {
         //访问方法
         String documentResult = sendPost(HTTPTOP + "/v2/document/createbyfile", requestHeaderMap, formTextsMap, files, "", "");
         HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
-        String code = hashMap.get("code").toString();
-        if("0".equals(code)){
-            String result = hashMap.get("result").toString();
-            HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
-            String documentId = documentIdMap.get("documentId").toString();
-            return documentId;
-        }
-        return "";
+
+        return hashMap;
     }
 
     /**

+ 531 - 0
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -761,6 +761,177 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					ActUtils.PD_REIMBURSEMENT[0], businessKey, processInstance.getId(), variables});
 		return "";
 	}
+
+
+	/**
+	 * 分公司提交存储
+	 * @param workInvoice
+	 * @param variables
+	 */
+	@Transactional(readOnly = false)
+	public String saveBranchExamine(WorkInvoice workInvoice,Map<String, Object> variables,String processInstanceId) {
+		long s1=System.currentTimeMillis();
+		if (StringUtils.isBlank(workInvoice.getNumber())) {
+			synchronized (SYN_BYTE) {
+				workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
+			}
+		}
+		String officeId = UserUtils.getUser().getOffice().getId();
+		Office office = officeService.get(officeId);
+		workInvoice.setOffice(office);
+		long s2=System.currentTimeMillis();
+		super.save(workInvoice);
+		//保存附件
+		this.saveAttachments(workInvoice);
+		long s3=System.currentTimeMillis();
+		String str = "";
+		//所属部门
+
+		String userName = UserUtils.get(workInvoice.getCreateBy().getId()).getName();
+		//项目名称获取
+		List<String> projectNameList = getProjectNameList(workInvoice);
+		String projectNameStr = String.join(",", projectNameList);
+		//ProjectRecords projectRecords = projectRecordsService.getRuralMasters(workInvoice.getProject().getId());
+		String title = "项目【"+ projectNameStr +"】发票申请待审批";
+		str = "项目【"+ projectNameStr +"】发票申请待审批,发票申请编号:"+workInvoice.getNumber();
+
+		long s4=System.currentTimeMillis();
+		//开票明细处理
+		updateWorkInvoiceInfo(workInvoice);
+		//开票与项目关系处理
+		updateWorkInvoiceProjectRelationInfo(workInvoice);
+		long s5=System.currentTimeMillis();
+		// 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+		identityService.setAuthenticatedUserId(UserUtils.getUser().getId());
+		// 启动流程
+		String businessKey = workInvoice.getId().toString();
+		WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("ggh3125f1f194c82bdea00005c750905",officeService.get(workInvoice.getOfficeId()));
+		// 启动流程
+		String processType = workActivityMenu.getProcessType();
+		StringBuffer buffer = new StringBuffer();
+		Activity activity = new Activity();
+		WorkProjectNotify workProjectNotify = UtilNotify
+				.saveNotify(workInvoice.getId(),
+						null,
+						workInvoice.getCompanyId(),
+						title,
+						str,
+						"212",
+						"0",
+						"待审批",
+						""
+				);
+		long s6=System.currentTimeMillis();
+		List<User> users = new ArrayList<>();
+		List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"5",workInvoice.getCreateBy());
+		//List<User> fpglys = UserUtils.getByRoleActivityEnname("fpgly",3,office.getId(),"5",workInvoice.getCreateBy());
+		//财务员工
+		List<User> fpglys = UserUtils.getByRoleActivityEnname("cwygevod",3,office.getId(),"5",workInvoice.getCreateBy());
+		long s7=System.currentTimeMillis();
+		if (StringUtils.isNotBlank(workActivityMenu.getId())) {
+			workProjectNotify.setNotifyRole("");
+			workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
+			List<Activity> activities = workActivityMenu.getActivities();
+			for (Activity a : activities) {
+				String encount = a.getEncount();
+				String enlist = a.getEnlist();
+				if (a.getRole()!=null && StringUtils.isNotBlank(a.getRole().getEnname())){
+					List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),office.getId(),"5",workInvoice.getCreateBy());
+					if (enusers.size()==0){
+						workInvoice.setInvoiceState("1");//暂存
+						this.save(workInvoice);
+						return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
+					}
+					variables.put(enlist, enusers);
+					variables.put(encount, enusers.size());
+				}
+				if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+					activity = a;
+				}
+			}
+			buffer.append(activity.getRole().getEnname());
+			if (activity != null && StringUtils.isNotBlank(activity.getId())) {
+				//角色审批
+				if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
+					users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"5",workInvoice.getCreateBy());
+				}
+				//人员审批
+				if (StringUtils.isNotBlank(activity.getUser().getId())) {
+					users.add(activity.getUser());
+				}
+			}
+			workProjectNotify.setId("");
+		} else {
+			//variables.put("fpglyList", fpglys);
+			if (bmzrs.size()==0 ){
+				workInvoice.setInvoiceState("1");//暂存
+				this.save(workInvoice);
+			}
+			if (bmzrs.size()==0){
+				return "流程审批人不能为空,部门主任下无用户,请联系管理员!";
+			}
+			//variables.put("fpglycount",fpglys.size());
+			variables.put("bmzrcount",bmzrs.size());
+			variables.put("bmzrList",bmzrs);
+			processType = "newWorkInvoiceExamine";
+			users.addAll(bmzrs);
+		}
+		for (User user : users){
+			workProjectNotify.setUser(user);
+			workProjectNotify.setId("");
+			workProjectNotifyService
+					.save(workProjectNotify);
+			Map<String,Object> extras = new HashMap<>();
+			extras.put("type","7002");
+			extras.put("id",workProjectNotify.getId());
+			extras.put("procDefKey","212");
+			UserUtils.pushInfoToApp(title,str,extras,user.getId());
+			UserUtils.pushIm(user.getId(),str);
+		}
+		variables.put("type", processType);
+		variables.put("busId", businessKey);
+		variables.put("title", "发票申请编号:" + workInvoice.getNumber());//设置标题;
+		long s8=System.currentTimeMillis();
+		ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+		workInvoice.setProcessInstance(processInstance);
+		long s9=System.currentTimeMillis();
+		if (StringUtils.isNotBlank(processInstanceId)) {
+			workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+			workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+			workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+		}
+		long s10=System.currentTimeMillis();
+		// 更新流程实例ID
+		workInvoice.setProcessInstanceId(processInstance.getId());
+		workInvoiceDao.updateProcessInstanceId(workInvoice);
+		//通知添加流程实例ID
+		workProjectNotify.setProcessInstanceId(processInstance.getId());
+		workProjectNotifyService.save(workProjectNotify);
+		List<Activity> list = workActivityMenu.getActivities();
+		long s11=System.currentTimeMillis();
+		if (list != null && list.size() != 0) {
+			workActivityProcessService.saveList(list, processInstance.getId());
+		} else {
+			WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+			workActivityProcess.setProcessKey("newWorkInvoiceExamine");
+			workActivityProcess.setCount(1);
+			workActivityProcess.setProcessInstanceId(processInstance.getId());
+			workActivityProcess.setIsApproval("0");
+			workActivityProcessService.insert(workActivityProcess);
+			workActivityProcess.setCount(2);
+			workActivityProcessService.insert(workActivityProcess);
+			workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
+			workActivityProcessService.insertAuditsByType(fpglys,processInstance.getId(),2,0);
+		}
+		long s12=System.currentTimeMillis();
+		logger.info("发票送审-------生成发票编号:"+(s2-s1)+"  保存发票信息:"+(s3-s2)+"  保存发票明细数据:"+(s5-s4)
+				+"  查询角色人员:"+(s7-s6)+"  流程启动:"+(s9-s8)+"  workActivityProcessService.updateProcessInstanceId:"+(s10-s9)
+				+"  查询角色人员:"+(s12-s11)+"  总时间:"+(s12-s1));
+		logger.debug("start process of {key={}, bkey={}, pid={}, variables={}}", new Object[]{
+				ActUtils.PD_REIMBURSEMENT[0], businessKey, processInstance.getId(), variables});
+		return "";
+	}
+
 	@Transactional(readOnly = false)
 	public void delete(WorkInvoice workInvoice) {
 		dao.get(workInvoice);
@@ -1487,6 +1658,366 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 
 
 	/**
+	 * 审核流程
+	 * @param workInvoice
+	 */
+	@Transactional(readOnly = false)
+	public String auditSaveExamine(WorkInvoice workInvoice,List<User> auditUsers) {
+		//所属部门
+		Office office = officeService.get(workInvoice.getOffice().getId());
+		String userName = UserUtils.get(workInvoice.getCreateBy().getId()).getName();
+		String  str = "发票申请编号:"+workInvoice.getNumber()+",实际开票单位:"+workInvoice.getClient().getName()+",创建人:"+userName+",所属部门:"+office.getName();
+		String title = "实际开票单位:"+workInvoice.getClient().getName();
+		// 对不同环节的业务逻辑进行操作
+		String taskDefKey = workInvoice.getAct().getTaskDefKey();
+		if("fpgly".equals(taskDefKey)){
+			updateWorkInvoiceInfo(workInvoice);
+			actTaskService.claim(workInvoice.getAct().getTaskId(), UserUtils.getUser().getId());
+		}else if (!"modifyApply".equals(taskDefKey)) {
+			actTaskService.claim(workInvoice.getAct().getTaskId(), UserUtils.getUser().getId());
+		}else {
+			workInvoice.getAct().setFlag("yes");
+		}
+		String comment = "";
+		if (workInvoice.getInvoiceState().equals("4")){
+			comment = ("yes".equals(workInvoice.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+		}else {
+			comment = ("yes".equals(workInvoice.getAct().getFlag())?"[同意] ":"[驳回] ")+workInvoice.getAct().getComment();
+		}
+		//yes 的时候状态为审核通过 否则为未通过
+		//2 审核中 4 驳回
+		workInvoice.setInvoiceState(("yes".equals(workInvoice.getAct().getFlag()) ? "2" : "4"));
+		Map<String, Object> vars = Maps.newHashMap();
+		//业务逻辑对应的条件表达式
+		String exp = "";
+		String taskCount = "";
+		String notifyRole = "";
+		int key = 0;
+		String enname = "";
+		List<Activity> activitieList = activityService.getByProcessInstanceId(workInvoice.getProcessInstanceId());
+		WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+		if (activitieList != null && activitieList.size() != 0) {
+			workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+			workActivityMenu.setActivities(activitieList);
+		}
+
+		//项目名称获取
+		List<String> projectNameList = getProjectNameList(workInvoice);
+		String projectNameStr = String.join(",", projectNameList);
+		WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+		WorkActivityProcess selectProcess = new WorkActivityProcess();
+		selectProcess.setProcessInstanceId(workInvoice.getProcessInstanceId());
+		List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+		List<Activity> activities = workActivityMenu.getActivities();
+		if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceExamine")) {
+			key = 1;
+			for (int i = 0; i < workActivityProcesses.size(); i++) {
+				WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+				if (taskDefKey.equals(activityProcess.getActivityTask()) && !taskDefKey.equals("modifyApply")) {
+					taskCount = activityProcess.getCount()+"";
+					workActivityProcess = activityProcess;
+					if (!workActivityProcess.getIsApproval().equals("0")) {
+						workActivityProcess.setId("");
+					}
+					exp = "pass";
+					if (!"yes".equals(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("4");
+						workActivityProcess.setIsApproval("2");
+						String returnBack = "-1";
+						for (Activity activity : activities) {
+							if (activity.getCount() == activityProcess.getCount()) {
+								notifyRole = activity.getName();
+								returnBack = activity.getReturnBack();
+								break;
+							}
+						}
+						if (returnBack.equals("0")) {
+							workActivityProcess.setId("");
+						}
+
+					} else {
+						workActivityProcess.setIsApproval("1");
+					}
+				}else if(taskDefKey.equals("modifyApply")){
+					taskCount = "0";
+					notifyRole = "调整申请";
+					exp = "pass";
+					workActivityProcess.setId("");
+					workActivityProcess.setCount(0);
+					if (!"yes".equals(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("3");
+						workActivityProcess.setIsApproval("2");
+					} else {
+						workActivityProcess.setIsApproval("1");
+					}
+					break;
+				}
+			}
+		} else {
+			workActivityMenu.setProcessType("newWorkInvoiceExamine");
+			for (int i = 0; i < workActivityProcesses.size(); i++) {
+				WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+				String count = activityProcess.getCount() + "";
+				workActivityProcess = activityProcess;
+				if (!workActivityProcess.getIsApproval().equals("0")) {
+					workActivityProcess.setId("");
+				}
+				// 审核环节
+				if ("bmzr".equals(taskDefKey) && count.contains("1")) {
+					taskCount = "1";
+					exp = "pass";
+					if ("yes".equals(workInvoice.getAct().getFlag()) &&("0").equals(workInvoice.getExt())) {
+						workActivityProcessService.insertAuditsByType(auditUsers,workInvoice.getProcessInstanceId(),2,1);
+						//分公司流程
+						notifyRole = "财务部门审批";
+						notifyRole = "审批通过";
+						workActivityProcess.setIsApproval("1");
+						enname = "fpgly";
+						vars.put("fpglyList", auditUsers);
+						vars.put("fpglycount",auditUsers.size());
+					}else {
+						notifyRole = "调整申请";
+						workActivityProcess.setIsApproval("2");
+					}
+					break;
+				}
+				if ("fpgly".equals(taskDefKey) && count.contains("2")) {
+					taskCount = "2";
+					exp = "pass";
+					if ("yes".equals(workInvoice.getAct().getFlag()) &&("0").equals(workInvoice.getExt())) {
+						workActivityProcessService.insertAuditsByType(auditUsers,workInvoice.getProcessInstanceId(),2,1);
+						//分公司流程
+						//notifyRole = "财务主任审批";
+						notifyRole = "审批通过";
+						workActivityProcess.setIsApproval("1");
+							/*enname = "fpgly";
+							vars.put("fpglyList", auditUsers);
+							vars.put("fpglycount",auditUsers.size());*/
+					}else {
+						notifyRole = "调整申请";
+						workActivityProcess.setIsApproval("2");
+					}
+					break;
+				}  /*else if ("fpgly".equals(taskDefKey) && count.contains("2")) {
+					taskCount = "2";
+					exp = "pass";
+					if ("yes".equals(workInvoice.getAct().getFlag())) {
+						notifyRole = "审批通过";
+						workActivityProcess.setIsApproval("1");
+					} else {
+						notifyRole = "调整申请";
+						workActivityProcess.setIsApproval("2");
+					}
+					break;
+				}*/  else if ("modifyApply".equals(taskDefKey)&& count.contains("0")) {
+					taskCount = "0";
+					notifyRole = "部门主任审批";
+					exp = "pass";
+					workActivityProcess.setCount(0);
+					enname = "bmzr";
+					if (!"yes".equals(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("3");
+					}
+					break;
+				} else if ("apply_end".equals(taskDefKey)) {
+				}
+
+			}
+		}
+		// 设置意见
+		workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workInvoice.getAct().getComment());
+		workInvoice.preUpdate();
+		// 提交流程任务
+		vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
+		vars.put("passs", true);
+		workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,workInvoice.getProcessInstanceId(),taskDefKey,"modifyApply",workInvoice.getAct().getFlag(),comment, activities);
+		// 提交流程任务
+		actTaskService.complete(workInvoice.getAct().getTaskId(), workInvoice.getAct().getProcInsId(), workInvoice.getAct().getComment(), vars);
+		boolean state = actTaskService.isProcessEnd(workInvoice.getAct().getProcInsId());
+		List<User> users = new ArrayList<>();
+		List<User> userList = new ArrayList<>();
+		//ProjectRecords projectRecords = projectRecordsService.getRuralMasters(workInvoice.getProject().getId());
+		if (!state) {
+			users.add(workInvoice.getCreateBy());
+			if ("yes".equals(workInvoice.getAct().getFlag())) {
+				title = "项目【"+ projectNameStr +"】发票申请通过";
+				str = "项目【"+ projectNameStr +"】发票申请通过,发票申请编号:"+workInvoice.getNumber();
+				workInvoice.setInvoiceState("5");
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				workProjectNotifyService
+						.save(UtilNotify
+								.saveNotify(workInvoice.getId(),
+										workInvoice.getCreateBy(),
+										workInvoice.getCompanyId(),
+										title,
+										str,
+										"212",
+										"0",
+										"待通知",
+										notifyRole));
+
+			} else {
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				if (StringUtils.isNotBlank(workInvoice.getInvoiceState()) && !workInvoice.getInvoiceState().equals("3")){
+					workInvoice.setInvoiceState("4");
+					workProjectNotifyService
+							.save(UtilNotify
+									.saveNotify(workInvoice.getId(),
+											workInvoice.getCreateBy(),
+											workInvoice.getCompanyId(),
+											title,
+											str,
+											"212",
+											"0",
+											"待通知",
+											notifyRole));
+				}
+			}
+			workActivityProcessService.deleteProcessIdAuditUsers(workInvoice.getProcessInstanceId());
+		} else {
+			if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceExamine")) {
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				WorkProjectNotify workProjectNotify = UtilNotify
+						.saveNotify(workInvoice.getId(),
+								new User(),
+								workInvoice.getCompanyId(),
+								title,
+								str,
+								"212",
+								"0",
+								"待审批",
+								notifyRole);
+				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+						activities,
+						workProjectNotify,
+						taskDefKey,
+						workInvoice.getAct().getFlag(),
+						taskCount,
+						workInvoice.getCreateBy(),
+						workInvoice.getOfficeId(),
+						"5");
+				for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+					users.add(workProjectNotify1.getUser());
+					workProjectNotify1.setId("");
+					workProjectNotify1.setIsNewRecord(false);
+					workProjectNotifyService
+							.save(workProjectNotify1);
+					if (!"modifyApply".equals(taskDefKey)){
+						Map<String,Object> extras = new HashMap<>();
+						if ("fpgly".equals(taskDefKey) ){
+							extras.put("type","7001");
+						}else {
+							extras.put("type","7002");
+						}
+						extras.put("id",workProjectNotify.getId());
+						extras.put("procDefKey","212");
+						UserUtils.pushInfoToApp(title,str,extras,workProjectNotify1.getUser().getId());
+
+					}
+				}
+
+			} else {
+				if (!"yes".equals(workInvoice.getAct().getFlag())) {//驳回待办提醒
+					title = "项目【"+ projectNameStr +"】发票申请被驳回";
+					str = "项目【"+ projectNameStr +"】发票申请被驳回,请选择重新申请或作废";
+					WorkProjectNotify notify = new WorkProjectNotify();
+					notify.setNotifyId(workInvoice.getId());
+					userList = workProjectNotifyService.readByNotifyId(notify);
+					workProjectNotifyService
+							.save(UtilNotify
+									.saveNotify(workInvoice.getId(),
+											workInvoice.getCreateBy(),
+											workInvoice.getCompanyId(),
+											title,
+											str,
+											"212",
+											"0",
+											"重新申请",
+											notifyRole));
+					users.add( workInvoice.getCreateBy());
+				} else {
+					if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
+						title = "项目【"+ projectNameStr +"】发票申请,待审批";
+						str = "项目【"+ projectNameStr +"】发票申请,待审批,发票申请编号:"+workInvoice.getNumber();;
+						WorkProjectNotify notify = new WorkProjectNotify();
+						notify.setNotifyId(workInvoice.getId());
+						userList = workProjectNotifyService.readByNotifyId(notify);
+						WorkProjectNotify workProjectNotify = UtilNotify
+								.saveNotify(workInvoice.getId(),
+										new User(),
+										workInvoice.getCompanyId(),
+										title,
+										str,
+										"212",
+										"0",
+										"待审批",
+										notifyRole);
+						for (User user1:auditUsers){
+							users.add(user1);
+							workProjectNotify.setUser(user1);
+							workProjectNotify.setId("");
+							workProjectNotify.setIsNewRecord(false);
+							workProjectNotifyService
+									.save(workProjectNotify);
+							if (!"modifyApply".equals(taskDefKey)){
+								Map<String,Object> extras = new HashMap<>();
+								if ("fpgly".equals(taskDefKey)){
+									extras.put("type","7001");
+								}else {
+									extras.put("type","7002");
+								}
+								extras.put("id",workProjectNotify.getId());
+								extras.put("procDefKey","212");
+								UserUtils.pushInfoToApp(title,str,extras,user1.getId());
+
+							}
+						}
+					}else {
+						WorkProjectNotify notify = new WorkProjectNotify();
+						notify.setNotifyId(workInvoice.getId());
+						userList = workProjectNotifyService.readByNotifyId(notify);
+						users.addAll(userList);
+						users.add(workInvoice.getCreateBy());
+						workProjectNotifyService
+								.save(UtilNotify
+										.saveNotify(workInvoice.getId(),
+												workInvoice.getCreateBy(),
+												workInvoice.getCompanyId(),
+												title,
+												str,
+												"212",
+												"0",
+												"重新申请",
+												notifyRole));
+					}
+				}
+			}
+		}
+		if (users!=null && users.size()!=0) {
+			for (User u : users) {
+				UserUtils.pushIm(u.getId(),str);
+			}
+		}
+		if (userList!=null && userList.size()!=0) {
+			for (User u : userList) {
+				UserUtils.pushMeIm(u.getId());
+			}
+		}
+		workInvoiceDao.update(workInvoice);
+		//开票与项目关系处理
+		updateWorkInvoiceProjectRelationInfo(workInvoice);
+		//附件处理
+		this.saveAttachments(workInvoice);
+		return "保存审核意见成功!";
+	}
+
+	/**
 	 * 获取流程详细信息
 	 * @param processInstanceId
 	 */

+ 54 - 0
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceController.java

@@ -265,6 +265,60 @@ public class WorkInvoiceController extends BaseController {
 			return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
 		}
 	}
+
+	/**
+	 * 发票审批(审定(内))
+	 * @param
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = "saveExamineAudit")
+	public String saveExamineAudit(WorkInvoice workInvoice, Model model,
+								   RedirectAttributes redirectAttributes) {
+		try{
+			// 对不同环节的业务逻辑进行操作
+			String taskDefKey = workInvoice.getAct().getTaskDefKey();
+			List<User> users = null;
+			//所属部门
+			Office office = officeService.get(workInvoice.getOffice().getId());
+			if ("bmzr".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwygevod",3,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("scbzr".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwzg",1,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("fpgly".equals(taskDefKey)){
+				if(("1").equals(workInvoice.getExt())) {
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 3);
+				}else{
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),1);
+				}
+			}else if ("modifyApply".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 1);
+			}
+			String flag = workInvoice.getAct().getFlag();
+			if ("yes".equals(flag) && (users==null || users.size()==0)){
+				addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+			}else {
+				String str = workInvoiceService.auditSaveExamine(workInvoice,users);
+				addMessage(redirectAttributes, str);
+			}
+		}catch (Exception e){
+			addMessage(redirectAttributes, "审批失败:");
+			logger.error("Exception e:"+e);
+		}
+
+		if (StringUtils.isNotBlank(workInvoice.getHome()) && "home".equals(workInvoice.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		}else if (StringUtils.isNotBlank(workInvoice.getHome()) && "notifyList".equals(workInvoice.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+		}else {
+			return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+		}
+	}
+
 	/**
 	 * 查看,增加,编辑开票管理表单页面
 	 */

+ 29 - 2
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java

@@ -21,6 +21,7 @@ import com.jeeplus.modules.act.utils.ActUtils;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -94,6 +95,8 @@ public class WorkInvoiceTwoController extends BaseController {
 	@Autowired
 	protected ProjectRecordsService projectRecordsService;
 	@Autowired
+	protected RuralProjectRecordsService ruralProjectRecordsService;
+	@Autowired
 	protected WorkInvoiceDetailService workInvoiceDetailService;
 	@Autowired
 	protected WorkInvoiceAlterService workInvoiceAlterService;
@@ -396,13 +399,37 @@ public class WorkInvoiceTwoController extends BaseController {
 			String str = "";
 			//默认添加为分公司
 			workInvoice.setExt("0");
+
+			//获取发票项目信息
+			List<WorkInvoiceProjectRelation> workInvoiceProjectRelationList = workInvoice.getWorkInvoiceProjectRelationList();
+			List<String> projectIdList = Lists.newArrayList();
+			//获取项目id并查询所有包含项目id的项目信息
+			for (WorkInvoiceProjectRelation projectInfo: workInvoiceProjectRelationList) {
+				if(StringUtils.isNotBlank(projectInfo.getProjectId())){
+					projectIdList.add(projectInfo.getProjectId());
+				}
+			}
+
+			if(projectIdList.size()>0){
+			//根据项目id查询项目信息中的项目类别
+				String projectSortCostInfo = ruralProjectRecordsService.getProjectSortCostInfo(projectIdList);
+				//如果项目类别中包含审定(内)即 8 则需要进行部门主任审核
+				if(projectSortCostInfo.contains("8")){
+					str = workInvoiceService.saveBranchExamine(workInvoice, variables,processInstanceId);
+				}else{
+					str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
+				}
+			}else{
+				str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
+			}
+
 			//1总公司0分公司
-			if("1".equals(workInvoice.getExt())){
+			/*if("1".equals(workInvoice.getExt())){
 				//str = workInvoiceService.save(workInvoice, variables,processInstanceId);
 				str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
 			}else if("0".equals(workInvoice.getExt())){
 				str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
-			}
+			}*/
 
 			if(StringUtils.isNotBlank(workInvoice.getExt())){
 				if (StringUtils.isNotBlank(str)){

+ 60 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -1476,6 +1476,66 @@ public class WorkProjectNotifyController extends BaseController {
 					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
 						return "modules/workinvoice/workInvoiceModify";
 					}
+				} else if (workProjectNotify.getType().equals("212")) {    //开票管理
+					WorkInvoice workInvoice = workInvoiceService.get(workProjectNotify.getNotifyId());
+					if (StringUtils.isNotBlank(workInvoice.getId())) {
+						workInvoiceService.queryDetails(workInvoice);
+					}
+					if(StringUtils.isNotBlank(workProjectNotify.getHome())){
+						workInvoice.setHome(workProjectNotify.getHome());
+					}else{
+						workInvoice.setHome("home");
+					}
+					workInvoice.setAct(getByAct(workInvoice.getProcessInstanceId()));
+					String taskDefKey = workInvoice.getAct().getTaskDefKey();
+					model.addAttribute("workInvoice", workInvoice);
+					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+
+						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;
+							}
+						}
+						return "modules/workinvoice/workInvoiceView";
+					} else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+
+						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;
+							}
+						}
+						model.addAttribute("identification","workinvoice");
+						model.addAttribute("identificationName","发票审核意见");
+						if (StringUtils.isNotBlank(taskDefKey) && ("bmzr".equals(taskDefKey) ||
+								"scbzr".equals(taskDefKey))) {
+							return "modules/workinvoice/workInvoiceExamineAudit";
+						} else if (StringUtils.isNotBlank(taskDefKey) && "fpgly".equals(taskDefKey)) {
+							workInvoice.setDrawerName(UserUtils.getUser().getName());
+							workInvoice.setInvoiceDate(new Date());
+							model.addAttribute("workInvoice", workInvoice);
+							return "modules/workinvoice/workInvoiceExamineAuditEnd";
+						}
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/workinvoice/workInvoiceExamineModify";
+					}
 				} else if (workProjectNotify.getType().equals("211")) {    //开票管理
 					WorkInvoice workInvoice = workInvoiceService.get(workProjectNotify.getNotifyId());
 					if (StringUtils.isNotBlank(workInvoice.getId())) {

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

@@ -1889,4 +1889,17 @@
 			</if>
 		</where>
 	</select>
+
+	<select id="getProjectSortCostInfo" resultType="java.lang.String">
+		select  GROUP_CONCAT(a.attachment_project_sort) from rural_project_records a
+		<where>
+			a.project_type = "2"
+			<if test="projectIdList!=null and projectIdList.size!=0">
+				and a.id in
+				<foreach collection="projectIdList" item="id" separator="," open="(" close=")">
+					#{id}
+				</foreach>
+			</if>
+		</where>
+	</select>
 </mapper>

+ 737 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceExamineAudit.jsp

@@ -0,0 +1,737 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>发票审批</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+	<style>
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		var count = 0;
+		var numcount=0;//验证导入发票号是否重复
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+				$("#opinion").val(ss);
+				if(obj == 1) {
+
+					$("#flag").val("yes");
+				}else {
+					$("#flag").val("no");
+				}
+
+
+				$("#inputForm").submit();
+				return true;
+			}
+			return false;
+		}
+		$(document).ready(function() {
+			layui.use('form', function () {
+				var form = layui.form;
+				form.render();
+			});
+			$("#name").focus();
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+
+			laydate.render({
+				elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+				, trigger: 'click'
+			});
+
+			laydate.render({
+				elem: '#takeDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+				, trigger: 'click'
+			});
+			String.prototype.endWith=function(endStr){
+				var d=this.length-endStr.length;
+				return (d>=0&&this.lastIndexOf(endStr)==d)
+			}
+		});
+
+		function addRow(list, idx, tpl, row,flag){
+			var idx1 = $("#workAccountList tr").length;
+			if(list == '#workAccountList' && idx1 < 100){
+				bornTemplete(list, idx, tpl, row, idx1);
+				if($("#invoiceType").val()=="专票"){
+					$("#workAccountList"+idx+"_code").attr("minlength","10");
+					$("#workAccountList"+idx+"_code").attr("maxlength","10");
+				}else if($("#invoiceType").val()=="普票"){
+					$("#workAccountList"+idx+"_code").attr("minlength","12");
+					$("#workAccountList"+idx+"_code").attr("maxlength","12");
+				}
+				if (idx==0 && flag){
+					$("#workAccountList"+idx+"_totalMoney").val(row);
+				}
+				//$("#workAccountList"+idx+"_number").val(("0000000" + 100000000 * Math.random()).match(/(\d{8})(\.|$)/)[1]);
+				// if(idx>0){
+				//     var i = idx-1;
+				//     var code = $("#workAccountList"+i+"_code").val();
+				//     if(code == null || code == undefined || code == ""){
+				// 		i = idx-2;
+				// 		code = $("#workAccountList"+i+"_code").val();
+				//     }
+				//     $("#workAccountList"+idx+"_code").val(code);
+				//
+				// }
+			}
+		}
+		function bornTemplete(list, idx, tpl, row, idx1){
+			$(list).append(Mustache.render(tpl, {
+				idx: idx, delBtn: true, row: row,
+				order:idx1 + 1
+			}));
+			$(list+idx).find("select").each(function(){
+				$(this).val($(this).attr("data-value"));
+			});
+			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+				var ss = $(this).attr("data-value").split(',');
+				for (var i=0; i<ss.length; i++){
+					if($(this).val() == ss[i]){
+						$(this).attr("checked","checked");
+					}
+				}
+			});
+		}
+		function delRow(obj, prefix) {
+			count++;
+			var id = $(prefix + "_id");
+			var delFlag = $(prefix + "_delFlag");
+			if (id.val() == "") {
+				$(obj).parent().parent().remove();
+			} else if (delFlag.val() == "0") {
+				delFlag.val("1");
+				$(obj).html("&divide;").attr("title", "撤回删除");
+				$(obj).parent().parent().addClass("error");
+				$(obj).parent().parent().addClass("hide");
+			} else if (delFlag.val() == "1") {
+				delFlag.val("0");
+				$(obj).html("&times;").attr("title", "删除");
+				$(obj).parent().parent().removeClass("error");
+			}
+			// var idx1 = $("#workAccountList tr").length; //tr 总数
+			// for (var i = 0; i < idx1; i++) {
+			//     $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
+			// }
+		}
+		function isNumber(val){
+			if(val === "" || val ==null){
+				return false;
+			}
+			var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+			var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+			if(regPos.test(val) || regNeg.test(val)){
+				return true;
+			}else{
+				return false;
+			}
+
+		}
+		function setVs(obj){
+			var a = $(obj).attr("id");
+			var b = a.replace('allPrice','proportion');
+			var value = obj.value;
+			var p = $("#price").val() || 0;
+			if(!p || p == 0){
+				parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+				return;
+			}
+			var num = value/p ;
+			if(!/^\d+(\.\d{1,2})?$/.test( value )){
+				parent.layer.msg("合价必须输入数字",{icon:5});
+			}else{
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+			}
+		}
+		function setTaxMoney(obj){
+			var a = $(obj).attr("id");
+			//金额
+			var b = a.replace('tax','taxMoney');
+			//开票金额
+			var t = a.replace('tax','totalMoney');
+			//税额
+			var tr = a.replace('tax','taxRate');
+			var value = obj.value || 0;
+			if(!value){
+				parent.layer.msg("请正确填写税率",{icon:5});
+				$("#" +  b ).val("");
+				$("#" +  tr ).val("");
+				return;
+			}
+			var m = ${workInvoice.money};
+			var t2 = $("#" +  t ).val();
+			if(!/^\d+(\.\d{1,4})?$/.test( t2 )){
+				parent.layer.msg("请正确填写开票金额",{icon:5});
+				return;
+			}/*else if(t2 > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }*/
+			var tax = 1 + value/100;
+			var p = $("#" +  t ).val() || 0;//获取开票金额
+			if(!p || p == 0){
+				parent.layer.msg("请先填写开票金额,且不能为零",{icon:5});
+				return;
+			}
+			var num = p/tax || 0;
+			$("#" +  b ).val(parseFloat(num.toFixed(2)));
+			var taxRate = p - num;
+			$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+		}
+		function setCheck(obj){
+			var aa = $(obj).attr("id");
+			//金额
+			var b = aa.replace('totalMoney','taxMoney');
+			//税额
+			var tr = aa.replace('totalMoney','taxRate');
+			//开票金额
+			var t = aa.replace('totalMoney','totalMoney');
+			var tm = $("#" +  t ).val();
+			//税率
+			var sl = aa.replace('totalMoney','tax');
+			var sc = $("#" +  sl ).val();
+			//处理百分比税率
+			var tax = 1 + sc/100;
+
+			$("#" +  b ).val("");
+			$("#" +  tr ).val("");
+			var m = ${workInvoice.money};
+			var a = obj.value;
+			/*if(a > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }else{*/
+			var num = tm/tax || 0;
+			$("#" +  b ).val(parseFloat(num.toFixed(2)));
+			var taxRate = tm - num;
+			$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			/*}*/
+		}
+		function getMoney(value,obj){
+			/*var aa = $(obj).attr("id");
+            //金额
+            var b = aa.replace('totalMoney','taxMoney');
+            console.log("b====="+b);
+            //税额
+            var tr = aa.replace('totalMoney','taxRate');
+            //开票金额
+            var t = aa.replace('totalMoney','totalMoney');
+            var tm = $("#" +  t ).val();
+            //税率
+            var sl = aa.replace('totalMoney','tax');
+            var sc = $("#" +  sl ).val();
+            //处理百分比税率
+            var tax = 1 + sc/100;
+
+            var m = ${workInvoice.money};
+            var money = "0.00";
+            //自动计算出结果并填充在相应的输入框中
+            var size = $("#workAccountList tr").length+count;
+            for (var i = 0;i<size;i++){
+                var _totalMoney = $("#workAccountList"+i+"_totalMoney").val();
+
+                var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
+                    if(money==""){
+                        money = parseFloat(_totalMoney).toFixed(2);
+                    }else {
+                        money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
+                    }
+                }
+            }
+            if(money >m){
+                console.log("money--------"+money);
+                $("#" + aa ).val("");
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("发票明细开票金额总值大于主申请发票开票金额",{icon:5});
+                return;
+			}else{
+				var num = tm/tax || 0;
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = tm - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			}*/
+		}
+		function setV(obj){
+			var a =  $(obj).attr("id");
+			var c = "京";
+			var date=new Date;
+			var year=date.getFullYear();
+			var month=date.getMonth()+1;
+			month =(month<10 ? "0"+month:month);
+			var mydate = (year.toString()+month.toString());
+			var timestamp="["+mydate+"]";//获取固定格式年月
+			var number = c+timestamp;
+			$("#" +  a ).val(number);
+		}
+		function checkSame(obj){
+			var value =obj.value;
+			var a = $(obj).attr("id");
+			var idx = a.replace('_number','');
+			var idxx = idx.replace('workAccountList','')
+			var b = a.replace('number','oldNumber');
+			var oldValue = $("#" +  b ).val();
+			var size = $("#workAccountList tr").length+count;
+			for (var i = 0;i<size;i++){
+				var _number = $("#workAccountList"+i+"_number").val();
+				var delFlag = $("#workAccountList"+i+"_delFlag").val();
+				if (_number!=undefined&& delFlag==0 && i!= idxx ){
+					if(_number == value){
+						$("#" +  a ).val("");
+						numcount++;
+						parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+						return;
+					}
+				}
+			}
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoicedetail/workInvoiceDetail/checkSame',
+				data:{
+					"number":value,"oldNumber":oldValue
+				},
+				success:function(data){
+					if("false" == data){
+						$("#" +  a ).val("");
+						numcount++;
+						parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+						return;
+					}
+				}
+			})
+		}
+		function openDialogreExcel(title,url,width,height,target){
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			top.layer.open({
+				type: 1,
+				area: [500,300],
+				title:"导入数据",
+				skin: 'three-btns with-demo',
+				content:$("#import").html() ,
+				btn: ['导入全部','仅导入当前纳税人识别号', '关闭'],
+				btn1: function(index, layero){
+					var impType='0';
+					importExcel(impType,url)
+					top.layer.close(index);
+				},
+				btn2: function(index, layero){
+					var impType='1';
+					importExcel(impType,url)
+					top.layer.close(index);
+				},
+				btn3: function(index){
+					top.layer.close(index);
+				}
+
+
+			});
+		}
+		function importExcel(impType,url){
+			var orUnicode=$("#orUnicode").val();
+			var invoiceType=$("#invoiceType").val();
+			url=url+"?impType="+encodeURIComponent(impType)+"&orUnicode="+encodeURIComponent(orUnicode)+"&invoiceType="+encodeURIComponent(invoiceType);
+			var formData = new FormData();
+			formData.append("file",top.$("#uploadFile")[0].files[0]);
+			var obj =top.$("#uploadFile")[0].files[0];
+			if(obj==undefined){
+				parent.layer.alert('请选择上传文件',{icon:0,title:'系统提示'});
+				return;
+			}
+			var fileType = obj.name;
+			if(!fileType.endWith("xml")){
+				top.layer.alert('请上传*.xml格式的文件',{icon:0,title:'系统提示'});
+				return;
+			}
+
+			$.ajax({
+				type: 'post',
+				url:url,
+				data: formData,
+				dataType: "json",
+				cache: false,
+				processData: false,
+				contentType: false,
+			}).success(function (data) {
+				for (var i = 0; i < data.data.length; i++) {
+					addExcelRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data.data[i]);
+					if($("#invoiceType").val()=="专票"){
+						$("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","10");
+						$("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","10");
+					}else if($("#invoiceType").val()=="普票"){
+						$("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","12");
+						$("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","12");
+					}
+					workAccountListRowIdx=workAccountListRowIdx+1;
+				}
+				if(numcount>0){
+					top.layer.alert(data.message+" 存在发票号重复数据!",{icon:5});
+				}else{
+					top.layer.alert(data.message,{icon:5});
+				}
+
+			}).error(function () {
+				top.layer.msg("导入文件失败!");
+			});
+		}
+		function addExcelRow(list, idx, tpl, row){
+			var idx1 = $("#workAccountList tr").length;
+			bornTemplete(list, idx, tpl, row, idx1);
+			$("#workAccountList"+idx+"_number").change();
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoice/workInvoice/saveExamineAudit" 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="act.procInsId"/>
+			<form:hidden path="act.procDefId"/>
+			<form:hidden id="flag" path="act.flag"/>
+			<c:set var="status" value="${workInvoice.act.status}" />
+			<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+			<div class="form-group layui-row first lw14">
+				<div class="form-group-label"><h2>基本信息</h2></div>
+				<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+					<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+								<%--						<th width="100px">操作</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						<c:forEach items="${workInvoice.workInvoiceProjectRelationList}" var="list">
+							<tr>
+								<td>
+									<input type="text" value="${list.projectName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.workContractName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td style="text-align:center;">
+									<input type="text" value="${list.projectNum}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.clientName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.reportDataNum}" readonly="readonly"  class="form-control"/>
+								</td>
+									<%--								<td class="text-center op-td" >--%>
+									<%--									{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}--%>
+									<%--								</td>--%>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="form-group layui-row first lw14">
+				<div class="form-group-label"><h2>发票详情</h2></div>
+					<%--<div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label"><span class="require-item">*</span>上级/本公司开票:</label>
+                        <div class="layui-input-block">
+                            <input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+                        </div>
+                    </div>--%>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item">*</span>发票类型:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" id="invoiceType"  class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item">*</span>实际开票单位:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.client.name}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">纳税人识别号:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" id="orUnicode"   class="form-control layui-input" value="${workInvoice.orUnicode}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">地址:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.address}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">电话:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.telephone}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开户银行:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.bank}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">银行账号:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.bankNumber}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">收款类型:</label>
+					<div class="layui-input-block">
+						<input id="chargeType" htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.chargeType}" />
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票内容:</label>
+					<div class="layui-input-block">
+						<input id="billingContent" htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.billingContent}" />
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item">*</span>开票金额(元):</label>
+					<div class="layui-input-block">
+						<input id="kaipiao" htmlEscape="false" readonly="true"   class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="##00.00"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票内容要求:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.content}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票人:</label>
+					<div class="layui-input-block">
+						<form:input   path="drawerName" htmlEscape="false" readonly="true"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">对账人:</label>
+					<div class="layui-input-block  with-icon">
+						<input type="text"  readonly="true" value="${workInvoice.accountCheckingUserName}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">对账地区:</label>
+					<div class="layui-input-block  with-icon">
+						<input type="text"  readonly="true" value="${workInvoice.area.name}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label double-line">备注:</label>
+					<div class="layui-input-block">
+						<form:textarea path="remarks" readonly="true" htmlEscape="false" rows="4" class="form-control" style="background-color: #f1f1f1" />
+					</div>
+				</div>
+					<%--			<div class="form-group layui-row">--%>
+					<%--				<div class="form-group-label"><h2>审批意见</h2></div>--%>
+					<%--				<div class="layui-item layui-col-sm8 lw6 with-textarea">--%>
+					<%--					<div class="layui-input-block" style="margin-left:10px;position: relative">--%>
+					<%--						<form:textarea placeholder="请输入意见:" path="act.comment" id="opinion" class="form-control" rows="4" cssStyle="height: 200px;" maxlength="127" />--%>
+					<%--						<a id="clearOpinon" class="layui-btn" style="position: absolute;bottom: 10px;right: 20px;">清空</a>--%>
+					<%--						<input type="file" name="upload_files" style="display: none;">--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+					<%--				<div class="layui-item layui-col-sm4 lw6 with-textarea">--%>
+					<%--					<div class="layui-input-block" style="margin-left:10px;">--%>
+					<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="同意" title="同意" style="cursor:pointer" class="apen"/></div>--%>
+					<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="不同意" title="不同意" style="cursor:pointer" class="apen"/></div>--%>
+					<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="请领导审核" title="请领导审核" style="cursor:pointer" class="apen"/></div>--%>
+					<%--						<div style="padding: 5px 0px;">--%>
+					<%--							<form:select path="act.comment" id="auditOpinion" lay-filter="opinion" lay-verify="opinion" class="form-control simple-select">--%>
+					<%--								<form:option value=""/>--%>
+					<%--								<form:options items="${fns:getMainDictListOnProjectAdvent('audit_opinion_template')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+					<%--							</form:select>--%>
+					<%--						</div>--%>
+					<%--					</div>--%>
+					<%--				</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="act.comment" class="form-control " rows="5" maxlength="20"/>--%>
+					<%--				</div>--%>
+					<%--			</div>--%>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.uploadMode == 2}">
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+												<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+											</c:when>
+											<c:otherwise>
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+													</c:when>
+													<c:otherwise>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+															</c:when>
+															<c:otherwise>
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+															</c:otherwise>
+														</c:choose>
+													</c:otherwise>
+												</c:choose>
+											</c:otherwise>
+										</c:choose>
+									</c:when>
+									<c:otherwise>
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+												<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+											</c:when>
+											<c:otherwise>
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+													</c:when>
+													<c:otherwise>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+															</c:when>
+															<c:otherwise>
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+															</c:otherwise>
+														</c:choose>
+													</c:otherwise>
+												</c:choose>
+											</c:otherwise>
+										</c:choose>
+									</c:otherwise>
+								</c:choose>
+								<td>${workClientAttachment.createBy.name}</td>
+								<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+								<td class="op-td">
+									<div class="op-btn-box" >
+											<%--附件下载删除--%>
+										<c:choose>
+											<c:when test="${workInvoice.uploadMode == 2}">
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+													</c:when>
+													<c:otherwise>
+														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+													</c:otherwise>
+												</c:choose>
+											</c:when>
+											<c:otherwise>
+												<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+											</c:otherwise>
+										</c:choose>
+										<c:if test="${workClientAttachment.collectFlag != 1}">
+											<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
+										</c:if>
+
+
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+
+
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+		<div class="form-group-label">
+			<div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>
+			<h2>审批意见</h2>
+		</div>
+		<iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>
+
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>审批流程</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<act:flowChart procInsId="${workInvoice.act.procInsId}"/>
+				<act:histoicFlow procInsId="${workInvoice.act.procInsId}" />
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

+ 911 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceExamineAuditEnd.jsp

@@ -0,0 +1,911 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>发票审批</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+	<style>
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+        var count = 0;
+        var numcount=0;//验证导入发票号是否重复
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+			  $("#opinion").val(ss);
+              if(obj == 1) {
+              	//非空验证
+				  var ff=true;
+				  $(".judgment").each(function(){
+					  var zhi=$(this).val();
+					  if (''==zhi || null == zhi){
+						  $(this).css("border","1px solid red")
+						  ff=false;
+					  }else{
+						  $(this).css("border","1px solid #f1f1f1")
+					  }
+				  });
+				  if (!ff){
+					  parent.layer.msg("发票号或开票金额未填写完整!", {icon: 5});
+					  return;
+				  }
+                  $("#flag").val("yes");
+              }else {
+				  $("#flag").val("no");
+              }
+              if(  obj == 1 && $("#workAccountList tr").length==0){
+                  top.layer.alert('请添加发票明细!', {icon: 0});
+                  return;
+              }
+
+              var m = ${workInvoice.money};
+              var money = "0.00";
+              //自动计算出结果并填充在相应的输入框中
+              var size = $("#workAccountList tr").length+count;
+              for (var i = 0;i<size;i++){
+                  var _totalMoney = $("#workAccountList"+i+"_totalMoney").val();
+
+                  var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                  if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
+                      if(money==""){
+                          money = parseFloat(_totalMoney).toFixed(2);
+                      }else {
+                          money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
+                      }
+                  }
+              }
+              if(obj == 1 && money != m ){
+                  top.layer.alert('发票明细总开票金额与主信息开票金额不等,请重新填写!', {icon: 0});
+                  return;
+              }
+
+			  $("#inputForm").submit();
+			  return true;
+		  }
+		  return false;
+		}
+		$(document).ready(function() {
+			layui.use('form', function () {
+				var form = layui.form;
+				form.render();
+			});
+			$("#name").focus();
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+
+            laydate.render({
+                elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+
+            laydate.render({
+                elem: '#takeDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+		});
+
+        function addRow(list, idx, tpl, row,flag){
+            var idx1 = $("#workAccountList tr").length;
+            if(list == '#workAccountList' && idx1 < 100){
+                bornTemplete(list, idx, tpl, row, idx1);
+                if($("#invoiceType").val()=="专票"){
+                    $("#workAccountList"+idx+"_code").attr("minlength","10");
+                    $("#workAccountList"+idx+"_code").attr("maxlength","10");
+                }else if($("#invoiceType").val()=="普票"){
+                    $("#workAccountList"+idx+"_code").attr("minlength","12");
+                    $("#workAccountList"+idx+"_code").attr("maxlength","12");
+                }
+                if (idx==0 && flag){
+					$("#workAccountList"+idx+"_totalMoney").val(row);
+				}
+                //$("#workAccountList"+idx+"_number").val(("0000000" + 100000000 * Math.random()).match(/(\d{8})(\.|$)/)[1]);
+                // if(idx>0){
+                //     var i = idx-1;
+                //     var code = $("#workAccountList"+i+"_code").val();
+                //     if(code == null || code == undefined || code == ""){
+				// 		i = idx-2;
+				// 		code = $("#workAccountList"+i+"_code").val();
+                //     }
+                //     $("#workAccountList"+idx+"_code").val(code);
+				//
+				// }
+            }
+        }
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function delRow(obj, prefix) {
+            count++;
+            var id = $(prefix + "_id");
+            var delFlag = $(prefix + "_delFlag");
+            if (id.val() == "") {
+                $(obj).parent().parent().remove();
+            } else if (delFlag.val() == "0") {
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            } else if (delFlag.val() == "1") {
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+            // var idx1 = $("#workAccountList tr").length; //tr 总数
+            // for (var i = 0; i < idx1; i++) {
+            //     $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
+            // }
+        }
+        function isNumber(val){
+            if(val === "" || val ==null){
+                return false;
+            }
+            var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+            if(regPos.test(val) || regNeg.test(val)){
+                return true;
+            }else{
+                return false;
+            }
+
+        }
+        function setVs(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('allPrice','proportion');
+            var value = obj.value;
+            var p = $("#price").val() || 0;
+            if(!p || p == 0){
+                parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+                return;
+            }
+            var num = value/p ;
+            if(!/^\d+(\.\d{1,2})?$/.test( value )){
+                parent.layer.msg("合价必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+            }
+        }
+        function setTaxMoney(obj){
+            var a = $(obj).attr("id");
+            //金额
+            var b = a.replace('tax','taxMoney');
+            //开票金额
+            var t = a.replace('tax','totalMoney');
+            //税额
+            var tr = a.replace('tax','taxRate');
+            var value = obj.value || 0;
+            if(!value){
+                parent.layer.msg("请正确填写税率",{icon:5});
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                return;
+			}
+            var m = ${workInvoice.money};
+            var t2 = $("#" +  t ).val();
+            if(!/^\d+(\.\d{1,4})?$/.test( t2 )){
+                parent.layer.msg("请正确填写开票金额",{icon:5});
+                return;
+            }/*else if(t2 > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }*/
+            var tax = 1 + value/100;
+            var p = $("#" +  t ).val() || 0;//获取开票金额
+            if(!p || p == 0){
+                parent.layer.msg("请先填写开票金额,且不能为零",{icon:5});
+                return;
+            }
+            var num = p/tax || 0;
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+                var taxRate = p - num;
+                $("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+        }
+        function setCheck(obj){
+            var aa = $(obj).attr("id");
+			//金额
+            var b = aa.replace('totalMoney','taxMoney');
+			//税额
+            var tr = aa.replace('totalMoney','taxRate');
+			//开票金额
+			var t = aa.replace('totalMoney','totalMoney');
+			var tm = $("#" +  t ).val();
+			//税率
+			var sl = aa.replace('totalMoney','tax');
+			var sc = $("#" +  sl ).val();
+			//处理百分比税率
+			var tax = 1 + sc/100;
+
+            $("#" +  b ).val("");
+            $("#" +  tr ).val("");
+            var m = ${workInvoice.money};
+            var a = obj.value;
+            /*if(a > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }else{*/
+				var num = tm/tax || 0;
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = tm - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			/*}*/
+        }
+        function getMoney(value,obj){
+			/*var aa = $(obj).attr("id");
+            //金额
+            var b = aa.replace('totalMoney','taxMoney');
+            console.log("b====="+b);
+            //税额
+            var tr = aa.replace('totalMoney','taxRate');
+            //开票金额
+            var t = aa.replace('totalMoney','totalMoney');
+            var tm = $("#" +  t ).val();
+            //税率
+            var sl = aa.replace('totalMoney','tax');
+            var sc = $("#" +  sl ).val();
+            //处理百分比税率
+            var tax = 1 + sc/100;
+
+            var m = ${workInvoice.money};
+            var money = "0.00";
+            //自动计算出结果并填充在相应的输入框中
+            var size = $("#workAccountList tr").length+count;
+            for (var i = 0;i<size;i++){
+                var _totalMoney = $("#workAccountList"+i+"_totalMoney").val();
+
+                var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
+                    if(money==""){
+                        money = parseFloat(_totalMoney).toFixed(2);
+                    }else {
+                        money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
+                    }
+                }
+            }
+            if(money >m){
+                console.log("money--------"+money);
+                $("#" + aa ).val("");
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("发票明细开票金额总值大于主申请发票开票金额",{icon:5});
+                return;
+			}else{
+				var num = tm/tax || 0;
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = tm - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			}*/
+        }
+        function setV(obj){
+            var a =  $(obj).attr("id");
+            var c = "京";
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+            var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }
+        function checkSame(obj){
+            var value =obj.value;
+            var a = $(obj).attr("id");
+            var idx = a.replace('_number','');
+            var idxx = idx.replace('workAccountList','')
+            var b = a.replace('number','oldNumber');
+            var oldValue = $("#" +  b ).val();
+            var size = $("#workAccountList tr").length+count;
+            for (var i = 0;i<size;i++){
+                var _number = $("#workAccountList"+i+"_number").val();
+                var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                if (_number!=undefined&& delFlag==0 && i!= idxx ){
+                    if(_number == value){
+                        $("#" +  a ).val("");
+                        numcount++;
+                        parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+                        return;
+                    }
+                }
+            }
+                $.ajax({
+                    type:'post',
+                    url:'${ctx}/workinvoicedetail/workInvoiceDetail/checkSame',
+                    data:{
+                        "number":value,"oldNumber":oldValue
+                    },
+                    success:function(data){
+                        if("false" == data){
+                            $("#" +  a ).val("");
+                            numcount++;
+                            parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+                            return;
+                        }
+                    }
+                })
+        }
+        function openDialogreExcel(title,url,width,height,target){
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 1,
+                area: [500,300],
+                title:"导入数据",
+                skin: 'three-btns with-demo',
+                content:$("#import").html() ,
+                btn: ['导入全部','仅导入当前纳税人识别号', '关闭'],
+                btn1: function(index, layero){
+                    var impType='0';
+                    importExcel(impType,url)
+                    top.layer.close(index);
+                },
+                btn2: function(index, layero){
+                    var impType='1';
+                    importExcel(impType,url)
+                    top.layer.close(index);
+                },
+                btn3: function(index){
+                    top.layer.close(index);
+                }
+
+
+            });
+        }
+        function importExcel(impType,url){
+            var orUnicode=$("#orUnicode").val();
+            var invoiceType=$("#invoiceType").val();
+            url=url+"?impType="+encodeURIComponent(impType)+"&orUnicode="+encodeURIComponent(orUnicode)+"&invoiceType="+encodeURIComponent(invoiceType);
+            var formData = new FormData();
+            formData.append("file",top.$("#uploadFile")[0].files[0]);
+            var obj =top.$("#uploadFile")[0].files[0];
+            if(obj==undefined){
+                parent.layer.alert('请选择上传文件',{icon:0,title:'系统提示'});
+                return;
+            }
+            var fileType = obj.name;
+            if(!fileType.endWith("xml")){
+                top.layer.alert('请上传*.xml格式的文件',{icon:0,title:'系统提示'});
+                return;
+            }
+
+            $.ajax({
+                type: 'post',
+                url:url,
+                data: formData,
+                dataType: "json",
+                cache: false,
+                processData: false,
+                contentType: false,
+            }).success(function (data) {
+                for (var i = 0; i < data.data.length; i++) {
+                    addExcelRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data.data[i]);
+                    if($("#invoiceType").val()=="专票"){
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","10");
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","10");
+					}else if($("#invoiceType").val()=="普票"){
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","12");
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","12");
+					}
+                    workAccountListRowIdx=workAccountListRowIdx+1;
+                }
+                if(numcount>0){
+                    top.layer.alert(data.message+" 存在发票号重复数据!",{icon:5});
+				}else{
+                    top.layer.alert(data.message,{icon:5});
+				}
+
+            }).error(function () {
+                top.layer.msg("导入文件失败!");
+            });
+		}
+        function addExcelRow(list, idx, tpl, row){
+            var idx1 = $("#workAccountList tr").length;
+			bornTemplete(list, idx, tpl, row, idx1);
+			$("#workAccountList"+idx+"_number").change();
+        }
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+	<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoice/workInvoice/saveExamineAudit" 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="act.procInsId"/>
+		<form:hidden path="act.procDefId"/>
+		<form:hidden id="flag" path="act.flag"/>
+		<c:set var="status" value="${workInvoice.act.status}" />
+		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+		<div class="form-group layui-row first lw14">
+			<div class="form-group-label"><h2>基本信息</h2></div>
+			<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+				<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="200px"><font color="red">*</font>项目名称</th>
+						<th width="200px">合同名称</th>
+						<th width="200px">项目编号</th>
+						<th width="200px">委托方</th>
+						<th width="200px">报告号</th>
+<%--						<th width="100px">操作</th>--%>
+					</tr>
+					</thead>
+					<tbody id="workInvoiceProjectRelationList">
+						<c:forEach items="${workInvoice.workInvoiceProjectRelationList}" var="list">
+							<tr>
+								<td>
+									<input type="text" value="${list.projectName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.workContractName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td style="text-align:center;">
+									<input type="text" value="${list.projectNum}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.clientName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.reportDataNum}" readonly="readonly"  class="form-control"/>
+								</td>
+<%--								<td class="text-center op-td" >--%>
+<%--									{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}--%>
+<%--								</td>--%>
+							</tr>
+						</c:forEach>
+					</tbody>
+				</table>
+			</div>
+		</div>
+		<div class="form-group layui-row first lw14">
+			<div class="form-group-label"><h2>发票详情</h2></div>
+			<%--<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item">*</span>上级/本公司开票:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+				</div>
+			</div>--%>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item">*</span>发票类型:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true" id="invoiceType"  class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item">*</span>实际开票单位:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.client.name}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">纳税人识别号:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true" id="orUnicode"   class="form-control layui-input" value="${workInvoice.orUnicode}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">地址:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.address}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">电话:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.telephone}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开户银行:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.bank}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">银行账号:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.bankNumber}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">收款类型:</label>
+				<div class="layui-input-block">
+					<input id="chargeType" htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.chargeType}" />
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开票内容:</label>
+				<div class="layui-input-block">
+					<input id="billingContent" htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.billingContent}" />
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item">*</span>开票金额(元):</label>
+				<div class="layui-input-block">
+					<input id="kaipiao" htmlEscape="false" readonly="true"   class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="##00.00"/>"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开票内容要求:</label>
+				<div class="layui-input-block">
+					<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.content}"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开票人:</label>
+				<div class="layui-input-block">
+					<form:input   path="drawerName" htmlEscape="false" readonly="true"  class="form-control layui-input"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">开票时间:</label>
+				<div class="layui-input-block">
+					<input class="form-control layer-date laydate-icon layui-input laydate-icondate" id="invoiceDate" name="invoiceDate" value="<fmt:formatDate
+							value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>">
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">领票时间:</label>
+				<div class="layui-input-block">
+					<input placeholder="请选择领票时间" class="form-control layer-date laydate-icon layui-input laydate-icondate" id="takeDate" name="takeDate" value="<fmt:formatDate
+							value="${workInvoice.takeDate}" pattern="yyyy-MM-dd"/>">
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">对账人:</label>
+				<div class="layui-input-block  with-icon">
+					<input type="text"  readonly="true" value="${workInvoice.accountCheckingUserName}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">对账地区:</label>
+				<div class="layui-input-block  with-icon">
+					<input type="text"  readonly="true" value="${workInvoice.area.name}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm12 with-textarea">
+				<label class="layui-form-label double-line">备注:</label>
+				<div class="layui-input-block">
+					<form:textarea path="remarks" readonly="true" htmlEscape="false" rows="4" class="form-control" style="background-color: #f1f1f1" />
+				</div>
+			</div>
+<%--			<div class="form-group layui-row">--%>
+<%--				<div class="form-group-label"><h2>审批意见</h2></div>--%>
+<%--				<div class="layui-item layui-col-sm8 lw6 with-textarea">--%>
+<%--					<div class="layui-input-block" style="margin-left:10px;position: relative">--%>
+<%--						<form:textarea placeholder="请输入意见:" path="act.comment" id="opinion" class="form-control" rows="4" cssStyle="height: 200px;" maxlength="127" />--%>
+<%--						<a id="clearOpinon" class="layui-btn" style="position: absolute;bottom: 10px;right: 20px;">清空</a>--%>
+<%--						<input type="file" name="upload_files" style="display: none;">--%>
+<%--					</div>--%>
+<%--				</div>--%>
+<%--				<div class="layui-item layui-col-sm4 lw6 with-textarea">--%>
+<%--					<div class="layui-input-block" style="margin-left:10px;">--%>
+<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="同意" title="同意" style="cursor:pointer" class="apen"/></div>--%>
+<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="不同意" title="不同意" style="cursor:pointer" class="apen"/></div>--%>
+<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="请领导审核" title="请领导审核" style="cursor:pointer" class="apen"/></div>--%>
+<%--						<div style="padding: 5px 0px;">--%>
+<%--							<form:select path="act.comment" id="auditOpinion" lay-filter="opinion" lay-verify="opinion" class="form-control simple-select">--%>
+<%--								<form:option value=""/>--%>
+<%--								<form:options items="${fns:getMainDictListOnProjectAdvent('audit_opinion_template')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+<%--							</form:select>--%>
+<%--						</div>--%>
+<%--					</div>--%>
+<%--				</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="act.comment" class="form-control " rows="5" maxlength="20"/>--%>
+<%--				</div>--%>
+<%--			</div>--%>
+		</div>
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>附件信息</h2></div>
+			<span id="attachment_title"></span>
+			<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+				<table id="upTable" class="table table-bordered table-condensed details">
+					<thead>
+					<tr>
+							<%-- <th>序号</th>--%>
+						<th>文件预览</th>
+						<th>上传人</th>
+						<th>上传时间</th>
+						<th width="200px">操作</th>
+					</tr>
+					</thead>
+					<tbody id="file_attachment">
+					<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+						<tr>
+								<%-- <td>${status.index + 1}</td>--%>
+							<c:choose>
+								<c:when test="${workInvoice.uploadMode == 2}">
+									<c:choose>
+										<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+											<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+										</c:when>
+										<c:otherwise>
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+													<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+												</c:when>
+												<c:otherwise>
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+															<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+														</c:when>
+														<c:otherwise>
+															<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+														</c:otherwise>
+													</c:choose>
+												</c:otherwise>
+											</c:choose>
+										</c:otherwise>
+									</c:choose>
+								</c:when>
+								<c:otherwise>
+									<c:choose>
+										<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+											<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+										</c:when>
+										<c:otherwise>
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+													<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+												</c:when>
+												<c:otherwise>
+													<c:choose>
+														<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+															<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+														</c:when>
+														<c:otherwise>
+															<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+														</c:otherwise>
+													</c:choose>
+												</c:otherwise>
+											</c:choose>
+										</c:otherwise>
+									</c:choose>
+								</c:otherwise>
+							</c:choose>
+							<td>${workClientAttachment.createBy.name}</td>
+							<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+							<td class="op-td">
+								<div class="op-btn-box" >
+										<%--附件下载删除--%>
+									<c:choose>
+										<c:when test="${workInvoice.uploadMode == 2}">
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+													<a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+												</c:when>
+												<c:otherwise>
+													<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+												</c:otherwise>
+											</c:choose>
+										</c:when>
+										<c:otherwise>
+											<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+										</c:otherwise>
+									</c:choose>
+									<c:if test="${workClientAttachment.collectFlag != 1}">
+										<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
+									</c:if>
+
+
+								</div>
+							</td>
+						</tr>
+					</c:forEach>
+					</tbody>
+				</table>
+			</div>
+		</div>
+
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>发票明细</h2></div>
+			<div class="layui-item nav-btns">
+				<a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+				<a href="javascript:void(0)" onclick="openDialogreExcel('导入数据', '${ctx}/workAccount/workAccount/import','90%','90%')" class="nav-btn nav-btn-import" ><i class="fa fa-plus"></i>&nbsp;导入</a>
+				<div id="import" class="hide" style="padding: 5px">
+					<input id="uploadFile" name="file" type="file" style="width:330px"/>导入文件不能超过5M,仅允许导入“xml”格式文件!<br/>  
+						<%--<input type="radio"  name="impType"  checked id="all" value="0">
+						<label for="all">导入全部</label>
+						<input type="radio"  name="impType" id="noAll" value="1">
+						<label for="noAll">仅导入当前纳税人识别号</label>--%>
+
+				</div>
+
+			</div>
+			<div class="layui-item layui-col-xs12 form-table-container">
+				<table id="contentTable" class="table table-bordered table-condensed can-edit">
+					<thead>
+					<tr>
+						<th>发票代码</th>
+						<th class="judgment-item"><span class="require-item">*</span>发票号</th>
+						<th class="judgment-item"><span class="require-item">*</span>开票金额</th>
+						<th width="80px">税率</th>
+						<th width="100px">金额</th>
+						<th width="100px">税额</th>
+						<th width="100px">累计登记金额</th>
+						<th width="80px">操作</th>
+						<%--<th><span class="require-item">*</span>发票状态</th>&lt;%&ndash;正常&ndash;%&gt;--%>
+						<%--<th><span class="require-item">*</span>被退标记</th>--%>
+						<%--<th><span class="require-item">*</span>被退票号</th>--%>
+						<%--<th><span class="require-item">*</span>开票日期</th>--%>
+					</tr>
+					</thead>
+					<tbody id="workAccountList">
+
+					</tbody>
+				</table>
+				<script type="text/template" id="workAccountListTpl">//<!--
+							<tr id="workAccountList{{idx}}">
+								<td class="hide">
+									<input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+									<input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
+								</td>
+								<td>
+									<input id="workAccountList{{idx}}_code" name="workAccountList[{{idx}}].code" type="text" value="{{row.code}}"    class="form-control number"/>
+								 </td>
+								 <td>
+									<input id="workAccountList{{idx}}_number" name="workAccountList[{{idx}}].number" onchange="checkSame(this)" type="text" value="{{row.number}}"  minlength="8" maxlength="8"  class="form-control number judgment"/>
+									 <input type="hidden" id="workAccountList{{idx}}_oldNumber" value="{{row.number}}"/>
+								 </td>
+								<td>
+									<input id="workAccountList{{idx}}_totalMoney"  onblur="setCheck(this)"  onchange="getMoney(this.value,this)"  name="workAccountList[{{idx}}].totalMoney" type="text" value="{{row.totalMoney}}"    class="form-control number judgment"/>
+								</td>
+								<td>
+								<div class="input-group">
+									<input id="workAccountList{{idx}}_tax" onblur="setTaxMoney(this)" name="workAccountList[{{idx}}].tax" type="text" value="{{row.tax}}"    class="form-control number"/><span class="input-group-addon input-height">%</span>
+									</div>
+								</td>
+								<td>
+									<input id="workAccountList{{idx}}_taxMoney" name="workAccountList[{{idx}}].taxMoney" type="text" value="{{row.taxMoney}}"    class="form-control number"/>
+								</td>
+								<td>
+									<input id="workAccountList{{idx}}_taxRate" name="workAccountList[{{idx}}].taxRate" type="text" value="{{row.taxRate}}"    class="form-control number"/>
+								</td>
+								<td>
+									<input id="workAccountList{{idx}}_incomeMoney" name="workAccountList[{{idx}}].incomeMoney" type="text" value="0"  readonly="true"  class="form-control"/>
+								</td>
+
+									<input id="workAccountList{{idx}}_state" name="workAccountList[{{idx}}].state"  type="hidden" value="正常"   class="form-control"/>
+
+									<input id="workAccountList{{idx}}_backSign" name="workAccountList[{{idx}}].backSign"  type="hidden" value="正常"  readonly="true"  class="form-control"/>
+
+									<input id="workAccountList{{idx}}_backNumber" name="workAccountList[{{idx}}].backNumber"  type="hidden" value=""  readonly="true"  class="form-control "/>
+
+
+								<td class="text-center op-td">
+									{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workAccountList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+								</td>
+							</tr>//-->
+				</script>
+				<script type="text/javascript">
+					var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+					$(document).ready(function() {
+						var data = ${fns:toJson(workInvoice.workAccountList)};
+						var kaipiao=$("#kaipiao").val();
+						if (data.length==0){
+							addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, kaipiao,"true");
+							workAccountListRowIdx = workAccountListRowIdx + 1;
+						}
+						for (var i=0; i<data.length; i++){
+							addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, data[i]);
+							workAccountListRowIdx = workAccountListRowIdx + 1;
+						}
+					});
+					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>
+			</div>
+		</div>
+
+
+		<div class="form-group layui-row page-end"></div>
+	</form:form>
+		<div class="form-group-label">
+			<div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>
+			<h2>审批意见</h2>
+		</div>
+		<iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>
+
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>审批流程</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<act:flowChart procInsId="${workInvoice.act.procInsId}"/>
+				<act:histoicFlow procInsId="${workInvoice.act.procInsId}" />
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1122 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceExamineModify.jsp


+ 2 - 2
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoList.jsp

@@ -788,10 +788,10 @@
                         ////对操作进行初始化
                         var xml="<div class=\"layui-btn-group\">";
 
-						if(d.notifyFlag != undefined && d.notifyFlag !=null && "" != d.notifyFlag && d.notifyFlag == 1)
+						/*if(d.notifyFlag != undefined && d.notifyFlag !=null && "" != d.notifyFlag && d.notifyFlag == 1)
 						{
 							xml+="<button onclick=\"notifyDialogre('发票审批', '${ctx}/workprojectnotify/workProjectNotify/form?id=" + d.notifyId +"&home=invoice','95%', '95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 审批</button>";
-						}
+						}*/
                         if(d.canedit1 != undefined && d.canedit1 =="1")
                         {
                             xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('修改发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/form?id=" + d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";