职务按钮、入职办理
commit
5d187d80c1
@ -0,0 +1,82 @@
|
|||||||
|
package com.api.browser.service.impl;
|
||||||
|
|
||||||
|
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.general.Util;
|
||||||
|
import weaver.systeminfo.SystemEnv;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职务类别
|
||||||
|
*
|
||||||
|
* @author lvyi
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class JobActivitiesBrowserService extends BrowserService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getBrowserData(Map<String, Object> params) throws Exception {
|
||||||
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||||
|
String jobactivitymark = Util.null2String(params.get("jobactivitymark"));
|
||||||
|
String jobactivityname = Util.null2String(params.get("jobactivityname"));
|
||||||
|
String sqlwhere = "where 1 = 1 ";
|
||||||
|
String backfields = "";
|
||||||
|
String fromSql = "";
|
||||||
|
String orderby = "";
|
||||||
|
if(!jobactivitymark.equals("")){
|
||||||
|
sqlwhere += " and Jobactivitymark like '%";
|
||||||
|
sqlwhere += Util.fromScreen2(jobactivitymark,user.getLanguage());
|
||||||
|
sqlwhere += "%'";
|
||||||
|
}
|
||||||
|
if(!jobactivityname.equals("")){
|
||||||
|
sqlwhere += " and jobactivityname like '%";
|
||||||
|
sqlwhere += Util.fromScreen2(jobactivityname,user.getLanguage());
|
||||||
|
sqlwhere += "%'";
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SplitTableColBean> cols = new ArrayList<SplitTableColBean>();
|
||||||
|
backfields = " id, jobactivitymark, jobactivityname, jobgroupname ";
|
||||||
|
fromSql = " ( SELECT " +
|
||||||
|
" a.id, " +
|
||||||
|
" a.jobactivitymark, " +
|
||||||
|
" a.jobactivityname, " +
|
||||||
|
" b.jobgroupname " +
|
||||||
|
"FROM " +
|
||||||
|
" HrmJobActivities a " +
|
||||||
|
" LEFT JOIN HrmJobGroups b ON b.id = a.jobgroupid " +
|
||||||
|
") t ";
|
||||||
|
orderby = " id ";
|
||||||
|
|
||||||
|
cols.add(new SplitTableColBean("true", "id"));
|
||||||
|
cols.add(new SplitTableColBean("35%", SystemEnv.getHtmlLabelName(399, user.getLanguage()), "jobactivitymark", "jobactivitymark").setIsInputCol(BoolAttr.TRUE));
|
||||||
|
cols.add(new SplitTableColBean("35%", SystemEnv.getHtmlLabelName(15767, user.getLanguage()), "jobactivityname", "jobactivityname"));
|
||||||
|
cols.add(new SplitTableColBean("30%", SystemEnv.getHtmlLabelName(805, user.getLanguage()), "jobgroupname", "jobgroupname"));//二开
|
||||||
|
|
||||||
|
SplitTableBean tableBean = new SplitTableBean(backfields, fromSql, sqlwhere, orderby, "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<String, Object>();
|
||||||
|
List<SearchConditionItem> conditions = new ArrayList<SearchConditionItem>();
|
||||||
|
apidatas.put(BrowserConstant.BROWSER_RESULT_CONDITIONS, conditions);
|
||||||
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||||
|
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 399, "jobactivitymark", true));
|
||||||
|
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 15767, "jobactivityname"));
|
||||||
|
conditions.add(conditionFactory.createCondition(ConditionType.INPUT, 805, "jobgroupname"));
|
||||||
|
return apidatas;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.api.sskj.controller;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
@Path("/sskj/entrymode")
|
||||||
|
public class EntryController extends com.engine.sskj.controller.EntryController{
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.engine.sskj.controller;
|
||||||
|
|
||||||
|
import com.engine.common.util.ParamUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.engine.sskj.service.EntryService;
|
||||||
|
import com.engine.sskj.service.impl.EntryServiceImpl;
|
||||||
|
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.Map;
|
||||||
|
|
||||||
|
public class EntryController {
|
||||||
|
|
||||||
|
public EntryService getEntryService(User user) {
|
||||||
|
return ServiceUtil.getService(EntryServiceImpl.class,user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@POST
|
||||||
|
@Path("/checkblacklist")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String checkBlackList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||||
|
Map<String, Object> resultDatas = getEntryService(user).checkBlackList(params);
|
||||||
|
return new Gson().toJson(resultDatas);
|
||||||
|
}
|
||||||
|
|
||||||
|
@POST
|
||||||
|
@Path("/checkentrystatus")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String checkEntryStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||||
|
Map<String, Object> resultDatas = getEntryService(user).checkEntryStatus(params);
|
||||||
|
return new Gson().toJson(resultDatas);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.engine.sskj.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface EntryService {
|
||||||
|
/**
|
||||||
|
* 入职申请新员工黑名单检测
|
||||||
|
*/
|
||||||
|
Map<String, Object> checkBlackList(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查入职办理时选中的人员是否待入职状态
|
||||||
|
*/
|
||||||
|
Map<String, Object> checkEntryStatus(Map<String, Object> params);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.engine.sskj.service.impl;
|
||||||
|
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.sskj.service.EntryService;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class EntryServiceImpl extends Service implements EntryService {
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> checkBlackList(Map<String, Object> params) {
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
|
||||||
|
String idNumbers = Util.null2String(params.get("idNumbers"));//获取入参中的身份证号
|
||||||
|
|
||||||
|
if ( StringUtils.isBlank(idNumbers)) {
|
||||||
|
result.put("code",500);
|
||||||
|
result.put("msg","未获取到身份证号。");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> inList = new ArrayList<>();
|
||||||
|
String[] idNumbersArr = idNumbers.split(",");
|
||||||
|
for (String idNumber:idNumbersArr) {
|
||||||
|
Integer number = -1;
|
||||||
|
String checkSql = "select count(*) as number from uf_entryblacklist where sfzh = ? ";
|
||||||
|
rs.executeQuery(checkSql,idNumber);
|
||||||
|
while (rs.next()) {
|
||||||
|
number = Util.getIntValue(Util.null2String(rs.getString("number")));
|
||||||
|
}
|
||||||
|
if ( number > 0 ) {//在黑名单中
|
||||||
|
inList.add(idNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !inList.isEmpty()) {
|
||||||
|
String inStr = String.join(",",inList);
|
||||||
|
result.put("code",500);
|
||||||
|
result.put("msg","身份证号:"+inStr+" 在黑名单中,是否继续入职申请?");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.put("code",200);
|
||||||
|
result.put("msg","该批人员身份证号均不在黑名单中。");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> checkEntryStatus(Map<String, Object> params) {
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
|
||||||
|
String dataIds = Util.null2String(params.get("dataIds"));
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(dataIds)) {
|
||||||
|
result.put("code",500);
|
||||||
|
result.put("msg","未选择需要检测入职状态的员工");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] idsArr = dataIds.split(",");
|
||||||
|
|
||||||
|
List<String> errorStatusList = new ArrayList<>();
|
||||||
|
List<String> errorPromptList = new ArrayList<>();
|
||||||
|
|
||||||
|
String checkStatusSql = "select rzzt,xm from uf_rzgl where id = ?";
|
||||||
|
for (String id: idsArr) {
|
||||||
|
rs.executeQuery(checkStatusSql,id);
|
||||||
|
while (rs.next()) {
|
||||||
|
Integer status = Util.getIntValue(Util.null2String(rs.getString("rzzt")));
|
||||||
|
String lastname = Util.null2String(rs.getString("xm"));
|
||||||
|
if (status != 0 ) {
|
||||||
|
errorStatusList.add(id);
|
||||||
|
errorPromptList.add(lastname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !errorStatusList.isEmpty()) {//存在不为待入职状态的数据
|
||||||
|
String prompStr = String.join(",",errorPromptList);
|
||||||
|
result.put("code",500);
|
||||||
|
result.put("msg","姓名为:"+prompStr+" 的人员,入职状态不出于待入职状态,不可以办理入职。");//确认一下需要提示什么
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.put("code",200);
|
||||||
|
result.put("msg","均可办理入职");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue