|
@@ -0,0 +1,49 @@
|
|
|
|
+package nckd.jimin.jyyy.fi.business;
|
|
|
|
+
|
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
|
+import kd.bos.logging.Log;
|
|
|
|
+import kd.bos.logging.LogFactory;
|
|
|
|
+import kd.bos.orm.query.QFilter;
|
|
|
|
+import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
|
+import kd.fi.er.business.trip.exception.TripSyncLogParam;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 商旅字段映射,同程人员同步
|
|
|
|
+ */
|
|
|
|
+public class DtgTripCusPlugin {
|
|
|
|
+ private static final Log logger = LogFactory.getLog(DtgTripCusPlugin.class);
|
|
|
|
+
|
|
|
|
+ public DtgTripCusPlugin() {
|
|
|
|
+ }
|
|
|
|
+ public Object getPositionLevelName(Map<String, Object> map, TripSyncLogParam tripSyncLogParam) {
|
|
|
|
+ Map<String, Object> context = (Map)map.get("context");
|
|
|
|
+ if (context == null) {
|
|
|
|
+ return "";
|
|
|
|
+ } else {
|
|
|
|
+ Object employeeNumber = context.get("param.outEmployeeId");
|
|
|
|
+ //人员基本信息hrpi_person
|
|
|
|
+ //职等基础hrpi_empjobrel
|
|
|
|
+ if (employeeNumber != null) {
|
|
|
|
+ DynamicObject hrPerson = BusinessDataServiceHelper.loadSingleFromCache("hrpi_person", "id", new QFilter[]{new QFilter("number", "=", employeeNumber)});
|
|
|
|
+ if (hrPerson == null) {
|
|
|
|
+ logger.info("根据员工number未获取到HR人员基本信息{}", employeeNumber);
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DynamicObject hrJobrel = BusinessDataServiceHelper.loadSingleFromCache("hrpi_empjobrel", "id, joblevel", new QFilter[]{new QFilter("person.id", "=", hrPerson.getLong("id"))});
|
|
|
|
+ if (hrJobrel == null) {
|
|
|
|
+ logger.info("根据员工number未获取到HR人员职等信息{}", employeeNumber);
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String result = hrJobrel.getDynamicObject("joblevel").getString("number");
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ } else {
|
|
|
|
+ logger.info("未获取到员工{}", employeeNumber);
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|