pull/171/head
dxfeng 2 years ago
commit c993cafab4

@ -0,0 +1,29 @@
package com.engine.organization.entity.chart;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author liang.cheng
* @Date 2023/6/29 11:19 AM
* @Description: TODO
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TimeLinesBO {
private Integer key;
private Integer id;
private String title;
private String color;
private String time;
}

@ -85,4 +85,12 @@ public interface OrgChartService {
*/
void insertChartVersion(Integer fclass,String description);
/**
* @Description:
* @Author: liang.cheng
* @Date: 2023/6/29 10:36 AM
* @param: [request2Map]
* @return: java.util.Map<java.lang.String,java.lang.Object>
*/
Map<String, Object> searchTimeLines(Map<String, Object> request2Map);
}

@ -4,6 +4,7 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.chart.CompanyTreePO;
import com.engine.organization.entity.chart.TimeLinesBO;
import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.scheme.po.GradePO;
import com.engine.organization.entity.scheme.po.LevelPO;
@ -620,6 +621,28 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
}
@Override
public Map<String, Object> searchTimeLines(Map<String, Object> params) {
Map<String,Object> datas = new HashMap<>();
RecordSet rs = new RecordSet();
String fclass = Util.null2String(params.get("fclass"));
List<TimeLinesBO> timeLinesBOList = new ArrayList<>();
timeLinesBOList.add(TimeLinesBO.builder().key(0).id(0).title("当前版本").color("blue").time("").build());
rs.executeQuery("SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ?",fclass,0);
while (rs.next()) {
timeLinesBOList.add(TimeLinesBO.builder()
.key(rs.getInt("id"))
.id(rs.getInt("id"))
.title(Util.null2String(rs.getString("description")))
.color("grey")
.time(Util.null2String(rs.getString("recorddate")))
.build());
}
datas.put("timelineList",timeLinesBOList);
return datas;
}
/**
*
*/

@ -30,9 +30,8 @@ public class OrgChartController {
@GET
@Path("/getCondition")
@Produces(MediaType.APPLICATION_JSON)
public String getCondition(@Context HttpServletRequest request, @Context HttpServletResponse
response) {
Map<String, Object> apidatas = new HashMap<String, Object>();
public String getCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
Map<String, Object> apidatas = new HashMap<>();
try {
User user = HrmUserVarify.getUser(request, response);
//实例化Service 并调用业务类处理
@ -47,7 +46,24 @@ public class OrgChartController {
return JSONObject.toJSONString(apidatas);
}
@GET
@Path("/timeLines")
@Produces(MediaType.APPLICATION_JSON)
public String searchTimeLines(@Context HttpServletRequest request, @Context HttpServletResponse response) {
Map<String, Object> apidatas = new HashMap<>();
try {
User user = HrmUserVarify.getUser(request, response);
apidatas = getOrgChartWrapper(user).searchTimeLines(ParamUtil.request2Map(request), user);
} catch (Exception e) {
//异常处理
e.printStackTrace();
apidatas.put("api_status", false);
apidatas.put("api_errormsg", "catch exception : " + e.getMessage());
}
return JSONObject.toJSONString(apidatas);
}
@GET
@Path("/getSubCompanyTree")
@ -77,7 +93,7 @@ public class OrgChartController {
@Produces(MediaType.APPLICATION_JSON)
public String getCompanyData(@Context HttpServletRequest request, @Context HttpServletResponse
response) {
Map<String, Object> apidatas = new HashMap<String, Object>();
Map<String, Object> apidatas = new HashMap<>();
try {
User user = HrmUserVarify.getUser(request, response);
//实例化Service 并调用业务类处理

@ -56,4 +56,7 @@ public class OrgChartWrapper extends Service {
return getOrgChartService(user).synchronousData(request2Map, user);
}
public Map<String, Object> searchTimeLines(Map<String, Object> request2Map, User user) {
return getOrgChartService(user).searchTimeLines(request2Map);
}
}

Loading…
Cancel
Save