动态获取对应显示布局

This commit is contained in:
dxfeng 2023-09-26 15:21:59 +08:00
parent 3603341c8a
commit f2a5ade9ad
4 changed files with 42 additions and 1 deletions

View File

@ -46,4 +46,13 @@ public class ApplicantResumeController {
String id = Util.null2String(params.get("id"));
return new ResponseResult<String, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::getInterviewInfoById, id);
}
@POST
@Path("/getDisplayLayoutId")
@Produces(MediaType.APPLICATION_JSON)
public String getDisplayLayoutId(@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(getApplicantResumeWrapper(user)::getDisplayLayoutId, params);
}
}

View File

@ -25,7 +25,15 @@ public interface ApplicantResumeService {
* 根据ID获取面试信息
*
* @param id
* @return
* @return 面试信息
*/
Map<String, Object> getInterviewInfoById(String id);
/**
* 获取编辑布局对应的显示布局ID
*
* @param params 入参
* @return 显示布局ID
*/
Map<String, Object> getDisplayLayoutId(Map<String, Object> params);
}

View File

@ -4,6 +4,7 @@ import com.engine.core.impl.Service;
import com.engine.recruit.service.ApplicantResumeService;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.resource.ResourceComInfo;
import java.util.ArrayList;
@ -71,6 +72,25 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
return returnMap;
}
@Override
public Map<String, Object> getDisplayLayoutId(Map<String, Object> params) {
Map<String, Object> returnMap = new HashMap<>();
String layoutId = Util.null2String(params.get("layoutid"));
String modeId = Util.null2String(params.get("modeId"));
returnMap.put("layoutId", layoutId);
RecordSet rs = new RecordSet();
rs.executeQuery("select layoutname from modehtmllayout where modeid = ? and id = ?", modeId, layoutId);
if (rs.next()) {
String layoutName = rs.getString("layoutname");
// 获取相同名称的显示布局ID
rs.executeQuery("select id from modehtmllayout where type = 0 and modeid = ? and layoutname =?", modeId, layoutName);
if (rs.next()) {
returnMap.put("layoutId", rs.getString("id"));
}
}
return returnMap;
}
/**
* 构建普通数据格式
*

View File

@ -25,4 +25,8 @@ public class ApplicantResumeWrapper extends Service {
public Map<String, Object> getInterviewInfoById(String id) {
return getApplicantResumeService(user).getInterviewInfoById(id);
}
public Map<String, Object> getDisplayLayoutId(Map<String, Object> params) {
return getApplicantResumeService(user).getDisplayLayoutId(params);
}
}