Преглед на файлове

知行同德应收应付、其他应收应付跨年问题处理

wzy преди 4 месеца
родител
ревизия
7e60762835

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

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

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

@@ -76,9 +76,9 @@ public interface ZxtdReportService {
      * 现金流量表上传文件至钉盘
      * @param response
      * @param userId
-     * @param month
+     * @param date
      */
-    void uploadToDingTalk2(HttpServletResponse response, String userId, String month);
+    void uploadToDingTalk2(HttpServletResponse response, String userId, String date);
 
     void updateTest();
 

+ 10 - 14
mjava-zhixingtongde/src/main/java/com/malk/zhixingtongde/service/impl/ZxtdReportServiceImpl.java

@@ -540,24 +540,20 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
 
     @Override
     @Async
-    public void uploadToDingTalk2(HttpServletResponse response,String userId,String month) {
+    public void uploadToDingTalk2(HttpServletResponse response,String userId,String date) {
         //获取当前时间戳
         long beginTimestamp = System.currentTimeMillis();
         System.out.println("开始上传现金流量表:" + beginTimestamp);
 
         //父节点dentryUuid
         String parentDentryUuid = "ZX6GRezwJlRgBQmQCGE54DMQWdqbropQ";//知行同德
-        String year = DateUtil.year(new Date()) + "";
 
-        //如果月份小于10,则在年份前面加0
-        if (month.length() == 1) {
-            month = "0" + month;
-        }
+        date = date.replace("-","");
 
-        exportCash(response, year + month);
+        exportCash(response, date);
 
         //文件
-        File file = new File(reportPath + "现金流量表-" + year + month + ".xlsx");
+        File file = new File(reportPath + "现金流量表-" + date + ".xlsx");
 
         //获取文件上传信息
         Map param = new HashMap();
@@ -610,8 +606,8 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
             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("上传文件异常");
+        }catch (Exception e){
+            log.info("上传文件异常:",e.getMessage());
         }
 
         long endTimestamp = System.currentTimeMillis();
@@ -1128,7 +1124,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
         // 数据预处理
         for (Map map:list){
             JSONObject formData=JSONObject.parseObject(String.valueOf(map.get("formData")));
-            String subject = formData.getString("textField_lqyx5k16") ;// 科目
+            String subject = formData.getString("selectField_m64i0kbn") ;// 科目
 
             if (ArrayUtil.contains(PAYABLE_CLASSIFYS,subject)){
                 //获取其他应收款明细子表单数据
@@ -2977,7 +2973,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
         // 数据预处理
         for (Map map:list){
             JSONObject formData=JSONObject.parseObject(String.valueOf(map.get("formData")));
-            String subject = formData.getString("textField_lqyx5k16") ;// 科目
+            String subject = formData.getString("selectField_m64i0kbn") ;// 科目
 
             if (ArrayUtil.contains(OTHER_PAYABLE_CLASSIFYS,subject)){
                 //获取其他应收款明细子表单数据
@@ -3068,7 +3064,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
         // 数据预处理
         for (Map map:list){
             JSONObject formData=JSONObject.parseObject(String.valueOf(map.get("formData")));
-            String subject = formData.getString("textField_lqyx5k16") ;// 科目
+            String subject = formData.getString("selectField_m64i0kbn") ;// 科目
 
             if (ArrayUtil.contains(OTHER_RECEIVABLE_CLASSIFYS,subject)){
                 //获取其他应收款明细子表单数据
@@ -3159,7 +3155,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
         // 数据预处理
         for (Map map:list){
             JSONObject formData=JSONObject.parseObject(String.valueOf(map.get("formData")));
-            String subject = formData.getString("textField_lqyx5k16") ;// 科目
+            String subject = formData.getString("selectField_m64i0kbn") ;// 科目
             if (!"平台服务费".equals(subject) && !"技术服务费".equals(subject)){
                 subject = "其他";
             }

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