新美光考勤关账功能开发
This commit is contained in:
parent
1e146c826e
commit
29e6efeac6
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.engine.xmgsecond.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2025/5/21 15:43
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class KqCloseRecords {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String subCompanyIds;
|
||||||
|
|
||||||
|
private String departmentIds;
|
||||||
|
|
||||||
|
private String startDate;
|
||||||
|
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
|
private Integer closeStatus;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.engine.xmgsecond.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2025/5/21 14:37
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class KqCloseSet {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer workflowId;
|
||||||
|
|
||||||
|
private String startDateCode;
|
||||||
|
|
||||||
|
private String endDateCode;
|
||||||
|
|
||||||
|
private String fbCode;
|
||||||
|
|
||||||
|
private String bmCode;
|
||||||
|
|
||||||
|
private Integer createNodeId;
|
||||||
|
|
||||||
|
private Integer endNodeId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package com.engine.xmgsecond.service;
|
package com.engine.xmgsecond.service;
|
||||||
|
|
||||||
import com.engine.workflow.entity.publicApi.PAResponseEntity;
|
import com.engine.workflow.entity.publicApi.PAResponseEntity;
|
||||||
|
import com.engine.xmgsecond.entity.KqCloseSet;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -13,4 +15,8 @@ import java.util.Map;
|
||||||
public interface KqCloseAccountService {
|
public interface KqCloseAccountService {
|
||||||
|
|
||||||
PAResponseEntity closeAccount(Map<String, Object> param);
|
PAResponseEntity closeAccount(Map<String, Object> param);
|
||||||
|
|
||||||
|
List<KqCloseSet> getWorkflowList();
|
||||||
|
|
||||||
|
Boolean checkSubmit(Map<String, Object> param);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,14 @@ import com.engine.workflow.entity.publicApi.PAResponseEntity;
|
||||||
import com.engine.workflow.entity.publicApi.ReqOperateRequestEntity;
|
import com.engine.workflow.entity.publicApi.ReqOperateRequestEntity;
|
||||||
import com.engine.workflow.publicApi.WorkflowRequestOperatePA;
|
import com.engine.workflow.publicApi.WorkflowRequestOperatePA;
|
||||||
import com.engine.workflow.publicApi.impl.WorkflowRequestOperatePAImpl;
|
import com.engine.workflow.publicApi.impl.WorkflowRequestOperatePAImpl;
|
||||||
|
import com.engine.xmgsecond.entity.KqCloseSet;
|
||||||
import com.engine.xmgsecond.service.KqCloseAccountService;
|
import com.engine.xmgsecond.service.KqCloseAccountService;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
import weaver.general.BaseBean;
|
import weaver.general.BaseBean;
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -26,10 +31,39 @@ public class KqCloseAccountServiceImpl extends Service implements KqCloseAccount
|
||||||
@Override
|
@Override
|
||||||
public PAResponseEntity closeAccount(Map<String, Object> param) {
|
public PAResponseEntity closeAccount(Map<String, Object> param) {
|
||||||
|
|
||||||
|
String id = Util.null2String(param.get("billid"));
|
||||||
|
String subCompanyIds = Util.null2String(param.get("gzfb"));
|
||||||
|
String departmentIds = Util.null2String(param.get("gzbm"));
|
||||||
|
String startDate = Util.null2String(param.get("ksrq"));
|
||||||
|
String endDate = Util.null2String(param.get("jsrq"));
|
||||||
|
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
List<KqCloseSet> workflowList = getWorkflowList();
|
||||||
WorkflowRequestOperatePA operatePA = getRequestOperatePA();
|
WorkflowRequestOperatePA operatePA = getRequestOperatePA();
|
||||||
|
|
||||||
|
//1.获取系统流程数据,根据关账流程配置中流程id
|
||||||
|
|
||||||
|
|
||||||
|
//2.根据表单id,及配置字段参数,.获取分部or部门 开始日期和结束日期
|
||||||
|
|
||||||
|
|
||||||
|
//3 值匹配筛选requestid
|
||||||
|
|
||||||
|
|
||||||
|
//4.流程干预操作
|
||||||
|
|
||||||
|
|
||||||
|
//5.更新关账记录表操作者信息
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ReqOperateRequestEntity requestParam = new ReqOperateRequestEntity();
|
ReqOperateRequestEntity requestParam = new ReqOperateRequestEntity();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//流程干预
|
//流程干预
|
||||||
// requestParam.setRequestId(1681681);
|
// requestParam.setRequestId(1681681);
|
||||||
// requestParam.setSrc("intervenor");
|
// requestParam.setSrc("intervenor");
|
||||||
|
|
@ -42,9 +76,56 @@ public class KqCloseAccountServiceImpl extends Service implements KqCloseAccount
|
||||||
// PAResponseEntity paResponseEntity = operatePA.doIntervenor(user, requestParam);
|
// PAResponseEntity paResponseEntity = operatePA.doIntervenor(user, requestParam);
|
||||||
|
|
||||||
|
|
||||||
//强制归档 DoArchivingCmd
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<KqCloseSet> getWorkflowList() {
|
||||||
|
|
||||||
|
List<KqCloseSet> kqCloseSets = new ArrayList<>();
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
rs.executeQuery("select id,lclj,ksrqdyzdbm,jsrqdyzdbm,ssfbdyzdbm,ssbmdyzdbm,fqjdid,gdjdid from uf_kqgzpz");
|
||||||
|
while (rs.next()) {
|
||||||
|
kqCloseSets.add(KqCloseSet.builder()
|
||||||
|
.id(Util.getIntValue(rs.getString("id")))
|
||||||
|
.workflowId(Util.getIntValue(rs.getString("lclj")))
|
||||||
|
.startDateCode(Util.null2String(rs.getString("ksrqdyzdbm")))
|
||||||
|
.endDateCode(Util.null2String(rs.getString("jsrqdyzdbm")))
|
||||||
|
.fbCode(Util.null2String(rs.getString("ssfbdyzdbm")))
|
||||||
|
.bmCode(Util.null2String(rs.getString("ssbmdyzdbm")))
|
||||||
|
.createNodeId(Util.getIntValue(rs.getString("fqjdid")))
|
||||||
|
.endNodeId(Util.getIntValue(rs.getString("gdjdid")))
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
return kqCloseSets;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean checkSubmit(Map<String, Object> param) {
|
||||||
|
|
||||||
|
String subCompanyIds = Util.null2String(param.get("subCompanyIds"));
|
||||||
|
String departmentIds = Util.null2String(param.get("departmentIds"));
|
||||||
|
String startDate = Util.null2String(param.get("startDate"));
|
||||||
|
String endDate = Util.null2String(param.get("endDate"));
|
||||||
|
|
||||||
|
boolean result = false;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
|
||||||
|
String sql = "select id from uf_kqgzjl where ksrq <= ? and jsrq >= ?";
|
||||||
|
|
||||||
|
if(!subCompanyIds.isEmpty()) {
|
||||||
|
sql += " and gzfb is not null and gzfb in ("+subCompanyIds+")";
|
||||||
|
rs.executeQuery(sql,endDate,startDate);
|
||||||
|
result = rs.getCounts()>0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!departmentIds.isEmpty() && !result) {
|
||||||
|
sql += " and gzbm is not null and gzbm in ("+departmentIds+")";
|
||||||
|
rs.executeQuery(sql,endDate,startDate);
|
||||||
|
result = rs.getCounts()>0;
|
||||||
|
}
|
||||||
|
rs.writeLog("KqCloseAccountServiceImpl:checkSubmit"+sql);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import weaver.hrm.User;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.POST;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.Produces;
|
import javax.ws.rs.Produces;
|
||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
|
|
@ -32,7 +33,7 @@ public class KqCloseAccountAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GET
|
@POST
|
||||||
@Path("/closeAccount")
|
@Path("/closeAccount")
|
||||||
@Produces(MediaType.TEXT_PLAIN)
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
public String closeAccount(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
public String closeAccount(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||||
|
|
@ -47,4 +48,38 @@ public class KqCloseAccountAction {
|
||||||
}
|
}
|
||||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/getWorkflowList")
|
||||||
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
|
public String getWorkflowList(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||||
|
Map<String, Object> data = new HashMap<>(8);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
data.put("data",getService(user).getWorkflowList());
|
||||||
|
data.put("code", 200);
|
||||||
|
} catch (Exception e) {
|
||||||
|
data.put("code", 500);
|
||||||
|
data.put("msg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/checkSubmit")
|
||||||
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
|
public String checkSubmit(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||||
|
Map<String, Object> data = new HashMap<>(8);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
data.put("data",getService(user).checkSubmit(ParamUtil.request2Map(request)));
|
||||||
|
data.put("code", 200);
|
||||||
|
} catch (Exception e) {
|
||||||
|
data.put("code", 500);
|
||||||
|
data.put("msg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue