联特科技绩效需求
This commit is contained in:
parent
adecc5ca95
commit
686c6e968b
|
|
@ -1,10 +1,14 @@
|
|||
package com.api.seclinktel.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/6/19 11:03
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class PerformanceWorkflowAction {
|
||||
|
||||
@Path("/seclinktel/performance/workflow")
|
||||
public class PerformanceWorkflowAction extends com.engine.seclinktel.web.PerformanceWorkflowAction {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.seclinktel.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/6/20 09:56
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DetailFields {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer rowIndex;
|
||||
|
||||
private double mkz;
|
||||
|
||||
private double mbz;
|
||||
|
||||
private double tzz;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.seclinktel.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/6/20 17:18
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DetailFieldsInterview {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer rowIndex;
|
||||
|
||||
private String mkz;
|
||||
|
||||
private String mbz;
|
||||
|
||||
private String tzz;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.engine.seclinktel.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/6/19 14:33
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuantitativeData {
|
||||
|
||||
|
||||
|
||||
private Integer type;
|
||||
|
||||
private Integer value;
|
||||
|
||||
private List<DetailFields> quantFields;
|
||||
|
||||
private List<DetailFieldsInterview> interviewFields;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.engine.seclinktel.entity;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/6/19 14:33
|
||||
* @Description: 定量
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class QuantitativeDataPO {
|
||||
|
||||
private Integer rowIndex;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private double mkz;
|
||||
|
||||
private double mbz;
|
||||
|
||||
private double tzz;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,10 @@
|
|||
package com.engine.seclinktel.service;
|
||||
|
||||
import com.engine.seclinktel.entity.QuantitativeData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/6/19 11:12
|
||||
|
|
@ -7,4 +12,6 @@ package com.engine.seclinktel.service;
|
|||
* @Version 1.0
|
||||
*/
|
||||
public interface PerformanceWorkflowService {
|
||||
|
||||
QuantitativeData buildDetailData(QuantitativeData quantitativeData);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,81 @@
|
|||
package com.engine.seclinktel.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.seclinktel.entity.QuantitativeData;
|
||||
import com.engine.seclinktel.service.PerformanceWorkflowService;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/6/19 11:12
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class PerformanceWorkflowServiceImpl {
|
||||
public class PerformanceWorkflowServiceImpl extends Service implements PerformanceWorkflowService {
|
||||
|
||||
private final static Map<Integer, List<String>> fieldMap = new HashMap<Integer, List<String>>() {{
|
||||
put(0, Arrays.asList("q1mjz","q1mbz","q1tzz"));
|
||||
put(1, Arrays.asList("q2mjz","q2mbz","q2tzz"));
|
||||
put(2, Arrays.asList("q3mjz","q3mbz","q3tzz"));
|
||||
put(3, Arrays.asList("q2mjz","q2mbz","q2tzz"));
|
||||
put(4, Arrays.asList("ndmjz","ndmbz","ndtzz"));
|
||||
}};
|
||||
|
||||
|
||||
@Override
|
||||
public QuantitativeData buildDetailData(QuantitativeData quantitativeData) {
|
||||
|
||||
List<String> fields = fieldMap.get(quantitativeData.getValue());
|
||||
String join = CollectionUtil.join(fields, ",");
|
||||
RecordSet rs = new RecordSet();
|
||||
if (quantitativeData.getType() == 1) {
|
||||
//1.管理人员个人绩效合约
|
||||
quantitativeData.getQuantFields().forEach(item -> {
|
||||
rs.executeQuery("select "+join+" from uf_glrydyjmb where id = ?",item.getId());
|
||||
if (rs.next()) {
|
||||
item.setMkz(Util.getDoubleValue(rs.getString(fields.get(0))));
|
||||
item.setMbz(Util.getDoubleValue(rs.getString(fields.get(1))));
|
||||
item.setTzz(Util.getDoubleValue(rs.getString(fields.get(2))));
|
||||
}
|
||||
});
|
||||
|
||||
quantitativeData.getInterviewFields().forEach(item -> {
|
||||
rs.executeQuery("select "+join+" from uf_dlrydxjmb where id = ?",item.getId());
|
||||
if (rs.next()) {
|
||||
item.setMkz(Util.null2String(rs.getString(fields.get(0))));
|
||||
item.setMbz(Util.null2String(rs.getString(fields.get(1))));
|
||||
item.setTzz(Util.null2String(rs.getString(fields.get(2))));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}else {
|
||||
//2.员工个人绩效合约
|
||||
quantitativeData.getQuantFields().forEach(item -> {
|
||||
rs.executeQuery("select "+join+" from uf_grjhjmb_dt1 where id = ?",item.getId());
|
||||
if (rs.next()) {
|
||||
item.setMkz(Util.getDoubleValue(rs.getString(fields.get(0))));
|
||||
item.setMbz(Util.getDoubleValue(rs.getString(fields.get(1))));
|
||||
item.setTzz(Util.getDoubleValue(rs.getString(fields.get(2))));
|
||||
}
|
||||
});
|
||||
|
||||
quantitativeData.getInterviewFields().forEach(item -> {
|
||||
rs.executeQuery("select "+join+" from uf_grjhjmb_dt3 where id = ?",item.getId());
|
||||
if (rs.next()) {
|
||||
item.setMkz(Util.null2String(rs.getString(fields.get(0))));
|
||||
item.setMbz(Util.null2String(rs.getString(fields.get(1))));
|
||||
item.setTzz(Util.null2String(rs.getString(fields.get(2))));
|
||||
}
|
||||
});
|
||||
}
|
||||
return quantitativeData;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,26 @@
|
|||
package com.engine.seclinktel.web;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.seclinktel.entity.QuantitativeData;
|
||||
import com.engine.seclinktel.service.PerformanceWorkflowService;
|
||||
import com.engine.seclinktel.service.impl.PerformanceWorkflowServiceImpl;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/6/19 11:04
|
||||
|
|
@ -7,4 +28,26 @@ package com.engine.seclinktel.web;
|
|||
* @Version 1.0
|
||||
*/
|
||||
public class PerformanceWorkflowAction {
|
||||
|
||||
private PerformanceWorkflowService getService(User user) {
|
||||
return ServiceUtil.getService(PerformanceWorkflowServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/buildDetailData")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String recordSignData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QuantitativeData quantitativeData){
|
||||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("result",getService(user).buildDetailData(quantitativeData));
|
||||
data.put("api_status", true);
|
||||
} catch (Exception e) {
|
||||
data.put("api_status", false);
|
||||
data.put("msg", "catch exception : " + e.getMessage());
|
||||
}
|
||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue