Compare commits
1 Commits
hrmAttenda
...
master
Author | SHA1 | Date |
---|---|---|
|
46f1c9fde1 | 8 months ago |
@ -1,13 +0,0 @@
|
|||||||
package com.api.jclattendance.web;
|
|
||||||
|
|
||||||
import javax.ws.rs.Path;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2023/12/26 6:52 PM
|
|
||||||
* @Description: 班次列表
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
@Path("/bs/jcl/workrules")
|
|
||||||
public class WorkRulesController extends com.engine.jclattendance.web.WorkRulesController{
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
package com.engine.jclattendance.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2023/11/16 2:37 PM
|
|
||||||
* @Description: TODO
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public class CustomizeRunTimeException extends RuntimeException{
|
|
||||||
|
|
||||||
public CustomizeRunTimeException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomizeRunTimeException(Throwable cause) {
|
|
||||||
super(cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomizeRunTimeException(String message, Throwable cause) {
|
|
||||||
super(message, cause);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
package com.engine.jclattendance.service;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2023/12/26 6:53 PM
|
|
||||||
* @Description: TODO
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public interface WorkRulesService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 班次列表
|
|
||||||
* @Author: liang.cheng
|
|
||||||
* @Date: 2023/12/26 7:18 PM
|
|
||||||
* @param: [resourceIds]
|
|
||||||
* @return: java.lang.String
|
|
||||||
*/
|
|
||||||
Map<String, Object> getWorkRulesList(String resourceIds);
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
package com.engine.jclattendance.service.impl;
|
|
||||||
|
|
||||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
|
||||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
|
||||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
||||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
|
||||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
||||||
import com.engine.core.impl.Service;
|
|
||||||
import com.engine.jclattendance.service.WorkRulesService;
|
|
||||||
import weaver.conn.RecordSet;
|
|
||||||
import weaver.conn.constant.DBConstant;
|
|
||||||
import weaver.general.PageIdConst;
|
|
||||||
import weaver.systeminfo.SystemEnv;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2023/12/26 6:54 PM
|
|
||||||
* @Description: TODO
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public class WorkRulesServiceImpl extends Service implements WorkRulesService {
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getWorkRulesList(String resourceIds) {
|
|
||||||
Map<String, Object> resultMap = new HashMap<>(4);
|
|
||||||
|
|
||||||
WeaTable table = new WeaTable();
|
|
||||||
String pageId = "ba1c29c23a8a46d9acff1d2ee4ff5fb3";
|
|
||||||
table.setPageID(pageId);
|
|
||||||
table.setPageUID(String.format("%s_%s",pageId,user.getUID()));
|
|
||||||
String pageSize = PageIdConst.getPageSize(pageId, user.getUID());
|
|
||||||
table.setPagesize(pageSize);
|
|
||||||
RecordSet rs=new RecordSet();
|
|
||||||
String fields = "t.id, t.mc,t.jc,t.ys,CONCAT(kssj, '-', jssj) as bcsj";
|
|
||||||
if(DBConstant.DB_TYPE_SQLSERVER.equalsIgnoreCase(rs.getDBType())){
|
|
||||||
fields = "t.id, t.mc,t.jc,t.ys,kssj + '-' + jssj as bcsj";
|
|
||||||
}
|
|
||||||
table.setBackfields(fields);
|
|
||||||
|
|
||||||
String fromSql = " from uf_jcl_kq_bcxx t";
|
|
||||||
table.setSqlform(fromSql);
|
|
||||||
|
|
||||||
String sqlWhere = " where 1=1 and t.attendance_organization in ("+resourceIds+")";
|
|
||||||
table.setSqlwhere(sqlWhere);
|
|
||||||
|
|
||||||
table.setSqlprimarykey("id");
|
|
||||||
table.getColumns().add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
|
||||||
table.getColumns().add(new WeaTableColumn("20%", "班次名称", "mc"));
|
|
||||||
table.getColumns().add(new WeaTableColumn("20%", "简称", "jc"));
|
|
||||||
table.getColumns().add(new WeaTableColumn("20%", "颜色", "ys"));
|
|
||||||
table.getColumns().add(new WeaTableColumn("40%", "班次时间", "bcsj"));
|
|
||||||
|
|
||||||
table.setTableType(WeaTableType.RADIO);
|
|
||||||
|
|
||||||
WeaResultMsg result = new WeaResultMsg(false);
|
|
||||||
result.putAll(table.makeDataResult());
|
|
||||||
result.success();
|
|
||||||
resultMap.putAll(result.getResultMap());
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
package com.engine.jclattendance.util;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2023/11/16 2:37 PM
|
|
||||||
* @Description: TODO
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public class ExceptionUtil {
|
|
||||||
public static String getRealMessage(Throwable e) {
|
|
||||||
while (e != null) {
|
|
||||||
Throwable cause = e.getCause();
|
|
||||||
if (cause == null) {
|
|
||||||
return e.getMessage();
|
|
||||||
}
|
|
||||||
e = cause;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
package com.engine.jclattendance.web;
|
|
||||||
|
|
||||||
import com.engine.common.util.ServiceUtil;
|
|
||||||
import com.engine.jclattendance.service.WorkRulesService;
|
|
||||||
import com.engine.jclattendance.service.impl.WorkRulesServiceImpl;
|
|
||||||
import com.engine.jclattendance.util.ResponseResult;
|
|
||||||
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.QueryParam;
|
|
||||||
import javax.ws.rs.core.Context;
|
|
||||||
import javax.ws.rs.core.MediaType;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2023/12/26 6:52 PM
|
|
||||||
* @Description: TODO
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public class WorkRulesController {
|
|
||||||
|
|
||||||
private WorkRulesService getReportCollectService(User user) {
|
|
||||||
return ServiceUtil.getService(WorkRulesServiceImpl.class,user);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/list")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public String getWorkRulesList(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
|
||||||
@QueryParam("resourceIds") String resourceIds) {
|
|
||||||
User user = HrmUserVarify.getUser(request, response);
|
|
||||||
return new ResponseResult<String, Map<String, Object>>(user).run(getReportCollectService(user) :: getWorkRulesList,resourceIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,14 @@
|
|||||||
|
package test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author weaver_cl
|
||||||
|
* @Description:
|
||||||
|
* @Date 2022/10/9
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
public class MainTest {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue