Bläddra i källkod

知行同德v5.0

wzy 11 månader sedan
förälder
incheckning
6037066fe3

+ 13 - 0
mjava-zhixingtongde/src/main/java/com/malk/zhixingtongde/controller/ZxtdReportConroller.java

@@ -100,5 +100,18 @@ public class ZxtdReportConroller {
         return McR.success();
     }
 
+    //现金流量表上传文件至钉盘
+    @PostMapping("/uploadToDingTalk2")
+    public McR uploadToDingTalk(HttpServletResponse response,String userId,String month) {
+        try {
+            zxtdReportService.uploadToDingTalk2(response,userId,month);
+            System.out.println("");
+        }catch (Exception e){
+            return McR.error(McREnum.UNKNOWN_EXCEPTION.toString(),"上传文件至钉盘失败");
+        }
+
+        return McR.success();
+    }
+
 
 }

+ 8 - 0
mjava-zhixingtongde/src/main/java/com/malk/zhixingtongde/service/ZxtdReportService.java

@@ -71,4 +71,12 @@ public interface ZxtdReportService {
      * @param year
      */
     void exportLiabilitiesDetails(HttpServletResponse response, String year);
+
+    /**
+     * 现金流量表上传文件至钉盘
+     * @param response
+     * @param userId
+     * @param month
+     */
+    void uploadToDingTalk2(HttpServletResponse response, String userId, String month);
 }

+ 228 - 82
mjava-zhixingtongde/src/main/java/com/malk/zhixingtongde/service/impl/ZxtdReportServiceImpl.java

@@ -24,6 +24,7 @@ import com.malk.zhixingtongde.entity.Profit;
 import com.malk.zhixingtongde.service.ZxtdReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import java.io.*;
@@ -54,13 +55,16 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
     @Autowired
     private DDClient ddClient;
 
+    @Value("${report.path}")
+    private String reportPath;
+
     private static String[] PROFIT_CLASSIFYS={"收入","销售费用","管理费用","研发费用","财务费用"};// 分类
     private static int[] PROFIT_NUMBERS={15,25,25,25,10};// 报表默认长度
 
     private static String[] RECEIVABLE_CLASSIFYS ={"平台服务费","技术服务费","其他"};// 应收账款表子科目
     private static int[] RECEIABLE_NUMBERS ={30,30,30};// 应收账款表默认长度
 
-    private static String[] OTHER_RECEIVABLE_CLASSIFYS ={"房屋押金","员工借款(备用金)","往来"};// 其他应收款表子科目
+    private static String[] OTHER_RECEIVABLE_CLASSIFYS ={"办公房屋费用","往来","员工借款(备用金)"};// 其他应收款表子科目
     private static int[] OTHER_RECEIABLE_NUMBERS ={15,15,15};// 其他应收款表默认长度
 
     private static String[] PAYABLE_CLASSIFYS ={"往来"};// 应付款表子科目
@@ -78,7 +82,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
 
     String _matchFormUuid(String code) {
         Map<String, String> formUuid = UtilMap.empty();
-        if (UtilEnv.getActiveProfile().equals(UtilEnv.ENV_PROD)) {
+        if (UtilEnv.getActiveProfile().equals(UtilEnv.ENV_PROD) || UtilEnv.getActiveProfile().equals(UtilEnv.ENV_DEV)) {
             formUuid.put("PROFIT", "FORM-32937639BC314882AF45201131EAE4C0YD2L"); // 利润表
             formUuid.put("DOMAIN", "https://nxcyz4.aliwork.com/"); // 宜搭域名
             formUuid.put("BUDGET","FORM-A0B077B5775341869605B2EB7E79356A7ZX7");// 成本费用预算编制中间表
@@ -90,6 +94,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
             formUuid.put("INCOME","FORM-DA4BC7EA522E4D59A9233C507206D291N1XX");// 收入申请表
             formUuid.put("PAY","FORM-DE36121157B74774B5C8462E38519269OAVS");// 支出申请表
             formUuid.put("ARTIFICIAL","FORM-52CEBFBA6D56413993E1F5075A493FDCVXVT");// 资产负债手动维护表
+            formUuid.put("PREVIOUS","FORM-2E13B1E519A3410D9DA27EA1DAA71ABF2UUO");// 往期数据手动维护表
         } else {
             formUuid.put("DOMAIN", "https://nxcyz4.aliwork.com/");
         }
@@ -382,86 +387,164 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
     public void uploadToDingTalk(HttpServletResponse response,String userId) {
         //获取当前时间戳
         long beginTimestamp = System.currentTimeMillis();
-        System.out.println("开始上传文件:" + beginTimestamp);
+        System.out.println("开始上传相关账户明细表:" + beginTimestamp);
 
         //父节点dentryUuid
-//        String parentDentryUuid = "9bN7RYPWdMm4Mv4eTDnleGRaVZd1wyK0";//poc api上传测试文件夹
         String parentDentryUuid = "ZX6GRezwJlRgBQmQCGE54DMQWdqbropQ";//知行同德
         String year = DateUtil.year(new Date()) + "";
-        String month = DateUtil.month(new Date()) + 1 + "";
 
         exportAll(response, year);
-        exportCash(response, year + "0" + month);
 
         //文件
-        File file1 = new File("d:\\现金流量表-" + year + "0" + month + ".xlsx");
-        File file2 = new File("d:\\相关账户明细表-" + year + ".xlsx");
-        List<File> files = new ArrayList<>();
-        Collections.addAll(files,file1,file2);
+        File file = new File("d:\\相关账户明细表-" + year + ".xlsx");
 
         //获取文件上传信息
         Map param = new HashMap();
-//        param.put("unionId","5PK3cMYhiStn7HDoNabweEgiEiE");//poc wzy
         param.put("unionId","b80wtLNgk1gXHvKn9eozugiEiE");//知行同德 lfx
         Map body = new HashMap();
         body.put("protocol","HEADER_SIGNATURE");
 
-        for (File file : files) {
-            DDR_New ddr = (DDR_New) UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/uploadInfos/query", ddConf.initTokenHeader(ddClient.getAccessToken()), param, body, DDR_New.class);
-            String uploadKey = ddr.getUploadKey();
-            Map headerSignatureInfo = ddr.getHeaderSignatureInfo();
-            Map<String,String> headers = (Map<String,String>) headerSignatureInfo.get("headers");
-            List<String> resourceUrls = (List<String>) headerSignatureInfo.get("resourceUrls");
-            String resourceUrl = resourceUrls.get(0);
-
-            //使用OSS的header加签方式上传文件
-            try {
-                URL url = new URL(resourceUrl);
-                HttpURLConnection connection = (HttpURLConnection)url.openConnection();
-                if (headers != null) {
-                    for (Map.Entry<String, String> entry : headers.entrySet()) {
-                        connection.setRequestProperty(entry.getKey(), entry.getValue());
-                    }
+        DDR_New ddr = (DDR_New) UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/uploadInfos/query", ddConf.initTokenHeader(ddClient.getAccessToken()), param, body, DDR_New.class);
+        String uploadKey = ddr.getUploadKey();
+        Map headerSignatureInfo = ddr.getHeaderSignatureInfo();
+        Map<String,String> headers = (Map<String,String>) headerSignatureInfo.get("headers");
+        List<String> resourceUrls = (List<String>) headerSignatureInfo.get("resourceUrls");
+        String resourceUrl = resourceUrls.get(0);
+        //使用OSS的header加签方式上传文件
+        try {
+            URL url = new URL(resourceUrl);
+            HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+            if (headers != null) {
+                for (Map.Entry<String, String> entry : headers.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
                 }
-                connection.setDoOutput(true);
-                connection.setRequestMethod("PUT");
-                connection.setUseCaches(false);
-                connection.setReadTimeout(10000);
-                connection.setConnectTimeout(10000);
-                connection.connect();
-                OutputStream out = connection.getOutputStream();
-
-
-                    InputStream is = new FileInputStream(file);
-                    byte[] b =new byte[1024];
-                    int temp;
-                    while ((temp=is.read(b))!=-1){
-                        out.write(b,0,temp);
-                    }
-                    out.flush();
-                    out.close();
-                    int responseCode = connection.getResponseCode();
-                    connection.disconnect();
-                    if (responseCode == 200) {
-                        System.out.println("上传成功");
-                    } else {
-                        System.out.println("上传失败");
-                    }
+            }
+            connection.setDoOutput(true);
+            connection.setRequestMethod("PUT");
+            connection.setUseCaches(false);
+            connection.setReadTimeout(10000);
+            connection.setConnectTimeout(10000);
+            connection.connect();
+            OutputStream out = connection.getOutputStream();
+            InputStream is = new FileInputStream(file);
+            byte[] b =new byte[1024];
+            int temp;
+            while ((temp=is.read(b))!=-1){
+                out.write(b,0,temp);
+            }
+            out.flush();
+            out.close();
+            int responseCode = connection.getResponseCode();
+            connection.disconnect();
+            if (responseCode == 200) {
+                System.out.println("上传成功");
+            } else {
+                System.out.println("上传失败");
+            }
+            //提交文件
+            Map body2 = new HashMap();
+            Map option = new HashMap();
+            option.put("conflictStrategy","OVERWRITE");
+            body2.put("uploadKey",uploadKey);
+            body2.put("name",file.getName());
+            body2.put("option",option);
+            UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/commit",ddClient.initTokenHeader(),param,body2);
+        }catch (IOException e){
+            System.out.println("上传文件异常");
+        }
 
-                    //提交文件
-                    Map body2 = new HashMap();
-                    Map option = new HashMap();
-                    option.put("conflictStrategy","OVERWRITE");
-                    body2.put("uploadKey",uploadKey);
-                    body2.put("name",file.getName());
-                    body2.put("option",option);
+        long endTimestamp = System.currentTimeMillis();
+        System.out.println("上传文件结束:" + endTimestamp);
+        System.out.println("上传文件耗时:" + (endTimestamp - beginTimestamp)/1000 + "s");
 
-                    UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/commit",ddClient.initTokenHeader(),param,body2);
+        //发送工作通知给当前登陆人
+        if (Objects.nonNull(userId)){
+            Map param2 = new HashMap();
+            param2.put("access_token",ddClient.getAccessToken());
+            Map body3 = new HashMap();
+            body3.put("agent_id",ddConf.getAgentId());
+            body3.put("userid_list",userId);
+            Map msg = new HashMap();
+            msg.put("msgtype","text");
+            //获取当前时间 精确到秒
+            String time = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
+            msg.put("text",UtilMap.map("content","报表已同步完成!请到钉钉云盘查看  时间:" + time));
+            body3.put("msg",msg);
+            UtilHttp.doPost("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2",null,param2,body3);
+        }
+    }
 
-            }catch (IOException e){
-                System.out.println("上传文件异常");
+    @Override
+    @Async
+    public void uploadToDingTalk2(HttpServletResponse response,String userId,String month) {
+        //获取当前时间戳
+        long beginTimestamp = System.currentTimeMillis();
+        System.out.println("开始上传现金流量表:" + beginTimestamp);
+
+        //父节点dentryUuid
+        String parentDentryUuid = "ZX6GRezwJlRgBQmQCGE54DMQWdqbropQ";//知行同德
+        String year = DateUtil.year(new Date()) + "";
+
+        exportCash(response, year + "0" + month);
+
+        //文件
+        File file = new File(reportPath + "现金流量表-" + year + "0" + month + ".xlsx");
+
+        //获取文件上传信息
+        Map param = new HashMap();
+        param.put("unionId","b80wtLNgk1gXHvKn9eozugiEiE");//知行同德 lfx
+        Map body = new HashMap();
+        body.put("protocol","HEADER_SIGNATURE");
+
+        DDR_New ddr = (DDR_New) UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/uploadInfos/query", ddConf.initTokenHeader(ddClient.getAccessToken()), param, body, DDR_New.class);
+        String uploadKey = ddr.getUploadKey();
+        Map headerSignatureInfo = ddr.getHeaderSignatureInfo();
+        Map<String,String> headers = (Map<String,String>) headerSignatureInfo.get("headers");
+        List<String> resourceUrls = (List<String>) headerSignatureInfo.get("resourceUrls");
+        String resourceUrl = resourceUrls.get(0);
+        //使用OSS的header加签方式上传文件
+        try {
+            URL url = new URL(resourceUrl);
+            HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+            if (headers != null) {
+                for (Map.Entry<String, String> entry : headers.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setDoOutput(true);
+            connection.setRequestMethod("PUT");
+            connection.setUseCaches(false);
+            connection.setReadTimeout(10000);
+            connection.setConnectTimeout(10000);
+            connection.connect();
+            OutputStream out = connection.getOutputStream();
+            InputStream is = new FileInputStream(file);
+            byte[] b =new byte[1024];
+            int temp;
+            while ((temp=is.read(b))!=-1){
+                out.write(b,0,temp);
+            }
+            out.flush();
+            out.close();
+            int responseCode = connection.getResponseCode();
+            connection.disconnect();
+            if (responseCode == 200) {
+                System.out.println("上传成功");
+            } else {
+                System.out.println("上传失败");
             }
+            //提交文件
+            Map body2 = new HashMap();
+            Map option = new HashMap();
+            option.put("conflictStrategy","OVERWRITE");
+            body2.put("uploadKey",uploadKey);
+            body2.put("name",file.getName());
+            body2.put("option",option);
+            UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/commit",ddClient.initTokenHeader(),param,body2);
+        }catch (IOException e){
+            System.out.println("上传文件异常");
         }
+
         long endTimestamp = System.currentTimeMillis();
         System.out.println("上传文件结束:" + endTimestamp);
         System.out.println("上传文件耗时:" + (endTimestamp - beginTimestamp)/1000 + "s");
@@ -477,7 +560,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
             msg.put("msgtype","text");
             //获取当前时间 精确到秒
             String time = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
-            msg.put("text",UtilMap.map("content","表已同步完成!请到钉钉云盘查看  时间:" + time));
+            msg.put("text",UtilMap.map("content","现金流量表已同步完成!请到钉钉云盘查看  时间:" + time));
             body3.put("msg",msg);
             UtilHttp.doPost("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2",null,param2,body3);
         }
@@ -598,6 +681,8 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
         //查询资产负债手动维护表
         List<Map> artificialList = getYdFormDataList(_matchFormUuid("ARTIFICIAL"),JSONObject.toJSONString(UtilMap.map("textField_lxtzn9up",year)),YDConf.FORM_QUERY.retrieve_list_all);
 
+        //查询往期数据手动维护表
+//        List<Map> previousList = getYdFormDataList(_matchFormUuid("PREVIOUS"), JSONObject.toJSONString(UtilMap.map("textField_lxtzn9up", "202401")), YDConf.FORM_QUERY.retrieve_list);
 
         //货币资金
         Accounts accounts1 = new Accounts();
@@ -622,11 +707,11 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     String amt = getBigDecimalStringAmt(formData.get("numberField_lp82nads"));
 
                     ReflectUtil.invoke(accounts1, "setAmt"+month, NumberUtil.sub(ReflectUtil.invoke(accounts1,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
-                    List<String> accounts = (List<String>) formData.get("multiSelectField_lv0bm8qs");
+                    /*List<String> accounts = (List<String>) formData.get("multiSelectField_lv0bm8qs");
                     String account = "";
                     if (Objects.nonNull(accounts) && !accounts.isEmpty()){
                         account = accounts.get(0);
-                    }
+                    }*/
                 }
             }
         }
@@ -672,7 +757,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     }
                 }
             }
-            //获取收入中实际已收的金额-应收账款表
+            /*//获取收入中实际已收的金额-应收账款表
             List<Map> collect = incomeList.stream().filter(p ->
                             String.valueOf(((Map) p.get("formData")).get("selectField_ly2pd5cm")).equals("关联应收帐款表"))
                     .collect(Collectors.toList());
@@ -684,12 +769,30 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     String month = String.valueOf(formData1.get("textField_lxl8moor")).substring(6);
                     ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                 }
-            }
-            String addAmt = accounts3.getInitialAmt();
+            }*/
+
+            /*//应收-往期
+            List<Map> collect2 = previousList.stream().filter(p ->
+                            String.valueOf(((Map) p.get("formData")).get("selectField_lyo7yox6")).equals("应收账款表"))
+                    .collect(Collectors.toList());
+            if (!collect2.isEmpty()){
+                for (Map oneCollect : collect2) {
+                    Map formData1 = (Map) oneCollect.get("formData");
+                    String amt = String.valueOf(formData1.get("numberField_lyo7yox9"));
+                    String month = String.valueOf(formData1.get("textField_lyo7yoxa")).substring(6);
+                    ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
+                }
+            }*/
+
+            //累加
+            /*String addAmt = accounts3.getInitialAmt();
             for (int i = 1; i < month1+2; i++) {
                 ReflectUtil.invoke(accounts3,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts3,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                 addAmt = ReflectUtil.invoke(accounts3,"getAmt"+i);
-            }
+            }*/
+
+
+
         }
 
         //其他应收款
@@ -720,11 +823,11 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     }
                 }
             }
-            //获取收入中实际已收的金额-应收账款表
+            /*//获取收入中实际已收的金额-应收账款表
             List<Map> collect = incomeList.stream().filter(p ->
                             String.valueOf(((Map) p.get("formData")).get("selectField_ly2pd5cm")).equals("关联其他应收款表"))
                     .collect(Collectors.toList());
-            //应收-已收
+            //其他应收-已收
             if (!collect.isEmpty()){
                 for (Map oneCollect : collect) {
                     Map formData1 = (Map) oneCollect.get("formData");
@@ -732,13 +835,27 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     String month = String.valueOf(formData1.get("textField_lxl8moor")).substring(6);
                     ReflectUtil.invoke(accounts2,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts2,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                 }
-            }
+            }*/
+
+            /*//其他应收-往期
+            List<Map> collect2 = previousList.stream().filter(p ->
+                            String.valueOf(((Map) p.get("formData")).get("selectField_lyo7yox6")).equals("其他应收款表"))
+                    .collect(Collectors.toList());
+            if (!collect2.isEmpty()){
+                for (Map oneCollect : collect2) {
+                    Map formData1 = (Map) oneCollect.get("formData");
+                    String amt = String.valueOf(formData1.get("numberField_lyo7yox9"));
+                    String month = String.valueOf(formData1.get("textField_lyo7yoxa")).substring(6);
+                    ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
+                }
+            }*/
 
-            String addAmt = accounts2.getInitialAmt();
+            //累加
+            /*String addAmt = accounts2.getInitialAmt();
             for (int i = 1; i < month1+2; i++) {
                 ReflectUtil.invoke(accounts2,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts2,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                 addAmt = ReflectUtil.invoke(accounts2,"getAmt"+i);
-            }
+            }*/
         }
 
         //手填数据
@@ -811,7 +928,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     }
                 }
             }
-            //获取支出中实际已付的金额-应付账款表
+            /*//获取支出中实际已付的金额-应付账款表
             List<Map> collect = payList.stream().filter(p ->
                             String.valueOf(((Map) p.get("formData")).get("selectField_ly2lhkpe")).equals("关联应付账款表"))
                     .collect(Collectors.toList());
@@ -823,12 +940,26 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     String month = String.valueOf(formData1.get("textField_lqvpypje")).substring(6);
                     ReflectUtil.invoke(accounts12,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts12,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                 }
-            }
-            String addAmt = accounts12.getInitialAmt();
+            }*/
+
+            /*//应付-往期
+            List<Map> collect2 = previousList.stream().filter(p ->
+                            String.valueOf(((Map) p.get("formData")).get("selectField_lyo7yox6")).equals("应付账款表"))
+                    .collect(Collectors.toList());
+            if (!collect2.isEmpty()){
+                for (Map oneCollect : collect2) {
+                    Map formData1 = (Map) oneCollect.get("formData");
+                    String amt = String.valueOf(formData1.get("numberField_lyo7yox9"));
+                    String month = String.valueOf(formData1.get("textField_lyo7yoxa")).substring(6);
+                    ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
+                }
+            }*/
+
+            /*String addAmt = accounts12.getInitialAmt();
             for (int i = 1; i < month1+2; i++) {
                 ReflectUtil.invoke(accounts12,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts12,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                 addAmt = ReflectUtil.invoke(accounts12,"getAmt"+i);
-            }
+            }*/
 
         }
 
@@ -862,11 +993,11 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     }
                 }
             }
-            //获取支出中实际已付的金额-其他应付款表
+            /*//获取支出中实际已付的金额-其他应付款表
             List<Map> collect = payList.stream().filter(p ->
                             String.valueOf(((Map) p.get("formData")).get("selectField_ly2lhkpe")).equals("关联其他应付款表"))
                     .collect(Collectors.toList());
-            //应付-已付
+            //其他应付-已付
             if (!collect.isEmpty()){
                 for (Map oneCollect : collect) {
                     Map formData1 = (Map) oneCollect.get("formData");
@@ -874,13 +1005,27 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
                     String month = String.valueOf(formData1.get("textField_lqvpypje")).substring(6);
                     ReflectUtil.invoke(accounts10,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts10,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                 }
-            }
+            }*/
 
-            String addAmt = accounts10.getInitialAmt();
+            /*//其他应付-往期
+            List<Map> collect2 = previousList.stream().filter(p ->
+                            String.valueOf(((Map) p.get("formData")).get("selectField_lyo7yox6")).equals("其他应付款表"))
+                    .collect(Collectors.toList());
+            if (!collect2.isEmpty()){
+                for (Map oneCollect : collect2) {
+                    Map formData1 = (Map) oneCollect.get("formData");
+                    String amt = String.valueOf(formData1.get("numberField_lyo7yox9"));
+                    String month = String.valueOf(formData1.get("textField_lyo7yoxa")).substring(6);
+                    ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
+                }
+            }*/
+
+            //累加
+            /*String addAmt = accounts10.getInitialAmt();
             for (int i = 1; i < month1+2; i++) {
                 ReflectUtil.invoke(accounts10,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts10,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
                 addAmt = ReflectUtil.invoke(accounts10,"getAmt"+i);
-            }
+            }*/
         }
 
         //未分配利润
@@ -1048,6 +1193,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
         incomeJsonString.add(COMPLETED_STATUS);
         incomeJsonString.add(AGREE_RESULT);
         String incomeSearchCondition = JSONObject.toJSONString(incomeJsonString);
+        String s = _matchFormUuid("INCOME");
         List<Map> incomeDataList = getYdFormDataList(_matchFormUuid("INCOME"),incomeSearchCondition,YDConf.FORM_QUERY.retrieve_list);
 
 //        List<Map> incomeDataList = getYdFormDataList(_matchFormUuid("INCOME"),JSONObject.toJSONString(UtilMap.map("textField_lqvp25z0", year)),YDConf.FORM_QUERY.retrieve_list);

+ 22 - 16
mjava-zhixingtongde/src/main/resources/application-dev.yml

@@ -39,24 +39,30 @@ logging:
 
 # dingtalk
 dingtalk:
-  #agentId: 2673435445
-  #appKey: dingozv6fzkpqkiupd3d
-  #appSecret: bO4AA6ujXj8xgLBJI5pR7ns0vRsHCn8Ng9fTf9WF95HTOlCW0oybYpHsuxXuBPiO
-  #corpId: dingcc1b1ffad0d5ca1d
-  #aesKey:
-  #token:
-  #operator: ""   # OA管理员账号 [0开头需要转一下字符串]
-
-  #poc
-  agentId: 2995824312
-  appKey: ding3ap1jk1tg44tz3s2
-  appSecret: PaWTDG-FiX-RW5fnV9r8CzEmR-9QlJpubC88txhprL_Z_iREO62B-iRW6w7gkA_K
-  corpId: ding321c72787fffc78b35c2f4657eb6378f
+  agentId: 3086109407
+  appKey: dinghyyu1rci8fgejgbx
+  appSecret: dE4r1mqQJqGPk8lQdbvmDdxqToE6RbcRL53mys4ajRPD4W2jAx3mhTbOULfT25wJ
+  corpId: ding9400625d56a28e4135c2f4657eb6378f
   aesKey:
   token:
-  operator: "344749020127590108"   # OA管理员账号 [0开头需要转一下字符串] wzy
+  operator: ""   # OA管理员账号 [0开头需要转一下字符串]
+
+  #poc
+#  agentId: 2995824312
+#  appKey: ding3ap1jk1tg44tz3s2
+#  appSecret: PaWTDG-FiX-RW5fnV9r8CzEmR-9QlJpubC88txhprL_Z_iREO62B-iRW6w7gkA_K
+#  corpId: ding321c72787fffc78b35c2f4657eb6378f
+#  aesKey:
+#  token:
+#  operator: "344749020127590108"   # OA管理员账号 [0开头需要转一下字符串] wzy
 
 # aliwork
 aliwork:
-  appType: APP_ZL5NE83JE84UUACZDD03
-  systemToken: 3J966U61PPNCA6ROEIX8L8TY6DF33EYW60BKLY
+  appType: APP_K8EYBJO1GLUWYIXT12DI
+  systemToken: 7C766871QS1GIKQ68SWX0BS71RSZ1LONSB2PLA
+
+report:
+  path: d:\\  # 报表文件保存路径
+
+
+

+ 3 - 0
mjava-zhixingtongde/src/main/resources/application-prod.yml

@@ -36,3 +36,6 @@ dingtalk:
 aliwork:
   appType: APP_K8EYBJO1GLUWYIXT12DI
   systemToken: 7C766871QS1GIKQ68SWX0BS71RSZ1LONSB2PLA
+
+report:
+  path: /home/server/zhixingtongde/file/  # 报表文件保存路径

+ 3 - 0
mjava-zhixingtongde/src/main/resources/application.yml

@@ -0,0 +1,3 @@
+spring:
+  profiles:
+    active: dev

BIN
mjava-zhixingtongde/src/main/resources/templates/Template_all.xlsx


BIN
mjava-zhixingtongde/src/main/resources/templates/Template_other_receivable.xlsx