Merge branch 'main' of http://221.226.25.34:3000/liuliang/hrm-attendance
commit
65366e6dfa
@ -0,0 +1,14 @@
|
||||
package com.api.attendance.workflow;
|
||||
|
||||
import com.engine.attendance.workflow.web.BusinessTripsApplyApi;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description: 出差申请相关api
|
||||
* @Date: 2024/3/15
|
||||
**/
|
||||
@Path("/attendance/businesstripsapply")
|
||||
public class BusinessTripsApplyActionApi extends BusinessTripsApplyApi {
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.engine.attendance.workflow.cmd;
|
||||
|
||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.jucailin.util.DbTools;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
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/15
|
||||
**/
|
||||
public class GetBusinessTripsApplyListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public GetBusinessTripsApplyListCmd(Map<String, Object> params, User user){
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> retmap = new HashMap<String, Object>();
|
||||
|
||||
//获取主表id列表
|
||||
String targetUserId = Util.null2String(params.get("targetUserId"));
|
||||
String businessTripsType = Util.null2String(params.get("businessTripsType"));
|
||||
String startDate = Util.null2String(params.get("startDate"));
|
||||
String endDate = Util.null2String(params.get("endDate"));
|
||||
|
||||
String sql = "select * from uf_jcl_kq_ccjl where ccr="+targetUserId;
|
||||
if (!businessTripsType.equals("")) {
|
||||
sql += "and cclx = " + businessTripsType;
|
||||
}
|
||||
if (!startDate.equals("")) {
|
||||
sql += "and ksrq >= " + startDate;
|
||||
}
|
||||
if (!endDate.equals("")) {
|
||||
sql += "and jsrq <= " + endDate;
|
||||
}
|
||||
List<String> maidList = new ArrayList<>();
|
||||
if (!targetUserId.equals("")) {
|
||||
List<Map<String,String>> datas = DbTools.getSqlToList(sql);
|
||||
if (datas.size() > 0) {
|
||||
datas.forEach(f -> {
|
||||
maidList.add(f.get("id"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
String backFields = "a.id,a.calendar_name,a.default_calendar,a.calendar_desc";
|
||||
String sqlFrom = " uf_jcl_kq_ccjl_dt1 a";
|
||||
String sqlWhere = " where 1=1";
|
||||
if (maidList.size() > 0) {
|
||||
sqlWhere = sqlWhere+ " and mainid in ("+String.join(",",maidList)+")";
|
||||
}
|
||||
String orderby = " id ";
|
||||
String tableString = "";
|
||||
|
||||
// String pageId = PageUidFactory.getHrmPageUid("KQCalendarSettingList");
|
||||
WeaTable table = new WeaTable();
|
||||
// table.setPageID(pageId);
|
||||
// table.setPageUID(pageId + "_" + user.getUID());
|
||||
// String pageSize = PageIdConst.getPageSize(pageId, user.getUID());
|
||||
table.setPagesize("10");
|
||||
|
||||
table.setBackfields(backFields);
|
||||
table.setSqlform(sqlFrom);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
table.setSqlprimarykey("id");
|
||||
table.setSqlorderby("id");
|
||||
// table.getColumns().addAll(tableFields());
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
if (maidList.size() > 0) {
|
||||
result.putAll(table.makeDataResult());
|
||||
}
|
||||
result.success();
|
||||
retmap.putAll(result.getResultMap());
|
||||
|
||||
return retmap;
|
||||
}
|
||||
/**
|
||||
* 构建表格字段
|
||||
*/
|
||||
private List<WeaTableColumn> tableFields() {
|
||||
return new ArrayList<WeaTableColumn>() {{
|
||||
add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
||||
add(new WeaTableColumn("10%", SystemEnv.getHtmlLabelName(000000, user.getLanguage()), "xxxxxxx"));//
|
||||
}};
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.engine.attendance.workflow.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface BusinessTripsApplyService {
|
||||
Map<String, Object> getBusinessTripsApplyList(Map<String, Object> params);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.engine.attendance.workflow.service.impl;
|
||||
|
||||
import com.engine.attendance.workflow.service.BusinessTripsApplyService;
|
||||
import com.engine.core.impl.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description: 出差申请
|
||||
* @Date: 2024/3/15
|
||||
**/
|
||||
public class BusinessTripsApplyServiceImpl extends Service implements BusinessTripsApplyService {
|
||||
@Override
|
||||
public Map<String, Object> getBusinessTripsApplyList(Map<String, Object> params) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.engine.attendance.workflow.web;
|
||||
|
||||
import com.engine.attendance.workflow.service.BusinessTripsApplyService;
|
||||
import com.engine.attendance.workflow.service.impl.BusinessTripsApplyServiceImpl;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.jucailin.service.KQCalendarSettingService;
|
||||
import com.engine.jucailin.service.impl.KQCalendarSettingServiceImpl;
|
||||
import com.engine.jucailin.util.ResponseResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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: sy
|
||||
* @Description: 出差申请
|
||||
* @Date: 2024/3/15
|
||||
**/
|
||||
@Slf4j
|
||||
public class BusinessTripsApplyApi {
|
||||
private BusinessTripsApplyService getBusinessTripsApplyService(User user) {
|
||||
return ServiceUtil.getService(BusinessTripsApplyServiceImpl.class,user);
|
||||
}
|
||||
/**
|
||||
* 出差申请列表
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getBusinessTripsApplyList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getBusinessTripsApplyList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String,Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getBusinessTripsApplyService(user) :: getBusinessTripsApplyList,param);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue