liuliang
parent
8251489d62
commit
135112a840
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="dataSourceStorageLocal" created-in="IU-212.4746.92">
|
||||||
|
<data-source name="Oracle - @192.168.0.106" uuid="ade958e9-d72b-48ba-8be1-0441de7da9a5">
|
||||||
|
<database-info product="Oracle" version="Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options" jdbc-version="4.3" driver-name="Oracle JDBC driver" driver-version="21.5.0.0.0" dbms="ORACLE" exact-version="11.2.0.4.0" exact-driver-version="21.5">
|
||||||
|
<extra-name-characters>$#</extra-name-characters>
|
||||||
|
<identifier-quote-string>"</identifier-quote-string>
|
||||||
|
</database-info>
|
||||||
|
<case-sensitivity plain-identifiers="upper" quoted-identifiers="exact" />
|
||||||
|
<secret-storage>master_key</secret-storage>
|
||||||
|
<user-name>hrm_test</user-name>
|
||||||
|
<schema-mapping>
|
||||||
|
<introspection-scope>
|
||||||
|
<node kind="schema">
|
||||||
|
<name qname="@" />
|
||||||
|
<name qname="PUBLIC" />
|
||||||
|
</node>
|
||||||
|
</introspection-scope>
|
||||||
|
</schema-mapping>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
|
<data-source source="LOCAL" name="Oracle - @192.168.0.106" uuid="ade958e9-d72b-48ba-8be1-0441de7da9a5">
|
||||||
|
<driver-ref>oracle.19</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<auto-commit>false</auto-commit>
|
||||||
|
<jdbc-driver>oracle.jdbc.OracleDriver</jdbc-driver>
|
||||||
|
<jdbc-url>jdbc:oracle:thin:@192.168.0.106:1521:ecology</jdbc-url>
|
||||||
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
|||||||
|
#n:HRM_TEST
|
||||||
|
!<md> [1709049810000, 0, null, null, -2147483648, -2147483648]
|
Binary file not shown.
@ -0,0 +1,2 @@
|
|||||||
|
#n:PUBLIC
|
||||||
|
!<md> [1709049847000, 0, null, null, -2147483648, -2147483648]
|
@ -0,0 +1,2 @@
|
|||||||
|
#n:SYS
|
||||||
|
!<md> [null, 0, null, null, -2147483648, -2147483648]
|
@ -0,0 +1,2 @@
|
|||||||
|
#n:SYSTEM
|
||||||
|
!<md> [null, 0, null, null, -2147483648, -2147483648]
|
@ -0,0 +1,4 @@
|
|||||||
|
GET http://hrm/kq/jucailin/persongroup
|
||||||
|
|
||||||
|
###
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -0,0 +1,17 @@
|
|||||||
|
package com.api.attendance.jucailin;
|
||||||
|
|
||||||
|
import com.engine.jucailin.web.KQCalendarSettingAction;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: sy
|
||||||
|
* @Description:
|
||||||
|
* @Date: 2024/2/27
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Path("/hrm/kq/jucailin/calendarsetting")
|
||||||
|
@Slf4j
|
||||||
|
public class KQCalendarSettingActionApi extends KQCalendarSettingAction {
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.api.attendance.jucailin;
|
||||||
|
|
||||||
|
import com.engine.jucailin.web.KQCommonAction;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
|
||||||
|
@Path("/hrm/kq/jucailin/common")
|
||||||
|
@Slf4j
|
||||||
|
public class KQCommonActionApi extends KQCommonAction {
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.api.attendance.jucailin;
|
||||||
|
|
||||||
|
import com.engine.jucailin.web.KQCycleSettingAction;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
|
||||||
|
@Path("/hrm/kq/jucailin/cyclesetting")
|
||||||
|
@Slf4j
|
||||||
|
public class KQCycleSettingActionApi extends KQCycleSettingAction {
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.api.attendance.jucailin;
|
||||||
|
|
||||||
|
import com.engine.jucailin.web.KQPersonGroupAction;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
|
||||||
|
@Path("/hrm/kq/jucailin/persongroup")
|
||||||
|
@Slf4j
|
||||||
|
public class KQPersonGroupActionApi extends KQPersonGroupAction {
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package com.engine.common.util.genid;
|
||||||
|
|
||||||
|
import java.net.Inet4Address;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.NetworkInterface;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class DefaultWorker implements Worker{
|
||||||
|
private Random random = new Random();
|
||||||
|
|
||||||
|
public DefaultWorker() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getWorkerId() {
|
||||||
|
int max = 100000;
|
||||||
|
int min = 10000;
|
||||||
|
int s = this.random.nextInt(max) % (max - min + 1) + min;
|
||||||
|
String ip = this.getHostIp();
|
||||||
|
long workerId = 0L;
|
||||||
|
if (ip != null) {
|
||||||
|
String str = ip.replaceAll("\\.", "") + s;
|
||||||
|
workerId = Long.parseLong(str);
|
||||||
|
workerId %= 1024L;
|
||||||
|
}
|
||||||
|
|
||||||
|
return workerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getHostIp() {
|
||||||
|
try {
|
||||||
|
Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||||
|
|
||||||
|
while(allNetInterfaces.hasMoreElements()) {
|
||||||
|
NetworkInterface netInterface = (NetworkInterface)allNetInterfaces.nextElement();
|
||||||
|
Enumeration<InetAddress> addresses = netInterface.getInetAddresses();
|
||||||
|
|
||||||
|
while(addresses.hasMoreElements()) {
|
||||||
|
InetAddress ip = (InetAddress)addresses.nextElement();
|
||||||
|
if (ip != null && ip instanceof Inet4Address
|
||||||
|
&& !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == -1) {
|
||||||
|
return ip.getHostAddress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception var5) {
|
||||||
|
var5.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return "127.0.0.1";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.engine.common.util.genid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id生成器
|
||||||
|
*/
|
||||||
|
public class IdGenerator {
|
||||||
|
|
||||||
|
public static long generate() {
|
||||||
|
SnowflakeId snowflakeId = new SnowflakeId();
|
||||||
|
return snowflakeId.get();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package com.engine.common.util.genid;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class SnowflakeId {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SnowflakeId.class);
|
||||||
|
private Worker worker;
|
||||||
|
private long startTime = this._curSecond();
|
||||||
|
private long time;
|
||||||
|
private long segment = 0L;
|
||||||
|
private long workerId = this.getWorker().getWorkerId();
|
||||||
|
private long sequence = 0L;
|
||||||
|
private static final long segmentBits = 9L;
|
||||||
|
private static final long workerIdBits = 10L;
|
||||||
|
private static final long sequenceBits = 13L;
|
||||||
|
private static final long timestampShift = 32L;
|
||||||
|
private static final long segmentShift = 23L;
|
||||||
|
private static final long workerIdShift = 13L;
|
||||||
|
private static final long sequenceMask = 8191L;
|
||||||
|
private static final long maxSegment = 511L;
|
||||||
|
private long twepoch = 1483200000L;
|
||||||
|
private long _counter = 0L;
|
||||||
|
|
||||||
|
public SnowflakeId() {
|
||||||
|
this.time = this.startTime - this.twepoch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Worker getWorker() {
|
||||||
|
return (Worker)(this.worker == null ? new DefaultWorker() : this.worker);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorker(Worker worker) {
|
||||||
|
this.worker = worker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized long get() {
|
||||||
|
long id = this.getNextId();
|
||||||
|
this.testSpeedLimit();
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized long[] getRangeId(int sizeOfIds) {
|
||||||
|
long[] r = new long[]{this.getNextId(), 0L};
|
||||||
|
this.sequence = this.sequence + (long)sizeOfIds - 1L - 1L;
|
||||||
|
this._counter = this._counter + (long)sizeOfIds - 1L - 1L;
|
||||||
|
if (this.sequence >> 13 > 0L) {
|
||||||
|
this.sequence &= 8191L;
|
||||||
|
if (this.segment >= 511L) {
|
||||||
|
++this.time;
|
||||||
|
this.segment = 0L;
|
||||||
|
} else {
|
||||||
|
++this.segment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
r[1] = this.getNextId();
|
||||||
|
this.testSpeedLimit();
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getNextId() {
|
||||||
|
++this.sequence;
|
||||||
|
++this._counter;
|
||||||
|
if (this.sequence >> 13 > 0L) {
|
||||||
|
if (this.segment >= 511L) {
|
||||||
|
++this.time;
|
||||||
|
} else {
|
||||||
|
this.sequence = 0L;
|
||||||
|
++this.segment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.time << 32 | this.segment << 23 | this.workerId << 13 | this.sequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long _curSecond() {
|
||||||
|
return System.currentTimeMillis() / 1000L;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void testSpeedLimit() {
|
||||||
|
long spentTime = this._curSecond() - this.startTime + 1L;
|
||||||
|
if (spentTime <= 0L || spentTime << 22 <= this._counter) {
|
||||||
|
try {
|
||||||
|
this.wait(10L);
|
||||||
|
this.testSpeedLimit();
|
||||||
|
} catch (Exception var4) {
|
||||||
|
logger.error(var4.getMessage(), var4);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package com.engine.common.util.genid;
|
||||||
|
|
||||||
|
public interface Worker {
|
||||||
|
long getWorkerId();
|
||||||
|
}
|
@ -0,0 +1,132 @@
|
|||||||
|
package com.engine.jucailin.cmd.calendar;
|
||||||
|
|
||||||
|
import com.api.browser.bean.SearchConditionItem;
|
||||||
|
import com.api.browser.bean.SearchConditionOption;
|
||||||
|
import com.api.hrm.bean.HrmFieldBean;
|
||||||
|
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.jucailin.enums.FieldHtmlTypeEnum;
|
||||||
|
import com.engine.jucailin.util.DbTools;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: sy
|
||||||
|
* @Description: 日历设置表单新建编辑返回
|
||||||
|
* @Date: 2024/2/27
|
||||||
|
**/
|
||||||
|
public class GetCalendarSettingFormCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetCalendarSettingFormCmd(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>();
|
||||||
|
List<Map<String, Object>> groupList = new ArrayList<Map<String, Object>>();
|
||||||
|
Map<String, Object> groupItem = new HashMap<String, Object>();
|
||||||
|
List<SearchConditionOption> optionsList = new ArrayList<SearchConditionOption>();
|
||||||
|
List<Object> itemList = new ArrayList<Object>();
|
||||||
|
|
||||||
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
||||||
|
SearchConditionItem searchConditionItem = null;
|
||||||
|
|
||||||
|
String billid = Util.null2String(params.get("billid"));
|
||||||
|
boolean hasFieldvalue = false;
|
||||||
|
Map<String,String> dateMap = Maps.newHashMap();
|
||||||
|
if (billid.length() != 0) {
|
||||||
|
dateMap = DbTools.getSqlToMap("select * from kq_calendar_name where id=?",billid);
|
||||||
|
if (dateMap.size() > 0) {
|
||||||
|
hasFieldvalue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HrmFieldBean hrmFieldBean = null;
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("affiliation");//所属机构
|
||||||
|
hrmFieldBean.setFieldlabel("17868");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.BROWSER.getKey());
|
||||||
|
hrmFieldBean.setType("164");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("affiliation")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("calendar_name");//日历名称
|
||||||
|
hrmFieldBean.setFieldlabel("531231");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.CHECKBOX.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("calendar_name")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("default_calendar");//默认日历
|
||||||
|
hrmFieldBean.setFieldlabel("546298");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.INPUT.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(2);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("default_calendar")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("attendance_organization");//适用范围
|
||||||
|
hrmFieldBean.setFieldlabel("511548");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.TEXTAREA.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(2);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("attendance_organization")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
//searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("calendar_desc");//日历说明
|
||||||
|
hrmFieldBean.setFieldlabel("546299");
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("calendar_desc")) : "");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.TEXTAREA.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(2);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
|
||||||
|
groupItem.put("items", itemList);
|
||||||
|
groupList.add(groupItem);
|
||||||
|
retmap.put("condition", groupList);
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package com.engine.jucailin.cmd.calendar;
|
||||||
|
|
||||||
|
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.kq.util.PageUidFactory;
|
||||||
|
import weaver.general.PageIdConst;
|
||||||
|
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/2/27
|
||||||
|
**/
|
||||||
|
public class GetCalendarSettingListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetCalendarSettingListCmd(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>();
|
||||||
|
|
||||||
|
String backFields = "a.id,a.calendar_name,a.default_calendar,a.calendar_desc";
|
||||||
|
String sqlFrom = " kq_calendar_name a";
|
||||||
|
String sqlWhere = " (a.delete_type is null or a.delete_type <> '1') ";
|
||||||
|
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(pageSize);
|
||||||
|
|
||||||
|
table.setBackfields(backFields);
|
||||||
|
table.setSqlform(sqlFrom);
|
||||||
|
table.setSqlwhere(sqlWhere);
|
||||||
|
table.setSqlprimarykey("id");
|
||||||
|
table.setSqlorderby("id");
|
||||||
|
table.getColumns().addAll(tableFields());
|
||||||
|
|
||||||
|
//主要用于 显示定制列以及 表格 每页展示记录数选择
|
||||||
|
// String sessionkey = pageUid + "_" + Util.getEncrypt(Util.getRandom());
|
||||||
|
// Util_TableMap.setVal(sessionkey, tableString);
|
||||||
|
// retmap.put("sessionkey", sessionkey);
|
||||||
|
// retmap.put("status", "1");
|
||||||
|
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
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(531231, user.getLanguage()), "calendar_name"));//日历名称
|
||||||
|
add(new WeaTableColumn("10%", SystemEnv.getHtmlLabelName(546298, user.getLanguage()), "default_calendar"));//默认日历
|
||||||
|
add(new WeaTableColumn("10%", SystemEnv.getHtmlLabelName(546299, user.getLanguage()), "calendar_desc"));//日历说明
|
||||||
|
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.engine.jucailin.cmd.common;
|
||||||
|
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.jucailin.util.DateUtil;
|
||||||
|
import com.engine.jucailin.util.DbTools;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class DeleteDataCommonCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public DeleteDataCommonCmd(Map<String, Object> params, User user){
|
||||||
|
this.params=params;
|
||||||
|
this.user=user;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public BizLogContext getLogContext() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(CommandContext commandContext) {
|
||||||
|
Map<String,Object> resultMap = Maps.newHashMap();
|
||||||
|
String tableNames = Util.null2String(params.get("tableName"));
|
||||||
|
String billids = Util.null2String(params.get("billids"));
|
||||||
|
String deleteType = Util.null2String(params.get("deleteType"));
|
||||||
|
if ("".equals(deleteType)){
|
||||||
|
deleteType = "delete_type";
|
||||||
|
}
|
||||||
|
String sql = "update "+tableNames +" set "+deleteType+"=1, update_time=? where id in ("+billids+")";
|
||||||
|
log.info("DeleteDataCommonCmd sql : [{}]",sql);
|
||||||
|
resultMap.put("result", DbTools.update(sql,DateUtil.getCurrentTime()));
|
||||||
|
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.engine.jucailin.cmd.common;
|
||||||
|
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.jucailin.genid.IdGenerator;
|
||||||
|
import com.engine.jucailin.util.CommonUtil;
|
||||||
|
import com.engine.jucailin.util.DbTools;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class InsertDataCommonCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public InsertDataCommonCmd(Map<String, Object> params, User user){
|
||||||
|
this.params=params;
|
||||||
|
this.user=user;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BizLogContext getLogContext() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(CommandContext commandContext) {
|
||||||
|
String tableName = Util.null2String(params.get("tableName"));
|
||||||
|
Map<String,Object> dataMap = (Map<String,Object>)params.get("data");
|
||||||
|
Map<String,Object> mainMap = Maps.newHashMap();
|
||||||
|
Map<String,List<Map<String,Object>>> detailMap = Maps.newHashMap();
|
||||||
|
for (Map.Entry<String, Object> entry: dataMap.entrySet()){
|
||||||
|
String key = entry.getKey();
|
||||||
|
if (key.startsWith("dt") && entry.getValue() instanceof List){
|
||||||
|
detailMap.put(key,(List<Map<String,Object>>)entry.getValue());
|
||||||
|
}else {
|
||||||
|
mainMap.put(entry.getKey(),entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
long mainid = IdGenerator.generate();
|
||||||
|
mainMap.put("id",mainid);
|
||||||
|
Map<String,Object> resultMap = Maps.newHashMap();
|
||||||
|
for (Map.Entry<String,List<Map<String,Object>>> detail: detailMap.entrySet()){
|
||||||
|
String detailTableName = tableName+"_"+detail.getKey();
|
||||||
|
List<Map<String,Object>> dataList = detail.getValue();
|
||||||
|
if (dataList.size() > 0){
|
||||||
|
List<Long> billids = Lists.newArrayList();
|
||||||
|
for (Map<String,Object> data : dataList){
|
||||||
|
long detailId = IdGenerator.generate();
|
||||||
|
data.put("id",detailId);
|
||||||
|
data.put("mainid",mainid);
|
||||||
|
billids.add(detailId);
|
||||||
|
CommonUtil.fillSaveData(data,user);
|
||||||
|
}
|
||||||
|
if (!CommonUtil.insertBatch(dataList,detailTableName)){
|
||||||
|
resultMap.put(detailTableName,"fail");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!DbTools.update(CommonUtil.makeInsertSql(tableName,mainMap,user))){
|
||||||
|
resultMap.put(tableName,"fail");
|
||||||
|
}
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.engine.jucailin.cmd.common;
|
||||||
|
|
||||||
|
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 com.google.common.collect.Maps;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class QueryDataCommonCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public QueryDataCommonCmd(Map<String, Object> params, User user){
|
||||||
|
this.params=params;
|
||||||
|
this.user=user;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BizLogContext getLogContext() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(CommandContext commandContext) {
|
||||||
|
String tableNames = Util.null2String(params.get("tableNames"));
|
||||||
|
String billid = Util.null2String(params.get("billid"));
|
||||||
|
Map<String,Object> resultMap = Maps.newHashMap();
|
||||||
|
for (String tableName :tableNames.split(",")){
|
||||||
|
String sql = "select * from "+tableName+" where 1=1";
|
||||||
|
if (tableName.contains("_dt")){
|
||||||
|
sql += " and mainid="+billid;
|
||||||
|
}else {
|
||||||
|
sql += " and id="+billid;
|
||||||
|
}
|
||||||
|
resultMap.put(tableName, DbTools.getSqlToList(sql));
|
||||||
|
}
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.engine.jucailin.cmd.common;
|
||||||
|
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.jucailin.genid.IdGenerator;
|
||||||
|
import com.engine.jucailin.util.CommonUtil;
|
||||||
|
import com.engine.jucailin.util.DbTools;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class UpdateDataCommonCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public UpdateDataCommonCmd(Map<String, Object> params, User user){
|
||||||
|
this.params=params;
|
||||||
|
this.user=user;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public BizLogContext getLogContext() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(CommandContext commandContext) {
|
||||||
|
String tableName = Util.null2String(params.get("tableName"));
|
||||||
|
Map<String,Object> dataMap = (Map<String,Object>)params.get("data");
|
||||||
|
String billid = Util.null2String(params.get("billid"));
|
||||||
|
Map<String, List<Map<String,Object>>> detailMap = Maps.newHashMap();
|
||||||
|
Map<String,Object> mainMap = Maps.newHashMap();
|
||||||
|
for (Map.Entry<String, Object> entry: dataMap.entrySet()){
|
||||||
|
String key = entry.getKey();
|
||||||
|
if (key.startsWith("dt") && entry.getValue() instanceof List){
|
||||||
|
detailMap.put(key,(List<Map<String,Object>>)entry.getValue());
|
||||||
|
}else {
|
||||||
|
mainMap.put(entry.getKey(),entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Map<String,Object> conditionMap = Maps.newHashMap();
|
||||||
|
conditionMap.put("id",billid);
|
||||||
|
Map<String,Object> resultMap = Maps.newHashMap();
|
||||||
|
if (!DbTools.update(CommonUtil.makeUpdateSql(tableName,mainMap,conditionMap))){
|
||||||
|
resultMap.put(tableName,"fail");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Map.Entry<String,List<Map<String,Object>>> detail: detailMap.entrySet()){
|
||||||
|
String detailTableName = tableName+"_"+detail.getKey();
|
||||||
|
List<Map<String,Object>> dataList = detail.getValue();
|
||||||
|
List<String> resultList = Lists.newArrayList();
|
||||||
|
for (Map<String,Object> data : dataList){
|
||||||
|
String id = Util.null2String(data.get("dtid"));
|
||||||
|
data.remove("dtid");
|
||||||
|
conditionMap.put("mainid",billid);
|
||||||
|
if (id.equals("")){
|
||||||
|
conditionMap.put("id", IdGenerator.generate());
|
||||||
|
}else {
|
||||||
|
conditionMap.put("id",Long.valueOf(id));
|
||||||
|
}
|
||||||
|
if (!DbTools.update(CommonUtil.makeUpdateSql(detailTableName,data,conditionMap))){
|
||||||
|
resultList.add(conditionMap.get("id").toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (resultList.size() > 0){
|
||||||
|
resultMap.put(detailTableName,resultList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,186 @@
|
|||||||
|
package com.engine.jucailin.cmd.cycle;
|
||||||
|
|
||||||
|
import com.api.browser.bean.SearchConditionItem;
|
||||||
|
import com.api.browser.bean.SearchConditionOption;
|
||||||
|
import com.api.hrm.bean.HrmFieldBean;
|
||||||
|
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.jucailin.enums.FieldHtmlTypeEnum;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class GetCycleFormCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetCycleFormCmd(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>();
|
||||||
|
List<Map<String, Object>> groupList = new ArrayList<Map<String, Object>>();
|
||||||
|
Map<String, Object> groupItem = new HashMap<String, Object>();
|
||||||
|
List<SearchConditionOption> optionsList = new ArrayList<SearchConditionOption>();
|
||||||
|
List<Object> itemList = new ArrayList<Object>();
|
||||||
|
|
||||||
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
||||||
|
SearchConditionItem searchConditionItem = null;
|
||||||
|
|
||||||
|
HrmFieldBean hrmFieldBean = null;
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("organzation");//所属机构
|
||||||
|
hrmFieldBean.setFieldlabel("17868");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.BROWSER.getKey());
|
||||||
|
hrmFieldBean.setType("164");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("cyclename");//周期名称
|
||||||
|
hrmFieldBean.setFieldlabel("388722");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.INPUT.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("attendcycle");//考勤周期
|
||||||
|
hrmFieldBean.setFieldlabel("15386");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.INPUT.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("yearly");//年度
|
||||||
|
hrmFieldBean.setFieldlabel("17138");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.INPUT.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("months");//月份
|
||||||
|
hrmFieldBean.setFieldlabel("887");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.INPUT.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("startdate");// 开始日期
|
||||||
|
hrmFieldBean.setFieldlabel("85");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.BROWSER.getKey());
|
||||||
|
hrmFieldBean.setType("2");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("enddate");// 结束日期
|
||||||
|
hrmFieldBean.setFieldlabel("1323");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.BROWSER.getKey());
|
||||||
|
hrmFieldBean.setType("2");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("cyclestate");// 状态
|
||||||
|
hrmFieldBean.setFieldlabel("602");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.SELECT.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
optionsList = new ArrayList<SearchConditionOption>();
|
||||||
|
optionsList.add(new SearchConditionOption("0", "待关账", true));//待关账
|
||||||
|
optionsList.add(new SearchConditionOption("1", "已关账"));//部门
|
||||||
|
optionsList.add(new SearchConditionOption("2", "已结账"));//已结账
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("closedate");// 关账日期
|
||||||
|
hrmFieldBean.setFieldlabel("85");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.BROWSER.getKey());
|
||||||
|
hrmFieldBean.setType("2");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("closetime");// 关账时间
|
||||||
|
hrmFieldBean.setFieldlabel("85");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.BROWSER.getKey());
|
||||||
|
hrmFieldBean.setType("19");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("memo");// 备注
|
||||||
|
hrmFieldBean.setFieldlabel("454");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.TEXTAREA.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
|
||||||
|
groupItem.put("items", itemList);
|
||||||
|
groupList.add(groupItem);
|
||||||
|
retmap.put("condition", groupList);
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,113 @@
|
|||||||
|
package com.engine.jucailin.cmd.cycle;
|
||||||
|
|
||||||
|
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.WeaTableOperate;
|
||||||
|
import com.cloudstore.eccom.pc.table.WeaTableOperates;
|
||||||
|
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.kq.util.PageUidFactory;
|
||||||
|
import weaver.general.PageIdConst;
|
||||||
|
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;
|
||||||
|
|
||||||
|
public class GetCycleListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetCycleListCmd(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>();
|
||||||
|
|
||||||
|
String cyclename = Util.null2String(params.get("cyclename"));
|
||||||
|
String year = Util.null2String(params.get("year"));
|
||||||
|
|
||||||
|
String backFields = "a.id,a.cyclename,a.attendcycle,a.yearly,a.months,a.startdate,a.enddate,a.cyclestate,a.closedate,a.closetime,a.memo";
|
||||||
|
String sqlFrom = " kq_cycle a";
|
||||||
|
String sqlWhere = " (a.delete_type is null or a.delete_type <> '1') ";
|
||||||
|
String orderby = " id ";
|
||||||
|
String tableString = "";
|
||||||
|
|
||||||
|
if (cyclename.length() > 0) {
|
||||||
|
sqlWhere += " and a.cyclename = "+cyclename ;
|
||||||
|
}
|
||||||
|
if (year.length() > 0){
|
||||||
|
sqlWhere += "a.yearly = "+year;
|
||||||
|
}
|
||||||
|
|
||||||
|
String pageId = PageUidFactory.getHrmPageUid("KQCycleList");
|
||||||
|
WeaTable table = new WeaTable();
|
||||||
|
table.setPageID(pageId);
|
||||||
|
table.setPageUID(pageId + "_" + user.getUID());
|
||||||
|
String pageSize = PageIdConst.getPageSize(pageId, user.getUID());
|
||||||
|
table.setPagesize(pageSize);
|
||||||
|
|
||||||
|
table.setBackfields(backFields);
|
||||||
|
table.setSqlform(sqlFrom);
|
||||||
|
table.setSqlwhere(sqlWhere);
|
||||||
|
table.setSqlprimarykey("id");
|
||||||
|
table.setSqlorderby("id");
|
||||||
|
table.getColumns().addAll(tableFields());
|
||||||
|
table.setOperates(getWeaTableOperates());
|
||||||
|
|
||||||
|
//主要用于 显示定制列以及 表格 每页展示记录数选择
|
||||||
|
// String sessionkey = pageUid + "_" + Util.getEncrypt(Util.getRandom());
|
||||||
|
// Util_TableMap.setVal(sessionkey, tableString);
|
||||||
|
// retmap.put("sessionkey", sessionkey);
|
||||||
|
// retmap.put("status", "1");
|
||||||
|
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
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%", "周期名称", "cyclename","cyclename","com.engine.kq.jucailin.util.ListConversionMethod.getCycleName"));//周期名称
|
||||||
|
add(new WeaTableColumn("10%", "考勤周期", "attendcycle"));//考勤周期
|
||||||
|
add(new WeaTableColumn("10%", "年度", "yearly"));//年度
|
||||||
|
add(new WeaTableColumn("10%", "月份", "months"));//月份
|
||||||
|
add(new WeaTableColumn("10%", "开始日期", "startdate"));//开始日期
|
||||||
|
add(new WeaTableColumn("10%", "结束日期", "enddate"));//结束日期
|
||||||
|
add(new WeaTableColumn("10%", "状态", "cyclestate","cyclestate").setTransmethod("com.engine.kq.jucailin.util.ListConversionMethod.getCyclestate").setOtherpara(user.getLanguage()+"").setColumn("cyclestate"));//状态
|
||||||
|
add(new WeaTableColumn("10%", "关账日期", "closedate"));//关账日期
|
||||||
|
add(new WeaTableColumn("10%", "关账时间", "closedate"));//关账时间
|
||||||
|
add(new WeaTableColumn("10%", "备注", "memo"));//备注
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置表格右侧操作按钮
|
||||||
|
*/
|
||||||
|
private WeaTableOperates getWeaTableOperates() {
|
||||||
|
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
||||||
|
weaTableOperates.setOperate(new ArrayList<WeaTableOperate>() {{
|
||||||
|
add(new WeaTableOperate(SystemEnv.getHtmlLabelName(91, user.getLanguage()), "javascript:doDel()", "1"));
|
||||||
|
add(new WeaTableOperate(SystemEnv.getHtmlLabelName(83, user.getLanguage()), "javascript:onLog()", "2"));
|
||||||
|
}});
|
||||||
|
return weaTableOperates;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
package com.engine.jucailin.cmd.cycle;
|
||||||
|
|
||||||
|
import com.api.browser.bean.SearchConditionItem;
|
||||||
|
import com.api.browser.bean.SearchConditionOption;
|
||||||
|
import com.api.hrm.bean.HrmFieldBean;
|
||||||
|
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.jucailin.enums.FieldHtmlTypeEnum;
|
||||||
|
import com.engine.jucailin.util.DbTools;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class GetCycleSettingFormCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetCycleSettingFormCmd(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>();
|
||||||
|
List<Map<String, Object>> groupList = new ArrayList<Map<String, Object>>();
|
||||||
|
Map<String, Object> groupItem = new HashMap<String, Object>();
|
||||||
|
List<SearchConditionOption> optionsList = new ArrayList<SearchConditionOption>();
|
||||||
|
List<Object> itemList = new ArrayList<Object>();
|
||||||
|
|
||||||
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
||||||
|
SearchConditionItem searchConditionItem = null;
|
||||||
|
|
||||||
|
String billid = Util.null2String(params.get("billid"));
|
||||||
|
boolean hasFieldvalue = false;
|
||||||
|
Map<String,String> dateMap = Maps.newHashMap();
|
||||||
|
if (billid.length() != 0) {
|
||||||
|
dateMap = DbTools.getSqlToMap("select * from kq_cycle_setting where id=?",billid);
|
||||||
|
if (dateMap.size() > 0) {
|
||||||
|
hasFieldvalue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HrmFieldBean hrmFieldBean = null;
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("organzation");//所属机构
|
||||||
|
hrmFieldBean.setFieldlabel("17868");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.BROWSER.getKey());
|
||||||
|
hrmFieldBean.setType("164");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("organzation")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("attendance_organization");//适用对象
|
||||||
|
hrmFieldBean.setFieldlabel("18126");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.TEXTAREA.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(2);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("attendance_organization")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
//searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("cyclename");//周期名称
|
||||||
|
hrmFieldBean.setFieldlabel("388722");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.INPUT.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(3);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("cyclename")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("ifdefault");//默认周期
|
||||||
|
hrmFieldBean.setFieldlabel("149");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.CHECKBOX.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(2);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("ifdefault")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("memo");//说明
|
||||||
|
hrmFieldBean.setFieldlabel("85");
|
||||||
|
hrmFieldBean.setFieldhtmltype(FieldHtmlTypeEnum.TEXTAREA.getKey());
|
||||||
|
hrmFieldBean.setType("1");
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(2);
|
||||||
|
hrmFieldBean.setFieldvalue(hasFieldvalue ? Util.null2String(dateMap.get("memo")) : "");
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
searchConditionItem.setOptions(optionsList);
|
||||||
|
searchConditionItem.setRules("required|string");
|
||||||
|
itemList.add(searchConditionItem);
|
||||||
|
|
||||||
|
|
||||||
|
groupItem.put("items", itemList);
|
||||||
|
groupList.add(groupItem);
|
||||||
|
retmap.put("condition", groupList);
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,102 @@
|
|||||||
|
package com.engine.jucailin.cmd.cycle;
|
||||||
|
|
||||||
|
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.WeaTableOperate;
|
||||||
|
import com.cloudstore.eccom.pc.table.WeaTableOperates;
|
||||||
|
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.kq.util.PageUidFactory;
|
||||||
|
import weaver.general.PageIdConst;
|
||||||
|
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;
|
||||||
|
|
||||||
|
public class GetCycleSettingListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetCycleSettingListCmd(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>();
|
||||||
|
|
||||||
|
String cyclename = Util.null2String(params.get("cyclename"));
|
||||||
|
|
||||||
|
String backFields = "a.id,a.ifdefault,a.cyclename,a.memo";
|
||||||
|
String sqlFrom = " kq_cycle_setting a";
|
||||||
|
String sqlWhere = " (a.delete_type is null or a.delete_type <> '1') ";
|
||||||
|
String orderby = " id ";
|
||||||
|
String tableString = "";
|
||||||
|
|
||||||
|
if (cyclename.length() > 0) {
|
||||||
|
sqlWhere += " and a.cyclename = like '%" + cyclename + "%' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
String pageId = PageUidFactory.getHrmPageUid("KQCycleSettingList");
|
||||||
|
WeaTable table = new WeaTable();
|
||||||
|
table.setPageID(pageId);
|
||||||
|
table.setPageUID(pageId + "_" + user.getUID());
|
||||||
|
String pageSize = PageIdConst.getPageSize(pageId, user.getUID());
|
||||||
|
table.setPagesize(pageSize);
|
||||||
|
|
||||||
|
table.setBackfields(backFields);
|
||||||
|
table.setSqlform(sqlFrom);
|
||||||
|
table.setSqlwhere(sqlWhere);
|
||||||
|
table.setSqlprimarykey("id");
|
||||||
|
table.setSqlorderby("id");
|
||||||
|
table.getColumns().addAll(tableFields());
|
||||||
|
table.setOperates(getWeaTableOperates());
|
||||||
|
|
||||||
|
//主要用于 显示定制列以及 表格 每页展示记录数选择
|
||||||
|
// String sessionkey = pageUid + "_" + Util.getEncrypt(Util.getRandom());
|
||||||
|
// Util_TableMap.setVal(sessionkey, tableString);
|
||||||
|
// retmap.put("sessionkey", sessionkey);
|
||||||
|
// retmap.put("status", "1");
|
||||||
|
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
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("20%", "名称", "cyclename"));//名称
|
||||||
|
add(new WeaTableColumn("20%", "默认周期", "ifdefault"));//默认周期
|
||||||
|
add(new WeaTableColumn("20%", "说明", "memo"));//说明
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置表格右侧操作按钮
|
||||||
|
*/
|
||||||
|
private WeaTableOperates getWeaTableOperates() {
|
||||||
|
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
||||||
|
weaTableOperates.setOperate(new ArrayList<WeaTableOperate>() {{
|
||||||
|
add(new WeaTableOperate(SystemEnv.getHtmlLabelName(91, user.getLanguage()), "javascript:doDel()", "1"));
|
||||||
|
add(new WeaTableOperate(SystemEnv.getHtmlLabelName(83, user.getLanguage()), "javascript:onLog()", "2"));
|
||||||
|
}});
|
||||||
|
return weaTableOperates;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.engine.jucailin.cmd.cycle;
|
||||||
|
|
||||||
|
import com.api.hrm.bean.TreeNode;
|
||||||
|
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 java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class GetCycleSettingTreeCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetCycleSettingTreeCmd(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) {
|
||||||
|
TreeNode root = new TreeNode();
|
||||||
|
String keyword = Util.null2String(params.get("keyword")).trim().toLowerCase();
|
||||||
|
root.setId("0");
|
||||||
|
root.setName("考勤周期");
|
||||||
|
root.setType("0");
|
||||||
|
root.setIcon("icon-coms-LargeArea");
|
||||||
|
List<TreeNode> groups = new ArrayList<TreeNode>();
|
||||||
|
String sql = "select id,cyclename from kq_cycle_setting where 1=1";
|
||||||
|
if (keyword.length() > 0){
|
||||||
|
sql += " and cyclename like '%" + keyword + "%' ";
|
||||||
|
}
|
||||||
|
List<Map<String,String>> dataList = DbTools.getSqlToList(sql);
|
||||||
|
for (Map<String,String> data:dataList){
|
||||||
|
TreeNode group = new TreeNode();
|
||||||
|
group.setId(data.get("id"));
|
||||||
|
group.setName(data.get("cyclename"));
|
||||||
|
group.setPid("0");
|
||||||
|
group.setType("1");
|
||||||
|
group.setCanClick(true);
|
||||||
|
group.setIcon("icon-coms-LargeArea");
|
||||||
|
groups.add(group);
|
||||||
|
}
|
||||||
|
root.setIsParent(groups.size()>0);
|
||||||
|
root.setSubs(groups);
|
||||||
|
Map<String, Object> treeObj = new HashMap<String, Object>();
|
||||||
|
treeObj.put("rootCompany", root);
|
||||||
|
return treeObj;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,113 @@
|
|||||||
|
package com.engine.jucailin.cmd.personGroup;
|
||||||
|
|
||||||
|
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.WeaTableOperate;
|
||||||
|
import com.cloudstore.eccom.pc.table.WeaTableOperates;
|
||||||
|
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.kq.util.PageUidFactory;
|
||||||
|
import weaver.general.PageIdConst;
|
||||||
|
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;
|
||||||
|
|
||||||
|
public class GetPersonGroupListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetPersonGroupListCmd(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>();
|
||||||
|
|
||||||
|
String groupname = Util.null2String(params.get("groupname"));
|
||||||
|
|
||||||
|
String subcompanyId = Util.null2String(params.get("subcompanyid"));
|
||||||
|
|
||||||
|
String userfor = Util.null2String(params.get("userfor"));
|
||||||
|
|
||||||
|
String backFields = "a.id,a.organzation,a.groupname,a.userfor,a.memo";
|
||||||
|
String sqlFrom = " kq_persongroup a";
|
||||||
|
String sqlWhere = " (delete_type is null or delete_type <> '1') ";
|
||||||
|
String orderby = " id ";
|
||||||
|
String tableString = "";
|
||||||
|
|
||||||
|
if (subcompanyId.length() > 0) {
|
||||||
|
sqlWhere += " and organzation = " + subcompanyId;
|
||||||
|
}
|
||||||
|
if (groupname.length() > 0) {
|
||||||
|
sqlWhere += " and groupname like '%" + groupname + "%' ";
|
||||||
|
}
|
||||||
|
if (userfor.length() > 0) {
|
||||||
|
sqlWhere += " and userfor = " + userfor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String pageId = PageUidFactory.getHrmPageUid("KQPersonGroupList");
|
||||||
|
WeaTable table = new WeaTable();
|
||||||
|
table.setPageID(pageId);
|
||||||
|
table.setPageUID(pageId + "_" + user.getUID());
|
||||||
|
String pageSize = PageIdConst.getPageSize(pageId, user.getUID());
|
||||||
|
table.setPagesize(pageSize);
|
||||||
|
|
||||||
|
table.setBackfields(backFields);
|
||||||
|
table.setSqlform(sqlFrom);
|
||||||
|
table.setSqlwhere(sqlWhere);
|
||||||
|
table.setSqlprimarykey("id");
|
||||||
|
table.setSqlorderby("id");
|
||||||
|
table.getColumns().addAll(tableFields());
|
||||||
|
table.setOperates(getWeaTableOperates());
|
||||||
|
|
||||||
|
//主要用于 显示定制列以及 表格 每页展示记录数选择
|
||||||
|
// String sessionkey = pageUid + "_" + Util.getEncrypt(Util.getRandom());
|
||||||
|
// Util_TableMap.setVal(sessionkey, tableString);
|
||||||
|
// retmap.put("sessionkey", sessionkey);
|
||||||
|
// retmap.put("status", "1");
|
||||||
|
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
result.putAll(table.makeDataResult());
|
||||||
|
result.success();
|
||||||
|
retmap.putAll(result.getResultMap());
|
||||||
|
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
/**ListConversionMethod
|
||||||
|
* 构建表格字段
|
||||||
|
*/
|
||||||
|
private List<WeaTableColumn> tableFields() {
|
||||||
|
return new ArrayList<WeaTableColumn>() {{
|
||||||
|
add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
||||||
|
add(new WeaTableColumn("20%", "所属机构", "organzation"));//所属机构
|
||||||
|
add(new WeaTableColumn("20%", "分组名称", "groupname"));//分组名称
|
||||||
|
add(new WeaTableColumn("20%", "应用场景", "userfor","userfor").setTransmethod("com.engine.jucailin.util.ListConversionMethod.getPersonGroupUserFor").setOtherpara(user.getLanguage()+"").setColumn("userfor"));//应用场景
|
||||||
|
add(new WeaTableColumn("20%", "说明", "memo"));//说明
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置表格右侧操作按钮
|
||||||
|
*/
|
||||||
|
private WeaTableOperates getWeaTableOperates() {
|
||||||
|
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
||||||
|
weaTableOperates.setOperate(new ArrayList<WeaTableOperate>() {{
|
||||||
|
add(new WeaTableOperate(SystemEnv.getHtmlLabelName(91, user.getLanguage()), "javascript:doDel()", "1"));
|
||||||
|
add(new WeaTableOperate(SystemEnv.getHtmlLabelName(83, user.getLanguage()), "javascript:onLog()", "2"));
|
||||||
|
}});
|
||||||
|
return weaTableOperates;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,298 @@
|
|||||||
|
package com.engine.jucailin.cmd.personGroup;
|
||||||
|
|
||||||
|
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 com.api.hrm.bean.HrmFieldBean;
|
||||||
|
import com.api.hrm.bean.SelectOption;
|
||||||
|
import com.api.hrm.bean.WeaRadioGroup;
|
||||||
|
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.hrm.moduledetach.ManageDetachComInfo;
|
||||||
|
import weaver.systeminfo.SystemEnv;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class GetSuitOrganzationFormCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetSuitOrganzationFormCmd(Map<String, Object> params, User user) {
|
||||||
|
this.user = user;
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(CommandContext commandContext) {
|
||||||
|
Map<String, Object> retmap = new HashMap<String, Object>();
|
||||||
|
Map<String,Object> groupitem = null;
|
||||||
|
List<Object> itemlist = null;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
String sql = "";
|
||||||
|
try{
|
||||||
|
//必要的权限判断
|
||||||
|
if(!HrmUserVarify.checkUserRight("HrmKQGroup:Add",user)) {
|
||||||
|
retmap.put("status", "-1");
|
||||||
|
retmap.put("message", SystemEnv.getHtmlLabelName(2012, user.getLanguage()));
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
/*考勤组成员相关id*/
|
||||||
|
String groupmemberId = Util.null2String(params.get("groupmemberId"));
|
||||||
|
String validateFrom = "";
|
||||||
|
String validateTo = "";
|
||||||
|
String type = "";
|
||||||
|
if(!"".equals(groupmemberId)) {
|
||||||
|
String editSql = "select * from kq_groupmember kg where (isDelete is null or isDelete<>1) and id=?";
|
||||||
|
rs.executeQuery(editSql, groupmemberId);
|
||||||
|
if (rs.next()) {
|
||||||
|
validateFrom = Util.null2String(rs.getString("validatefrom"));
|
||||||
|
validateTo = Util.null2String(rs.getString("validateto"));
|
||||||
|
type = Util.null2String(rs.getString("type"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
||||||
|
SearchConditionItem searchConditionItem = null;
|
||||||
|
HrmFieldBean hrmFieldBean = null;
|
||||||
|
itemlist = new ArrayList<Object>();
|
||||||
|
groupitem = new HashMap<String,Object>();
|
||||||
|
//下拉
|
||||||
|
List<Object> condition = new ArrayList<Object>();
|
||||||
|
if("".equals(groupmemberId)) {
|
||||||
|
//类型、对象、成员级别
|
||||||
|
String[] fields = new String[]{"type,63,5,1", "resourceid,106,3,17", "subcompanyid,106,3,164", "departmentid,106,3,4",
|
||||||
|
"jobtitle,106,3,24", "jobtitlelevel,28169,5,1", "jobtitlesubcompany,19437,3,164", "jobtitledepartment,19438,3,4",
|
||||||
|
"seclevel,683,1,scope"};
|
||||||
|
groupitem.put("title", SystemEnv.getHtmlLabelName(1361, Util.getIntValue(user.getLanguage())));
|
||||||
|
groupitem.put("defaultshow", true);
|
||||||
|
for(int i=0;i<fields.length;i++){
|
||||||
|
String[] fieldinfo = fields[i].split(",");
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname(fieldinfo[0]);
|
||||||
|
hrmFieldBean.setFieldlabel(fieldinfo[1]);
|
||||||
|
hrmFieldBean.setFieldhtmltype(fieldinfo[2]);
|
||||||
|
hrmFieldBean.setType(fieldinfo[3]);
|
||||||
|
if(hrmFieldBean.getType().equals("scope")){
|
||||||
|
hrmFieldBean.setIsScope(true);
|
||||||
|
}
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
if(hrmFieldBean.getFieldhtmltype().equals("5")){
|
||||||
|
List<SearchConditionOption> statusOptions = new ArrayList<SearchConditionOption>();
|
||||||
|
if(hrmFieldBean.getFieldname().equals("type")){
|
||||||
|
statusOptions.add(new SearchConditionOption("1",SystemEnv.getHtmlLabelName(179,user.getLanguage()),true));
|
||||||
|
statusOptions.add(new SearchConditionOption("2",SystemEnv.getHtmlLabelName(141,user.getLanguage())));
|
||||||
|
statusOptions.add(new SearchConditionOption("3",SystemEnv.getHtmlLabelName(124,user.getLanguage())));
|
||||||
|
statusOptions.add(new SearchConditionOption("5",SystemEnv.getHtmlLabelName(6086,user.getLanguage())));
|
||||||
|
if(!new ManageDetachComInfo().appDetachDisableAll(user)) {
|
||||||
|
statusOptions.add(new SearchConditionOption("6", SystemEnv.getHtmlLabelName(1340, user.getLanguage())));
|
||||||
|
}
|
||||||
|
searchConditionItem.setOptions(statusOptions);
|
||||||
|
}else if(hrmFieldBean.getFieldname().equals("jobtitlelevel")){
|
||||||
|
statusOptions.add(new SearchConditionOption("1",SystemEnv.getHtmlLabelName(140,user.getLanguage()),true));
|
||||||
|
statusOptions.add(new SearchConditionOption("3",SystemEnv.getHtmlLabelName(19438,user.getLanguage())));
|
||||||
|
statusOptions.add(new SearchConditionOption("2",SystemEnv.getHtmlLabelName(19437,user.getLanguage())));
|
||||||
|
searchConditionItem.setOptions(statusOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
searchConditionItem.setLabelcol(6);
|
||||||
|
if(hrmFieldBean.getFieldname().equals("typevalue")||hrmFieldBean.getFieldname().equals("jobtitle")
|
||||||
|
||hrmFieldBean.getFieldname().equals("subcompanyid") || hrmFieldBean.getFieldname().equals("departmentid")){
|
||||||
|
searchConditionItem.setFieldcol(10);
|
||||||
|
}else{
|
||||||
|
searchConditionItem.setFieldcol(18);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!hrmFieldBean.getFieldname().equals("type")||!hrmFieldBean.getFieldname().equals("seclevel")){
|
||||||
|
searchConditionItem.setViewAttr(3);
|
||||||
|
}
|
||||||
|
if (fieldinfo[2].equals("3") && !"2".equals(fieldinfo[3])) {
|
||||||
|
searchConditionItem.getBrowserConditionParam().setViewAttr(3);
|
||||||
|
searchConditionItem.getBrowserConditionParam().setIsSingle(false);
|
||||||
|
}
|
||||||
|
if(hrmFieldBean.getFieldname().equals("jobtitlesubcompany")||hrmFieldBean.getFieldname().equals("jobtitledepartment")){
|
||||||
|
searchConditionItem.getBrowserConditionParam().setIsSingle(true);
|
||||||
|
}
|
||||||
|
if(hrmFieldBean.getFieldname().equals("seclevel")){
|
||||||
|
List<Object> value1 = new ArrayList<Object>();
|
||||||
|
value1.add(0);
|
||||||
|
value1.add(100);
|
||||||
|
searchConditionItem.setValue(value1);
|
||||||
|
searchConditionItem.setConditionType(ConditionType.INPUT_INTERVAL);
|
||||||
|
}
|
||||||
|
itemlist.add(searchConditionItem);
|
||||||
|
}
|
||||||
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||||
|
searchConditionItem = conditionFactory.createCondition(ConditionType.CHECKBOX, "125963","alllevel",true);
|
||||||
|
itemlist.add(searchConditionItem);
|
||||||
|
|
||||||
|
condition.add(itemlist.get(0));
|
||||||
|
|
||||||
|
List<Object> itemList = validateItemlist(hrmFieldSearchConditionComInfo, validateFrom, validateTo);
|
||||||
|
//人力
|
||||||
|
Map<String,Object> conditionMap = new HashMap<String, Object>();
|
||||||
|
List<Object> conditionlist = new ArrayList<Object>();
|
||||||
|
List<Object> conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(1));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(0));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(1));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionMap.put("1",conditionlist);
|
||||||
|
|
||||||
|
//分部
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(2));
|
||||||
|
//暂不支持包含下级
|
||||||
|
//conditionlist2.add(itemlist.get(11));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(8));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(0));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(1));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionMap.put("2",conditionlist);
|
||||||
|
|
||||||
|
//部门
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(3));
|
||||||
|
//暂不支持包含下级
|
||||||
|
//conditionlist2.add(itemlist.get(11));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(8));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(0));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(1));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionMap.put("3",conditionlist);
|
||||||
|
|
||||||
|
//岗位
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(4));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(5));
|
||||||
|
|
||||||
|
WeaRadioGroup wrg = new WeaRadioGroup();
|
||||||
|
wrg.setLabel(SystemEnv.getHtmlLabelName(28169, user.getLanguage()));
|
||||||
|
List<Object> option = new ArrayList<Object>();
|
||||||
|
Map<String, Object> selectLinkageDatas = new HashMap<String, Object>();
|
||||||
|
selectLinkageDatas.put("2" ,itemlist.get(6));
|
||||||
|
selectLinkageDatas.put("3" ,itemlist.get(7));
|
||||||
|
wrg.setSelectLinkageDatas(selectLinkageDatas);
|
||||||
|
option.add(new SelectOption("1",SystemEnv.getHtmlLabelName(140, user.getLanguage()),true));
|
||||||
|
option.add(new SelectOption("2",SystemEnv.getHtmlLabelName(19437, user.getLanguage())));
|
||||||
|
option.add(new SelectOption("3",SystemEnv.getHtmlLabelName(19438, user.getLanguage())));
|
||||||
|
|
||||||
|
List<String> domkey = new ArrayList<String>();
|
||||||
|
wrg.setOptions(option);
|
||||||
|
wrg.setConditionType("SELECT_LINKAGE");
|
||||||
|
wrg.setFieldcol(18);
|
||||||
|
wrg.setLabelcol(6);
|
||||||
|
domkey.add("jobtitlelevel");
|
||||||
|
wrg.setDomkey(domkey);
|
||||||
|
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(wrg);
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(8));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(0));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(1));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionMap.put("5",conditionlist);
|
||||||
|
|
||||||
|
//所有人
|
||||||
|
conditionlist = new ArrayList<Object>();
|
||||||
|
conditionlist2 = new ArrayList<Object>();
|
||||||
|
conditionlist2.add(itemlist.get(8));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(0));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionlist2 = new ArrayList<>();
|
||||||
|
conditionlist2.add(itemList.get(1));
|
||||||
|
conditionlist.add(conditionlist2);
|
||||||
|
conditionMap.put("6",conditionlist);
|
||||||
|
|
||||||
|
condition.add(conditionMap);
|
||||||
|
} else {
|
||||||
|
List<Object> itemList = validateItemlist(hrmFieldSearchConditionComInfo, validateFrom, validateTo);
|
||||||
|
condition.add(itemList.get(0));
|
||||||
|
condition.add(itemList.get(1));
|
||||||
|
}
|
||||||
|
retmap.put("conditions", condition);
|
||||||
|
retmap.put("status", "1");
|
||||||
|
retmap.put("type", type);
|
||||||
|
}catch (Exception e) {
|
||||||
|
retmap.put("status", "-1");
|
||||||
|
retmap.put("message", SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
|
||||||
|
writeLog(e);
|
||||||
|
}
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Object> validateItemlist(HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo, String validateFromDate, String validateToDate) {
|
||||||
|
List<Object> itemlist = new ArrayList<>();
|
||||||
|
HrmFieldBean hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("validateFromDate");//开始日期
|
||||||
|
hrmFieldBean.setFieldlabel("19548");
|
||||||
|
hrmFieldBean.setFieldhtmltype("3");
|
||||||
|
hrmFieldBean.setType("2");
|
||||||
|
hrmFieldBean.setFieldvalue(validateFromDate);
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(2);
|
||||||
|
hrmFieldBean.setTip(SystemEnv.getHtmlLabelName(546201,user.getLanguage()));
|
||||||
|
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
itemlist.add(searchConditionItem);
|
||||||
|
|
||||||
|
hrmFieldBean = new HrmFieldBean();
|
||||||
|
hrmFieldBean.setFieldname("validateToDate");//结束日期
|
||||||
|
hrmFieldBean.setFieldlabel("19547");
|
||||||
|
hrmFieldBean.setFieldhtmltype("3");
|
||||||
|
hrmFieldBean.setType("2");
|
||||||
|
hrmFieldBean.setFieldvalue(validateToDate);
|
||||||
|
hrmFieldBean.setIsFormField(true);
|
||||||
|
hrmFieldBean.setViewAttr(2);
|
||||||
|
hrmFieldBean.setTip(SystemEnv.getHtmlLabelName(546202,user.getLanguage()));
|
||||||
|
searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||||
|
itemlist.add(searchConditionItem);
|
||||||
|
|
||||||
|
return itemlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BizLogContext getLogContext() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,164 @@
|
|||||||
|
package com.engine.jucailin.cmd.personGroup;
|
||||||
|
|
||||||
|
import com.cloudstore.dev.api.util.Util_TableMap;
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.jucailin.util.Constant;
|
||||||
|
import com.engine.kq.util.PageUidFactory;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.hrm.moduledetach.ManageDetachComInfo;
|
||||||
|
import weaver.systeminfo.SystemEnv;
|
||||||
|
import weaver.systeminfo.systemright.CheckSubCompanyRight;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class GetSuitOrganzationListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
|
||||||
|
public GetSuitOrganzationListCmd(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>();
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
try {
|
||||||
|
if(!HrmUserVarify.checkUserRight("HrmKQGroup:Add",user)) {
|
||||||
|
retmap.put("status", "-1");
|
||||||
|
retmap.put("message", SystemEnv.getHtmlLabelName(2012, user.getLanguage()));
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
//String groupId = Util.null2String(params.get("groupId"));
|
||||||
|
// String subcompanyId = new KQGroupComInfo().getSubcompanyid(groupId);
|
||||||
|
CheckSubCompanyRight checkSubCompanyRight = new CheckSubCompanyRight();
|
||||||
|
ManageDetachComInfo manageDetachComInfo = new ManageDetachComInfo();
|
||||||
|
boolean hrmdetachable = manageDetachComInfo.isUseHrmManageDetach();//是否开启了人力资源模块的管理分权
|
||||||
|
//int operatelevel = -1;
|
||||||
|
int operatelevel = 2;
|
||||||
|
// if(hrmdetachable) {
|
||||||
|
// operatelevel = checkSubCompanyRight.ChkComRightByUserRightCompanyId(user.getUID(), "HrmKQGroup:Add", Util.getIntValue(subcompanyId, -1));
|
||||||
|
// }else{
|
||||||
|
// operatelevel = 2;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if(user.getUID() == 1){
|
||||||
|
// operatelevel = 2;
|
||||||
|
// }
|
||||||
|
|
||||||
|
String billid = Util.null2String(params.get("billid"));
|
||||||
|
String tableName = Util.null2String(params.get("tableName"));
|
||||||
|
String modeId = Constant.modeToTable.get(tableName);
|
||||||
|
|
||||||
|
String hrmName = Util.null2String(params.get("hrmName"));
|
||||||
|
String hrmJobtitle = Util.null2String(params.get("hrmJobtitle"));
|
||||||
|
String hrmSubcompany = Util.null2String(params.get("hrmSubcompany"));
|
||||||
|
String department = Util.null2String(params.get("department"));
|
||||||
|
|
||||||
|
String validateFromDate = Util.null2String(params.get("validateFromDate"));
|
||||||
|
String validateToDate = Util.null2String(params.get("validateToDate"));
|
||||||
|
|
||||||
|
String backfields = " * ";
|
||||||
|
String fromSql = " kq_groupmember_"+modeId+" a ";
|
||||||
|
String sqlWhere = " (delete_type is null "+(rs.getDBType().equals("oracle") ? "" : " or delete_type=0")+") ";
|
||||||
|
String orderby = " a.id asc " ;
|
||||||
|
|
||||||
|
if (billid.length() > 0){
|
||||||
|
sqlWhere += " and dataid="+billid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hrmName.length() > 0 ){
|
||||||
|
sqlWhere += " and ( exists ( select 1 from hrmresource where a.typevalue=id and a.membertype=1 and lastname like '%"+hrmName+"%') " +
|
||||||
|
" or exists ( select 1 from hrmjobtitles where a.typevalue=id and a.membertype=5 and jobtitlename like '%"+hrmName+"%')" +
|
||||||
|
" or exists ( select 1 from hrmsubcompany where a.typevalue=id and a.membertype=2 and subcompanyname like '%"+hrmName+"%')" +
|
||||||
|
" or exists ( select 1 from hrmdepartment where a.typevalue=id and a.membertype=3 and departmentname like '%"+hrmName+"%')) ";
|
||||||
|
|
||||||
|
}
|
||||||
|
if(hrmJobtitle.length() > 0){
|
||||||
|
sqlWhere += " and a.membertype=5 and a.typevalue = "+hrmJobtitle;
|
||||||
|
}
|
||||||
|
if(hrmSubcompany.length() > 0){
|
||||||
|
sqlWhere += " and a.membertype=2 and a.typevalue = "+hrmSubcompany;
|
||||||
|
}
|
||||||
|
if(department.length() >0){
|
||||||
|
sqlWhere += " and a.membertype=3 and a.typevalue = "+department ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(validateFromDate.length() >0){
|
||||||
|
if(rs.getDBType().equalsIgnoreCase("oracle")) {
|
||||||
|
sqlWhere += " and ('"+validateFromDate+"' between nvl(a.validatefrom,'2000-01-01') and nvl(a.validateto,'2999-12-31')) ";
|
||||||
|
}else if((rs.getDBType()).equalsIgnoreCase("mysql")){
|
||||||
|
sqlWhere += " and ('"+validateFromDate+"' between ifnull(a.validatefrom,'2000-01-01') and ifnull(a.validateto,'2999-12-31')) ";
|
||||||
|
}else {
|
||||||
|
sqlWhere += " and ('"+validateFromDate+"' between isnull(a.validatefrom,'2000-01-01') and isnull(a.validateto,'2999-12-31')) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(validateToDate.length() >0){
|
||||||
|
if(rs.getDBType().equalsIgnoreCase("oracle")) {
|
||||||
|
sqlWhere += " and ('"+validateToDate+"' between nvl(a.validatefrom,'2000-01-01') and nvl(a.validateto,'2999-12-31')) ";
|
||||||
|
}else if((rs.getDBType()).equalsIgnoreCase("mysql")){
|
||||||
|
sqlWhere += " and ('"+validateToDate+"' between ifnull(a.validatefrom,'2000-01-01') and ifnull(a.validateto,'2999-12-31')) ";
|
||||||
|
}else {
|
||||||
|
sqlWhere += " and ('"+validateToDate+"' between isnull(a.validatefrom,'2000-01-01') and isnull(a.validateto,'2999-12-31')) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String pageUid = PageUidFactory.getHrmPageUid("KQGroupMembersSearchList");
|
||||||
|
|
||||||
|
String operateString= "<operates width=\"20%\">";
|
||||||
|
// operateString+=" <popedom transmethod=\"com.engine.kq.util.TransMethod.getGroupMembersOperate\" otherpara=\""+groupId+"\"></popedom> ";
|
||||||
|
//operateString+=" <operate href=\"javascript:doEdit();\" text=\""+SystemEnv.getHtmlLabelName(93,user.getLanguage())+"\" index=\"0\"/>";
|
||||||
|
if(operatelevel > 1) {
|
||||||
|
operateString += " <operate href=\"javascript:doDel();\" text=\"" + SystemEnv.getHtmlLabelName(91, user.getLanguage()) + "\" index=\"0\"/>";
|
||||||
|
}
|
||||||
|
operateString+=" <operate href=\"javascript:doEdit();\" text=\""+SystemEnv.getHtmlLabelName(93,user.getLanguage())+"\" index=\"1\"/>";
|
||||||
|
operateString+="</operates>";
|
||||||
|
String tableString =" <table pageUid=\""+pageUid+"\" pagesize=\"10\" tabletype=\"checkbox\">"+
|
||||||
|
" <sql backfields=\""+backfields+"\" sqlform=\""+fromSql+"\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlWhere)+"\" sqlorderby=\""+orderby+"\" sqlprimarykey=\"a.id\" sqlsortway=\"desc\" sqlisdistinct=\"\"/>"+
|
||||||
|
// " <checkboxpopedom showmethod=\"com.engine.kq.util.TransMethod.getKQGroupMembersCheckbox\" id=\"checkbox\" popedompara=\"column:id+"+groupId+"\" />"+
|
||||||
|
operateString+
|
||||||
|
" <head>"+
|
||||||
|
" <col width=\"0%\" hide=\"true\" text=\"\" column=\"id\"/>"+
|
||||||
|
" <col width=\"25%\" text=\""+SystemEnv.getHtmlLabelName(21956,user.getLanguage())+"\" column=\"membertype\" orderkey=\"membertype\" transmethod=\"com.engine.hrm.util.HrmTransMethod.getResourceType\" otherpara=\""+user.getLanguage()+"\"/>"+
|
||||||
|
" <col width=\"30%\" text=\""+SystemEnv.getHtmlLabelName(106,user.getLanguage())+"\" column=\"typevalue\" orderkey=\"typevalue\" transmethod=\"com.engine.hrm.util.HrmTransMethod.getResourceName\" otherpara=\"column:membertype+column:alllevel+"+user.getLanguage()+"+column:jobtitlelevel+column:jobtitlelevelvalue\" />"+
|
||||||
|
" <col width=\"25%\" text=\""+SystemEnv.getHtmlLabelName(683,user.getLanguage())+"\" column=\"seclevel\" orderkey=\"seclevel\" transmethod=\"com.engine.hrm.util.HrmTransMethod.getSecLevel\" otherpara=\"column:seclevelto\"/>"+
|
||||||
|
" <col width=\"25%\" text=\""+SystemEnv.getHtmlLabelName(19548,user.getLanguage())+"\" column=\"validatefrom\" orderkey=\"validatefrom\"/>"+
|
||||||
|
" <col width=\"25%\" text=\""+SystemEnv.getHtmlLabelName(19547,user.getLanguage())+"\" column=\"validateto\" orderkey=\"validateto\"/>"+
|
||||||
|
" </head>"+
|
||||||
|
" </table>";
|
||||||
|
|
||||||
|
//主要用于 显示定制列以及 表格 每页展示记录数选择
|
||||||
|
String sessionkey = pageUid + "_" + Util.getEncrypt(Util.getRandom());
|
||||||
|
Util_TableMap.setVal(sessionkey, tableString);
|
||||||
|
retmap.put("sessionkey", sessionkey);
|
||||||
|
retmap.put("status", "1");
|
||||||
|
if(operatelevel > 0){
|
||||||
|
retmap.put("canAdd", true);
|
||||||
|
}else{
|
||||||
|
retmap.put("canAdd", false);
|
||||||
|
}
|
||||||
|
if(operatelevel > 1){
|
||||||
|
retmap.put("canDel", true);
|
||||||
|
}else{
|
||||||
|
retmap.put("canDel", false);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
retmap.put("status", "-1");
|
||||||
|
retmap.put("message", SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
|
||||||
|
writeLog(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.engine.jucailin.enums;
|
||||||
|
|
||||||
|
import com.finance.toolkit.BaseEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调整起算日期
|
||||||
|
*/
|
||||||
|
public enum FieldHtmlTypeEnum implements BaseEnum {
|
||||||
|
INPUT("1","单行文本框"),
|
||||||
|
TEXTAREA("2","多行文本框"),
|
||||||
|
BROWSER("3","浏览按钮"),
|
||||||
|
CHECKBOX("4","Check框"),
|
||||||
|
SELECT("5","选择框"),
|
||||||
|
UPLOAD("6","附件"),
|
||||||
|
COLORPICKER("7","颜色选择"),
|
||||||
|
DESCRIPTION("8","描述类型");
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
FieldHtmlTypeEnum(String key, String value){
|
||||||
|
this.key=key;
|
||||||
|
this.value=value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getKey() {
|
||||||
|
return this.key;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.engine.jucailin.exception;
|
||||||
|
|
||||||
|
public class AttendanceRunTimeException extends RuntimeException {
|
||||||
|
public AttendanceRunTimeException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AttendanceRunTimeException(Throwable cause) {
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AttendanceRunTimeException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.engine.jucailin.exception;
|
||||||
|
|
||||||
|
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 "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
|||||||
|
package com.engine.jucailin.genid;
|
||||||
|
|
||||||
|
import java.net.Inet4Address;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.NetworkInterface;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class DefaultWorker implements Worker{
|
||||||
|
private Random random = new Random();
|
||||||
|
|
||||||
|
public DefaultWorker() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getWorkerId() {
|
||||||
|
int max = 100000;
|
||||||
|
int min = 10000;
|
||||||
|
int s = this.random.nextInt(max) % (max - min + 1) + min;
|
||||||
|
String ip = this.getHostIp();
|
||||||
|
long workerId = 0L;
|
||||||
|
if (ip != null) {
|
||||||
|
String str = ip.replaceAll("\\.", "") + s;
|
||||||
|
workerId = Long.parseLong(str);
|
||||||
|
workerId %= 1024L;
|
||||||
|
}
|
||||||
|
|
||||||
|
return workerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getHostIp() {
|
||||||
|
try {
|
||||||
|
Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||||
|
|
||||||
|
while(allNetInterfaces.hasMoreElements()) {
|
||||||
|
NetworkInterface netInterface = (NetworkInterface)allNetInterfaces.nextElement();
|
||||||
|
Enumeration<InetAddress> addresses = netInterface.getInetAddresses();
|
||||||
|
|
||||||
|
while(addresses.hasMoreElements()) {
|
||||||
|
InetAddress ip = (InetAddress)addresses.nextElement();
|
||||||
|
if (ip != null && ip instanceof Inet4Address
|
||||||
|
&& !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == -1) {
|
||||||
|
return ip.getHostAddress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception var5) {
|
||||||
|
var5.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return "127.0.0.1";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.engine.jucailin.genid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id生成器
|
||||||
|
*/
|
||||||
|
public class IdGenerator {
|
||||||
|
|
||||||
|
public static long generate() {
|
||||||
|
SnowflakeId snowflakeId = new SnowflakeId();
|
||||||
|
return snowflakeId.get();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package com.engine.jucailin.genid;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class SnowflakeId {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SnowflakeId.class);
|
||||||
|
private Worker worker;
|
||||||
|
private long startTime = this._curSecond();
|
||||||
|
private long time;
|
||||||
|
private long segment = 0L;
|
||||||
|
private long workerId = this.getWorker().getWorkerId();
|
||||||
|
private long sequence = 0L;
|
||||||
|
private static final long segmentBits = 9L;
|
||||||
|
private static final long workerIdBits = 10L;
|
||||||
|
private static final long sequenceBits = 13L;
|
||||||
|
private static final long timestampShift = 32L;
|
||||||
|
private static final long segmentShift = 23L;
|
||||||
|
private static final long workerIdShift = 13L;
|
||||||
|
private static final long sequenceMask = 8191L;
|
||||||
|
private static final long maxSegment = 511L;
|
||||||
|
private long twepoch = 1483200000L;
|
||||||
|
private long _counter = 0L;
|
||||||
|
|
||||||
|
public SnowflakeId() {
|
||||||
|
this.time = this.startTime - this.twepoch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Worker getWorker() {
|
||||||
|
return (Worker)(this.worker == null ? new DefaultWorker() : this.worker);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorker(Worker worker) {
|
||||||
|
this.worker = worker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized long get() {
|
||||||
|
long id = this.getNextId();
|
||||||
|
this.testSpeedLimit();
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized long[] getRangeId(int sizeOfIds) {
|
||||||
|
long[] r = new long[]{this.getNextId(), 0L};
|
||||||
|
this.sequence = this.sequence + (long)sizeOfIds - 1L - 1L;
|
||||||
|
this._counter = this._counter + (long)sizeOfIds - 1L - 1L;
|
||||||
|
if (this.sequence >> 13 > 0L) {
|
||||||
|
this.sequence &= 8191L;
|
||||||
|
if (this.segment >= 511L) {
|
||||||
|
++this.time;
|
||||||
|
this.segment = 0L;
|
||||||
|
} else {
|
||||||
|
++this.segment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
r[1] = this.getNextId();
|
||||||
|
this.testSpeedLimit();
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getNextId() {
|
||||||
|
++this.sequence;
|
||||||
|
++this._counter;
|
||||||
|
if (this.sequence >> 13 > 0L) {
|
||||||
|
if (this.segment >= 511L) {
|
||||||
|
++this.time;
|
||||||
|
} else {
|
||||||
|
this.sequence = 0L;
|
||||||
|
++this.segment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.time << 32 | this.segment << 23 | this.workerId << 13 | this.sequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long _curSecond() {
|
||||||
|
return System.currentTimeMillis() / 1000L;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void testSpeedLimit() {
|
||||||
|
long spentTime = this._curSecond() - this.startTime + 1L;
|
||||||
|
if (spentTime <= 0L || spentTime << 22 <= this._counter) {
|
||||||
|
try {
|
||||||
|
this.wait(10L);
|
||||||
|
this.testSpeedLimit();
|
||||||
|
} catch (Exception var4) {
|
||||||
|
logger.error(var4.getMessage(), var4);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package com.engine.jucailin.genid;
|
||||||
|
|
||||||
|
public interface Worker {
|
||||||
|
long getWorkerId();
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package com.engine.jucailin.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface KQCalendarSettingService {
|
||||||
|
Map<String, Object> getCalendarSettingList(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> getCalendarSettingForm(Map<String, Object> params);
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.engine.jucailin.service;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface KQCommonService {
|
||||||
|
Map<String,Object> saveKQData(Map<String,Object> param);
|
||||||
|
|
||||||
|
Map<String,Object> doQueryCommon(Map<String,Object> param);
|
||||||
|
|
||||||
|
Map<String,Object> delCommon(Map<String,Object> param);
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.engine.jucailin.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface KQCycleSettingService {
|
||||||
|
Map<String, Object> getCycleSettingList(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> getCycleSettingTree(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> getCycleSettingForm(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> getCycleList(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> getCycleForm(Map<String, Object> params);
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.engine.jucailin.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface KQPersonGroupService {
|
||||||
|
Map<String, Object> getPersonGroupList(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> getSuitOrganzationList(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> getSuitOrganzationForm(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> saveSuitOrganzation(Map<String, Object> params);
|
||||||
|
|
||||||
|
Map<String, Object> delSuitOrganzation(Map<String, Object> params);
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.engine.jucailin.service.impl;
|
||||||
|
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.jucailin.cmd.calendar.GetCalendarSettingFormCmd;
|
||||||
|
import com.engine.jucailin.cmd.calendar.GetCalendarSettingListCmd;
|
||||||
|
import com.engine.jucailin.service.KQCalendarSettingService;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: sy
|
||||||
|
* @Description: 日历设置实现类
|
||||||
|
* @Date: 2024/2/27
|
||||||
|
**/
|
||||||
|
public class KQCalendarSettingServiceImpl extends Service implements KQCalendarSettingService {
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getCalendarSettingList(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetCalendarSettingListCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getCalendarSettingForm(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetCalendarSettingFormCmd(params,user));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.engine.jucailin.service.impl;
|
||||||
|
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.jucailin.cmd.cycle.*;
|
||||||
|
import com.engine.jucailin.service.KQCycleSettingService;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class KQCycleSettingServiceImpl extends Service implements KQCycleSettingService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getCycleSettingList(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetCycleSettingListCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getCycleSettingTree(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetCycleSettingTreeCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getCycleList(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetCycleListCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getCycleSettingForm(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetCycleSettingFormCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getCycleForm(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetCycleFormCmd(params,user));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.engine.jucailin.service.impl;
|
||||||
|
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.jucailin.cmd.common.DeleteDataCommonCmd;
|
||||||
|
import com.engine.jucailin.cmd.personGroup.GetPersonGroupListCmd;
|
||||||
|
import com.engine.jucailin.cmd.personGroup.GetSuitOrganzationFormCmd;
|
||||||
|
import com.engine.jucailin.cmd.personGroup.GetSuitOrganzationListCmd;
|
||||||
|
import com.engine.jucailin.cmd.personGroup.SaveSuitOrganzationCmd;
|
||||||
|
import com.engine.jucailin.service.KQPersonGroupService;
|
||||||
|
import com.engine.jucailin.util.Constant;
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class KQPersonGroupServiceImpl extends Service implements KQPersonGroupService {
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getPersonGroupList(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetPersonGroupListCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getSuitOrganzationList(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetSuitOrganzationListCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getSuitOrganzationForm(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new GetSuitOrganzationFormCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> saveSuitOrganzation(Map<String, Object> params) {
|
||||||
|
return commandExecutor.execute(new SaveSuitOrganzationCmd(params,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> delSuitOrganzation(Map<String, Object> params) {
|
||||||
|
String tableName = Util.null2String(params.get("tableName"));
|
||||||
|
String modeid = Constant.modeToTable.get(tableName);
|
||||||
|
String memberTableName = "kq_groupmember_"+modeid;
|
||||||
|
params.put("tableName",memberTableName);
|
||||||
|
return commandExecutor.execute(new DeleteDataCommonCmd(params,user));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,311 @@
|
|||||||
|
package com.engine.jucailin.util;
|
||||||
|
|
||||||
|
import com.engine.kq.log.KQLog;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.reflect.TypeToken;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import weaver.general.BaseBean;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileFilter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.net.JarURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.jar.JarEntry;
|
||||||
|
import java.util.jar.JarFile;
|
||||||
|
|
||||||
|
|
||||||
|
public class CommonUtil<T> {
|
||||||
|
public static KQLog log = new KQLog();
|
||||||
|
public static Gson gson = new Gson();
|
||||||
|
public static Type list_map_type = new TypeToken<List<Map<String,String>>>(){}.getType();
|
||||||
|
public static Type map_type = new TypeToken<Map<String,Object>>(){}.getType();
|
||||||
|
public static BaseBean baseBean = new BaseBean();
|
||||||
|
/**
|
||||||
|
* 组装insert的sql语句
|
||||||
|
* @param tableName 表名
|
||||||
|
* @param map 列名及对应值
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String makeInsertSql(String tableName, Map<String,Object> map,User user){
|
||||||
|
fillSaveData(map,user);
|
||||||
|
String insertSql = "insert into "+tableName;
|
||||||
|
String key = "(";
|
||||||
|
String value = "(";
|
||||||
|
for (Map.Entry<String,Object> e : map.entrySet()){
|
||||||
|
key = key + e.getKey() +",";
|
||||||
|
value = value + "'"+e.getValue()+"'" +",";
|
||||||
|
}
|
||||||
|
key = key.substring(0,key.length()-1) + ")";
|
||||||
|
value = value.substring(0,value.length()-1)+")";
|
||||||
|
insertSql = insertSql + key +" values "+value;
|
||||||
|
log.info("makeInsertSql : "+insertSql);
|
||||||
|
return insertSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组装update的sql语句
|
||||||
|
* @param tableName 表名
|
||||||
|
* @param map 列名及对应值
|
||||||
|
* @param condition 条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String makeUpdateSql(String tableName, Map<String,Object> map,Map<String,Object> condition){
|
||||||
|
fillUpdateData(map);
|
||||||
|
String updateSql = "update "+tableName+" set ";
|
||||||
|
for (Map.Entry<String,Object> e : map.entrySet()){
|
||||||
|
if (e.getValue() !=null && !"".equals(e.getValue())){
|
||||||
|
updateSql = updateSql + e.getKey()+"='"+e.getValue().toString()+"',";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateSql = updateSql.substring(0,updateSql.length()-1) + " where 1=1";
|
||||||
|
for (Map.Entry<String,Object> e : condition.entrySet()){
|
||||||
|
updateSql = updateSql + " and "+ e.getKey()+"='"+e.getValue()+"'";
|
||||||
|
}
|
||||||
|
log.info("makeUpdateSql : "+updateSql);
|
||||||
|
|
||||||
|
return updateSql;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填充插入数据库固定字段数据
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static void fillSaveData(Map<String,Object> data, User user){
|
||||||
|
data.put("create_time", DateUtil.getCurrentTime());
|
||||||
|
data.put("update_time", DateUtil.getCurrentTime());
|
||||||
|
data.put("creator",user.getUID());
|
||||||
|
data.put("delete_type","0");
|
||||||
|
data.put("tenant_key","jucailin");
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 填充更新数据库固定字段数据
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static void fillUpdateData(Map<String,Object> data){
|
||||||
|
data.put("update_time", DateUtil.getCurrentTime());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量查出
|
||||||
|
* @param dataList
|
||||||
|
* @param tableName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean insertBatch(List<Map<String,Object>> dataList, String tableName){
|
||||||
|
String sql = "insert into "+tableName;
|
||||||
|
String key = "(";
|
||||||
|
String value = "(";
|
||||||
|
for (Map.Entry<String,Object> data : dataList.get(0).entrySet()){
|
||||||
|
key = key + data.getKey() +",";
|
||||||
|
value = value + "?,";
|
||||||
|
}
|
||||||
|
key = key.substring(0,key.length()-1) + ")";
|
||||||
|
value = value.substring(0,value.length()-1)+")";
|
||||||
|
sql = sql + key +" values "+value;
|
||||||
|
log.info("insertBatch sql :"+sql);
|
||||||
|
List<List> insertDataList = Lists.newArrayList();
|
||||||
|
for (Map<String,Object> dataMap : dataList){
|
||||||
|
ArrayList<Object> list = new ArrayList<>();
|
||||||
|
for (Map.Entry<String,Object> entry : dataMap.entrySet()){
|
||||||
|
list.add(entry.getValue());
|
||||||
|
}
|
||||||
|
insertDataList.add(list);
|
||||||
|
}
|
||||||
|
log.info(insertDataList);
|
||||||
|
return DbTools.updateBatch(sql,insertDataList);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 解析格式为[{a:b,c:d}]格式的json
|
||||||
|
* @param json
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Map<String,String>> resolveList_Map(String json){
|
||||||
|
List<Map<String,String>> list= gson.fromJson(json,list_map_type);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 解析格式为{a:b,c:d}格式的json
|
||||||
|
* @param json
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String,Object> resolveMap(String json){
|
||||||
|
Map<String,Object> list= gson.fromJson(json,map_type);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过接口名取得某个接口下所有实现这个接口的类
|
||||||
|
*/
|
||||||
|
public List<T> getAllClassByInterface(Class<?> c) {
|
||||||
|
List<T> returnClassList = null;
|
||||||
|
if (c.isInterface()) {
|
||||||
|
try {
|
||||||
|
// 获取当前的包名
|
||||||
|
String packageName = c.getPackage().getName();
|
||||||
|
// 获取当前包下以及子包下所以的类
|
||||||
|
List<Class<?>> allClass = getClasses(packageName);
|
||||||
|
if (allClass != null) {
|
||||||
|
returnClassList = new ArrayList();
|
||||||
|
for (Class<?> cls : allClass) {
|
||||||
|
// 判断是否是同一个接口
|
||||||
|
if (c.isAssignableFrom(cls)) {
|
||||||
|
// 本身不加入进去
|
||||||
|
if (!c.equals(cls)) {
|
||||||
|
returnClassList.add((T)cls.newInstance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
baseBean.writeLog(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnClassList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从包package中获取所有的Class
|
||||||
|
*
|
||||||
|
* @param packageName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public static List<Class<?>> getClasses(String packageName) {
|
||||||
|
// 第一个class类的集合
|
||||||
|
List<Class<?>> classes = new ArrayList<Class<?>>();
|
||||||
|
// 是否循环迭代
|
||||||
|
boolean recursive = true;
|
||||||
|
// 获取包的名字 并进行替换
|
||||||
|
String packageDirName = packageName.replace('.', '/');
|
||||||
|
// 定义一个枚举的集合 并进行循环来处理这个目录下的things
|
||||||
|
Enumeration<URL> dirs;
|
||||||
|
try {
|
||||||
|
dirs = Thread.currentThread().getContextClassLoader().getResources(packageDirName);
|
||||||
|
// 循环迭代下去
|
||||||
|
while (dirs.hasMoreElements()) {
|
||||||
|
// 获取下一个元素
|
||||||
|
URL url = dirs.nextElement();
|
||||||
|
// 得到协议的名称
|
||||||
|
String protocol = url.getProtocol();
|
||||||
|
// 如果是以文件的形式保存在服务器上
|
||||||
|
if ("file".equals(protocol)) {
|
||||||
|
// 获取包的物理路径
|
||||||
|
String filePath = URLDecoder.decode(url.getFile(), "UTF-8");
|
||||||
|
// 以文件的方式扫描整个包下的文件 并添加到集合中
|
||||||
|
findAndAddClassesInPackageByFile(packageName, filePath, recursive, classes);
|
||||||
|
} else if ("jar".equals(protocol)) {
|
||||||
|
// 如果是jar包文件
|
||||||
|
// 定义一个JarFile
|
||||||
|
JarFile jar;
|
||||||
|
try {
|
||||||
|
// 获取jar
|
||||||
|
jar = ((JarURLConnection) url.openConnection()).getJarFile();
|
||||||
|
// 从此jar包 得到一个枚举类
|
||||||
|
Enumeration<JarEntry> entries = jar.entries();
|
||||||
|
// 同样的进行循环迭代
|
||||||
|
while (entries.hasMoreElements()) {
|
||||||
|
// 获取jar里的一个实体 可以是目录 和一些jar包里的其他文件 如META-INF等文件
|
||||||
|
JarEntry entry = entries.nextElement();
|
||||||
|
String name = entry.getName();
|
||||||
|
// 如果是以/开头的
|
||||||
|
if (name.charAt(0) == '/') {
|
||||||
|
// 获取后面的字符串
|
||||||
|
name = name.substring(1);
|
||||||
|
}
|
||||||
|
// 如果前半部分和定义的包名相同
|
||||||
|
if (name.startsWith(packageDirName)) {
|
||||||
|
int idx = name.lastIndexOf('/');
|
||||||
|
// 如果以"/"结尾 是一个包
|
||||||
|
if (idx != -1) {
|
||||||
|
// 获取包名 把"/"替换成"."
|
||||||
|
packageName = name.substring(0, idx).replace('/', '.');
|
||||||
|
}
|
||||||
|
// 如果可以迭代下去 并且是一个包
|
||||||
|
if ((idx != -1) || recursive) {
|
||||||
|
// 如果是一个.class文件 而且不是目录
|
||||||
|
if (name.endsWith(".class") && !entry.isDirectory()) {
|
||||||
|
// 去掉后面的".class" 获取真正的类名
|
||||||
|
String className = name.substring(packageName.length() + 1, name.length() - 6);
|
||||||
|
try {
|
||||||
|
// 添加到classes
|
||||||
|
classes.add(Class.forName(packageName + '.' + className));
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
baseBean.writeLog(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
baseBean.writeLog(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
baseBean.writeLog(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return classes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以文件的形式来获取包下的所有Class
|
||||||
|
*
|
||||||
|
* @param packageName
|
||||||
|
* @param packagePath
|
||||||
|
* @param recursive
|
||||||
|
* @param classes
|
||||||
|
*/
|
||||||
|
public static void findAndAddClassesInPackageByFile(String packageName, String packagePath, final boolean recursive, List<Class<?>> classes) {
|
||||||
|
// 获取此包的目录 建立一个File
|
||||||
|
File dir = new File(packagePath);
|
||||||
|
// 如果不存在或者 也不是目录就直接返回
|
||||||
|
if (!dir.exists() || !dir.isDirectory()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 如果存在 就获取包下的所有文件 包括目录
|
||||||
|
File[] dirfiles = dir.listFiles(new FileFilter() {
|
||||||
|
// 自定义过滤规则 如果可以循环(包含子目录) 或则是以.class结尾的文件(编译好的java类文件)
|
||||||
|
@Override
|
||||||
|
public boolean accept(File file) {
|
||||||
|
return (recursive && file.isDirectory()) || (file.getName().endsWith(".class"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 循环所有文件
|
||||||
|
for (File file : dirfiles) {
|
||||||
|
// 如果是目录 则继续扫描
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
findAndAddClassesInPackageByFile(packageName + "." + file.getName(), file.getAbsolutePath(), recursive, classes);
|
||||||
|
} else {
|
||||||
|
// 如果是java类文件 去掉后面的.class 只留下类名
|
||||||
|
String className = file.getName().substring(0, file.getName().length() - 6);
|
||||||
|
try {
|
||||||
|
// 添加到集合中去
|
||||||
|
classes.add(Class.forName(packageName + '.' + className));
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
baseBean.writeLog(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.engine.jucailin.util;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class Constant {
|
||||||
|
|
||||||
|
public static final Map<String,String> modeToTable = new HashMap(){{
|
||||||
|
//周期设置表
|
||||||
|
put("kq_cycle_setting","1");
|
||||||
|
}};
|
||||||
|
}
|
@ -0,0 +1,248 @@
|
|||||||
|
package com.engine.jucailin.util;
|
||||||
|
|
||||||
|
import weaver.general.TimeUtil;
|
||||||
|
|
||||||
|
import java.time.*;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
public class DateUtil {
|
||||||
|
public static DateTimeFormatter yyyyMMdd = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
public static DateTimeFormatter yyyyMMddHHmmss = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
public static DateTimeFormatter yyyyMMddHHmm = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
|
||||||
|
public static DateTimeFormatter yyyyMM = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||||
|
public static DateTimeFormatter yyyy = DateTimeFormatter.ofPattern("yyyy");
|
||||||
|
|
||||||
|
public static String beforeMonth(String time,int month){
|
||||||
|
LocalDateTime localDateTime = DateUtil.getTime(time);
|
||||||
|
return localDateTime.minusMonths(month).format(yyyyMMdd);
|
||||||
|
}
|
||||||
|
public static String lastMonth(String time){
|
||||||
|
LocalDateTime localDateTime = DateUtil.getTime(time);
|
||||||
|
|
||||||
|
return localDateTime.plusMonths(1).format(yyyyMM);
|
||||||
|
}
|
||||||
|
public static String lastMonth(String time,DateTimeFormatter dateTimeFormatter){
|
||||||
|
LocalDateTime localDateTime = DateUtil.getTime(time);
|
||||||
|
|
||||||
|
return localDateTime.plusMonths(1).format(dateTimeFormatter);
|
||||||
|
}
|
||||||
|
public static String nextMonth(String time,int month,DateTimeFormatter dateTimeFormatter){
|
||||||
|
LocalDateTime localDateTime = DateUtil.getTime(time);
|
||||||
|
|
||||||
|
return localDateTime.plusMonths(month).format(dateTimeFormatter);
|
||||||
|
}
|
||||||
|
public static String nextYear(String time,int year,DateTimeFormatter dateTimeFormatter){
|
||||||
|
LocalDateTime localDateTime = DateUtil.getTime(time);
|
||||||
|
|
||||||
|
return localDateTime.plusYears(year).format(dateTimeFormatter);
|
||||||
|
}
|
||||||
|
public static String beforeYear(String time,int year,DateTimeFormatter dateTimeFormatter){
|
||||||
|
LocalDateTime localDateTime = DateUtil.getTime(time);
|
||||||
|
|
||||||
|
return localDateTime.minusYears(year).format(dateTimeFormatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String beforeDay(String time,long day){
|
||||||
|
LocalDateTime localDateTime = LocalDate.parse(time, yyyyMMdd).atStartOfDay();
|
||||||
|
return localDateTime.minusDays(day).format(yyyyMMdd);
|
||||||
|
}
|
||||||
|
public static String AfterDay(String time,long day){
|
||||||
|
LocalDateTime localDateTime = LocalDate.parse(time, yyyyMMdd).atStartOfDay();
|
||||||
|
|
||||||
|
return localDateTime.plusDays(day).format(yyyyMMdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String beforeMinutes(String time,long minutes){
|
||||||
|
LocalDateTime localDateTime = DateUtil.getTime(time);
|
||||||
|
return localDateTime.minusMinutes(minutes).format(yyyyMMddHHmm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String AfterMinutes(String time,long minutes){
|
||||||
|
LocalDateTime localDateTime = DateUtil.getTime(time);
|
||||||
|
return localDateTime.plusMinutes(minutes).format(yyyyMMddHHmm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String nowMonth(String time){
|
||||||
|
LocalDateTime localDateTime = LocalDate.parse(time, yyyyMMdd).atStartOfDay();
|
||||||
|
return localDateTime.format(yyyyMM);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCurrentDate(){
|
||||||
|
return LocalDateTime.now().format(yyyyMMdd);
|
||||||
|
}
|
||||||
|
public static String getCurrentTime(){
|
||||||
|
return LocalDateTime.now().format(yyyyMMddHHmmss);
|
||||||
|
}
|
||||||
|
public static String getCurrentTime(String timeType){
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(timeType);
|
||||||
|
return LocalDateTime.now().format(formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获得往后日期
|
||||||
|
public static String getCurrentDatePlusDay(int day){
|
||||||
|
return LocalDateTime.now().plusDays(day).format(yyyyMMdd);
|
||||||
|
}
|
||||||
|
//获得往前日期
|
||||||
|
public static String getCurrentDateMinusDay(int day){
|
||||||
|
return LocalDateTime.now().minusDays(day).format(yyyyMMdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static LocalDateTime getTime(String time){
|
||||||
|
int length = time.length();
|
||||||
|
switch (length){
|
||||||
|
case 10:
|
||||||
|
return LocalDate.parse(time, yyyyMMdd).atStartOfDay();
|
||||||
|
case 19:
|
||||||
|
return LocalDateTime.parse(time, yyyyMMddHHmmss);
|
||||||
|
case 16:
|
||||||
|
return LocalDateTime.parse(time, yyyyMMddHHmm);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得时间与当前相差的小时
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd HH:mm:ss
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static long getBetWeenHours(String startTime){
|
||||||
|
|
||||||
|
Duration duration = Duration.between(LocalDateTime.parse(startTime,yyyyMMddHHmmss),LocalDateTime.now());
|
||||||
|
|
||||||
|
return duration.toHours();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得两个时间相差的年份
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getBetWeenYears(String startTime){
|
||||||
|
Period duration = Period.between(LocalDate.parse(startTime,yyyyMMdd),LocalDateTime.now().toLocalDate());
|
||||||
|
|
||||||
|
return duration.getYears();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得两个时间相差的年份
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getBetWeenYears(String startTime,String endTime){
|
||||||
|
Period duration = Period.between(LocalDate.parse(startTime,yyyyMMdd),LocalDate.parse(endTime,yyyyMMdd));
|
||||||
|
return duration.getYears();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得两个时间相差的月份
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getBetWeenMonths(String startTime,String endTime){
|
||||||
|
LocalDateTime startDate = DateUtil.getTime(startTime);
|
||||||
|
LocalDateTime endDate = DateUtil.getTime(endTime);
|
||||||
|
|
||||||
|
YearMonth startYearMonth = YearMonth.from(startDate);
|
||||||
|
YearMonth endYearMonth = YearMonth.from(endDate);
|
||||||
|
|
||||||
|
int betweenMonth = (int) ChronoUnit.MONTHS.between(startYearMonth, endYearMonth);
|
||||||
|
if (startDate.getDayOfMonth()>endDate.getDayOfMonth()){
|
||||||
|
betweenMonth= betweenMonth-1;
|
||||||
|
}
|
||||||
|
return betweenMonth;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得当前时间相差的天数
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getBetWeenDays(String startTime){
|
||||||
|
LocalDate startDate = LocalDate.parse(startTime);
|
||||||
|
LocalDate endDate = LocalDateTime.now().toLocalDate();
|
||||||
|
|
||||||
|
long daysBetween = ChronoUnit.DAYS.between(startDate, endDate);
|
||||||
|
return Math.toIntExact(daysBetween);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得当前时间相差的天数
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getBetWeenDays(String startTime,String endTime){
|
||||||
|
LocalDate startDate = LocalDate.parse(startTime);
|
||||||
|
LocalDate endDate = LocalDate.parse(endTime);
|
||||||
|
|
||||||
|
long daysBetween = ChronoUnit.DAYS.between(startDate, endDate);
|
||||||
|
return Math.toIntExact(daysBetween);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得当前时间相差的分钟数
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getBetWeenMinutes(String startTime,String endTime,DateTimeFormatter formatter){
|
||||||
|
LocalDateTime startDate = LocalDateTime.parse(startTime,formatter);
|
||||||
|
LocalDateTime endDate = LocalDateTime.parse(endTime,formatter);
|
||||||
|
|
||||||
|
long daysBetween = ChronoUnit.MINUTES.between(startDate, endDate);
|
||||||
|
return Math.toIntExact(daysBetween);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得当前时间相差的分钟数
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getBetWeenMinutes(String startTime,String endTime){
|
||||||
|
LocalDateTime startDate = DateUtil.getTime(startTime);
|
||||||
|
LocalDateTime endDate = DateUtil.getTime(endTime);
|
||||||
|
|
||||||
|
long daysBetween = ChronoUnit.MINUTES.between(startDate, endDate);
|
||||||
|
return Math.toIntExact(daysBetween);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得两个时间相差的小时
|
||||||
|
* @param startTime 开始时间 yyyy-MM-dd HH:mm:ss
|
||||||
|
* @param endTime 结束时间 yyyy-MM-dd HH:mm:ss
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static long getBetWeenHours(String startTime,String endTime){
|
||||||
|
Duration duration = Duration.between(getTime(startTime),getTime(endTime));
|
||||||
|
|
||||||
|
return duration.toHours();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得两个时间相差的周
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getBetweenWeeks(String startTime,String endTime){
|
||||||
|
int days = getBetWeenDays(startTime,endTime);
|
||||||
|
int dayOfWeek = TimeUtil.getDayOfWeek(startTime);
|
||||||
|
if (dayOfWeek == 0){
|
||||||
|
dayOfWeek = 7;
|
||||||
|
}
|
||||||
|
days = days-(7-dayOfWeek);
|
||||||
|
|
||||||
|
return days/7;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得该月份的天数
|
||||||
|
* @param time
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getDays(String time,int CalendarType){
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Integer.valueOf(time.split("-")[0]), Integer.valueOf(time.split("-")[1]) - 1, 1);
|
||||||
|
return calendar.getActualMaximum(CalendarType);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,132 @@
|
|||||||
|
package com.engine.jucailin.util;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class DbTools {
|
||||||
|
|
||||||
|
private static ThreadLocal<RecordSet> thread = ThreadLocal.withInitial(()->new RecordSet());
|
||||||
|
|
||||||
|
|
||||||
|
public static List<Map<String,String>> getSqlToList(String sql,Object...value){
|
||||||
|
RecordSet rs = thread.get();
|
||||||
|
|
||||||
|
List<Map<String,String>> result = new ArrayList<>();
|
||||||
|
if (value == null || value.length <=0 || "".equals(value)){
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
}else {
|
||||||
|
rs.executeQuery(sql,value);
|
||||||
|
}
|
||||||
|
while (rs.next()){
|
||||||
|
Map<String,String> dataMap = new HashMap<>();
|
||||||
|
String[] columns = rs.getColumnName();
|
||||||
|
for (String column:columns){
|
||||||
|
dataMap.put(column,rs.getString(column));
|
||||||
|
}
|
||||||
|
result.add(dataMap);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Map<String,Object>> getSqlToListKeySmallLetter(String sql,Object...value){
|
||||||
|
RecordSet rs = thread.get();
|
||||||
|
|
||||||
|
List<Map<String,Object>> result = new ArrayList<>();
|
||||||
|
if (value == null || value.length <=0 || "".equals(value)){
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
}else {
|
||||||
|
rs.executeQuery(sql,value);
|
||||||
|
}
|
||||||
|
while (rs.next()){
|
||||||
|
Map<String,Object> dataMap = new HashMap<>();
|
||||||
|
String[] columns = rs.getColumnName();
|
||||||
|
for (String column:columns){
|
||||||
|
dataMap.put(column.toLowerCase(),rs.getString(column));
|
||||||
|
}
|
||||||
|
result.add(dataMap);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Map<String,String> getSqlToMap(String sql,Object...value){
|
||||||
|
RecordSet rs = thread.get();
|
||||||
|
Map<String,String> result = Maps.newHashMap();
|
||||||
|
if (value == null || value.length <=0 || "".equals(value)){
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
}else {
|
||||||
|
rs.executeQuery(sql,value);
|
||||||
|
}
|
||||||
|
if (rs.next()){
|
||||||
|
String[] columns = rs.getColumnName();
|
||||||
|
for (String column:columns){
|
||||||
|
result.put(column.toLowerCase(),rs.getString(column));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Map<String,Object> getSqlToMapList(String sql,Object...value){
|
||||||
|
RecordSet rs = thread.get();
|
||||||
|
Map<String,Object> result = Maps.newHashMap();
|
||||||
|
if (value == null || value.length <=0 || "".equals(value)){
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
}else {
|
||||||
|
rs.executeQuery(sql,value);
|
||||||
|
}
|
||||||
|
while (rs.next()){
|
||||||
|
result.put(rs.getString("id"),rs.getString("name"));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean update(String sql,Object...value){
|
||||||
|
RecordSet rs = thread.get();
|
||||||
|
if (value == null || value.length <=0 || "".equals(value)){
|
||||||
|
return rs.executeUpdate(sql);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
return rs.executeUpdate(sql,value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean update(RecordSet rs,String sql,Object...value){
|
||||||
|
if (value == null || value.length <=0 || "".equals(value)){
|
||||||
|
return rs.executeUpdate(sql);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
return rs.executeUpdate(sql,value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取sql语句
|
||||||
|
* @param sql
|
||||||
|
* @param value
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getSql(String sql,Object...value){
|
||||||
|
RecordSet rs = thread.get();
|
||||||
|
rs.executeQuery(sql,value);
|
||||||
|
String sentenceSql = "";
|
||||||
|
if (rs.next()){
|
||||||
|
sentenceSql = rs.getString("sentence");
|
||||||
|
}
|
||||||
|
return sentenceSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean updateBatch(String sql,List<List> dataList){
|
||||||
|
RecordSet rs = thread.get();
|
||||||
|
return rs.executeBatchSql(sql,dataList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.engine.jucailin.util;
|
||||||
|
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
|
public class KQDateUtil {
|
||||||
|
|
||||||
|
public static Date getUpdateDate(){
|
||||||
|
Long now = System.currentTimeMillis();
|
||||||
|
Date date = new Date(now);
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package com.engine.jucailin.util;
|
||||||
|
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聚财林列表的显示转换方法
|
||||||
|
*/
|
||||||
|
public class ListConversionMethod {
|
||||||
|
/**
|
||||||
|
* 获取人员分组应用场景显示列
|
||||||
|
*
|
||||||
|
* @param userfor 0-分部、1-部门、2-人员、3-岗位、4-所有人
|
||||||
|
* @param languageId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getPersonGroupUserFor(String userfor, String languageId) {
|
||||||
|
String userforShow = "";
|
||||||
|
int language = Util.getIntValue(languageId, 7);
|
||||||
|
if (userfor.equals("0")) {
|
||||||
|
userforShow = "通用";
|
||||||
|
} else if (userfor.equals("1")) {
|
||||||
|
userforShow = "排班";
|
||||||
|
} else if (userfor.equals("2")) {
|
||||||
|
userforShow = "打卡";
|
||||||
|
} else if (userfor.equals("3")) {
|
||||||
|
userforShow = "假期额度";
|
||||||
|
} else if (userfor.equals("4")) {
|
||||||
|
userforShow = "考勤方案";
|
||||||
|
}else if (userfor.equals("4")) {
|
||||||
|
userforShow = "管理员权限";
|
||||||
|
}
|
||||||
|
return userforShow;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周期状态
|
||||||
|
*
|
||||||
|
* @param languageId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getCyclestate(String cyclestate, String languageId) {
|
||||||
|
String stateShow = "";
|
||||||
|
int language = Util.getIntValue(languageId, 7);
|
||||||
|
if (cyclestate.equals("0")) {
|
||||||
|
stateShow = "待关账";
|
||||||
|
} else if (cyclestate.equals("1")) {
|
||||||
|
stateShow = "已关账";
|
||||||
|
} else if (cyclestate.equals("2")) {
|
||||||
|
stateShow = "已结账";
|
||||||
|
}
|
||||||
|
return stateShow;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周期名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getCycleName(String cyclename, String languageId) {
|
||||||
|
String sql = "select cyclename from kq_cycle_setting where id="+cyclename;
|
||||||
|
Map<String,String> data = DbTools.getSqlToMap(sql);
|
||||||
|
return data.get("cyclename");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.engine.jucailin.web;
|
||||||
|
|
||||||
|
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 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/2/27
|
||||||
|
**/
|
||||||
|
public class KQCalendarSettingAction {
|
||||||
|
|
||||||
|
private KQCalendarSettingService getKQCalendarSettingService(User user) {
|
||||||
|
return ServiceUtil.getService(KQCalendarSettingServiceImpl.class,user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日历设置列表
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getCalendarSettingList")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getCalendarSettingList(@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(getKQCalendarSettingService(user) :: getCalendarSettingList,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日历设置表单
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getCalendarSettingForm")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getCalendarSettingForm(@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(getKQCalendarSettingService(user) :: getCalendarSettingForm,param);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package com.engine.jucailin.web;
|
||||||
|
|
||||||
|
import com.engine.common.util.ParamUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.jucailin.service.KQCommonService;
|
||||||
|
import com.engine.jucailin.service.impl.KQCommonServiceImpl;
|
||||||
|
import com.engine.jucailin.util.ResponseResult;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import oracle.jdbc.proxy.annotation.Post;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class KQCommonAction {
|
||||||
|
|
||||||
|
private KQCommonService getKQCommonService(User user) {
|
||||||
|
return ServiceUtil.getService(KQCommonServiceImpl.class,user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新考勤数据
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/doSubmit")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String saveKQData(@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(getKQCommonService(user) :: saveKQData,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询详情页面
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/doQueryCommon")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String doQueryCommon(@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(getKQCommonService(user) :: doQueryCommon,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除考勤数据
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/delCommon")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String delCommon(@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(getKQCommonService(user) :: delCommon,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,99 @@
|
|||||||
|
package com.engine.jucailin.web;
|
||||||
|
|
||||||
|
import com.engine.common.util.ParamUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.jucailin.service.KQCycleSettingService;
|
||||||
|
import com.engine.jucailin.service.impl.KQCycleSettingServiceImpl;
|
||||||
|
import com.engine.jucailin.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.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class KQCycleSettingAction {
|
||||||
|
|
||||||
|
private KQCycleSettingService getKQCycleSettingService(User user) {
|
||||||
|
return ServiceUtil.getService(KQCycleSettingServiceImpl.class,user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周期设置列表
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getCycleSettingList")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getCycleSettingList(@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(getKQCycleSettingService(user) :: getCycleSettingList,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周期设置树
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getCycleSettingTree")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getCycleSettingTree(@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(getKQCycleSettingService(user) :: getCycleSettingTree,param);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 周期设置表单
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getCycleSettingForm")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getCycleSettingForm(@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(getKQCycleSettingService(user) :: getCycleSettingForm,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤周期列表查询
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getCycleList")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getCycleList(@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(getKQCycleSettingService(user) :: getCycleList,param);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 考勤周期表单
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getCycleForm")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getCycleForm(@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(getKQCycleSettingService(user) :: getCycleForm,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package com.engine.jucailin.web;
|
||||||
|
|
||||||
|
import com.engine.common.util.ParamUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.jucailin.service.KQPersonGroupService;
|
||||||
|
import com.engine.jucailin.service.impl.KQPersonGroupServiceImpl;
|
||||||
|
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.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.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class KQPersonGroupAction {
|
||||||
|
|
||||||
|
private KQPersonGroupService getKQCommonService(User user) {
|
||||||
|
return ServiceUtil.getService(KQPersonGroupServiceImpl.class,user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员分组列表查询
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getPersonGroupList")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getPersonGroupList(@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(getKQCommonService(user) :: getPersonGroupList,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适用组织列表查询
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getSuitOrganzationList")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getSuitOrganzationList(@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(getKQCommonService(user) :: getSuitOrganzationList,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适用组织表单
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/getSuitOrganzationForm")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getSuitOrganzationForm(@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(getKQCommonService(user) :: getSuitOrganzationForm,param);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 适用组织表单
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/saveSuitOrganzation")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String saveSuitOrganzation(@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(getKQCommonService(user) :: saveSuitOrganzation,param);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 适用组织表单
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/delSuitOrganzation")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String delSuitOrganzation(@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(getKQCommonService(user) :: delSuitOrganzation,param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue