diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/HTGD_MES_TDLApproveActivon.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/HTGD_MES_TDLApproveActivon.java index e3c3768..6f71427 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/HTGD_MES_TDLApproveActivon.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/HTGD_MES_TDLApproveActivon.java @@ -1,7 +1,5 @@ package com.weaver.seconddev.interfaces.workflow.action; -import com.alibaba.fastjson.JSONObject; -import com.netflix.discovery.converters.Auto; import com.weaver.seconddev.interfaces.oames.ReturnMesWLPS_SYService; import com.weaver.seconddev.interfaces.oames.SI_OA_HTOAApproFlowSync_OUTServiceStub; import com.weaver.seconddev.interfaces.swfa.BillFieldUtil; diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/controller/HTGD_IT13_GETIP_CONTROLLER.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/controller/HTGD_IT13_GETIP_CONTROLLER.java new file mode 100644 index 0000000..4b4f1b3 --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/controller/HTGD_IT13_GETIP_CONTROLLER.java @@ -0,0 +1,53 @@ +package com.weaver.seconddev.interfaces.workflow.controller; + + +import com.alibaba.fastjson.JSONObject; +import com.weaver.common.base.entity.result.WeaResult; +import com.weaver.verupgrade.general.Util; +import com.weaver.verupgrade.hrm.User; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Author: XinfengYin + * @CreateTime: 2025-02-17 + * @Description: IP地址赋值 + */ + + + +@Slf4j +@RestController +@RequestMapping({"/papi/secondev/workflow/controller" }) +public class HTGD_IT13_GETIP_CONTROLLER { + @GetMapping("/getip") + public WeaResult run(@RequestParam Map params) { + log.error("HTGD_IT13_GETIP_CONTROLLER ===> Start"); + String userid = null2String(params.get("userId")); + log.error("HTGD_IT13_GETIP_CONTROLLER ===> params",userid); + User user = new User(Util.getLongValue(userid)); + String IP = user.getLoginip(); + Map data = new HashMap<>(); + data.put("ip",IP); + return WeaResult.success(JSONObject.toJSONString(data)); + } + + + public static String null2String(String s){ + return s == null ? "" : s; + } + + public static String null2String(Object o){ + return o == null ? "" : o.toString(); + } + + public static String null2String(String s1,String s2){ + return s1 == null ? (s2 == null ? "" : s2) : s1; + } +}