上海中远重工组织架构图新增需求

上海中远重工组织架构图
Chengliang 7 months ago
parent f74d6da24c
commit ea32d72774

@ -100,4 +100,13 @@ public interface ChartService {
* @return: java.util.Map<java.lang.String,java.lang.Object>
*/
Map<String, Object> getDepartmentNewDetail(Map<String, Object> request2Map);
/**
* @Description:
* @Author: liang.cheng
* @Date: 2024/8/1 4:30 PM
* @param: []
* @return: java.util.Map<java.lang.String,java.lang.Object>
*/
Map<String, Object> versionDelete(Integer versionId);
}

@ -1310,22 +1310,7 @@ public class ChartServiceImpl extends Service implements ChartService {
"department, subcompanyid, subcompany, costcenter,manager, assistant, workcode, classification, " +
"versiondate, policy, degree,versionid,lastname,companyworkyear) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?," +
"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
// while (rs.next()) {
// insertList = new ArrayList<>();
// insertList.add(StringUtils.isBlank(rs.getString("resourceid")) ? null : rs.getInt("resourceid"));
// insertList.add(StringUtils.isBlank(rs.getString("managerid")) ? null : rs.getInt("managerid"));
// insertList.add(StringUtils.isBlank(rs.getString("subcompanyid")) ? null : rs.getInt("subcompanyid"));
// insertList.add(StringUtils.isBlank(rs.getString("departmentid")) ? null : rs.getInt("departmentid"));
// insertList.add(rs.getString("managerstr"));
// //insertList.add(rs.getString("virtualtype"));
// insertList.add(currentDate);
// insertList.add(StringUtils.isBlank(versionId) ? null : Util.getIntValue(versionId));
// insertParamList.add(insertList);
// }
// String insertVirtualHrmSql = "insert into jcl_chart_resource(resourceid,MANAGER,subcompanyid," +
// "departmentid,managerstr," +
// //"virtualtype," +
// "versiondate,versionid) values (?,?,?,?,?,?,?)";
insertData(recordSetTrans, insertVirtualHrmSql, insertParamList);
}
@ -1806,4 +1791,30 @@ public class ChartServiceImpl extends Service implements ChartService {
currentList.add(chartPO);
}
@Override
public Map<String, Object> versionDelete(Integer versionId) {
Map<String, Object> data = new HashMap<>();
RecordSet rs = new RecordSet();
//1.删除版本表
rs.executeUpdate("delete from jcl_org_chartversion where id = ?",versionId);
//2.删除历史分部表
rs.executeUpdate("delete from jcl_chart_subcompany where versionid = ?",versionId);
//3.删除历史部门表
rs.executeUpdate("delete from jcl_chart_department where versionid = ?",versionId);
//4.删除历史聚才林岗位表
rs.executeUpdate("delete from jcl_chart_job where versionid = ?",versionId);
//5.删除历史人员表
rs.executeUpdate("delete from jcl_chart_resource where versionid = ?",versionId);
data.put("versionId",versionId);
return data;
}
}

@ -470,6 +470,15 @@ public class OrganizationDateUtil {
return localDate;
}
/**
*
* @return
*/
public static String dateExample(LocalDate date) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
return date.format(formatter);
}
}

@ -14,10 +14,7 @@ import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.HashMap;
@ -124,6 +121,24 @@ public class OrgChartController {
return JSONObject.toJSONString(apidatas);
}
@GET
@Path("/versionDelete")
@Produces(MediaType.APPLICATION_JSON)
public String versionDelete(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("versionId") Integer versionId) {
Map<String, Object> apidatas = new HashMap<>(4);
try {
User user = HrmUserVarify.getUser(request, response);
apidatas = getOrgChartWrapper(user).versionDelete(versionId);
apidatas.put("api_status", true);
} 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")

@ -91,4 +91,8 @@ public class OrgChartWrapper extends Service {
public Map<String, Object> recordStatistics(StatisticsParam param) {
return getChartService(user).recordStatistics(param);
}
public Map<String, Object> versionDelete(Integer versionId) {
return getChartService(user).versionDelete(versionId);
}
}

@ -0,0 +1,39 @@
package weaver.interfaces.organization.cronjob;
import com.engine.organization.service.impl.ChartServiceImpl;
import com.engine.organization.util.OrganizationDateUtil;
import weaver.hrm.User;
import weaver.interfaces.schedule.BaseCronJob;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;
/**
* @Author liang.cheng
* @Date 2024/8/2 9:39 AM
* @Description:
* @Version 1.0
*/
public class OrgVersionRecordCron extends BaseCronJob {
@Override
public void execute() {
ChartServiceImpl chartService = new ChartServiceImpl();
User user = new User();
user.setUid(1);
// 获取当前日期
LocalDate today = LocalDate.now();
String example = OrganizationDateUtil.dateExample(today);
String description = "版本自动记录"+example;
Map<String, Object> params = new HashMap<String, Object>(4){
{
put("description",description);
}};
chartService.versionRecord(params,user);
}
}
Loading…
Cancel
Save