|
@@ -6,6 +6,7 @@ import kd.bos.logging.LogFactory;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
+import kd.bos.util.StringUtils;
|
|
|
import kd.fi.er.business.trip.exception.TripSyncLogParam;
|
|
|
|
|
|
import java.util.Map;
|
|
@@ -27,19 +28,26 @@ public class LocationCityPlugin {
|
|
|
public Object getLocationCity(Map<String, Object> map, TripSyncLogParam tripSyncLogParam) {
|
|
|
logger.info("商旅集成,字段映射插件执行:{} ", tripSyncLogParam.getTraceid());
|
|
|
DynamicObject billInfo = (DynamicObject)map.get("bill");
|
|
|
-
|
|
|
String billfield = (String)map.get("billfield");
|
|
|
logger.info("billfield:{} ", billfield);
|
|
|
if(billInfo != null){
|
|
|
- // 传报销人
|
|
|
- return getLocationCity(billInfo.getDynamicObject("applier").getPkValue());
|
|
|
+ String applierId = billInfo.getString(billfield);
|
|
|
+ if(StringUtils.isNotEmpty(applierId)){
|
|
|
+ Object locationCity = getLocationCity(Long.valueOf(applierId));
|
|
|
+ if(locationCity != null){
|
|
|
+ // 查询行政区划名称
|
|
|
+ return QueryServiceHelper.queryOne("bd_admindivision", "name",
|
|
|
+ new QFilter("id", QCP.equals, locationCity).toArray()).getString("name");
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
public Object getLocationCity(Object userId){
|
|
|
// 申请人 -> HR人员 -> 常驻工作地 -> 工作地
|
|
|
- DynamicObject userInfo = QueryServiceHelper.queryOne("bos_user", "number", new QFilter("id,number", QCP.equals, userId).toArray());
|
|
|
+ DynamicObject userInfo = QueryServiceHelper.queryOne("bos_user", "id,number", new QFilter("id", QCP.equals, userId).toArray());
|
|
|
DynamicObject hrPerson = QueryServiceHelper.queryOne("hrpi_person", "id", new QFilter[]{
|
|
|
new QFilter("number", QCP.equals, userInfo.getString("number")),
|
|
|
new QFilter("iscurrentversion", QCP.equals, Boolean.TRUE)
|