Explorar o código

评价器登录

lihong hai 1 ano
pai
achega
4d0555ac20

+ 11 - 1
src/main/java/cn/hnthyy/thmz/controller/LoginController.java

@@ -4,6 +4,7 @@ import cn.hnthyy.thmz.Utils.*;
 import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.his.mz.Employee;
+import cn.hnthyy.thmz.entity.thmz.EvaluateInfo;
 import cn.hnthyy.thmz.entity.thmz.LoginErr;
 import cn.hnthyy.thmz.entity.thmz.User;
 import cn.hnthyy.thmz.entity.thmz.UserControls;
@@ -15,6 +16,7 @@ import cn.hnthyy.thmz.service.his.zd.DictDataService;
 import cn.hnthyy.thmz.service.thmz.EvaluationService;
 import cn.hnthyy.thmz.service.thmz.LoginErrService;
 import cn.hnthyy.thmz.service.thmz.TokenService;
+import cn.hnthyy.thmz.service.thmz.TsmzService;
 import cn.hnthyy.thmz.service.thmz.UserService;
 import cn.hnthyy.thmz.service.thmz.WindowsService;
 import cn.hutool.core.codec.Base64;
@@ -24,6 +26,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.*;
 
@@ -46,6 +50,8 @@ public class LoginController {
     //private LoginErrService loginErrService;
     @Autowired
     private DictDataService dictDataService;
+    @Resource
+    private TsmzService tsmzService;
     /**登录错误次数 锁定账户临界值*/
     //private static final int LOGIN__ERR_COUNT =  10000;
     //private static final int LOGIN__ERR_COUNT_TIME =  1;
@@ -57,7 +63,7 @@ public class LoginController {
      * @return
      */
     @RequestMapping(value = "/login", method = RequestMethod.POST)
-    public Map<String, Object> login(@RequestBody User userParam) {
+    public Map<String, Object> login(@RequestBody User userParam,HttpServletRequest request) {
         Map<String, Object> resultMap = new HashMap<>();
         if (userParam == null) {
             resultMap.put("code", -1);
@@ -156,6 +162,10 @@ public class LoginController {
                 TokenUtil.USER_CONTROL_MAP.clear();
             }
         }
+        tsmzService.signInWhenUserLogin(EvaluateInfo.builder()
+                .staffId(user.getUserIdCode())
+                .staffName(user.getUserName())
+                .clientIp(HttpUtil.getIPAddress(request)).build());
         Date deadTime = DateUtil.getDate(Constants.JWT_TTL);
         String token =TokenUtil.createJWT(JsonUtil.object2Json(user),deadTime);
         resultMap.put("code", 0);

+ 21 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TsmzServiceImpl.java

@@ -539,6 +539,27 @@ public class TsmzServiceImpl implements TsmzService {
         }
     }
 
+    /**
+     * @description: 新评价器登录
+     * @author: lihong
+     * @date: 2024/7/2 15:38
+     * @param: staffId 人员编码
+     * @param: staffName 人员名称
+     * @param: clientIp  ip
+     */
+    @Override
+    public void signInWhenUserLogin(EvaluateInfo evaluateInfo) {
+        String realUrl = wxPayOrderServiceUrl + "/api/bjdeshun/evaluator/signInWhenUserLogin";
+        try {
+            log.info("[signInWhenUserLogin]入参={}",evaluateInfo);
+            HttpRequest.post(realUrl)
+                    .body(JsonUtil.object2Json(evaluateInfo))
+                    .timeout(1000)
+                    .execute();
+        } catch (Exception e) {
+        }
+    }
+
     @Override
     public Map<String, BigDecimal> queryYbAmount(String patientId, Integer times) {
         return mzPatientMiMapper.selectYbAmount(patientId, times);

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/TsmzService.java

@@ -146,6 +146,15 @@ public interface TsmzService {
      * @param: evaluateInfo
      **/
     void evaluatorStart(EvaluateInfo evaluateInfo);
+    /**
+     * @description: 新评价器登录
+     * @author: lihong 
+     * @date: 2024/7/2 15:38 
+     * @param: staffId 人员编码
+     * @param: staffName 人员名称
+     * @param: clientIp  ip
+     **/
+    void signInWhenUserLogin(EvaluateInfo evaluateInfo);
 
     /**
      * 根据门诊ID和就诊次数查询门诊统筹报销金额 包含统筹支付和个人账户支付金额