|
@@ -11,11 +11,13 @@ import kd.bos.entity.operate.result.OperationResult;
|
|
import kd.bos.exception.KDException;
|
|
import kd.bos.exception.KDException;
|
|
import kd.bos.form.IFormView;
|
|
import kd.bos.form.IFormView;
|
|
import kd.bos.orm.ORM;
|
|
import kd.bos.orm.ORM;
|
|
|
|
+import kd.bos.orm.query.QCP;
|
|
import kd.bos.orm.query.QFilter;
|
|
import kd.bos.orm.query.QFilter;
|
|
import kd.bos.schedule.api.MessageHandler;
|
|
import kd.bos.schedule.api.MessageHandler;
|
|
import kd.bos.schedule.executor.AbstractTask;
|
|
import kd.bos.schedule.executor.AbstractTask;
|
|
import kd.bos.sec.user.utils.UserOperationUtils;
|
|
import kd.bos.sec.user.utils.UserOperationUtils;
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
|
+import kd.bos.servicehelper.operation.DeleteServiceHelper;
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
import sys.sc.formplugin.ABillServiceHelper;
|
|
import sys.sc.formplugin.ABillServiceHelper;
|
|
import sys.sc.opplugin.utils.InterFaceImgUtils;
|
|
import sys.sc.opplugin.utils.InterFaceImgUtils;
|
|
@@ -217,6 +219,10 @@ public class UpdateDataDailyTask extends AbstractTask {
|
|
OperationResult operationResult = ABillServiceHelper.saveOperate(orgview);
|
|
OperationResult operationResult = ABillServiceHelper.saveOperate(orgview);
|
|
//保存不成功
|
|
//保存不成功
|
|
if (!operationResult.isSuccess()) {
|
|
if (!operationResult.isSuccess()) {
|
|
|
|
+ //清除编码为org开头的数据
|
|
|
|
+ QFilter filter=new QFilter("number", QCP.equals,"Org%");
|
|
|
|
+ DeleteServiceHelper.delete("bos_adminorg",new QFilter[]{filter});
|
|
|
|
+ ABillServiceHelper.saveOperate(orgview);
|
|
}
|
|
}
|
|
org = orgview.getModel().getDataEntity();
|
|
org = orgview.getModel().getDataEntity();
|
|
//如果存在单位则检查单位名是否一致,不一致则更新
|
|
//如果存在单位则检查单位名是否一致,不一致则更新
|
|
@@ -246,7 +252,10 @@ public class UpdateDataDailyTask extends AbstractTask {
|
|
yjjgView.getModel().setValue("enable", "1");
|
|
yjjgView.getModel().setValue("enable", "1");
|
|
OperationResult yjjgOperationResult = ABillServiceHelper.saveOperate(yjjgView);
|
|
OperationResult yjjgOperationResult = ABillServiceHelper.saveOperate(yjjgView);
|
|
if (!yjjgOperationResult.isSuccess()) {
|
|
if (!yjjgOperationResult.isSuccess()) {
|
|
-
|
|
|
|
|
|
+ //清除编码为org开头的数据
|
|
|
|
+ QFilter filter=new QFilter("number", QCP.equals,"Org%");
|
|
|
|
+ DeleteServiceHelper.delete("bos_adminorg",new QFilter[]{filter});
|
|
|
|
+ ABillServiceHelper.saveOperate(yjjgView);
|
|
}
|
|
}
|
|
yjjg = yjjgView.getModel().getDataEntity();
|
|
yjjg = yjjgView.getModel().getDataEntity();
|
|
} else if (!yjjg.getString("name").equals(yjjgmc)) {
|
|
} else if (!yjjg.getString("name").equals(yjjgmc)) {
|
|
@@ -273,9 +282,10 @@ public class UpdateDataDailyTask extends AbstractTask {
|
|
// 保存操作
|
|
// 保存操作
|
|
OperationResult szbmOperationResult = ABillServiceHelper.saveOperate(szbmView);
|
|
OperationResult szbmOperationResult = ABillServiceHelper.saveOperate(szbmView);
|
|
if (!szbmOperationResult.isSuccess()) {
|
|
if (!szbmOperationResult.isSuccess()) {
|
|
- // 如果保存失败,可以在这里处理错误
|
|
|
|
- log.info("保存部门失败!");
|
|
|
|
- return;
|
|
|
|
|
|
+ //清除编码为org开头的数据
|
|
|
|
+ QFilter filter=new QFilter("number", QCP.equals,"Org%");
|
|
|
|
+ DeleteServiceHelper.delete("bos_adminorg",new QFilter[]{filter});
|
|
|
|
+ ABillServiceHelper.saveOperate(szbmView);
|
|
}
|
|
}
|
|
if (szbmView.getModel() != null) {
|
|
if (szbmView.getModel() != null) {
|
|
szbm = szbmView.getModel().getDataEntity();
|
|
szbm = szbmView.getModel().getDataEntity();
|
|
@@ -430,11 +440,8 @@ public class UpdateDataDailyTask extends AbstractTask {
|
|
String simplePinyin = UserOperationUtils.getFirstSpellByName(name);
|
|
String simplePinyin = UserOperationUtils.getFirstSpellByName(name);
|
|
userinfo.set("fullpinyin", fullPinyin);
|
|
userinfo.set("fullpinyin", fullPinyin);
|
|
userinfo.set("simplepinyin", simplePinyin);
|
|
userinfo.set("simplepinyin", simplePinyin);
|
|
- // 设置用户名
|
|
|
|
- String username = UserOperationUtils.getUserNameByFormatedFullPinyin(
|
|
|
|
- (long) userinfo.getPkValue(), fullPinyin, null
|
|
|
|
- );
|
|
|
|
- userinfo.set("username", username);
|
|
|
|
|
|
+ // 设置用户名为工号
|
|
|
|
+ userinfo.set("username", gonghao);
|
|
// 创建部门分录
|
|
// 创建部门分录
|
|
DynamicObjectCollection bmflList = userinfo.getDynamicObjectCollection("entryentity");
|
|
DynamicObjectCollection bmflList = userinfo.getDynamicObjectCollection("entryentity");
|
|
DynamicObject bumeninfo = bmflList.addNew();
|
|
DynamicObject bumeninfo = bmflList.addNew();
|