人员接口增加同步评标专家库的功能;

用友bip同步接口修改了内外部供应商的分类编号
This commit is contained in:
yuxueliang0813 2024-12-18 18:23:48 +08:00
parent 5b6f7fe129
commit e19ee81524
3 changed files with 58 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import kd.bos.context.RequestContext; import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.exception.KDException; import kd.bos.exception.KDException;
import kd.bos.logging.Log; import kd.bos.logging.Log;
import kd.bos.logging.LogFactory; import kd.bos.logging.LogFactory;
@ -34,6 +35,9 @@ import java.util.Map;
public class DobeDWpersonTask extends AbstractTask implements Plugin { public class DobeDWpersonTask extends AbstractTask implements Plugin {
private static final String entityName = "bos_user";//系统库 表名 t_sec_user private static final String entityName = "bos_user";//系统库 表名 t_sec_user
private static final String personEntityName = "qeug_recon_personbank";//供应链库 人员收款银行账户 表名 tk_qeug_recon_personbank private static final String personEntityName = "qeug_recon_personbank";//供应链库 人员收款银行账户 表名 tk_qeug_recon_personbank
private static final String proficientName = "rebm_proficient";//供应链库 评标专家库 表名 t_bid_proficient
private static final String proficientTypeName = "rebm_proficienttype";//供应链库 专家专业分类 表名 t_bid_majortype
private static Log log = LogFactory.getLog(DobeDWpersonTask.class); private static Log log = LogFactory.getLog(DobeDWpersonTask.class);
private static final String dw_menthod = "mdm_user"; private static final String dw_menthod = "mdm_user";
@ -120,6 +124,9 @@ public class DobeDWpersonTask extends AbstractTask implements Plugin {
DynamicObject personbank = null; DynamicObject personbank = null;
DynamicObject deptOrg = null; DynamicObject deptOrg = null;
Map<String, Object> dataMap = null; Map<String, Object> dataMap = null;
DynamicObject proficientInfo = null;//评标专家库
DynamicObject ptinfo = BusinessDataServiceHelper.loadSingleFromCache(proficientTypeName,"id,number,name",new QFilter[]{new QFilter("number","=","00")});
DynamicObjectCollection ptcoll = null;
for (int i = 0; i < detailsJson.size(); i++) { for (int i = 0; i < detailsJson.size(); i++) {
json_body = detailsJson.getJSONObject(i); json_body = detailsJson.getJSONObject(i);
// userID = json_body.getString("user_id"); // userID = json_body.getString("user_id");
@ -182,6 +189,26 @@ public class DobeDWpersonTask extends AbstractTask implements Plugin {
log.info(String.format("数仓的部门在金蝶中未找到对应组织:%s", deptid)); log.info(String.format("数仓的部门在金蝶中未找到对应组织:%s", deptid));
} }
} }
//处理新增 评标专家库
proficientInfo = BusinessDataServiceHelper.newDynamicObject(proficientName);
proficientInfo.set("billno",number);//专家编号
proficientInfo.set("name",name);//专家姓名
proficientInfo.set("type","internalExperts");//专家来源--默认内部专家
proficientInfo.set("telephone",phone);//手机号
ptcoll = proficientInfo.getDynamicObjectCollection("majortype");
DynamicObject newptinfo = new DynamicObject(ptcoll.getDynamicObjectType());
newptinfo.set("fbasedataId", ptinfo);
ptcoll.add(newptinfo);
proficientInfo.set("majortype",ptcoll);//专业分类
proficientInfo.set("org",deptOrg.getLong("id"));//采购组织
proficientInfo.set("userdstatus","Enable"); //使用状态--默认可用
proficientInfo.set("billstatus","C"); //使用状态--默认已审核
proficientInfo.set("politicalstatus","other"); //政治面貌--默认其他
proficientInfo.set("majortypenames",ptinfo.getString("name")); //专业分类名称字符串
proficientInfo.set("entitytypeid",proficientName); //实体类型ID
//保存数据直接保存入库不走操作校验
SaveServiceHelper.save(new DynamicObject[]{proficientInfo});
//处理新增人员收款银行账户 //处理新增人员收款银行账户
if(DobeDWUtils.isEmpty(bank_account)){ if(DobeDWUtils.isEmpty(bank_account)){
continue; continue;

View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import kd.bos.context.RequestContext; import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.exception.KDException; import kd.bos.exception.KDException;
import kd.bos.logging.Log; import kd.bos.logging.Log;
import kd.bos.logging.LogFactory; import kd.bos.logging.LogFactory;
@ -34,6 +35,8 @@ import java.util.Map;
public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin {
private static final String entityName = "bos_user";//系统库 表名 t_sec_user private static final String entityName = "bos_user";//系统库 表名 t_sec_user
private static final String personEntityName = "qeug_recon_personbank";//供应链库 人员收款银行账户 表名 tk_qeug_recon_personbank private static final String personEntityName = "qeug_recon_personbank";//供应链库 人员收款银行账户 表名 tk_qeug_recon_personbank
private static final String proficientName = "rebm_proficient";//供应链库 评标专家库 表名 t_bid_proficient
private static final String proficientTypeName = "rebm_proficienttype";//供应链库 专家专业分类 表名 t_bid_majortype
private static Log log = LogFactory.getLog(DobeDWpersonUpdateTask.class); private static Log log = LogFactory.getLog(DobeDWpersonUpdateTask.class);
private static final String dw_menthod = "mdm_user"; private static final String dw_menthod = "mdm_user";
@ -104,6 +107,9 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin {
DynamicObject deptOrg = null; DynamicObject deptOrg = null;
DynamicObject personbank = null; DynamicObject personbank = null;
Map<String, Object> dataMap = null; Map<String, Object> dataMap = null;
DynamicObject proficientInfo = null;//评标专家库
DynamicObject ptinfo = BusinessDataServiceHelper.loadSingleFromCache(proficientTypeName,"id,number,name",new QFilter[]{new QFilter("number","=","00")});
DynamicObjectCollection ptcoll = null;
for (int i = 0; i < detailsJson.size(); i++) { for (int i = 0; i < detailsJson.size(); i++) {
json_body = detailsJson.getJSONObject(i); json_body = detailsJson.getJSONObject(i);
// userID = json_body.getString("user_id"); // userID = json_body.getString("user_id");
@ -153,6 +159,28 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin {
log.info(String.format("数仓的部门在金蝶中未找到对应组织:%s", deptid)); log.info(String.format("数仓的部门在金蝶中未找到对应组织:%s", deptid));
} }
} }
//处理新增 评标专家库
proficientInfo = BusinessDataServiceHelper.loadSingle(proficientName,new QFilter[]{new QFilter("billno","=",number)});
if(proficientInfo == null){
proficientInfo = BusinessDataServiceHelper.newDynamicObject(proficientName);
proficientInfo.set("billno",number);//专家编号
proficientInfo.set("name",name);//专家姓名
proficientInfo.set("type","internalExperts");//专家来源--默认内部专家
proficientInfo.set("telephone",phone);//手机号
ptcoll = proficientInfo.getDynamicObjectCollection("majortype");
DynamicObject newptinfo = new DynamicObject(ptcoll.getDynamicObjectType());
newptinfo.set("fbasedataId", ptinfo);
ptcoll.add(newptinfo);
proficientInfo.set("majortype",ptcoll);//专业分类
proficientInfo.set("org",deptOrg.getLong("id"));//采购组织
proficientInfo.set("userdstatus","Enable"); //使用状态--默认可用
proficientInfo.set("billstatus","C"); //使用状态--默认已审核
proficientInfo.set("politicalstatus","other"); //政治面貌--默认其他
proficientInfo.set("majortypenames",ptinfo.getString("name")); //专业分类名称字符串
proficientInfo.set("entitytypeid",proficientName); //实体类型ID
//保存数据直接保存入库不走操作校验
SaveServiceHelper.save(new DynamicObject[]{proficientInfo});
}
//处理人员收款银行账户的修改,银行账户为空时不处理 //处理人员收款银行账户的修改,银行账户为空时不处理
if(DobeDWUtils.isEmpty(bank_account)){ if(DobeDWUtils.isEmpty(bank_account)){
continue; continue;

View File

@ -352,7 +352,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
items.put("pk_subjcode",accountview.replace(".","")); items.put("pk_subjcode",accountview.replace(".",""));
}else{ }else{
String suptype = getSupplierType(supplierid); String suptype = getSupplierType(supplierid);
if("DB01".equals(suptype)){ if("GYSFL-202411-001".equals(suptype)){
items.put("pk_subjcode","22020105");//集团内 items.put("pk_subjcode","22020105");//集团内
}else{ }else{
items.put("pk_subjcode","22020104");//收支项目编码 费用项目660224-管理费用-服务费 会计科目(一个) items.put("pk_subjcode","22020104");//收支项目编码 费用项目660224-管理费用-服务费 会计科目(一个)
@ -474,7 +474,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
typeinfo = typecolls.get(j); typeinfo = typecolls.get(j);
if(typeinfo.getDynamicObject("suppliergroup") != null){ if(typeinfo.getDynamicObject("suppliergroup") != null){
supTypeStr = typeinfo.getDynamicObject("suppliergroup").getString("number"); supTypeStr = typeinfo.getDynamicObject("suppliergroup").getString("number");
if("DB01".equals(supTypeStr) || "DB02".equals(supTypeStr)){ if("GYSFL-202411-001".equals(supTypeStr) || "GYSFL-202411-002".equals(supTypeStr)){
break; break;
} }
} }
@ -483,7 +483,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
} }
if(supTypeStr == null){ if(supTypeStr == null){
supTypeStr = "DB02";//如果上述未找到对应分类则默认算集团外 supTypeStr = "GYSFL-202411-002";//如果上述未找到对应分类则默认算集团外
} }
return supTypeStr; return supTypeStr;
} }