|
|
@ -169,7 +169,7 @@ public class AutoCreateWorkflowService {
|
|
|
|
Object value = entry.getValue();
|
|
|
|
Object value = entry.getValue();
|
|
|
|
FormDataDuty formDataDuty = FormDataDuty.builder().build();
|
|
|
|
FormDataDuty formDataDuty = FormDataDuty.builder().build();
|
|
|
|
|
|
|
|
|
|
|
|
Long optionId = null;
|
|
|
|
String optionId = null;
|
|
|
|
// log.error("入参key:"+key+" value:"+value);
|
|
|
|
// log.error("入参key:"+key+" value:"+value);
|
|
|
|
String code = "";
|
|
|
|
String code = "";
|
|
|
|
JSONObject doc = new JSONObject();
|
|
|
|
JSONObject doc = new JSONObject();
|
|
|
@ -205,12 +205,12 @@ public class AutoCreateWorkflowService {
|
|
|
|
|
|
|
|
|
|
|
|
if(mainMap.get("hrm:"+str2) != null){
|
|
|
|
if(mainMap.get("hrm:"+str2) != null){
|
|
|
|
String hrmResource = (String) mainMap.get("hrm:"+str2);
|
|
|
|
String hrmResource = (String) mainMap.get("hrm:"+str2);
|
|
|
|
Long id = getIdByWorkcode(hrmResource,createTenantKey,zhsjy);
|
|
|
|
String id = getIdByWorkcode(hrmResource,createTenantKey,zhsjy);
|
|
|
|
SimpleEmployee simpleEmployee = hrmCommonUtil.getSimpleEmployee(id);
|
|
|
|
SimpleEmployee simpleEmployee = hrmCommonUtil.getSimpleEmployee(Long.valueOf(id));
|
|
|
|
log.error("simpleEmployee == " + simpleEmployee.toString());
|
|
|
|
log.error("simpleEmployee == " + simpleEmployee.toString());
|
|
|
|
optionId = simpleEmployee.getDepartmentId();
|
|
|
|
optionId = String.valueOf(simpleEmployee.getDepartmentId());
|
|
|
|
if (key.contains("com:")) {
|
|
|
|
if (key.contains("com:")) {
|
|
|
|
optionId = Long.valueOf(departmentComInfo.getSubcompanyid1(String.valueOf(optionId)));
|
|
|
|
optionId = departmentComInfo.getSubcompanyid1(String.valueOf(optionId)) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
key = str3;
|
|
|
|
key = str3;
|
|
|
|
formDataDuty.setDataKey(key);
|
|
|
|
formDataDuty.setDataKey(key);
|
|
|
@ -235,7 +235,7 @@ public class AutoCreateWorkflowService {
|
|
|
|
String docId = docUtil.createdocByBase642(docName, base64, "", creator, "");
|
|
|
|
String docId = docUtil.createdocByBase642(docName, base64, "", creator, "");
|
|
|
|
log.error("生成的附件id:"+docId);
|
|
|
|
log.error("生成的附件id:"+docId);
|
|
|
|
formDataDuty.setDataKey(key);
|
|
|
|
formDataDuty.setDataKey(key);
|
|
|
|
DataOptions options = DataOptions.builder().optionId(Long.parseLong(docId)).content(docName).build();
|
|
|
|
DataOptions options = DataOptions.builder().optionId( docId ).content(docName).build();
|
|
|
|
List<DataOptions> dataOptions = new ArrayList();
|
|
|
|
List<DataOptions> dataOptions = new ArrayList();
|
|
|
|
dataOptions.add(options);
|
|
|
|
dataOptions.add(options);
|
|
|
|
formDataDuty.setDataOptions(dataOptions);
|
|
|
|
formDataDuty.setDataOptions(dataOptions);
|
|
|
@ -293,7 +293,7 @@ public class AutoCreateWorkflowService {
|
|
|
|
// 遍历内部 JSONArray
|
|
|
|
// 遍历内部 JSONArray
|
|
|
|
for (int j = 0; j < innerArray.size(); j++) {
|
|
|
|
for (int j = 0; j < innerArray.size(); j++) {
|
|
|
|
JSONObject jsonDetail = innerArray.getJSONObject(j);
|
|
|
|
JSONObject jsonDetail = innerArray.getJSONObject(j);
|
|
|
|
Long optionId = null;
|
|
|
|
String optionId = null;
|
|
|
|
|
|
|
|
|
|
|
|
// 遍历 JSONObject 的键值对
|
|
|
|
// 遍历 JSONObject 的键值对
|
|
|
|
for (String key : jsonDetail.keySet()) {
|
|
|
|
for (String key : jsonDetail.keySet()) {
|
|
|
@ -325,11 +325,11 @@ public class AutoCreateWorkflowService {
|
|
|
|
|
|
|
|
|
|
|
|
if(mainMap.get("hrm:"+str2) != null){
|
|
|
|
if(mainMap.get("hrm:"+str2) != null){
|
|
|
|
String hrmResource = (String) mainMap.get("hrm:"+str2);
|
|
|
|
String hrmResource = (String) mainMap.get("hrm:"+str2);
|
|
|
|
Long id = getIdByWorkcode(hrmResource,createTenantKey,zhsjy);
|
|
|
|
String id = getIdByWorkcode(hrmResource,createTenantKey,zhsjy);
|
|
|
|
SimpleEmployee simpleEmployee = hrmCommonUtil.getSimpleEmployee(id);
|
|
|
|
SimpleEmployee simpleEmployee = hrmCommonUtil.getSimpleEmployee(Long.valueOf(id));
|
|
|
|
optionId = simpleEmployee.getDepartmentId();
|
|
|
|
optionId = String.valueOf(simpleEmployee.getDepartmentId());
|
|
|
|
if (key.contains("com:")) {
|
|
|
|
if (key.contains("com:")) {
|
|
|
|
optionId = Long.valueOf(departmentComInfo.getSubcompanyid1(String.valueOf(optionId)));
|
|
|
|
optionId = departmentComInfo.getSubcompanyid1(String.valueOf(optionId)) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
key = str3;
|
|
|
|
key = str3;
|
|
|
|
formDataDuty.setDataKey(key);
|
|
|
|
formDataDuty.setDataKey(key);
|
|
|
@ -431,10 +431,9 @@ public class AutoCreateWorkflowService {
|
|
|
|
* @param workcode
|
|
|
|
* @param workcode
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private Long getIdByWorkcode(String workcode,String createTenantKey , String zhsjy) {
|
|
|
|
private String getIdByWorkcode(String workcode,String createTenantKey , String zhsjy) {
|
|
|
|
log.error("人员工号:"+workcode);
|
|
|
|
log.error("人员工号:"+workcode);
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
String sql = "select ID from eteams.dbo.employee where status = 'normal' and job_num = '"+workcode+"' and tenant_key = '"+createTenantKey+"'";
|
|
|
|
|
|
|
|
Map<String,Object> recordMap = new HashMap<>();
|
|
|
|
Map<String,Object> recordMap = new HashMap<>();
|
|
|
|
// String sourceType = "LOGIC";
|
|
|
|
// String sourceType = "LOGIC";
|
|
|
|
String sourceType = zhsjy;
|
|
|
|
String sourceType = zhsjy;
|
|
|
@ -444,13 +443,26 @@ public class AutoCreateWorkflowService {
|
|
|
|
// recordMap = recordList.get(0);
|
|
|
|
// recordMap = recordList.get(0);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
|
|
|
|
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
|
|
|
|
rs.executeQuery(sql, zhsjy);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> list = Arrays.asList(workcode.split(","));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String ids = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String code: list) {
|
|
|
|
Long id = null;
|
|
|
|
Long id = null;
|
|
|
|
|
|
|
|
String sql = "select ID from eteams.dbo.employee where status = 'normal' and job_num = '"+code+"' and tenant_key = '"+createTenantKey+"'";
|
|
|
|
|
|
|
|
rs.executeQuery(sql, zhsjy);
|
|
|
|
if(rs.next()){
|
|
|
|
if(rs.next()){
|
|
|
|
id = Long.parseLong(rs.getString("id"));
|
|
|
|
id = Long.parseLong(rs.getString("id"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.error("人员ID:"+id);
|
|
|
|
log.error("人员ID:"+id);
|
|
|
|
return id;
|
|
|
|
ids+=id;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ids;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|