From 07223a3dfc2869c21f8a99eff52e23ca444d1a36 Mon Sep 17 00:00:00 2001 From: Administrator <704728292@qq.com> Date: Wed, 2 Apr 2025 14:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E7=BB=84=E7=BB=87=E5=91=98?= =?UTF-8?q?=E5=B7=A5id=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esb/UpdateGlzzygidAction.java | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/esb/UpdateGlzzygidAction.java diff --git a/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/esb/UpdateGlzzygidAction.java b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/esb/UpdateGlzzygidAction.java new file mode 100644 index 0000000..5cbcd6c --- /dev/null +++ b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/esb/UpdateGlzzygidAction.java @@ -0,0 +1,86 @@ +package com.weaver.seconddev.jcl.organization.esb; + +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.weaver.common.base.entity.result.WeaResult; +import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface; +import com.weaver.seconddev.jcl.organization.util.DatabaseUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.*; + +/** + * @use:更新关联组织员工id + * @date 2025年3月31日 + * @author xuxy + */ +@Service("UpdateGlzzygidAction_jcl") +public class UpdateGlzzygidAction implements EsbServerlessRpcRemoteInterface { + + @Autowired + private DatabaseUtils databaseUtils; + + private static final Logger log = LoggerFactory.getLogger(UpdateGlzzygidAction.class); + + @Override + public WeaResult> execute(Map params) { + Map rs =new HashMap<>(); + //查询组织员工表人员id + String sfzhm = String.valueOf(params.get("sfzhm").toString()); + String sjh = String.valueOf(params.get("sjh").toString()); + String yx = String.valueOf(params.get("yx").toString()); + Map result = queryEmployeeInfoBySfz(sfzhm,sjh,yx); + log.error("UpdateGlzzygidAction.flowV3:"+result); + rs.put("flowV3",result); + return WeaResult.success(rs); + } + + public Map queryEmployeeInfoBySfz(String sfzhm,String sjh,String yx) { + Map rs = new HashMap<>(); + String userId = ""; + String sql = ""; + String str = ""; + int flag = 0; + if(StringUtils.isNotBlank(sfzhm)){ + sql=" SELECT user from hr_userinfo where delete_type=0 and TENANT_KEY='t7n9jpeaoa' and ID_NO = '" + sfzhm + "'" ; + }else if(StringUtils.isNotBlank(sjh)){ + sql=" select id from eteams.employee where delete_type=0 and TENANT_KEY='t7n9jpeaoa' and mobile = '" + sjh + "'" ; + flag = 1; + }else if(StringUtils.isNotBlank(yx)){ + sql=" select id from eteams.employee where delete_type=0 and TENANT_KEY='t7n9jpeaoa' and email = '" + yx + "'" ; + flag = 2; + }else{ + return rs; + } + log.error("queryEmployeeInfoBySfz.sql:{}",sql); + rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql); + List> recordList = databaseUtils.getDataSourceList(rs); + log.error("queryEmployeeInfoBySfz.recordList:{}",recordList); + if(flag==0){ + if(CollectionUtils.isNotEmpty(recordList)){ + userId = (String) recordList.get(0).get("user"); + } + }else { + if(CollectionUtils.isNotEmpty(recordList)){ + userId = (String) recordList.get(0).get("id"); + } + } + //更新员工信息表 + if(flag==0){ + str = "update uf_jcl_employee_information set glzzyg = '" + userId + "'" + + " where id_no = '" + sfzhm + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 "; + }else if(flag==1) { + str = "update uf_jcl_employee_information set glzzyg = '" + userId + "'" + + " where mobile = '" + sjh + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 "; + }else { + str = "update uf_jcl_employee_information set glzzyg = '" + userId + "'" + + " where email = '" + yx + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 "; + } + log.error("queryEmployeeInfoBySfz.sql:{}",str); + rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", str); + log.error("UpdateYgxxInfoAction.rs:{}", rs); + return rs; + } +}