五院杭州中心 引入产品功能 岗位数据更新人员卡片
parent
671df80a9c
commit
93ee7661b5
@ -0,0 +1,5 @@
|
||||
#\u4E1A\u52A1\u804C\u52A1\u5E8F\u5217
|
||||
postionType=field49
|
||||
|
||||
#\u4E1A\u52A1\u804C\u52A1\u5C42\u7EA7
|
||||
postion=field50
|
@ -0,0 +1,25 @@
|
||||
package com.engine.wysecond.service;
|
||||
|
||||
import com.engine.wysecond.entity.ResourcesPo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/2/28 16:18
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ResourceCardService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 更新人员卡片工作信息自定义字段 (存在导入全量更新)
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2025/2/28 16:22
|
||||
* @param: [resourcesPo]
|
||||
* @return: int
|
||||
*/
|
||||
int upDateCard(List<ResourcesPo> resourcesPo);
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.engine.wysecond.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.wysecond.entity.ResourcesPo;
|
||||
import com.engine.wysecond.service.PostionMatrixService;
|
||||
import com.engine.wysecond.service.ResourceCardService;
|
||||
import com.weaver.general.Util;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/2/28 16:18
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class ResourceCardServiceImpl extends Service implements ResourceCardService {
|
||||
|
||||
private PostionMatrixService getService(User user) {
|
||||
return ServiceUtil.getService(PostionMatrixServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int upDateCard(List<ResourcesPo> resourcesPo) {
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
List<ResourcesPo> resourcesPoList = getService(user).postionPeoples();
|
||||
|
||||
String postionType = rs.getPropValue("wysecond", "postionType");
|
||||
String postion = rs.getPropValue("wysecond", "postion");
|
||||
resourcesPoList.forEach(resources -> {
|
||||
rs.executeQuery("select count(1) as sums from cus_fielddata where id = ? and scopeid =3 and scope = 'HrmCustomFieldByInfoType'",resources.getResourceId());
|
||||
rs.next();
|
||||
|
||||
int sums = Util.getIntValue(rs.getString("sums"));
|
||||
if (sums > 0) {
|
||||
//更新
|
||||
rs.executeUpdate("update cus_fielddata set " + postionType + "= ?," + postion + "= ? where id = ? and scopeid =3 and scope = 'HrmCustomFieldByInfoType'", resources.getPostionType(),
|
||||
resources.getPostion(), resources.getResourceId());
|
||||
|
||||
|
||||
}else {
|
||||
//插入
|
||||
rs.executeUpdate("insert into cus_fielddata(id,scopeid,scope,"+postionType+","+postion+") values(?,?,?,?,?)",resources.getResourceId(),
|
||||
3,"HrmCustomFieldByInfoType",resources.getPostionType(),resources.getPostion());
|
||||
}
|
||||
|
||||
});
|
||||
return resourcesPoList.size();
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package weaver.formmode.customjavacode.modeexpand;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
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 weaver.conn.RecordSet;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2025/2/28 17:44
|
||||
* @Description: 建模卡片按钮扩展
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class PostionModeExpand extends AbstractModeExpandJavaCodeNew {
|
||||
|
||||
private ResourceCardService getCardService(User user) {
|
||||
return ServiceUtil.getService(ResourceCardServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private PostionMatrixService getMatrixService(User user) {
|
||||
return ServiceUtil.getService(PostionMatrixServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
try {
|
||||
User user = (User)param.get("user");
|
||||
RecordSet rs = new RecordSet();
|
||||
RequestInfo requestInfo = (RequestInfo)param.get("RequestInfo");
|
||||
if(requestInfo != null){
|
||||
int billid = Util.getIntValue(requestInfo.getRequestid());
|
||||
int modeid = Util.getIntValue(requestInfo.getWorkflowid());
|
||||
if(billid > 0 && modeid > 0){
|
||||
rs.executeQuery("select xm from uf_ywzwxx where id = ?",billid);
|
||||
rs.next();
|
||||
String xm = Util.null2String(rs.getString("xm"));
|
||||
|
||||
String sql = "select id,xm,ywzwxl,ywzwcj,rbywzwcjqssj from uf_ywzwxx where rbywzwcjqssj is not null and xm = ?";
|
||||
rs.executeQuery(sql,xm);
|
||||
List<ResourcesPo> resourcesList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
resourcesList.add(ResourcesPo.builder()
|
||||
.id(Util.getIntValue(rs.getString("id")))
|
||||
.resourceId(Util.null2String(rs.getString("xm")))
|
||||
.postionType(Util.null2String(rs.getString("ywzwxl")))
|
||||
.postion(Util.null2String(rs.getString("ywzwcj")))
|
||||
.workDate(Util.null2String(rs.getString("rbywzwcjqssj")))
|
||||
.build());
|
||||
}
|
||||
|
||||
List<ResourcesPo> resourcesPos = getMatrixService(user).filterClosestWorkDate(resourcesList);
|
||||
|
||||
//更新
|
||||
getCardService(user).upDateCard(resourcesPos);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
result.put("errmsg","业务职务信息更新人员卡片失败");
|
||||
result.put("flag", "false");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue