五院杭州中心 流程转建模后更新人员卡片
parent
2118b56a94
commit
0c0226d62d
@ -0,0 +1,71 @@
|
|||||||
|
package weaver.interfaces.wysecond;
|
||||||
|
|
||||||
|
import com.api.formmode.page.util.Util;
|
||||||
|
import com.engine.integration.util.StringUtils;
|
||||||
|
import com.engine.wysecond.entity.ResourcesPo;
|
||||||
|
import com.engine.wysecond.service.PostionMatrixService;
|
||||||
|
import com.engine.wysecond.service.ResourceCardService;
|
||||||
|
import com.engine.wysecond.service.impl.PostionMatrixServiceImpl;
|
||||||
|
import com.engine.wysecond.service.impl.ResourceCardServiceImpl;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2025/3/7 10:34
|
||||||
|
* @Description: 拟晋升业务职务人选审批 流程转建模后数据再写入人员卡片
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class PostionPromotionAction implements Action{
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
int formid = Math.abs(requestInfo.getRequestManager().getFormid());
|
||||||
|
String requestid = requestInfo.getRequestid();
|
||||||
|
String tableName = "formtable_main_"+formid;
|
||||||
|
String detailName = tableName+"_dt1";
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
|
||||||
|
List<String> nameList = new ArrayList<>();
|
||||||
|
rs.executeQuery("select d.xm from "+tableName+" a Left JOIN "+detailName+" d on a.id = d.mainid where a.requestid = ?",requestid);
|
||||||
|
while (rs.next()) {
|
||||||
|
nameList.add(Util.null2String(rs.getString("xm")));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollectionUtils.isNotEmpty(nameList)) {
|
||||||
|
List<ResourcesPo> resourcesPos = postionPeoples(nameList);
|
||||||
|
ResourceCardService resourceCardService = new ResourceCardServiceImpl();
|
||||||
|
resourceCardService.upDateCard(resourcesPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<ResourcesPo> postionPeoples(List<String> nameList) {
|
||||||
|
PostionMatrixService postionMatrixService = new PostionMatrixServiceImpl();
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
String join = StringUtils.join(nameList, ",");
|
||||||
|
List<ResourcesPo> resourcesList = new ArrayList<>();
|
||||||
|
rs.executeQuery("select id,xm,szbm,ywzwxl,ywzwcj,rbywzwcjqssj from uf_ywzwxx where " +
|
||||||
|
" rbywzwcjqssj is not null and xm in ("+join+")");
|
||||||
|
while (rs.next()) {
|
||||||
|
resourcesList.add(ResourcesPo.builder()
|
||||||
|
.id(com.weaver.general.Util.getIntValue(rs.getString("id")))
|
||||||
|
.resourceId(com.weaver.general.Util.null2String(rs.getString("xm")))
|
||||||
|
.department(com.weaver.general.Util.null2String(rs.getString("szbm")))
|
||||||
|
.postionType(com.weaver.general.Util.null2String(rs.getString("ywzwxl")))
|
||||||
|
.postion(com.weaver.general.Util.null2String(rs.getString("ywzwcj")))
|
||||||
|
.workDate(com.weaver.general.Util.null2String(rs.getString("rbywzwcjqssj")))
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
return postionMatrixService.filterClosestWorkDate(resourcesList);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue