|
@@ -9,6 +9,7 @@ import com.malk.core.McProject;
|
|
|
import com.malk.mc.service.McYdService;
|
|
|
import com.malk.server.aliwork.YDConf;
|
|
|
import com.malk.server.aliwork.YDParam;
|
|
|
+import com.malk.server.common.McException;
|
|
|
import com.malk.server.common.McR;
|
|
|
import com.malk.server.dingtalk.DDConf;
|
|
|
import com.malk.server.dingtalk.DDR_New;
|
|
@@ -602,6 +603,44 @@ public class McYdServiceImpl implements McYdService {
|
|
|
return McR.success();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public McR shareRecord(Map data) {
|
|
|
+ // 执行分享逻辑 [ 拼接后的权限组 ]
|
|
|
+ McException.assertParamException_Null(data, "compId, userIds, userId, content, atUserId");
|
|
|
+ //开始抓取宜搭对应的子表数据
|
|
|
+ String processInstanceId = data.get("processInstanceId").toString();
|
|
|
+ ArrayList<Map<String,String>> maps_YD = new ArrayList<>();
|
|
|
+ DDR_New ddrNew1 = ydClient.queryData(YDParam.builder().formInstanceId(processInstanceId).build()
|
|
|
+ , YDConf.FORM_QUERY.retrieve_id);
|
|
|
+ Map data1 = ddrNew1.getFormData();
|
|
|
+ List<Map> list = new ArrayList<>();
|
|
|
+ if (data1.get("tableField_m2cx8zh5") != null){
|
|
|
+ list = (List<Map>) data1.get("tableField_m2cx8zh5");
|
|
|
+ }
|
|
|
+ Map sss=new HashMap<>();
|
|
|
+ sss.put("employeeField_m2cx8zh6",data.get("atUserId").toString().split(","));
|
|
|
+ sss.put("textareaField_m2cx8zh7",data.get("content"));
|
|
|
+ //原有数据
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ Map sss2 = new HashMap();
|
|
|
+ Map map = (Map) list.get(i);
|
|
|
+ sss2.put("employeeField_m2cx8zh6",map.get("employeeField_m2cx8zh6_id"));
|
|
|
+ sss2.put("textareaField_m2cx8zh7",map.get("textareaField_m2cx8zh7"));
|
|
|
+ maps_YD.add(sss2);
|
|
|
+ }
|
|
|
+ maps_YD.add(sss);//新增数据
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put(UtilMap.getString(data, "compId"),UtilMap.getList(data, "userIds"));
|
|
|
+ map.put("tableField_m2cx8zh5",maps_YD);
|
|
|
+
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
+ .formInstId(processInstanceId)
|
|
|
+ .updateFormDataJson(JSON.toJSONString(map))
|
|
|
+ .build(), YDConf.FORM_OPERATION.update);
|
|
|
+
|
|
|
+ return McR.success();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private static void extractOperatorIds(JSONArray array, List<String> result) {
|
|
|
for (Object item : array) {
|