修改业务单元的体系字段
This commit is contained in:
parent
b462c5d631
commit
16ea246b21
|
@ -96,7 +96,8 @@ public class DobeDWorgTask extends AbstractTask implements Plugin {
|
|||
String orgID = null;
|
||||
String parentId = null;
|
||||
String person_charge = null;//部门下的负责人的工号
|
||||
String updateSql = null;
|
||||
String updateNocgeSql = "UPDATE t_SEC_UserPosition SET fisincharge=? WHERE fdptid in (select fid from t_org_org where fyzjorgid=?);";
|
||||
String updatecgeSql = "UPDATE t_SEC_UserPosition SET fisincharge=? WHERE fdptid in (select fid from t_org_org where fyzjorgid=?) and fid in (select fid from t_sec_user where fnumber=?);";
|
||||
for (int i = 0; i < detailsJson.size(); i++) {
|
||||
json_body = detailsJson.getJSONObject(i);
|
||||
orgNumber = json_body.getString("org_code");
|
||||
|
@ -116,10 +117,8 @@ public class DobeDWorgTask extends AbstractTask implements Plugin {
|
|||
if(currentOrg != null){
|
||||
//根据组织下的负责人id去人员分录表中更新负责人标记,先去除这个部门下人员的负责人标记,再更新
|
||||
if(!DobeDWUtils.isEmpty(person_charge)){
|
||||
updateSql = "UPDATE t_SEC_UserPosition SET fisincharge=? WHERE fdptid in (select fid from t_org_org where fyzjorgid=?);";
|
||||
DB.update(DBRoute.of("sys"), updateSql, new Object[]{0,orgID});
|
||||
updateSql = "UPDATE t_SEC_UserPosition SET fisincharge=? WHERE fdptid in (select fid from t_org_org where fyzjorgid=?) and fid in (select fid from t_sec_user where fnumber=?);";
|
||||
DB.update(DBRoute.of("sys"), updateSql, new Object[]{1,orgID,person_charge});
|
||||
DB.update(DBRoute.of("sys"), updateNocgeSql, new Object[]{0,orgID});
|
||||
DB.update(DBRoute.of("sys"), updatecgeSql, new Object[]{1,orgID,person_charge});
|
||||
}
|
||||
//已存在,做更新
|
||||
if(orgNumber.equals(currentOrg.getString("number")) && orgName.equals(currentOrg.getString("name"))){
|
||||
|
|
|
@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONArray;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import kd.bos.context.RequestContext;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.db.DB;
|
||||
import kd.bos.db.DBRoute;
|
||||
import kd.bos.exception.KDException;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
|
@ -88,12 +90,13 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
// String fisleaf = null;//是否叶子节点
|
||||
String faddress = null;//项目地址
|
||||
String project_stage = null;//业务体系--二开字段,用于工作流发起判断(新拓 成熟)
|
||||
String forgid = null;//所属组织-行政组织
|
||||
String forgid = null;//所属组织-行政组织的编号
|
||||
Date project_getdate = null;//项目获取时间
|
||||
String fdwid = null;//数仓项目id--二开字段,唯一标识
|
||||
String ywlx = null;//业务类型--二开字段,仅记录数仓数据
|
||||
DynamicObject orginfo = null;
|
||||
DynamicObject projectinfo = null;
|
||||
String updateSql = "UPDATE t_org_org SET fk_qeug_combofield=? WHERE fnumber=?;";
|
||||
// DynamicObject projectstageinfo = null;
|
||||
for (int i = 0; i < detailsJson.size(); i++) {
|
||||
json_body = detailsJson.getJSONObject(i);
|
||||
|
@ -136,9 +139,9 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
// projectinfo.set("islatestversion", true);//是否最新版
|
||||
projectinfo.set("mainprojectid", projectinfo.getLong("id"));//主项目ID
|
||||
if("新拓园区".equals(project_stage)){
|
||||
projectinfo.set("qeug_combofield", "xintuo");
|
||||
projectinfo.set("qeug_combofield", "XTYQ");
|
||||
}else if("成熟园区".equals(project_stage)){
|
||||
projectinfo.set("qeug_combofield", "chengshu");
|
||||
projectinfo.set("qeug_combofield", "CSYQ");
|
||||
}
|
||||
// projectinfo.set("billno", fbillno);
|
||||
// projectinfo.set("org", );
|
||||
|
@ -178,14 +181,23 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
projectinfo.set("versionnum", "V1.0");//版本号 默认值
|
||||
projectinfo.set("creator", 43007523L);//创建人默认指定为金小蝶
|
||||
if("新拓园区".equals(project_stage)){
|
||||
projectinfo.set("qeug_combofield", "xintuo");
|
||||
projectinfo.set("qeug_combofield", "XTYQ");
|
||||
}else if("成熟园区".equals(project_stage)){
|
||||
projectinfo.set("qeug_combofield", "chengshu");
|
||||
projectinfo.set("qeug_combofield", "CSYQ");
|
||||
}
|
||||
projectinfo.set("qeug_ywlx", ywlx);
|
||||
//保存数据:直接保存入库,不走操作校验
|
||||
SaveServiceHelper.save(new DynamicObject[]{projectinfo});
|
||||
}
|
||||
//获得组织对象后,将本项目的体系字段更新到组织的体系上面
|
||||
if(!DobeDWUtils.isEmpty(project_stage) && !DobeDWUtils.isEmpty(forgid)){
|
||||
// updateSql = "UPDATE t_org_org SET fk_qeug_combofield=? WHERE fnumber=?;";
|
||||
if("新拓园区".equals(project_stage)){
|
||||
DB.update(DBRoute.of("sys"), updateSql, new Object[]{"XTYQ",forgid});
|
||||
}else if("成熟园区".equals(project_stage)){
|
||||
DB.update(DBRoute.of("sys"), updateSql, new Object[]{"CSYQ",forgid});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue