中航富士达人事需求
This commit is contained in:
parent
9db67591a0
commit
91ebd93f5a
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.forstarsecond.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/5/8 09:29
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FamilyWorkUnit {
|
||||
|
||||
private String id;
|
||||
|
||||
private String unit;
|
||||
}
|
||||
|
|
@ -49,5 +49,23 @@ public interface ExamineRankingService {
|
|||
* @param: [resourceId]
|
||||
* @return: java.lang.String
|
||||
*/
|
||||
String resourceImage(String billid);
|
||||
Map<String,Object> resourceImage(String billid);
|
||||
|
||||
/**
|
||||
* @Description: 获取普实供应商列表
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2025/5/7 15:47
|
||||
* @param: [billid]
|
||||
* @return: java.util.List<java.lang.String>
|
||||
*/
|
||||
List<String> workUnits();
|
||||
|
||||
/**
|
||||
* @Description: 家庭成员工作单位
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2025/5/7 16:03
|
||||
* @param: [params]
|
||||
* @return: java.util.List<java.lang.String>
|
||||
*/
|
||||
Map<String,List<String>> familyWorkUnit(Map<String, Object> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,16 @@ package com.engine.forstarsecond.service.impl;
|
|||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.forstarsecond.entity.ExamineRanking;
|
||||
import com.engine.forstarsecond.entity.FamilyWorkUnit;
|
||||
import com.engine.forstarsecond.service.ExamineRankingService;
|
||||
import lombok.SneakyThrows;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.conn.RecordSetDataSource;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
|
|
@ -89,12 +92,50 @@ public class ExamineRankingServiceImpl extends Service implements ExamineRanking
|
|||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public String resourceImage(String billid) {
|
||||
public Map<String,Object> resourceImage(String billid) {
|
||||
RecordSet rs = new RecordSet();
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
rs.executeQuery("select ryid from uf_hr_employee where id = ?",billid);
|
||||
rs.next();
|
||||
String ryid = Util.null2String(rs.getString("ryid"));
|
||||
return new ResourceComInfo().getMessagerUrls(ryid);
|
||||
result.put("id",ryid);
|
||||
result.put("url",new ResourceComInfo().getMessagerUrls(ryid));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> workUnits() {
|
||||
RecordSetDataSource rst = new weaver.conn.RecordSetDataSource();
|
||||
List<String> unitList = new ArrayList<>();
|
||||
rst.executeQueryWithDatasource("select VndName from V_OA_BPVnd","AErp8_XAFSD");
|
||||
while (rst.next()) {
|
||||
unitList.add(Util.null2String(rst.getString("VndName").trim()));
|
||||
}
|
||||
return unitList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,List<String>> familyWorkUnit(Map<String, Object> params) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String type = Util.null2String(params.get("type"));
|
||||
//1 正式员工台账
|
||||
String tableName = "1".equals(type) ? "uf_jcl_rzgl_dt3" : "uf_jcl_wbrzgl_dt3";
|
||||
List<FamilyWorkUnit> familyWorkUnits = new ArrayList<>();
|
||||
rs.executeQuery("select mainid,gzdw from "+tableName);
|
||||
while (rs.next()) {
|
||||
familyWorkUnits.add(FamilyWorkUnit.builder()
|
||||
.id(Util.null2String(rs.getString("mainid")))
|
||||
.unit(Util.null2String(rs.getString("gzdw")))
|
||||
.build());
|
||||
}
|
||||
return familyWorkUnits.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
FamilyWorkUnit::getId,
|
||||
Collectors.mapping(
|
||||
FamilyWorkUnit::getUnit,
|
||||
Collectors.toList()
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -105,8 +146,8 @@ public class ExamineRankingServiceImpl extends Service implements ExamineRanking
|
|||
*/
|
||||
private void calculateRank(
|
||||
List<ExamineRanking> dataList,
|
||||
Function<ExamineRanking, Integer> groupKeyGetter, // 分组字段的 Getter
|
||||
BiConsumer<ExamineRanking, String> rankFieldSetter // 排名结果的 Setter(直接使用 BiConsumer)
|
||||
Function<ExamineRanking, Integer> groupKeyGetter,
|
||||
BiConsumer<ExamineRanking, String> rankFieldSetter
|
||||
) {
|
||||
// 1. 按分组字段(如 ssks 或 bmmc)分组
|
||||
Map<Integer, List<ExamineRanking>> groupedData = dataList.stream()
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class ExamineRankingAction {
|
|||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("url", getService(user).resourceImage(billid));
|
||||
data.putAll(getService(user).resourceImage(billid));
|
||||
data.put("code", 200);
|
||||
} catch (Exception e) {
|
||||
data.put("code", 500);
|
||||
|
|
@ -61,6 +61,39 @@ public class ExamineRankingAction {
|
|||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/workUnits")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String workUnits(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("units",getService(user).workUnits());
|
||||
data.put("code", 200);
|
||||
} catch (Exception e) {
|
||||
data.put("code", 500);
|
||||
data.put("msg", "catch exception : " + e.getMessage());
|
||||
}
|
||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/familyWorkUnit")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String familyWorkUnit(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("unitList", getService(user).familyWorkUnit(ParamUtil.request2Map(request)));
|
||||
data.put("code", 200);
|
||||
} catch (Exception e) {
|
||||
data.put("code", 500);
|
||||
data.put("msg", "catch exception : " + e.getMessage());
|
||||
}
|
||||
return JSONObject.toJSONString(data,SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.weaver.formmode.customjavacode.forstarsecond;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import weaver.conn.RecordSetDataSource;
|
||||
import weaver.formmode.customjavacode.AbstractCustomSqlConditionJavaCode;
|
||||
import weaver.general.Util;
|
||||
|
||||
|
||||
public class CustomSearchTemplate extends AbstractCustomSqlConditionJavaCode {
|
||||
|
||||
/**
|
||||
* 生成SQL查询限制条件
|
||||
* @param param
|
||||
* param包含(但不限于)以下数据
|
||||
* user 当前用户
|
||||
*
|
||||
* @return
|
||||
* 返回的查询限制条件的格式举例为: t1.a = '1' and t1.b = '3' and t1.c like '%22%'
|
||||
* 其中t1为表单主表表名的别名
|
||||
*/
|
||||
@Override
|
||||
public String generateSqlCondition(Map<String, Object> param) throws Exception {
|
||||
|
||||
RecordSetDataSource rst = new weaver.conn.RecordSetDataSource();
|
||||
List<String> unitList = new ArrayList<>();
|
||||
rst.executeQueryWithDatasource("select VndName from V_OA_BPVnd","AErp8_XAFSD");
|
||||
while (rst.next()) {
|
||||
unitList.add(Util.null2String(rst.getString("VndName").trim()));
|
||||
}
|
||||
String join = unitList.stream()
|
||||
.map(s -> "'" + s + "'")
|
||||
.collect(Collectors.joining(","));
|
||||
rst.writeLog("CustomSearchTemplate:"+unitList.toString());
|
||||
|
||||
String sqlCondition = "d1.gzdw in ("+join+")";
|
||||
|
||||
return sqlCondition;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue