generated from dxfeng/secondev-chapanda-feishu
暂存-笔试结果更新功能开发
This commit is contained in:
parent
e55303b0b9
commit
890a44585d
|
|
@ -0,0 +1,12 @@
|
|||
package com.api.recruit.controller;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/10/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/jcl/recruit/written")
|
||||
public class WrittenResultsController extends com.engine.recruit.controller.WrittenResultsController{
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.recruit.controller;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.recruit.util.ResponseResult;
|
||||
import com.engine.recruit.wrapper.WrittenResultsWrapper;
|
||||
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.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: 2024/01/24
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class WrittenResultsController {
|
||||
public WrittenResultsWrapper getWrittenResultsWrapper(User user) {
|
||||
return ServiceUtil.getService(WrittenResultsWrapper.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getFormCondition")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getFormCondition(@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(getWrittenResultsWrapper(user)::getFormCondition,params);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.engine.recruit.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/01/24
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface WrittenResultsService {
|
||||
|
||||
/**
|
||||
* 获取表单结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getFormCondition();
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.service.WrittenResultsService;
|
||||
import com.engine.recruit.util.RecruitFormItemUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/01/24
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class WrittenResultsServiceImpl extends Service implements WrittenResultsService {
|
||||
@Override
|
||||
public Map<String, Object> getFormCondition() {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
SearchConditionItem schemeNameCondition = RecruitFormItemUtil.inputItem(user, 2, 17, 1, 50, "导入类型", "importType");
|
||||
schemeNameCondition.setRules("required|string");
|
||||
schemeNameCondition.setValue("更新");
|
||||
SearchConditionItem schemeNoCondition = RecruitFormItemUtil.uploadItem(user, 2, 17, 3, 50, "Excel文件", "excelFile", 5, 1, "xls,xlsx");
|
||||
SearchConditionItem subCompanyIdItem = RecruitFormItemUtil.browserItem(user, 2, 17, 1, false, "所属分部", "164", "subCompanyId", "");
|
||||
SearchConditionItem textareaItem = RecruitFormItemUtil.textareaItem(user, 2, 17, true, 1, 200, "方案说明", "schemeDescription");
|
||||
|
||||
selectItems.add(schemeNameCondition);
|
||||
selectItems.add(schemeNoCondition);
|
||||
selectItems.add(subCompanyIdItem);
|
||||
selectItems.add(textareaItem);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems, ""));
|
||||
apiDatas.put("condition", addGroups);
|
||||
apiDatas.put("hasRight", true);
|
||||
return apiDatas;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,357 @@
|
|||
package com.engine.recruit.util;
|
||||
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import com.api.browser.util.ConditionFactory;
|
||||
import com.api.browser.util.ConditionType;
|
||||
import weaver.hrm.User;
|
||||
import weaver.integration.util.ConstantsUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @description:
|
||||
* @Date 2024/1/24
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Deprecated
|
||||
public class RecruitFormItemUtil {
|
||||
|
||||
/**
|
||||
* 下拉框
|
||||
*
|
||||
* @param user
|
||||
* @param selectOptions
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param labelcol
|
||||
* @param isQuickSearch
|
||||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem selectItem(User user, List<SearchConditionOption> selectOptions, int colSpan, int fieldcol,
|
||||
int labelcol, boolean isQuickSearch, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem select = conditionFactory.createCondition(ConditionType.SELECT, 502327, name);
|
||||
select.setOptions(selectOptions);
|
||||
select.setColSpan(colSpan);
|
||||
select.setFieldcol(fieldcol);
|
||||
select.setLabelcol(labelcol);
|
||||
select.setIsQuickSearch(isQuickSearch);
|
||||
select.setLabel(label);
|
||||
return select;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* checkbox
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param isQuickSearch
|
||||
* @param label
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem checkboxItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, boolean isQuickSearch, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem checkbox = conditionFactory.createCondition(ConditionType.CHECKBOX, 502327, name);
|
||||
checkbox.setColSpan(colSpan);
|
||||
checkbox.setFieldcol(fieldcol);
|
||||
checkbox.setViewAttr(viewAttr);
|
||||
checkbox.setIsQuickSearch(isQuickSearch);
|
||||
checkbox.setLabel(label);
|
||||
return checkbox;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 输入框数字
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem inputNumberItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem inputnumber = conditionFactory.createCondition(ConditionType.INPUTNUMBER, 502327, name);
|
||||
inputnumber.setColSpan(colSpan);
|
||||
inputnumber.setFieldcol(fieldcol);
|
||||
inputnumber.setViewAttr(viewAttr);
|
||||
inputnumber.setLabel(label);
|
||||
return inputnumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 输入框文本
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param length
|
||||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem inputItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, int length, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem input = conditionFactory.createCondition(ConditionType.INPUT, 25034, name);
|
||||
input.setColSpan(colSpan);
|
||||
input.setFieldcol(fieldcol);
|
||||
input.setViewAttr(viewAttr);
|
||||
input.setLength(length);
|
||||
input.setLabel(label);
|
||||
return input;
|
||||
}
|
||||
|
||||
public static SearchConditionItem uploadItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, int length, String label, String name,int maxUploadSize,int maxFilesNumber,String limitType) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem upload = conditionFactory.createCondition(ConditionType.UPLOAD, 25034, name);
|
||||
upload.setColSpan(colSpan);
|
||||
upload.setFieldcol(fieldcol);
|
||||
upload.setViewAttr(viewAttr);
|
||||
upload.setLength(length);
|
||||
upload.setLabel(label);
|
||||
upload.setUploadUrl(ConstantsUtil.INTEGRATION_DATASOURCE_UPLOADFILE);
|
||||
upload.setCategory("string");
|
||||
upload.setMultiSelection(false);
|
||||
Map<String, Object> otherParams = new HashMap<>();
|
||||
otherParams.put("maxUploadSize", maxUploadSize);
|
||||
otherParams.put("autoUpload", true);
|
||||
otherParams.put("limitType", limitType);
|
||||
upload.setOtherParams(otherParams);
|
||||
upload.setMaxFilesNumber(maxFilesNumber);
|
||||
upload.setViewAttr(viewAttr);
|
||||
if (viewAttr == 3) {
|
||||
upload.setRules("required");
|
||||
}
|
||||
return upload;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 浏览按钮
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param isQuickSearch
|
||||
* @param label
|
||||
* @param type
|
||||
* @param name
|
||||
* @param fieldDbType 数据展现集成标识
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem browserItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, boolean isQuickSearch, String label, String type, String name, String fieldDbType) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem browser = conditionFactory.createCondition(ConditionType.BROWSER, 502327, name, type);
|
||||
browser.setColSpan(colSpan);
|
||||
browser.setFieldcol(fieldcol);
|
||||
browser.setViewAttr(viewAttr);
|
||||
browser.setIsQuickSearch(isQuickSearch);
|
||||
browser.setLabel(label);
|
||||
if ("161".equals(type) || "162".equals(type)) {
|
||||
fieldDbType = "browser." + fieldDbType;
|
||||
BrowserBean browserBean = new BrowserBean();
|
||||
// completeParams
|
||||
Map<String, Object> completeMap = new HashMap<>();
|
||||
completeMap.put("f_weaver_belongto_usertype", 0);
|
||||
completeMap.put("type", type);
|
||||
completeMap.put("fielddbtype", fieldDbType);
|
||||
browserBean.setCompleteParams(completeMap);
|
||||
// conditionDataParams
|
||||
Map<java.lang.String, Object> conditionDataMap = new HashMap<>();
|
||||
conditionDataMap.put("f_weaver_belongto_usertype", 0);
|
||||
conditionDataMap.put("type", fieldDbType);
|
||||
conditionDataMap.put("fielddbtype", fieldDbType);
|
||||
browserBean.setConditionDataParams(conditionDataMap);
|
||||
// dataParams
|
||||
Map<java.lang.String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("f_weaver_belongto_usertype", 0);
|
||||
dataMap.put("type", fieldDbType);
|
||||
browserBean.setDataParams(dataMap);
|
||||
// destDataParams
|
||||
Map<java.lang.String, Object> destDataMap = new HashMap<>();
|
||||
destDataMap.put("f_weaver_belongto_usertype", 0);
|
||||
destDataMap.put("type", fieldDbType);
|
||||
browserBean.setDestDataParams(destDataMap);
|
||||
|
||||
browserBean.setLinkUrl("");
|
||||
browserBean.setMobileLinkUrl("");
|
||||
browserBean.setPageSize(10);
|
||||
browserBean.setScrollx(true);
|
||||
browserBean.setTitle(label);
|
||||
browserBean.setType(type);
|
||||
|
||||
browser.setBrowserConditionParam(browserBean);
|
||||
if ("162".equals(type)) {
|
||||
HashMap<String, Object> otherMap = new HashMap<>();
|
||||
otherMap.put("isMultCheckbox", "true");
|
||||
otherMap.put("icon", "icon-coms-integration");
|
||||
browser.setOtherParams(otherMap);
|
||||
}
|
||||
}
|
||||
return browser;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 日期区间
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param viewAttr
|
||||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem rangeDateItem(User user, int colSpan, int fieldcol, int viewAttr
|
||||
, String label, String name1, String name2) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem rangeDate = conditionFactory.createCondition(ConditionType.TIMEPICKER, 502327, new String[]{name1, name2});
|
||||
rangeDate.setColSpan(colSpan);
|
||||
rangeDate.setFieldcol(fieldcol);
|
||||
rangeDate.setViewAttr(viewAttr);
|
||||
rangeDate.setLabel(label);
|
||||
return rangeDate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 多行文本框
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param isQuickSearch
|
||||
* @param viewAttr
|
||||
* @param length
|
||||
* @param label
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem textareaItem(User user, int colSpan, int fieldcol, boolean isQuickSearch,
|
||||
int viewAttr, int length, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem textarea = conditionFactory.createCondition(ConditionType.TEXTAREA, 502227, name);
|
||||
textarea.setColSpan(colSpan);
|
||||
textarea.setFieldcol(fieldcol);
|
||||
textarea.setIsQuickSearch(isQuickSearch);
|
||||
textarea.setViewAttr(viewAttr);
|
||||
textarea.setLength(length);
|
||||
textarea.setLabel(label);
|
||||
|
||||
return textarea;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 日期组合
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param isQuickSearch
|
||||
* @param viewAttr
|
||||
* @param label
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem dateItem(User user, int colSpan, int fieldcol, boolean isQuickSearch,
|
||||
int viewAttr, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem date = conditionFactory.createCondition(ConditionType.DATE, 502227, name);
|
||||
date.setColSpan(colSpan);
|
||||
date.setFieldcol(fieldcol);
|
||||
date.setIsQuickSearch(isQuickSearch);
|
||||
date.setViewAttr(viewAttr);
|
||||
date.setLabel(label);
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
* @param isQuickSearch
|
||||
* @param viewAttr
|
||||
* @param label
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem datePickerItem(User user, int colSpan, int fieldcol, boolean isQuickSearch,
|
||||
int viewAttr, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem datePicker = conditionFactory.createCondition(ConditionType.DATEPICKER, 502227, name);
|
||||
datePicker.setColSpan(colSpan);
|
||||
datePicker.setFieldcol(fieldcol);
|
||||
datePicker.setIsQuickSearch(isQuickSearch);
|
||||
datePicker.setViewAttr(viewAttr);
|
||||
datePicker.setLabel(label);
|
||||
return datePicker;
|
||||
}
|
||||
|
||||
|
||||
public static SearchConditionItem dateGroupItem(User user, int colSpan, int fieldcol, boolean isQuickSearch,
|
||||
int viewAttr, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem dateGroup = conditionFactory.createCondition(ConditionType.DATEGROUP, 502227, name);
|
||||
dateGroup.setColSpan(colSpan);
|
||||
dateGroup.setFieldcol(fieldcol);
|
||||
dateGroup.setIsQuickSearch(isQuickSearch);
|
||||
dateGroup.setViewAttr(viewAttr);
|
||||
dateGroup.setLabel(label);
|
||||
List<Object> datas = new ArrayList<>();
|
||||
datas.add(new DateGroupData("全部", "0"));
|
||||
datas.add(new DateGroupData("今天", "1"));
|
||||
datas.add(new DateGroupData("本周", "2"));
|
||||
datas.add(new DateGroupData("本月", "3"));
|
||||
datas.add(new DateGroupData("本季", "4"));
|
||||
datas.add(new DateGroupData("本年", "5"));
|
||||
datas.add(new DateGroupData("上个月", "7"));
|
||||
datas.add(new DateGroupData("上一年", "8"));
|
||||
datas.add(new DateGroupData("指定日期范围", "6"));
|
||||
dateGroup.setDatas(datas);
|
||||
dateGroup.setValue(new ArrayList<>());
|
||||
dateGroup.setDateGroup(true);
|
||||
return dateGroup;
|
||||
}
|
||||
|
||||
static class DateGroupData {
|
||||
private String name;
|
||||
private String value;
|
||||
|
||||
public DateGroupData(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.recruit.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.service.WrittenResultsService;
|
||||
import com.engine.recruit.service.impl.WrittenResultsServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/01/24
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class WrittenResultsWrapper extends Service {
|
||||
private WrittenResultsService getWrittenResultsService(User user) {
|
||||
return ServiceUtil.getService(WrittenResultsServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> getFormCondition(Map<String, Object> params) {
|
||||
return getWrittenResultsService(user).getFormCondition();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue