4 次代码提交 bc3fb8d277 ... ad63e937ec

作者 SHA1 备注 提交日期
  wzy ad63e937ec Merge branch 'master' of https://mc.cloudpure.cn/mjava/cont 1 月之前
  wzy 07f92bb453 金轮 1 月之前
  wzy 0041c2e819 博洋 1 月之前
  wzy d6570a354f 思库 1 月之前

+ 5 - 0
mjava-boyang/src/main/java/com/malk/boyang/controller/BoyangController.java

@@ -28,6 +28,11 @@ public class BoyangController {
     public McR sign(@RequestBody Map body) {
         return boyangService.eSignSubmit(body);
     }
+    @GetMapping("/retrySign")
+    public McR retrySign(String businessId) {
+        return boyangService.retrySign(businessId);
+    }
+
 
     @GetMapping("/getOrganization")
     public McR getOrganization(String name) {

+ 3 - 0
mjava-boyang/src/main/java/com/malk/boyang/service/BoyangService.java

@@ -14,4 +14,7 @@ public interface BoyangService {
     McR getOrganization(String name);
 
     void start(String processInstanceId,String signFlowId);
+
+    //根据审批编号重试发起e签宝签署
+    McR retrySign(String businessId);
 }

+ 33 - 0
mjava-boyang/src/main/java/com/malk/boyang/service/impl/BoyangServiceImpl.java

@@ -23,6 +23,9 @@ import org.springframework.stereotype.Service;
 import java.io.*;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 @Slf4j
@@ -516,6 +519,36 @@ public class BoyangServiceImpl implements BoyangService {
         }
     }
 
+    @Override
+    public McR retrySign(String businessId) {
+        // 前12位: 年月日时分
+        String datePart = businessId.substring(0, 12);
+        // 16-17位: 秒
+        String secondPart = businessId.substring(15, 17);
+
+        // 组合完整时间: 年月日时分秒
+        String dateTimeStr = datePart + secondPart;
+        LocalDateTime localDateTime = LocalDateTime.parse(dateTimeStr, DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
+
+        // 转换为时间戳(毫秒)
+        long startTime = localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
+        long endTime = localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() + 1000;//应对审批编号与实际时间戳存在差异情况
+
+        Map instanceIds = ddClient_workflow.getInstanceIds(ddClient.getAccessToken(), "PROC-7DF36B3B-FBAD-4DF6-B8CD-723FFA8DBEC5", startTime, endTime, null);
+
+        List<String> list = UtilMap.getList(instanceIds, "list");
+
+        if (list.size() == 1){
+            String processInstanceId = list.get(0);
+            Map map = new HashMap();
+            map.put("processInstanceId",processInstanceId);
+
+            return eSignSubmit(map);
+        }else {
+            return McR.errorUnknown("未找到符合条件的数据");
+        }
+    }
+
     //下载钉钉OA审批单附件
     private void downloadDdFile(String processInstanceId,String fileId,String downloadPath){
         try {

+ 2 - 0
mjava-jinlun/src/main/java/com/malk/jinlun/service/CpClient.java

@@ -16,6 +16,8 @@ public interface CpClient {
 
     List<Map> getCpUserInfo(String corpId, List<String> departmentIds, List<String> ids, String mobile, String name, int page, int size);
 
+    List<Map> getCpDepartmentInfo();
+
     Map getCpBoResultData(Map result);
 
     void isSuccess(Map result);

+ 15 - 0
mjava-jinlun/src/main/java/com/malk/jinlun/service/impl/CpClientImpl.java

@@ -202,6 +202,21 @@ public class CpClientImpl implements CpClient {
         return content;
     }
 
+    @Override
+    public List<Map> getCpDepartmentInfo() {
+        String s = UtilHttp.doPost(cloudpivotConfig.getRedirectUri() + "openapi/v3/organization/department/query", CloudpivotConfig.initTokenHeader(getCpAccessToken()), null, new HashMap());
+
+        Map result = (Map) JSONObject.parse(s);
+
+        isSuccess(result);
+
+        Map data = UtilMap.getMap(result, "data");
+
+        List<Map> content = UtilMap.getList(data, "content");
+
+        return content;
+    }
+
 
     //获取云枢表单详情返回结果中单据字段值
     @Override

+ 24 - 8
mjava-jinlun/src/main/java/com/malk/jinlun/service/impl/JinlunTaskServiceImpl.java

@@ -786,8 +786,8 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
         List<Map> filterString = new ArrayList<>();
 
         //审核日期为昨天至今天
-        filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FApproveDate","265",1,"","","0"));//审核日期在今天之前N天以后
-//        filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FBillNo","67","S305-251031001","","","0"));//单据编号等于XX
+        filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FApproveDate","265",131,"","","0"));//审核日期在今天之前N天以后
+//        filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FBillNo","67","S305-260505001","","","0"));//单据编号等于XX
 
         billQuery.setFilterString(filterString);
         billQuery.setLimit(limit);
@@ -915,6 +915,12 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
         //处理同一出库单多个明细
         List<Map<String, Object>> list = mergeListMap(dataList, "ShortText1775629055296", "Sheet1775629877034");
 
+        List<Map> cpDepartmentInfo = cpClient.getCpDepartmentInfo();
+        Map<String, String> cpDepartmentMap = new HashMap<>();
+        for (Map cpDepartment : cpDepartmentInfo) {
+            cpDepartmentMap.put(UtilMap.getString(cpDepartment,"id"),UtilMap.getString(cpDepartment,"name"));
+        }
+
         //处理特殊字段格式
         for (Map<String, Object> stringObjectMap : list) {
             //成员
@@ -922,6 +928,7 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
             if(cpUserMap.containsKey(salerName)){
                 Map cpUserInfo = cpUserMap.get(salerName);
                 stringObjectMap.put("StaffSingle1775629353797",cpUserInfo);//销售员
+                stringObjectMap.put("ShortText1775629254048",cpDepartmentMap.get(UtilMap.getString(cpUserInfo,"mainDepartmentId")));//销售部门
             }else {
                 List<Map> cpUserInfoList = cpClient.getCpUserInfo(null, null, null, null, salerName, 0, 1);
                 if (cpUserInfoList.size() == 1){
@@ -929,6 +936,8 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
                     cpUserInfo.put("type",3);
                     stringObjectMap.put("StaffSingle1775629353797",cpUserInfo);//销售员
                     cpUserMap.put(salerName,cpUserInfo);
+
+                    stringObjectMap.put("ShortText1775629254048",cpDepartmentMap.get(UtilMap.getString(cpUserInfo,"mainDepartmentId")));//销售部门
                 }else {
                     stringObjectMap.put("StaffSingle1775629353797",null);
                 }
@@ -944,7 +953,7 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
                     Map cpUserInfo = (Map) cpUserInfoList.get(0);
                     cpUserInfo.put("type",3);
                     stringObjectMap.put("StaffSelector1775629377100",cpUserInfo);//跟单员
-                    cpUserMap.put(salerName,cpUserInfo);
+                    cpUserMap.put(gendanName,cpUserInfo);
                 }else {
                     stringObjectMap.put("StaffSelector1775629377100",null);
                 }
@@ -1024,10 +1033,10 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
 
         BillQuery billQuery = new BillQuery();
         billQuery.setFormId("AR_MatchRecord");
-        billQuery.setFieldKeys("FBILLNO,FCURWRITTENOFFAMOUNTFOR,FCURWRITTENOFFAMOUNT,FCURRENCYID.FName,FSOURCETYPE.FName,FSRCBILLNO,FVERIFYDATE,FCONTACTUNITTYPE,FCONTACTUNIT.FNumber,FCONTACTUNIT.FName,FBILLNUMBER");
+        billQuery.setFieldKeys("FBILLNO,FPLANAMOUNTFOR,FPLANAMOUNT,FCURWRITTENOFFAMOUNTFOR,FCURWRITTENOFFAMOUNT,FCURRENCYID.FName,FSOURCETYPE.FName,FSRCBILLNO,FVERIFYDATE,FCONTACTUNITTYPE,FCONTACTUNIT.FNumber,FCONTACTUNIT.FName,FBILLNUMBER");
         List<Map> filterString = new ArrayList<>();
 
-        filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FVERIFYDATE","265",1,"","","0"));//核销日期在今天之前N天以后
+        filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FVERIFYDATE","265",12,"","","0"));//核销日期在今天之前N天以后
 //        filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FVERIFYDATE","39","2026-01-01 00:00:00","","","0"));//核销日期>=XX
 //        filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FVERIFYDATE","16","2026-03-31 00:00:00","","","0"));//核销日期<=XX
         filterString.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FCURWRITTENOFFAMOUNTFOR","21",0,"","","0"));//本次核销金额>0
@@ -1055,6 +1064,9 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
         for (Map map : list) {
             Map body = new HashMap();
             body.put("ShortText1776845631494",UtilMap.getString(map, "FBILLNO"));//核销单号
+            Double fplanamountfor = UtilMap.getDouble(map, "FPLANAMOUNTFOR");
+            body.put("Number1778657486463", fplanamountfor);//应收金额
+            body.put("Number1778657494744",UtilMap.getDouble(map, "FPLANAMOUNT"));//应收金额本位币
             body.put("Number1776845666515",UtilMap.getDouble(map, "FCURWRITTENOFFAMOUNTFOR"));//本次核销金额
             body.put("Number1776845698524",UtilMap.getDouble(map, "FCURWRITTENOFFAMOUNT"));//本次核销金额本位币
             body.put("ShortText1776845718075",UtilMap.getString(map, "FCURRENCYID.FName"));//结算币别
@@ -1075,15 +1087,17 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
             body.put("ShortText1776845907662",UtilMap.getString(map, "FCONTACTUNIT.FNumber"));//往来单位编码
             body.put("Text1776845928307",UtilMap.getString(map, "FCONTACTUNIT.FName"));//往来单位名称
 
-            String saleOrderNumber = UtilMap.getString(map, "FBILLNUMBER");//销售订单号
+//            String saleOrderNumber = UtilMap.getString(map, "FBILLNUMBER");//销售订单号
+            String saleOrderNumber = "";//销售订单号    必须查询应收单获取到期日
 
             if (Strings.isBlank(saleOrderNumber)){
                 //查询应收单
                 BillQuery billQuery2 = new BillQuery();
                 billQuery2.setFormId("AR_receivable");
-                billQuery2.setFieldKeys("FBillNo,FSourceBillNo");
+                billQuery2.setFieldKeys("FBillNo,FSourceBillNo,FENDDATE");
                 List<Map> filterString2 = new ArrayList<>();
-                filterString2.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FBillNo","17",fsrcbillno,"","","0"));//单据编号包含XX
+                filterString2.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FBillNo","67",fsrcbillno,"","","0"));//单据编号等于XX
+                filterString2.add(UtilMap.map("FieldName, Compare, Value, Left, Right, Logic","FPAYAMOUNTFOR","76",fplanamountfor,"","","0"));//收款计划-应收金额等于XX
                 billQuery2.setFilterString(filterString2);
                 billQuery2.setLimit(1);
                 billQuery2.setStartRow(0);
@@ -1093,6 +1107,8 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
                     if (!ysdList.isEmpty()){
                         Map ysd = ysdList.get(0);
                         String fSourceBillNo = UtilMap.getString(ysd, "FSourceBillNo");//销售出库单单号
+                        String fenddate = UtilMap.getString(ysd, "FENDDATE").split("\\.")[0].replace("T"," ");//到期日
+                        body.put("Date1778657519700",fenddate);
 
                         if (Strings.isNotBlank(fSourceBillNo)){
                             //查询销售出库单

+ 2 - 2
mjava-siku/src/main/java/com/malk/siku/service/impl/SikuServiceImpl.java

@@ -2363,7 +2363,7 @@ public class SikuServiceImpl implements SikuService {
             body.put("type",2);
             body.put("budget_cycle",0);
             body.put("total_quota",0);
-            body.put("member_used",2);//0 :全员可见 1:项目成员可见 2:公司主体可见
+            body.put("member_used",1);//0 :全员可见 1:项目成员可见 2:公司主体可见
             body.put("legal_entity_id",ddLegalEntity.get(htqygssh));//项目所属公司主体ID
             body.put("start_date",startDate);
             body.put("expiry_date",endDate);
@@ -2377,7 +2377,7 @@ public class SikuServiceImpl implements SikuService {
             body.put("out_budget_id",projectCode);
             body.put("name",projectName);
             body.put("type",2);
-            body.put("member_used",2);//0 :全员可见 1:项目成员可见 2:公司主体可见
+            body.put("member_used",1);//0 :全员可见 1:项目成员可见 2:公司主体可见
             body.put("legal_entity_id",ddLegalEntity.get(htqygssh));//项目所属公司主体ID
             body.put("leader_employee_id",JSONObject.toJSONString(leader_employee_id));