|
|
@@ -8,6 +8,7 @@ import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
|
|
|
import com.kingdee.bos.metadata.entity.*;
|
|
|
import com.kingdee.bos.metadata.function.WfEventListenerStateManager;
|
|
|
import com.kingdee.bos.metadata.query.util.CompareType;
|
|
|
+import com.kingdee.bos.util.BOSObjectType;
|
|
|
import com.kingdee.bos.util.BOSUuid;
|
|
|
import com.kingdee.eas.base.attachment.AttachmentFactory;
|
|
|
import com.kingdee.eas.base.attachment.AttachmentInfo;
|
|
|
@@ -19,6 +20,8 @@ import com.kingdee.eas.base.permission.UserCollection;
|
|
|
import com.kingdee.eas.base.permission.UserFactory;
|
|
|
import com.kingdee.eas.base.permission.UserInfo;
|
|
|
import com.kingdee.eas.basedata.org.*;
|
|
|
+import com.kingdee.eas.basedata.person.PersonCollection;
|
|
|
+import com.kingdee.eas.basedata.person.PersonFactory;
|
|
|
import com.kingdee.eas.basedata.person.PersonInfo;
|
|
|
import com.kingdee.eas.common.EASBizException;
|
|
|
import com.kingdee.eas.custom.beisen.utils.Helper;
|
|
|
@@ -30,9 +33,7 @@ import com.kingdee.eas.framework.CoreBaseCollection;
|
|
|
import com.kingdee.eas.framework.CoreBaseInfo;
|
|
|
import com.kingdee.eas.framework.ICoreBase;
|
|
|
import com.kingdee.eas.hr.affair.*;
|
|
|
-import com.kingdee.eas.hr.base.ApproveTypeEnum;
|
|
|
-import com.kingdee.eas.hr.base.HRBillStateEnum;
|
|
|
-import com.kingdee.eas.hr.base.HRBizDefineInfo;
|
|
|
+import com.kingdee.eas.hr.base.*;
|
|
|
import com.kingdee.eas.hr.emp.PersonPhotoFactory;
|
|
|
import com.kingdee.eas.hr.emp.PersonPhotoInfo;
|
|
|
import com.kingdee.shr.attachment.AttachmentState;
|
|
|
@@ -214,6 +215,9 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
System.out.println("=======入职单已存在=============");//0044610
|
|
|
OperateLogEntryInfo operateLogEntryInfo = new OperateLogEntryInfo();
|
|
|
operateLogEntryInfo.setErrorInfo("入职单已存在");
|
|
|
+ EmpEnrollBizBillEntryCollection entrys1 = collection.get(0).getEntrys();
|
|
|
+ String empName = entrys1.get(0).getEmpName();
|
|
|
+ operateLogInfo.setName(empName);
|
|
|
entrys.add(operateLogEntryInfo);
|
|
|
try {
|
|
|
localInstance.save(operateLogInfo);
|
|
|
@@ -253,13 +257,14 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
System.out.println(e.getMessage());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- operateLogInfo.setBusinessId(headId);
|
|
|
+ //operateLogInfo.setBusinessId(headId);
|
|
|
OperateLogEntryCollection entrys = operateLogInfo.getEntrys();
|
|
|
OperateLogEntryInfo operateLogEntryInfo = new OperateLogEntryInfo();
|
|
|
String f = e.getMessage();
|
|
|
if (f!=null&&f.length()>500){
|
|
|
f = f.substring(0, 500);
|
|
|
}
|
|
|
+ operateLogInfo.setName(f);
|
|
|
operateLogEntryInfo.setErrorInfo("整理保存头部数据失败!!!!" + f);
|
|
|
entrys.add(operateLogEntryInfo);
|
|
|
System.out.println(e.getMessage());
|
|
|
@@ -355,21 +360,36 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
operateLogInfo.setBusinessName(view1.getName());
|
|
|
boolean isCreateData1 = boybsViewConfigEntryInfo.isIsCreateData();
|
|
|
try {
|
|
|
+ BOSUuid read = BOSUuid.read(headId);
|
|
|
+ ICoreBase bosObject = (ICoreBase) (BOSObjectFactory.createBOSObject(context, read.getType()));
|
|
|
+ CoreBaseInfo coreBaseInfo = bosObject.getValue(new ObjectUuidPK(read));
|
|
|
+ operateLogInfo.setName(coreBaseInfo.getString("name"));
|
|
|
+ operateLogInfo.setNumber(coreBaseInfo.getString("number"));
|
|
|
if (type.getValue().equals("list")) {
|
|
|
- boyProcessing(view1, headId, jsonObject1.getJSONArray(beiSenData1), null, "fileInfos", beiSenData1);
|
|
|
- String boy = jsonObject1.getJSONArray(beiSenData1).toJSONString();
|
|
|
- if (boy.length()>500){
|
|
|
- boy = boy.substring(0, 500);
|
|
|
+ JSONArray jsonArray = jsonObject1.getJSONArray(beiSenData1);
|
|
|
+ if (jsonArray==null||jsonArray.size()==0){
|
|
|
+ operateLogEntryInfo.setErrorInfo("北森数据不存在"+beiSenData1);
|
|
|
+ }else {
|
|
|
+ boyProcessing(view1, headId, jsonArray, null, "fileInfos", beiSenData1);
|
|
|
+ String boy = jsonObject1.getJSONArray(beiSenData1).toJSONString();
|
|
|
+ if (boy.length()>500){
|
|
|
+ boy = boy.substring(0, 500);
|
|
|
+ }
|
|
|
+ operateLogEntryInfo.setErrorInfo(boy);
|
|
|
}
|
|
|
-
|
|
|
- operateLogEntryInfo.setErrorInfo(boy);
|
|
|
} else {
|
|
|
- boyProcessing(view1, isCreateData1, headId, jsonObject1.getJSONObject(beiSenData1), null, "fileInfos", beiSenData1);
|
|
|
- String boy =jsonObject1.getJSONObject(beiSenData1).toJSONString();
|
|
|
- if (boy.length()>500){
|
|
|
- boy = boy.substring(0, 500);
|
|
|
+ JSONObject jsonObject11 = jsonObject1.getJSONObject(beiSenData1);
|
|
|
+ if (jsonObject11==null||jsonObject11.size()==0){
|
|
|
+ operateLogEntryInfo.setErrorInfo("北森数据不存在"+beiSenData1);
|
|
|
+ }else {
|
|
|
+ boyProcessing(view1, isCreateData1, headId,jsonObject11, null, "fileInfos", beiSenData1);
|
|
|
+ String boy =jsonObject1.getJSONObject(beiSenData1).toJSONString();
|
|
|
+ if (boy.length()>500){
|
|
|
+ boy = boy.substring(0, 500);
|
|
|
+ }
|
|
|
+ operateLogEntryInfo.setErrorInfo(boy);
|
|
|
}
|
|
|
- operateLogEntryInfo.setErrorInfo(boy);
|
|
|
+
|
|
|
}
|
|
|
entrys1.add(operateLogEntryInfo);
|
|
|
try {
|
|
|
@@ -483,7 +503,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
|
|
|
}
|
|
|
// 处理文件信息
|
|
|
- fileProcessor(save.toString(), null, jsonArray);
|
|
|
+ fileProcessor(save.toString(), jsonArray);
|
|
|
|
|
|
if (fileJSON != null) {
|
|
|
// 获取文件信息的第一个 JSON 对象
|
|
|
@@ -644,7 +664,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
}
|
|
|
}
|
|
|
// 处理文件信息
|
|
|
- fileProcessor(save.toString(), null, jsonArray1);
|
|
|
+ fileProcessor(save.toString(), jsonArray1);
|
|
|
}
|
|
|
if (fileJSON != null) {
|
|
|
// 获取文件信息的第一个 JSON 对象
|
|
|
@@ -737,6 +757,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
System.out.println("===============alias:" + alias);
|
|
|
Object dataObject = jsonObject.get(split[0]);
|
|
|
String s1 = attributes.get("data-valueType");
|
|
|
+ fileName = attributes.get("data-fileName");
|
|
|
if (s1 != null && s1.equals("url")) {
|
|
|
if (dataObject instanceof JSONObject) {
|
|
|
JSONObject data = jsonObject.getJSONObject(split[0]);
|
|
|
@@ -753,12 +774,22 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
// 将数据的 UI 主键、下载链接和文件名添加到文件信息的 JSON 对象中
|
|
|
file.put("uipk", attributes.get("data-uipk"));
|
|
|
file.put("url", string);
|
|
|
- file.put("name", data.getString("text"));
|
|
|
+ file.put("name", fileName);
|
|
|
// 将文件信息的 JSON 对象添加到文件信息的 JSON 数组中
|
|
|
files.add(file);
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
|
+ }else if (value instanceof String){
|
|
|
+ String string = data.getString(split[1]);
|
|
|
+ file = new JSONObject();
|
|
|
+ // 将数据的 UI 主键、下载链接和文件名添加到文件信息的 JSON 对象中
|
|
|
+ file.put("uipk", attributes.get("data-uipk"));
|
|
|
+ file.put("url", string);
|
|
|
+ file.put("name", fileName);
|
|
|
+ // 将文件信息的 JSON 对象添加到文件信息的 JSON 数组中
|
|
|
+ files.add(file);
|
|
|
+ continue;
|
|
|
}
|
|
|
if (value == null || value.equals("null") || value.equals("{}") || value.equals("")) {
|
|
|
continue;
|
|
|
@@ -773,6 +804,11 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
|
|
|
} else if (dataObject instanceof JSONArray) {
|
|
|
JSONArray jsonArray1 = jsonObject.getJSONArray(split[0]);
|
|
|
+ if ((split[0].equals("entryRecord")||split[0].equals("employmentRecord"))&&jsonArray1.size()>0){
|
|
|
+ jsonArray1 = paixu(jsonArray1, "entryDate");
|
|
|
+ System.out.println("排序后entryRecord/employmentRecord"+jsonArray1);
|
|
|
+ // (可选)将排序后的List转回JSONArray
|
|
|
+ }
|
|
|
for (int j = 0; j < jsonArray1.size(); j++) {
|
|
|
JSONObject data = jsonArray1.getJSONObject(j);
|
|
|
if (data != null) {
|
|
|
@@ -789,7 +825,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
// 将数据的 UI 主键、下载链接和文件名添加到文件信息的 JSON 对象中
|
|
|
file.put("uipk", attributes.get("data-uipk"));
|
|
|
file.put("url", string);
|
|
|
- file.put("name", data.getString("text"));
|
|
|
+ file.put("name", fileName);
|
|
|
// 将文件信息的 JSON 对象添加到文件信息的 JSON 数组中
|
|
|
files.add(file);
|
|
|
}
|
|
|
@@ -977,12 +1013,48 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
hrBizDefineInfo.setId(BOSUuid.read("DawAAAApC9TmaL7Z"));
|
|
|
setCoreBaseInfo(coreBaseInfo, "entrys.hrBizDefine", hrBizDefineInfo);
|
|
|
}else {
|
|
|
- System.out.println("====empEnrollBizBills= DawAAAApC9DmaL7Z= 否");
|
|
|
- hrBizDefineInfo.setId(BOSUuid.read("DawAAAApC9DmaL7Z"));
|
|
|
- setCoreBaseInfo(coreBaseInfo, "entrys.hrBizDefine", hrBizDefineInfo);
|
|
|
+
|
|
|
+ PersonCollection personCollection = PersonFactory.getLocalInstance(context)
|
|
|
+ .getPersonCollection("where PassportNO='" + value + "' or IDCardNO='" + value + "'");
|
|
|
+ if (personCollection.size()>0){
|
|
|
+ System.out.println("====empEnrollBizBills= DawAAAApC9TmaL7Z= 是");
|
|
|
+ hrBizDefineInfo.setId(BOSUuid.read("DawAAAApC9TmaL7Z"));
|
|
|
+ setCoreBaseInfo(coreBaseInfo, "entrys.hrBizDefine", hrBizDefineInfo);
|
|
|
+ }else {
|
|
|
+ System.out.println("====empEnrollBizBills= DawAAAApC9DmaL7Z= 否");
|
|
|
+ hrBizDefineInfo.setId(BOSUuid.read("DawAAAApC9DmaL7Z"));
|
|
|
+ setCoreBaseInfo(coreBaseInfo, "entrys.hrBizDefine", hrBizDefineInfo);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
- setCoreBaseInfo(coreBaseInfo, name, value);
|
|
|
+ if (name.equals("nCell")){
|
|
|
+ String s = extractContent((String) value);
|
|
|
+ System.out.println(s +"''''''''"+value );
|
|
|
+ if (s!=null&&!s.equals("")){
|
|
|
+ System.out.println("setCoreBaseInfo(coreBaseInfo, \"globalRoaming\", s);\n");
|
|
|
+ setCoreBaseInfo(coreBaseInfo, "globalRoaming", s);
|
|
|
+ value = ((String) value).replace("("+s+")","");
|
|
|
+ setCoreBaseInfo(coreBaseInfo, name, value);
|
|
|
+ }else {
|
|
|
+ System.out.println("setCoreBaseInfo(coreBaseInfo, \"globalRoaming\", +86);\n");
|
|
|
+ setCoreBaseInfo(coreBaseInfo, "globalRoaming", "+86");
|
|
|
+ }
|
|
|
+ }else if (name.equals("entrys.nCell")||name.equals("entrys.telNum")){
|
|
|
+ String s = extractContent((String) value);
|
|
|
+ System.out.println(s +"''''''''"+value );
|
|
|
+ if (s!=null&&!s.equals("")) {
|
|
|
+ System.out.println("setCoreBaseInfo(coreBaseInfo, \"entrys.globalRoaming\", s));\n");
|
|
|
+ setCoreBaseInfo(coreBaseInfo, "entrys.globalRoaming", s);
|
|
|
+ value = ((String) value).replace("("+s+")","");
|
|
|
+ setCoreBaseInfo(coreBaseInfo, name, value);
|
|
|
+ }else {
|
|
|
+ System.out.println("setCoreBaseInfo(coreBaseInfo, \"entrys.globalRoaming\", +86));\n");
|
|
|
+ setCoreBaseInfo(coreBaseInfo, "entrys.globalRoaming", "+86");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ setCoreBaseInfo(coreBaseInfo, name, value);
|
|
|
+ }
|
|
|
// 将值设置到当前实体对象中
|
|
|
//coreBaseInfo.put(name, value);
|
|
|
}
|
|
|
@@ -993,6 +1065,29 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
// 返回处理后的文件信息的 JSON 数组
|
|
|
return files;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 提取字符串中括号内的内容
|
|
|
+ * @param input 包含括号的原始字符串
|
|
|
+ * @return 括号内的内容,若格式不合法则返回空字符串
|
|
|
+ */
|
|
|
+ public String extractContent(String input) {
|
|
|
+ // 检查输入是否为空
|
|
|
+ if (input == null || input.isEmpty()) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 定位左括号'('和右括号')'的位置
|
|
|
+ int leftIndex = input.indexOf('(');
|
|
|
+ int rightIndex = input.indexOf(')');
|
|
|
+
|
|
|
+ // 校验括号位置合法性(左括号存在、右括号存在、左括号在右括号之前)
|
|
|
+ if (leftIndex == -1 || rightIndex == -1 || leftIndex >= rightIndex) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 截取括号之间的内容(左括号后一位到右括号前一位)
|
|
|
+ return input.substring(leftIndex + 1, rightIndex);
|
|
|
+ }
|
|
|
|
|
|
public void setCoreBaseInfo(CoreBaseInfo coreBaseInfo, String name, Object value) {
|
|
|
System.out.println("+++++++++++++++" + name + ":" + value);
|
|
|
@@ -1029,8 +1124,8 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
if (split[1].equals("position")) {
|
|
|
if (value instanceof PositionInfo) {
|
|
|
objectValue.put("job", ((PositionInfo) value).getJob());
|
|
|
+ objectValue.put("adminOrg", ((PositionInfo) value).getAdminOrgUnit());
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -1125,14 +1220,8 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
save = bosObject.save(coreBaseInfo);
|
|
|
|
|
|
}
|
|
|
- PersonInfo personInfo = null;
|
|
|
- if (coreBaseInfo instanceof PersonInfo) {
|
|
|
- personInfo = (PersonInfo) coreBaseInfo;
|
|
|
- } else {
|
|
|
- personInfo = (PersonInfo) (coreBaseInfo.get("person"));
|
|
|
- }
|
|
|
// 处理文件信息
|
|
|
- fileProcessor(save.toString(), personInfo, jsonArray);
|
|
|
+ fileProcessor(save.toString(), jsonArray);
|
|
|
|
|
|
// 获取文件信息的第一个 JSON 对象
|
|
|
if (fileJSON != null) {
|
|
|
@@ -1245,10 +1334,8 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
save = bosObject.save(coreBaseInfo);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- PersonInfo personInfo = (PersonInfo) coreBaseInfo.get("person");
|
|
|
// 处理文件信息
|
|
|
- fileProcessor(save.toString(), personInfo, jsonArray);
|
|
|
+ fileProcessor(save.toString(), jsonArray);
|
|
|
|
|
|
// 获取文件信息的第一个 JSON 对象
|
|
|
if (fileJSON != null) {
|
|
|
@@ -1308,11 +1395,10 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
* 处理文件信息
|
|
|
*
|
|
|
* @param id 关联的 ID
|
|
|
- * @param personInfo 人员信息对象
|
|
|
* @param jsonArray 文件信息的 JSON 数组
|
|
|
* @throws JSONException JSON 处理异常
|
|
|
*/
|
|
|
- public void fileProcessor(String id, PersonInfo personInfo, JSONArray jsonArray) throws JSONException {
|
|
|
+ public void fileProcessor(String id, JSONArray jsonArray) throws JSONException {
|
|
|
// 遍历文件信息的 JSON 数组
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
// 获取单个文件信息
|
|
|
@@ -1327,15 +1413,25 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
continue;
|
|
|
}
|
|
|
if (uipk.equals("PersonPhoto")) {
|
|
|
+ System.out.println("头像处理");
|
|
|
try {
|
|
|
+ PersonInfo personInfo = getPerson(id);
|
|
|
if (personInfo != null) {
|
|
|
+ System.out.println("========personInfo 获取到的员工id===="+personInfo.getId());
|
|
|
// 保存人员照片信息
|
|
|
savePersonPhoto(personInfo, url);
|
|
|
+ }else {
|
|
|
+ System.out.println("========personInfo 获取到的员工id==== null");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
// 抛出运行时异常,表示保存人员照片信息失败
|
|
|
- throw new RuntimeException(e);
|
|
|
+ throw new RuntimeException(e+"抛出运行时异常,表示保存人员照片信息失败");
|
|
|
+ } catch (BOSException e) {
|
|
|
+ throw new RuntimeException(e+"查询入制单失败!或者查询临时员工失败!"+id);
|
|
|
+ } catch (EASBizException e) {
|
|
|
+ throw new RuntimeException(e+"查询入制单失败!或者查询临时员工失败!"+id);
|
|
|
}
|
|
|
} else {
|
|
|
try {
|
|
|
@@ -1346,19 +1442,22 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
} else {
|
|
|
dataImg = helper.getBytesByNetURL("http:" + url);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
// 插入人员附件信息
|
|
|
- if (name == null) {
|
|
|
+ if (name != null&&!name.equals("")) {
|
|
|
+ String s = extractFileNameFromUrl(url);
|
|
|
+ String[] split = s.split("\\.");
|
|
|
+ System.out.println("+++++split+++++++++"+split[1]);
|
|
|
+ name = name + "." +split[1];
|
|
|
+ }else {
|
|
|
name = extractFileNameFromUrl(url);
|
|
|
}
|
|
|
insertPersonAttachment(name, uipk, id, dataImg);
|
|
|
} catch (IOException e) {
|
|
|
// 抛出运行时异常,表示下载文件数据失败
|
|
|
- throw new RuntimeException(e);
|
|
|
+ throw new RuntimeException(e+"抛出运行时异常,表示下载文件数据失败");
|
|
|
} catch (BOSException e) {
|
|
|
// 抛出运行时异常,表示插入人员附件信息失败
|
|
|
- throw new RuntimeException(e);
|
|
|
+ throw new RuntimeException(e+"抛出运行时异常,表示插入人员附件信息失败");
|
|
|
} catch (EASBizException e) {
|
|
|
// 抛出运行时异常,表示插入人员附件信息失败
|
|
|
throw new RuntimeException(e);
|
|
|
@@ -1367,9 +1466,57 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public PersonInfo getPerson(String id) throws BOSException, EASBizException {
|
|
|
+ PersonInfo personInfo = null;
|
|
|
+ BOSUuid read = BOSUuid.read(id);
|
|
|
+ BOSObjectType type = read.getType();
|
|
|
+ String bosType = type.toString();
|
|
|
+ if (bosType.equals("80EF7DED")){
|
|
|
+ System.out.println("传入的ID:"+id+" 为员工,personInfo bosType:80EF7DED");
|
|
|
+ personInfo = new PersonInfo();
|
|
|
+ personInfo.setId(read);
|
|
|
+ }else if (bosType.equals("B41CAA3F")){
|
|
|
+ System.out.println("传入的ID:"+id+" 入职单, EmpEnrollBizBill bosType:B41CAA3F");
|
|
|
+ System.out.println("查询入职单:"+id+"");
|
|
|
+ EmpEnrollBizBillInfo empEnrollBizBillInfo = EmpEnrollBizBillFactory
|
|
|
+ .getLocalInstance(context).getEmpEnrollBizBillInfo("where id = '" + id + "'");
|
|
|
+ EmpEnrollBizBillEntryCollection entrys = empEnrollBizBillInfo.getEntrys();
|
|
|
+ if (entrys.size()<=0){
|
|
|
+ throw new RuntimeException("入职单没有对应的分录:"+id);
|
|
|
+ }
|
|
|
+ EmpEnrollBizBillEntryInfo empEnrollBizBillEntryInfo = entrys.get(0);
|
|
|
+ BOSUuid entryId = empEnrollBizBillEntryInfo.getId();
|
|
|
+ System.out.println("查询入职单分录/查询临时人员:"+entryId+"");
|
|
|
+ TempPersonPhotoCollection tempPersonPhotoCollection = TempPersonPhotoFactory.getLocalInstance(context).
|
|
|
+ getTempPersonPhotoCollection("where EmpEnrollBillEntryId = '" + entryId + "'");
|
|
|
+ if (tempPersonPhotoCollection.size()<=0){
|
|
|
+ System.out.println("创建临时员工");
|
|
|
+ TempPersonPhotoInfo tempPersonPhotoInfo = new TempPersonPhotoInfo();
|
|
|
+ BOSUuid bosUuid = BOSUuid.create("80EF7DED");
|
|
|
+ System.out.println("创建临时员工id"+bosUuid.toString());
|
|
|
+ tempPersonPhotoInfo.setTempPersonId(bosUuid.toString());
|
|
|
+ tempPersonPhotoInfo.setEmpEnrollBillEntryId(empEnrollBizBillEntryInfo);
|
|
|
+ IObjectPK save = TempPersonPhotoFactory.getLocalInstance(context).save(tempPersonPhotoInfo);
|
|
|
+ System.out.println("=========save====保持临时员工信息==="+save);
|
|
|
+ personInfo = new PersonInfo();
|
|
|
+ personInfo.setId(bosUuid);
|
|
|
+ }else {
|
|
|
+ System.out.println("查询到了临时员工");
|
|
|
+ TempPersonPhotoInfo tempPersonPhotoInfo = tempPersonPhotoCollection.get(0);
|
|
|
+ String tempPersonId = tempPersonPhotoInfo.getTempPersonId();
|
|
|
+ personInfo = new PersonInfo();
|
|
|
+ personInfo.setId(BOSUuid.read(tempPersonId));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return personInfo;
|
|
|
+ }
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
|
- String name = extractFileNameFromUrl("https://dfiles.italent.cn/download/recruitonboardingfile/433107/1753067254/3/66304e3e5cb7431f9fb1900ba675cee3.jpg?sig_t=1753070295&sig_exp=2592000&sig_a=recruitonboarding&sig_pm=8&sig_npm=2&sig_v=1&sig=41d7e3c49cef36421ff8c4c4bd4ff6b145810ca3");
|
|
|
- System.out.println(name);
|
|
|
+// String name = extractFileNameFromUrl("https://dfiles.italent.cn/download/recruitonboardingfile/433107/1753067254/3/66304e3e5cb7431f9fb1900ba675cee3.jpg?sig_t=1753070295&sig_exp=2592000&sig_a=recruitonboarding&sig_pm=8&sig_npm=2&sig_v=1&sig=41d7e3c49cef36421ff8c4c4bd4ff6b145810ca3");
|
|
|
+
|
|
|
+ String s = new SynchronousEmpBillControllerBean().extractContent("18xxxx1111");
|
|
|
+ System.out.println(s);
|
|
|
}
|
|
|
|
|
|
// 从URL中提取文件名
|
|
|
@@ -1450,7 +1597,8 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
// 获取用户 ID
|
|
|
String userId = userInfo.getId().toString();
|
|
|
// 设置附件名称
|
|
|
- ai.setName(filename.substring(0, filename.lastIndexOf(46)));
|
|
|
+ System.out.println("+++filename+++"+filename);
|
|
|
+ ai.setName(filename.substring(0, filename.lastIndexOf(".")));
|
|
|
// 设置附件简单名称
|
|
|
ai.setSimpleName(filename.substring(filename.lastIndexOf(".") + 1));
|
|
|
// 设置附件描述
|
|
|
@@ -1665,10 +1813,10 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- JSONArray paixu (JSONArray jsonArray,String entryDate){
|
|
|
+ JSONArray paixu (JSONArray jsonArray,final String entryDate){
|
|
|
List<JSONObject> list = jsonArray.toJavaList(JSONObject.class);
|
|
|
// 定义日期格式
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
|
|
+ final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
|
|
// 排序
|
|
|
Collections.sort(list, new Comparator<JSONObject>() {
|
|
|
@Override
|
|
|
@@ -1684,7 +1832,7 @@ public class SynchronousEmpBillControllerBean extends AbstractSynchronousEmpBill
|
|
|
|
|
|
// 比较日期
|
|
|
return date2.compareTo(date1);
|
|
|
- } catch (ParseException e) {
|
|
|
+ } catch (Exception e) {
|
|
|
// 处理日期解析异常
|
|
|
e.printStackTrace();
|
|
|
return 0;
|