考勤,出勤汇总报表相关接口
parent
0926a17f3d
commit
783da0574b
@ -0,0 +1,14 @@
|
||||
package com.api.attendance.summary;
|
||||
|
||||
import com.engine.attendance.workflow.web.AttendanceSummaryApi;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description: 出勤汇总相关api
|
||||
* @Date: 2024/3/26
|
||||
**/
|
||||
@Path("/attendance/summary")
|
||||
public class AttendanceSummaryActionApi extends AttendanceSummaryApi {
|
||||
}
|
@ -0,0 +1,212 @@
|
||||
package com.engine.attendance.workflow.cmd;
|
||||
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.hrm.bean.WeaRadioGroup;
|
||||
import com.api.hrm.util.HrmAdvancedSearchUtil;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.common.service.HrmCommonService;
|
||||
import com.engine.common.service.impl.HrmCommonServiceImpl;
|
||||
import com.engine.common.util.DbTools;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.kq.biz.KQSettingsBiz;
|
||||
import com.google.common.collect.Lists;
|
||||
import weaver.backup.logging.Logger;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.settings.ChgPasswdReminder;
|
||||
import weaver.hrm.settings.RemindSettings;
|
||||
import weaver.systemExpAndImp.logging.LoggerFactory;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description: 出勤汇总查询条件
|
||||
* @Date: 2024/3/21
|
||||
**/
|
||||
public class GetCqSummarySearchConditionCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public GetCqSummarySearchConditionCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
private Logger log = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {Map<String,Object> retmap = new HashMap<String,Object>();
|
||||
List<Object> lsCondition = new ArrayList<Object>();
|
||||
List<SearchConditionItem> cusCondition = new ArrayList<SearchConditionItem>();
|
||||
String[] options = null;
|
||||
String[] selectLinkageDatas = null;
|
||||
try{
|
||||
HrmAdvancedSearchUtil hrmAdvancedSearchUtil = new HrmAdvancedSearchUtil();
|
||||
HrmCommonService hrmCommonService = new HrmCommonServiceImpl();
|
||||
|
||||
boolean kq_personal_reportsearch = KQSettingsBiz.showLeaveTypeSet("kq_personal_reportsearch");
|
||||
//展示列、时间范围、数据范围
|
||||
WeaRadioGroup wrg = null;
|
||||
if(kq_personal_reportsearch) {
|
||||
options = new String[]{"1,15537,false","2,15539,false","3,15541,false","7,27347,false","4,21904,false","6,32530,false", "9,18196,true", "10,526968,false"};
|
||||
} else {
|
||||
options = new String[]{"1,15537,false","2,15539,false","3,15541,false","7,27347,false","4,21904,false","5,15384,false","8,81716,false","6,32530,false", "9,18196,true", "10,526968,false"};
|
||||
}
|
||||
wrg = hrmAdvancedSearchUtil.getAdvanceCondition("typeselect","19482",options,null,user);
|
||||
wrg.setLabelcol(3);
|
||||
wrg.setFieldcol(20);
|
||||
Map<String,Object> selectLinks = new HashMap<String, Object>();
|
||||
List<String> domkey = new ArrayList<String>();
|
||||
Map<String,Object> map = new HashMap<String, Object>();
|
||||
selectLinks.put("conditionType", "RANGEPICKER");
|
||||
domkey = new ArrayList<String>();
|
||||
domkey.add("fromDate");
|
||||
domkey.add("toDate");
|
||||
selectLinks.put("domkey", domkey);
|
||||
map.put("6", selectLinks);
|
||||
wrg.setSelectLinkageDatas(map);
|
||||
log.info("wrg_options : " + wrg.getOptions());
|
||||
lsCondition.add(wrg);
|
||||
|
||||
if(kq_personal_reportsearch) {
|
||||
if(hrmCommonService.isManager(user.getUID())){
|
||||
options = new String[]{"3,1867,false","4,15089,false"};
|
||||
} else {
|
||||
options = new String[]{"3,1867,false"};
|
||||
}
|
||||
} else {
|
||||
if(hrmCommonService.isManager(user.getUID())){
|
||||
options = new String[]{"0,140,true","1,141,false","2,124,false","3,1867,false","4,15089,false"};
|
||||
}else{
|
||||
options = new String[]{"0,140,true","1,141,false","2,124,false","3,1867,false"};
|
||||
}
|
||||
}
|
||||
|
||||
selectLinkageDatas = new String[]{"1,subCompanyId,141,3,194","2,departmentId,124,3,57","3,resourceId,1867,3,17","4,allLevel,389995,4,1"};
|
||||
if(user.getUID()!=1){
|
||||
if(kq_personal_reportsearch) {
|
||||
selectLinkageDatas[2]="3,resourceId,1867,3,17,"+user.getUID();
|
||||
options[0]="3,1867,true";
|
||||
} else {
|
||||
selectLinkageDatas[2]="3,resourceId,1867,3,17,"+user.getUID();
|
||||
options[0]="0,140,false";
|
||||
options[3]="3,1867,true";
|
||||
}
|
||||
}
|
||||
wrg = hrmAdvancedSearchUtil.getAdvanceCondition("viewScope","34102",options,selectLinkageDatas,user);
|
||||
wrg.setLabelcol(3);
|
||||
wrg.setFieldcol(20);
|
||||
lsCondition.add(wrg);
|
||||
|
||||
WeaRadioGroup wrg1 = new WeaRadioGroup();
|
||||
|
||||
ChgPasswdReminder reminder = new ChgPasswdReminder();
|
||||
RemindSettings settings = reminder.getRemindSettings();
|
||||
String checkUnJob = Util.null2String(settings.getCheckUnJob(), "0");
|
||||
List<String> statusList = Lists.newArrayList();
|
||||
if ("1".equals(checkUnJob)) {//启用后,只有有“离职人员查看”权限的用户才能检索非在职人员
|
||||
if (HrmUserVarify.checkUserRight("hrm:departureView", user)) {
|
||||
statusList.add("9,332,false");
|
||||
}
|
||||
} else {
|
||||
statusList.add("9,332,false");
|
||||
}
|
||||
statusList.add("0,15710,false");
|
||||
statusList.add("1,15711,false");
|
||||
statusList.add("2,480,false");
|
||||
statusList.add("3,15844,false");
|
||||
if ("1".equals(checkUnJob)) {//启用后,只有有“离职人员查看”权限的用户才能检索非在职人员
|
||||
if (HrmUserVarify.checkUserRight("hrm:departureView", user)) {
|
||||
statusList.add("4,6094,false");
|
||||
statusList.add("5,6091,false");
|
||||
statusList.add("6,6092,false");
|
||||
statusList.add("7,2245,false");
|
||||
}
|
||||
} else {
|
||||
statusList.add("4,6094,false");
|
||||
statusList.add("5,6091,false");
|
||||
statusList.add("6,6092,false");
|
||||
statusList.add("7,2245,false");
|
||||
}
|
||||
statusList.add("8,1831,true");
|
||||
options = new String[statusList.size()];
|
||||
for(int i = 0 ; i < statusList.size() ; i++){
|
||||
String statusStr = statusList.get(i);
|
||||
options[i] = statusStr;
|
||||
}
|
||||
|
||||
wrg1 = hrmAdvancedSearchUtil.getAdvanceCondition("status","602",options,null,user);
|
||||
wrg1.setLabelcol(3);
|
||||
wrg1.setFieldcol(20);
|
||||
lsCondition.add(wrg1);
|
||||
|
||||
List<Object> showColumns = new ArrayList<>();
|
||||
String cascadekey = "";
|
||||
List<Map<String,Object>> selectOptions = new ArrayList<>();
|
||||
Map<String,Object> selectOption = null;
|
||||
|
||||
//设置展示列
|
||||
//个人信息相关
|
||||
selectOption = new HashMap<>();
|
||||
selectOption.put("key","subcompany");
|
||||
selectOption.put("cascadekey",cascadekey);
|
||||
selectOption.put("showname",SystemEnv.getHtmlLabelName(528842, user.getLanguage()));//分部
|
||||
selectOption.put("selected",true);
|
||||
selectOptions.add(selectOption);
|
||||
|
||||
selectOption = new HashMap<>();
|
||||
selectOption.put("key","department");
|
||||
selectOption.put("cascadekey",cascadekey);
|
||||
selectOption.put("showname",SystemEnv.getHtmlLabelName(528843, user.getLanguage()));//部门
|
||||
selectOption.put("selected",false);
|
||||
selectOptions.add(selectOption);
|
||||
|
||||
showColumns.add(selectOptions);
|
||||
//考勤项目
|
||||
String kqxmSql = "select * from uf_jcl_kq_kqxm";
|
||||
List<Map<String,Object>> kqxmDates = DbTools.getSqlToList(kqxmSql);
|
||||
log.info("kqxmDates : " + kqxmDates);
|
||||
selectOptions = new ArrayList<>();
|
||||
for(Map<String,Object> kqxm : kqxmDates) {
|
||||
selectOption = new HashMap<>();
|
||||
selectOption.put("key", "kqxm" + "_" + kqxm.get("id"));
|
||||
selectOption.put("cascadekey",cascadekey);
|
||||
selectOption.put("showname",kqxm.get("mc"));
|
||||
selectOption.put("selected",true);
|
||||
selectOptions.add(selectOption);
|
||||
}
|
||||
showColumns.add(selectOptions);
|
||||
|
||||
retmap.put("showColumns", showColumns);
|
||||
createSearchConditionItemList(cusCondition);
|
||||
|
||||
retmap.put("status", "1");
|
||||
retmap.put("conditions", lsCondition);
|
||||
retmap.put("cusCondition", cusCondition);
|
||||
}catch (Exception e) {
|
||||
writeLog(e);
|
||||
retmap.put("status", "-1");
|
||||
retmap.put("message", ""+ SystemEnv.getHtmlLabelName(10004510,weaver.general.ThreadVarLanguage.getLang())+"");
|
||||
}
|
||||
return retmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 这里只处理非下拉框字段
|
||||
* @param cusCondition
|
||||
*/
|
||||
public void createSearchConditionItemList(List<SearchConditionItem> cusCondition) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,83 @@
|
||||
package com.engine.attendance.workflow.web;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.attendance.workflow.service.AttendanceSummaryService;
|
||||
import com.engine.attendance.workflow.service.BusinessTripsApplyService;
|
||||
import com.engine.attendance.workflow.service.impl.AttendanceSummaryServiceImpl;
|
||||
import com.engine.attendance.workflow.service.impl.BusinessTripsApplyServiceImpl;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import weaver.general.Util;
|
||||
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.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description: 出勤汇总数据相关功能接口
|
||||
* @Date: 2024/3/25
|
||||
**/
|
||||
public class AttendanceSummaryApi {
|
||||
|
||||
private AttendanceSummaryService getAttendanceSummaryService(User user) {
|
||||
return ServiceUtil.getService(AttendanceSummaryServiceImpl.class,user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出勤汇总报表查询条件
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/getCqSummarySearchCondition")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String getCqSummarySearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
apidatas = getAttendanceSummaryService(user).getCqSummarySearchCondition(ParamUtil.request2Map(request));
|
||||
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出勤汇总报表
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/getCqSummaryReport")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String getCqSummaryReport(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
apidatas = getAttendanceSummaryService(user).getCqSummaryReport(ParamUtil.request2Map(request));
|
||||
return JSONObject.toJSONString(apidatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出勤汇总数据
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/addAttendanceSummary")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String addAttendanceSummary(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
apidatas = getAttendanceSummaryService(user).addAttendanceSummary(ParamUtil.request2Map(request));
|
||||
return JSONObject.toJSONString(apidatas);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue