数智-职务岗位体系改造
parent
43dd33d0a2
commit
efbedd5d7a
@ -0,0 +1,193 @@
|
||||
package com.api.browser.service.impl;
|
||||
|
||||
import com.api.browser.bean.ListHeadBean;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SplitTableBean;
|
||||
import com.api.browser.bean.SplitTableColBean;
|
||||
import com.api.browser.service.BrowserService;
|
||||
import com.api.browser.util.*;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数智岗位浏览按钮二开
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/04
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JobTitlesBrowserService extends BrowserService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getBrowserData(Map<String, Object> params) throws Exception {
|
||||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
String jobtitlemark = Util.null2String(params.get("jobtitlemark"));
|
||||
String jobtitlename = Util.null2String(params.get("jobtitlename"));
|
||||
String jobtitlecode = Util.null2String(params.get("jobtitlecode"));
|
||||
String jobactivityname = Util.null2String(params.get("jobactivityname"));
|
||||
String sqlwhere = "where 1 = 1 ";
|
||||
String backfields;
|
||||
String fromSql;
|
||||
String orderby;
|
||||
List<SplitTableColBean> cols = new ArrayList<>();
|
||||
SplitTableBean tableBean;
|
||||
if ("278".equals(browserType)) {
|
||||
backfields = "c.id,c.jobtitlemark,c.jobtitlename,a.jobgroupname,a.jobgroupremark,b.jobactivitymark";
|
||||
fromSql = "from HrmJobTitles c left join HrmJobActivities b on b.id = c.jobactivityid left join HrmJobGroups a on a.id = b.jobgroupid";
|
||||
orderby = "c.id";
|
||||
sqlwhere = " where (c.canceled is null or c.canceled <> 1)";
|
||||
String jobgroupid = Util.null2String(params.get("jobgroupid"));
|
||||
String jobactivitieid = Util.null2String(params.get("jobactivitieid"));
|
||||
if (!"".equals(jobgroupid)) {
|
||||
sqlwhere += " and a.id =" + jobgroupid;
|
||||
}
|
||||
if (!"".equals(jobactivitieid)) {
|
||||
sqlwhere += " and b.id= " + jobactivitieid;
|
||||
}
|
||||
if (!"".equals(jobtitlemark)) {
|
||||
sqlwhere += " and c.jobtitlemark like '%" + Util.fromScreen2(jobtitlemark, user.getLanguage()) + "%' ";
|
||||
}
|
||||
if (!"".equals(jobtitlename)) {
|
||||
sqlwhere += " and c.jobtitlename like '%" + Util.fromScreen2(jobtitlename, user.getLanguage()) + "%' ";
|
||||
}
|
||||
if (!"".equals(jobtitlecode)) {
|
||||
sqlwhere += " and c.jobtitlecode like '%" + Util.fromScreen2(jobtitlecode, user.getLanguage()) + "%' ";
|
||||
}
|
||||
|
||||
cols.add(new SplitTableColBean("true", "id"));
|
||||
cols.add(new SplitTableColBean("35%", SystemEnv.getHtmlLabelName(6086, user.getLanguage()), "jobtitlemark", "jobtitlemark", 1).setIsInputCol(BoolAttr.TRUE));
|
||||
cols.add(new SplitTableColBean("35%", SystemEnv.getHtmlLabelName(1915, user.getLanguage()), "jobactivitymark", "jobactivitymark"));
|
||||
cols.add(new SplitTableColBean("30%", SystemEnv.getHtmlLabelName(805, user.getLanguage()), "jobgroupremark", "jobgroupremark"));
|
||||
tableBean = new SplitTableBean(backfields, fromSql, sqlwhere, orderby, "c.id", cols);
|
||||
} else {
|
||||
backfields = " a.id as id,a.jobtitlemark as jobtitlemark,a.jobtitlename as jobtitlename, b.jobactivityname as jobactivityname, b.jobactivitymark as jobactivitymark , a.jobtitlecode as jobtitlecode, c.jobgroupremark as jobgroupremark";
|
||||
fromSql = " from HrmJobTitles a left join HrmJobActivities b on a.jobactivityid=b.id left join hrmjobgroups c on b.jobgroupid =c.id";
|
||||
orderby = " a.id ";
|
||||
sqlwhere += " and (a.canceled is null or a.canceled <> 1)";
|
||||
if (!"".equals(jobtitlemark)) {
|
||||
sqlwhere += " and a.jobtitlemark like '%" + jobtitlemark + "%'";
|
||||
}
|
||||
|
||||
if (!"".equals(jobtitlename)) {
|
||||
sqlwhere += " and a.jobtitlename like '%" + jobtitlename + "%'";
|
||||
}
|
||||
|
||||
if (!"".equals(jobtitlecode)) {
|
||||
sqlwhere += " and a.jobtitlecode like '%" + jobtitlecode + "%'";
|
||||
}
|
||||
|
||||
if (!"".equals(jobactivityname)) {
|
||||
sqlwhere += " and jobactivityname like '%" + jobactivityname + "%'";
|
||||
}
|
||||
cols.add(new SplitTableColBean("true", "id"));
|
||||
cols.add(new SplitTableColBean("20%", "岗位名称", "jobtitlename", "jobtitlename"));
|
||||
cols.add(new SplitTableColBean("20%", "职级名称", "jobtitlemark", "jobtitlemark").setIsInputCol(BoolAttr.TRUE));
|
||||
cols.add(new SplitTableColBean("20%", "岗位编号", "jobtitlecode", "jobtitlecode"));
|
||||
cols.add(new SplitTableColBean("20%", "职级代码", "jobactivitymark", "jobactivitymark"));
|
||||
cols.add(new SplitTableColBean("20%", "序列", "jobgroupremark", "jobgroupremark"));
|
||||
tableBean = new SplitTableBean(backfields, fromSql, sqlwhere, orderby, "a.id", cols);
|
||||
}
|
||||
|
||||
tableBean.setSqlsortway("ASC");
|
||||
tableBean.setSqlisdistinct("true");
|
||||
apidatas.putAll(SplitTableUtil.makeListDataResult(tableBean));
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getBrowserConditionInfo(Map<String, Object> params) throws Exception {
|
||||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
List<SearchConditionItem> conditions = new ArrayList<>();
|
||||
apidatas.put(BrowserConstant.BROWSER_RESULT_CONDITIONS, conditions);
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
if ("278".equals(browserType)) {
|
||||
conditions.add(conditionFactory.createCondition(ConditionType.BROWSER, 805, "jobgroupid", "281"));
|
||||
conditions.add(conditionFactory.createCondition(ConditionType.BROWSER, 15855, "jobactivitieid", "282"));
|
||||
}
|
||||
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 15767, "jobtitlename"));
|
||||
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 399, "jobtitlemark", true));
|
||||
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 524944, "jobtitlecode"));
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getMultBrowserDestData(Map<String, Object> params) throws Exception {
|
||||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
List<Map<String, Object>> datas = new ArrayList<>();
|
||||
String selectids = Util.null2String(params.get(BrowserConstant.BROWSER_MULT_DEST_SELECTIDS));
|
||||
if (user == null || "".equals(selectids)) {
|
||||
return apidatas;
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
String tempSql = " select c.id,c.jobtitlemark,c.jobtitlename,a.jobgroupname,a.jobgroupremark,b.jobactivitymark " +
|
||||
" from HrmJobTitles c left join HrmJobActivities b on b.id = c.jobactivityid left join HrmJobGroups a on a.id = b.jobgroupid " +
|
||||
" where c.id in (" + selectids + ")" +
|
||||
" order by c.jobtitlemark ";
|
||||
rs.execute(tempSql);
|
||||
while (rs.next()) {
|
||||
Map<String, Object> item = new HashMap<>(16);
|
||||
item.put("id", rs.getString("id"));
|
||||
item.put("jobtitlemark", Util.null2String(rs.getString("jobtitlemark")));
|
||||
item.put("jobactivitymark", Util.null2String(rs.getString("jobactivitymark")));
|
||||
item.put("jobgroupremark", Util.null2String(rs.getString("jobgroupremark")));
|
||||
datas.add(item);
|
||||
}
|
||||
|
||||
List<ListHeadBean> tableHeadColumns = new ArrayList<>();
|
||||
tableHeadColumns.add(new ListHeadBean("id", BoolAttr.TRUE));
|
||||
tableHeadColumns.add(new ListHeadBean("jobtitlemark", "", 1, BoolAttr.TRUE));
|
||||
tableHeadColumns.add(new ListHeadBean("jobactivitymark", ""));
|
||||
tableHeadColumns.add(new ListHeadBean("jobgroupremark", ""));
|
||||
|
||||
apidatas.put(BrowserConstant.BROWSER_RESULT_COLUMN, tableHeadColumns);
|
||||
apidatas.put(BrowserConstant.BROWSER_RESULT_DATA, datas);
|
||||
apidatas.put(BrowserConstant.BROWSER_RESULT_TYPE, BrowserDataType.LIST_ALL_DATA.getTypeid());
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> browserAutoComplete(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
String q = Util.null2String(request.getParameter("q"));
|
||||
List<String> sqlParams = new ArrayList<>();
|
||||
String keyword = "";
|
||||
if (q.length() > 0) {
|
||||
keyword = "%" + q + "%";
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
String sqlwhere = "where 1 = 1 ";
|
||||
String backfields = " a.id as id,a.jobtitlemark as jobtitlemark,a.jobtitlename as jobtitlename,a.jobtitlecode as jobtitlecode,b.jobactivityname as jobactivityname, b.jobactivitymark as jobactivitymark ";
|
||||
String fromSql = " from HrmJobTitles a left join HrmJobActivities b on a.jobactivityid=b.id ";
|
||||
String orderby = " order by a.id ";
|
||||
sqlwhere += " and (a.canceled is null or a.canceled <> 1)";
|
||||
if (!"".equals(keyword)) {
|
||||
sqlwhere += " and (a.jobtitlemark like ? or a.jobtitlename like ? or a.ecology_pinyin_search like ? )";
|
||||
sqlParams.add(keyword);
|
||||
sqlParams.add(keyword);
|
||||
sqlParams.add(keyword);
|
||||
}
|
||||
String sql = "select " + backfields + fromSql + sqlwhere + orderby;
|
||||
rs.executeQuery(sql, sqlParams);
|
||||
List<Map<String, String>> datas = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
Map<String, String> item = new HashMap<>();
|
||||
item.put("id", Util.null2String(rs.getString("id")));
|
||||
String name = Util.null2String(rs.getString("jobtitlemark"));
|
||||
String jobtitlecode = Util.null2String(rs.getString("jobtitlecode"));
|
||||
String title = name + "|" + jobtitlecode + "|" + Util.null2String(rs.getString("jobactivitymark"));
|
||||
item.put("name", name);
|
||||
item.put("title", title);
|
||||
datas.add(item);
|
||||
}
|
||||
apidatas.put("datas", datas);
|
||||
return apidatas;
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package com.api.kr.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/18
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/kangrui/kq/interactive")
|
||||
public class KqInteractiveController extends com.engine.kr.web.KqInteractiveController{
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.customization.shuzhi;
|
||||
|
||||
import com.cloudstore.dev.api.util.Util_TableMap;
|
||||
import com.engine.core.cfg.annotation.CommandDynamicProxy;
|
||||
import com.engine.core.interceptor.AbstractCommandProxy;
|
||||
import com.engine.core.interceptor.Command;
|
||||
import com.engine.hrm.cmd.jobset.GetJobTitleListCmd;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 岗位列表表头信息调整
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/04/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
@CommandDynamicProxy(target = GetJobTitleListCmd.class, desc = "调整表头信息")
|
||||
public class SzGetJobTitleListCmd extends AbstractCommandProxy<Map<String, Object>> {
|
||||
@Override
|
||||
public Map<String, Object> execute(Command<Map<String, Object>> targetCommand) {
|
||||
|
||||
Map<String, Object> result = nextExecute(targetCommand);
|
||||
String sessionKey = Util.null2String(result.get("sessionkey"));
|
||||
String tableString = Util_TableMap.getVal(sessionKey);
|
||||
tableString = tableString.replace("岗位简称", "岗位名称")
|
||||
.replace("岗位全称", "职级名称")
|
||||
.replace("所属职务", "职级代码")
|
||||
.replace("职务类别", "序列");
|
||||
Util_TableMap.setVal(sessionKey, tableString);
|
||||
return result;
|
||||
}
|
||||
}
|
@ -1,129 +0,0 @@
|
||||
package com.engine.kr.entity.kq;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 加班流程转换类
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class KqActionBO {
|
||||
|
||||
/**
|
||||
* 根据人员ID获取人员名称
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public static String getUserName(String userId) {
|
||||
String userName = "";
|
||||
if (StringUtils.isBlank(userId)) {
|
||||
return userName;
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select lastname from hrmresource where id = ? ", userId);
|
||||
if (rs.next()) {
|
||||
userName = rs.getString("lastname");
|
||||
}
|
||||
return userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据人员ID获取人员工号
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public static String getWorkCode(String userId) {
|
||||
String workCode = "";
|
||||
if (StringUtils.isBlank(userId)) {
|
||||
return workCode;
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select workcode from hrmresource where id = ? ", userId);
|
||||
if (rs.next()) {
|
||||
workCode = rs.getString("workcode");
|
||||
}
|
||||
return workCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请假类型代码
|
||||
*
|
||||
* @param leaveType 流程请假类型
|
||||
* @return 请假类型代码
|
||||
*/
|
||||
public static String getLeaveTypeCode(String leaveType) {
|
||||
String leaveTypeCode = "";
|
||||
if (StringUtils.isBlank(leaveType)) {
|
||||
return leaveTypeCode;
|
||||
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select kqxtzdz from uf_jqzdpp where lczd =?", leaveType);
|
||||
if (rs.next()) {
|
||||
leaveTypeCode = rs.getString("kqxtzdz");
|
||||
}
|
||||
return leaveTypeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取加班类型
|
||||
*
|
||||
* @param workType 流程加班类型
|
||||
* @return 加班类型代码
|
||||
*/
|
||||
public static String getWorkTypeCode(String workType) {
|
||||
String workTypeCode = "";
|
||||
if (StringUtils.isBlank(workType)) {
|
||||
return workTypeCode;
|
||||
}
|
||||
switch (workType) {
|
||||
case "0":
|
||||
workTypeCode = "JB01";
|
||||
break;
|
||||
case "1":
|
||||
workTypeCode = "JB02";
|
||||
break;
|
||||
case "2":
|
||||
workTypeCode = "JB03";
|
||||
break;
|
||||
case "3":
|
||||
workTypeCode = "JB20";
|
||||
break;
|
||||
case "4":
|
||||
workTypeCode = "JB30";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return workTypeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程创建、最后操作时间
|
||||
*
|
||||
* @param requestId
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> getOperateDateTime(String requestId) {
|
||||
Map<String, String> map = new HashMap<>(2);
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select createdate,createtime,lastoperatedate,lastoperatetime from workflow_requestbase where requestid = ? ", requestId);
|
||||
if (rs.next()) {
|
||||
String createdate = rs.getString("createdate");
|
||||
String createtime = rs.getString("createtime");
|
||||
String lastoperatedate = rs.getString("lastoperatedate");
|
||||
String lastoperatetime = rs.getString("lastoperatetime");
|
||||
map.put("addDay", createdate + " " + createtime);
|
||||
map.put("cfmDay", lastoperatedate + " " + lastoperatetime);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package com.engine.kr.enums;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/18
|
||||
* @version: 1.0
|
||||
*/
|
||||
public enum KqInteractiveEnum {
|
||||
/**
|
||||
* 获取token
|
||||
*/
|
||||
TOKEN("TOKEN", "/Person/getToken"),
|
||||
LEAVE_BAL("LEAVE_BAL", "/Person/iLeaveBal"),
|
||||
SIGN_CREATE("SIGN_CREATE", "/Person/iSignCreate"),
|
||||
OVERTIME_CREATE("OVERTIME_CREATE", "/Person/iOvertimeCreate"),
|
||||
LEAVE_CREATE("LEAVE_CREATE", "/Person/iLeaveCreate"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private final String name;
|
||||
/**
|
||||
* 请求路径
|
||||
*/
|
||||
private final String postPath;
|
||||
|
||||
KqInteractiveEnum(String name, String postPath) {
|
||||
this.name = name;
|
||||
this.postPath = postPath;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getPostPath() {
|
||||
return postPath;
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package com.engine.kr.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/17
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface KqInteractiveService {
|
||||
|
||||
/**
|
||||
* 获取假期余额
|
||||
*
|
||||
* @param params 参数
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getLeaveBal(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取用户照片
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getUserImage(Map<String, Object> params);
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package com.engine.kr.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.kr.service.KqInteractiveService;
|
||||
import com.engine.kr.service.impl.KqInteractiveServiceImpl;
|
||||
import com.engine.kr.util.ResponseResult;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
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.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/18
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class KqInteractiveController {
|
||||
public KqInteractiveService getService(User user) {
|
||||
return ServiceUtil.getService(KqInteractiveServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/getLeaveBal")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getLeaveBal(@Context HttpServletRequest request, @Context HttpServletResponse response, Map<String, Object> params) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getLeaveBal, params);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getUserImage")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getUserImage(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getUserImage, params);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.engine.kr.exception;
|
||||
package com.engine.shuzhi.exception;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
@ -1,4 +1,4 @@
|
||||
package com.engine.kr.util;
|
||||
package com.engine.shuzhi.util;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
@ -1,10 +1,10 @@
|
||||
package com.engine.kr.util;
|
||||
package com.engine.shuzhi.util;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.core.exception.ECException;
|
||||
import com.engine.kr.exception.CustomizeRunTimeException;
|
||||
import com.engine.shuzhi.exception.CustomizeRunTimeException;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
@ -1,137 +0,0 @@
|
||||
package weaver.interfaces.kr.workflow.action;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.kr.entity.kq.KqActionBO;
|
||||
import com.engine.kr.entity.kq.KqGlobal;
|
||||
import com.engine.kr.enums.KqInteractiveEnum;
|
||||
import com.engine.kr.service.impl.KqInteractiveServiceImpl;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class KrBatchOvertimeCreateAction implements Action {
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
|
||||
String billNo = "";
|
||||
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
String name = property.getName();
|
||||
String value = property.getValue();
|
||||
switch (name) {
|
||||
case "lcbh":
|
||||
billNo = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
String token = new KqInteractiveServiceImpl().getToken();
|
||||
String cfmBy = KqActionBO.getUserName(requestInfo.getLastoperator());
|
||||
Map<String, String> operateDateTime = KqActionBO.getOperateDateTime(requestInfo.getRequestid());
|
||||
|
||||
|
||||
DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo();
|
||||
DetailTable detailTable = detailTableInfo.getDetailTable()[0];
|
||||
Row[] rows = detailTable.getRow();
|
||||
boolean isRun = true;
|
||||
for (Row row : rows) {
|
||||
if (!isRun) {
|
||||
break;
|
||||
}
|
||||
String personId = "";
|
||||
String otType = "";
|
||||
String otAdjuest = "";
|
||||
String beginDate = "";
|
||||
String beginTime = "";
|
||||
String endDate = "";
|
||||
String endTime = "";
|
||||
String billHours = "";
|
||||
String otReason = "";
|
||||
Cell[] cells = row.getCell();
|
||||
for (Cell cell : cells) {
|
||||
String name = cell.getName();
|
||||
String value = cell.getValue();
|
||||
switch (name) {
|
||||
case "xm":
|
||||
personId = KqActionBO.getWorkCode(value);
|
||||
break;
|
||||
case "jblx":
|
||||
otType = KqActionBO.getWorkTypeCode(value);
|
||||
break;
|
||||
case "bcfs":
|
||||
otAdjuest = value;
|
||||
break;
|
||||
case "ksrq":
|
||||
beginDate = value;
|
||||
break;
|
||||
case "kssj":
|
||||
beginTime = value;
|
||||
break;
|
||||
case "jsrq":
|
||||
endDate = value;
|
||||
break;
|
||||
case "jssj":
|
||||
endTime = value;
|
||||
break;
|
||||
case "jbsc":
|
||||
billHours = value;
|
||||
break;
|
||||
case "jbsy":
|
||||
otReason = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 每一行发起一次请求
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("token", token);
|
||||
params.put("personId", personId);
|
||||
params.put("billNo", billNo + "-" + row.getId());
|
||||
params.put("otType", otType);
|
||||
params.put("otAdjuest", otAdjuest);
|
||||
params.put("beginDate", beginDate);
|
||||
params.put("beginTime", beginTime);
|
||||
params.put("endDate", endDate);
|
||||
params.put("endTime", endTime);
|
||||
params.put("billHours", billHours);
|
||||
params.put("runsNo", null);
|
||||
params.put("otReason", otReason);
|
||||
params.put("addBy", requestInfo.getCreatorid());
|
||||
params.put("addDay", operateDateTime.get("addDay"));
|
||||
params.put("cfmBy", cfmBy);
|
||||
params.put("cfmDay", operateDateTime.get("cfmDay"));
|
||||
// 1新增、2变动、3取消
|
||||
params.put("billStat", 1);
|
||||
new BaseBean().writeLog("########批量加班流程,requestid={" + requestInfo.getRequestid() + "],传参:"+ JSON.toJSONString(params));
|
||||
|
||||
String returnStr = HttpUtil.post(KqGlobal.POST_URL + KqInteractiveEnum.OVERTIME_CREATE.getPostPath(), params);
|
||||
new BaseBean().writeLog("########批量加班流程,requestid={" + requestInfo.getRequestid() + "],接口响应数据:"+ returnStr);
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(returnStr);
|
||||
String code = jsonObject.getString("code");
|
||||
if (!KqGlobal.SUC_CODE.equals(code)) {
|
||||
requestInfo.getRequestManager().setMessagecontent(jsonObject.getString("msg"));
|
||||
isRun = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isRun) {
|
||||
return SUCCESS;
|
||||
}
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
package weaver.interfaces.kr.workflow.action;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.kr.entity.kq.KqActionBO;
|
||||
import com.engine.kr.entity.kq.KqGlobal;
|
||||
import com.engine.kr.enums.KqInteractiveEnum;
|
||||
import com.engine.kr.service.impl.KqInteractiveServiceImpl;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class KrLeaveCreateAction implements Action {
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
String resourceId = "";
|
||||
String leaveType = "";
|
||||
String startDate = "";
|
||||
String startTime = "";
|
||||
String endDate = "";
|
||||
String endTime = "";
|
||||
String leaveDuration = "";
|
||||
String leaveReason = "";
|
||||
String billNo = "";
|
||||
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
String name = property.getName();
|
||||
String value = property.getValue();
|
||||
switch (name) {
|
||||
case "resourceId":
|
||||
resourceId = value;
|
||||
break;
|
||||
case "jqlx":
|
||||
leaveType = value;
|
||||
break;
|
||||
case "ksrq":
|
||||
startDate = value;
|
||||
break;
|
||||
case "kssj":
|
||||
startTime = value;
|
||||
break;
|
||||
case "jsrq":
|
||||
endDate = value;
|
||||
break;
|
||||
case "jssj":
|
||||
endTime = value;
|
||||
break;
|
||||
case "qjsc":
|
||||
leaveDuration = value;
|
||||
break;
|
||||
case "qjsy":
|
||||
leaveReason = value;
|
||||
break;
|
||||
case "lcbh":
|
||||
billNo = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
Map<String, String> operateDateTime = KqActionBO.getOperateDateTime(requestInfo.getRequestid());
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("token", new KqInteractiveServiceImpl().getToken());
|
||||
params.put("personId", KqActionBO.getWorkCode(resourceId));
|
||||
params.put("billNo", billNo);
|
||||
params.put("dayoffType", KqActionBO.getLeaveTypeCode(leaveType));
|
||||
params.put("beginDate", startDate);
|
||||
params.put("beginTime", startTime);
|
||||
params.put("endDate", endDate);
|
||||
params.put("endTime", endTime);
|
||||
params.put("billHours", leaveDuration);
|
||||
params.put("runsNo", null);
|
||||
params.put("inout", null);
|
||||
params.put("incHoli", null);
|
||||
params.put("dayoffReason", leaveReason);
|
||||
params.put("addBy", requestInfo.getCreatorid());
|
||||
params.put("addDay", operateDateTime.get("addDay"));
|
||||
params.put("cfmBy", KqActionBO.getUserName(requestInfo.getLastoperator()));
|
||||
params.put("cfmDay", operateDateTime.get("addDay"));
|
||||
// 1新增、2变动、3取消
|
||||
params.put("billStat", 1);
|
||||
|
||||
new BaseBean().writeLog("########请假流程,requestid={" + requestInfo.getRequestid() + "],传参:"+ JSON.toJSONString(params));
|
||||
|
||||
String returnStr = HttpUtil.post(KqGlobal.POST_URL + KqInteractiveEnum.LEAVE_CREATE.getPostPath(), params);
|
||||
new BaseBean().writeLog("########请假流程,requestid={" + requestInfo.getRequestid() + "],接口响应数据:"+ returnStr);
|
||||
JSONObject jsonObject = JSONObject.parseObject(returnStr);
|
||||
String code = jsonObject.getString("code");
|
||||
if (KqGlobal.SUC_CODE.equals(code)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
requestInfo.getRequestManager().setMessagecontent(jsonObject.getString("msg"));
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
package weaver.interfaces.kr.workflow.action;
|
||||
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/24
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class KrLeaveRepeatAction implements Action {
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
String resourceId = "";
|
||||
String leaveType = "";
|
||||
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
String name = property.getName();
|
||||
String value = property.getValue();
|
||||
switch (name) {
|
||||
case "resourceId":
|
||||
resourceId = value;
|
||||
break;
|
||||
case "jqlx":
|
||||
leaveType = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
String billTableName = requestInfo.getRequestManager().getBillTableName();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select count(1) as num from " + billTableName + " where resourceId = ? and jqlx =? and requestid != ? and spzt != 2", resourceId, leaveType, requestInfo.getRequestid());
|
||||
if (rs.next()) {
|
||||
int num = rs.getInt("num");
|
||||
if (num > 0) {
|
||||
requestInfo.getRequestManager().setMessagecontent("当前人员存在未审批完成的请假审核流程,请勿重复提交");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
package weaver.interfaces.kr.workflow.action;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.kr.entity.kq.KqActionBO;
|
||||
import com.engine.kr.entity.kq.KqGlobal;
|
||||
import com.engine.kr.enums.KqInteractiveEnum;
|
||||
import com.engine.kr.service.impl.KqInteractiveServiceImpl;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/05/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class KrSingleOvertimeCreateAction implements Action {
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
String resourceId = "";
|
||||
String fromDate = "";
|
||||
String fromTime = "";
|
||||
String toDate = "";
|
||||
String toTime = "";
|
||||
// 补偿方式
|
||||
String overtimeType = "";
|
||||
String duration = "";
|
||||
String billNo = "";
|
||||
String workType = "";
|
||||
String workReason = "";
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
String name = property.getName();
|
||||
String value = property.getValue();
|
||||
switch (name) {
|
||||
case "resourceId":
|
||||
resourceId = value;
|
||||
break;
|
||||
case "fromDate":
|
||||
fromDate = value;
|
||||
break;
|
||||
case "fromTime":
|
||||
fromTime = value;
|
||||
break;
|
||||
case "toDate":
|
||||
toDate = value;
|
||||
break;
|
||||
case "toTime":
|
||||
toTime = value;
|
||||
break;
|
||||
case "overtime_type":
|
||||
overtimeType = value;
|
||||
break;
|
||||
case "duration":
|
||||
duration = value;
|
||||
break;
|
||||
case "lcbh":
|
||||
billNo = value;
|
||||
break;
|
||||
case "jblx":
|
||||
workType = value;
|
||||
break;
|
||||
case "jbsy":
|
||||
workReason = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
Map<String, String> operateDateTime = KqActionBO.getOperateDateTime(requestInfo.getRequestid());
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("token", new KqInteractiveServiceImpl().getToken());
|
||||
params.put("personId", KqActionBO.getWorkCode(resourceId));
|
||||
params.put("billNo", billNo);
|
||||
params.put("otType", KqActionBO.getWorkTypeCode(workType));
|
||||
params.put("otAdjuest", overtimeType);
|
||||
params.put("beginDate", fromDate);
|
||||
params.put("beginTime", fromTime);
|
||||
params.put("endDate", toDate);
|
||||
params.put("endTime", toTime);
|
||||
params.put("billHours", duration);
|
||||
params.put("runsNo", null);
|
||||
params.put("otReason", workReason);
|
||||
params.put("addBy", requestInfo.getCreatorid());
|
||||
params.put("addDay", operateDateTime.get("addDay"));
|
||||
params.put("cfmBy", KqActionBO.getUserName(requestInfo.getLastoperator()));
|
||||
params.put("cfmDay", operateDateTime.get("addDay"));
|
||||
params.put("billStat", 1);
|
||||
|
||||
new BaseBean().writeLog("########加班流程,requestid={" + requestInfo.getRequestid() + "],传参:"+ JSON.toJSONString(params));
|
||||
|
||||
String returnStr = HttpUtil.post(KqGlobal.POST_URL + KqInteractiveEnum.OVERTIME_CREATE.getPostPath(), params);
|
||||
new BaseBean().writeLog("########加班流程,requestid={" + requestInfo.getRequestid() + "],接口响应数据:"+ returnStr);
|
||||
JSONObject jsonObject = JSONObject.parseObject(returnStr);
|
||||
String code = jsonObject.getString("code");
|
||||
if (KqGlobal.SUC_CODE.equals(code)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
requestInfo.getRequestManager().setMessagecontent(jsonObject.getString("msg"));
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue