Commit 894db9ad authored by gaozhaochen's avatar gaozhaochen

update: 敏感数据加密解密处理,卫管中心预约统计

parent c6fc236d
...@@ -89,7 +89,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs ...@@ -89,7 +89,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
return this.getByPhone(split[2]); return this.getByPhone(split[2]);
// 随身办登陆 // 随身办登陆
case SSB: case SSB:
return this.getBySSBToken(split[0], split[2]); return this.getBySSBToken(split[0], split[2], split[1]);
// 香山中医院公众号登陆 // 香山中医院公众号登陆
// inStr = 公众号标识符@公众号appId@token@hospitalCode // inStr = 公众号标识符@公众号appId@token@hospitalCode
case WOA_NL: case WOA_NL:
...@@ -174,7 +174,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs ...@@ -174,7 +174,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
} }
private UserInfo getBySSBToken(String source, String token) { private UserInfo getBySSBToken(String source, String token, String appId) {
WDUserInfo wdUser = SsbUtil.getUserInfo(token); WDUserInfo wdUser = SsbUtil.getUserInfo(token);
log.error("ssb.login.wdUser = {}", JSONUtil.toJsonStr(wdUser)); log.error("ssb.login.wdUser = {}", JSONUtil.toJsonStr(wdUser));
if (ObjectUtil.isNull(wdUser) || StrUtil.isBlank(wdUser.getMobile())) { if (ObjectUtil.isNull(wdUser) || StrUtil.isBlank(wdUser.getMobile())) {
...@@ -196,6 +196,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs ...@@ -196,6 +196,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
user.setStatus(Constant.BYTE_NO); user.setStatus(Constant.BYTE_NO);
user.setPasswd(ENCODER.encode(Constant.DEFAULT_PASSWORD)); user.setPasswd(ENCODER.encode(Constant.DEFAULT_PASSWORD));
user.setPhone(wdUser.getMobile()); user.setPhone(wdUser.getMobile());
user.setAppId(appId);
this.save(user); this.save(user);
// List<WDUserCardInfo> cardList = SsbUtil.getUserCardInfoList(token); // List<WDUserCardInfo> cardList = SsbUtil.getUserCardInfoList(token);
} }
...@@ -203,6 +204,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs ...@@ -203,6 +204,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
UserInfo info = new UserInfo(); UserInfo info = new UserInfo();
info.setSysUserBase(user); info.setSysUserBase(user);
info.setOpenId(wdUser.getMobile()); info.setOpenId(wdUser.getMobile());
info.setAppId(appId);
return info; return info;
} }
......
...@@ -52,17 +52,17 @@ public class EncryptionUtil { ...@@ -52,17 +52,17 @@ public class EncryptionUtil {
} }
public static void main(String[] args) { // public static void main(String[] args) {
KeyPair kp = SecureUtil.generateKeyPair(SIGN_TYPE_RSA, DEFAULT_RSA_KEY_SIZE); // KeyPair kp = SecureUtil.generateKeyPair(SIGN_TYPE_RSA, DEFAULT_RSA_KEY_SIZE);
PublicKey pbkey = kp.getPublic(); // PublicKey pbkey = kp.getPublic();
PrivateKey prkey = kp.getPrivate(); // PrivateKey prkey = kp.getPrivate();
String pubkey = (new BASE64Encoder()).encode(pbkey.getEncoded()); // String pubkey = (new BASE64Encoder()).encode(pbkey.getEncoded());
String prikey = (new BASE64Encoder()).encode(prkey.getEncoded()); // String prikey = (new BASE64Encoder()).encode(prkey.getEncoded());
//logger.info("{}生成秘钥成功,公钥:{},私钥:{}",appkey,pubkey,prikey); // //logger.info("{}生成秘钥成功,公钥:{},私钥:{}",appkey,pubkey,prikey);
Map map = new HashMap(); // Map map = new HashMap();
map.put("pub", pubkey); // map.put("pub", pubkey);
map.put("pri", prikey); // map.put("pri", prikey);
//
} // }
} }
...@@ -11,6 +11,7 @@ import cn.sh.stc.sict.cloud.common.security.util.SecurityUtils; ...@@ -11,6 +11,7 @@ import cn.sh.stc.sict.cloud.common.security.util.SecurityUtils;
import cn.sh.stc.sict.cloud.upms.dto.CurrentUser; import cn.sh.stc.sict.cloud.upms.dto.CurrentUser;
import cn.sh.stc.sict.theme.hpgp.vo.IntelligentAnswerVO; import cn.sh.stc.sict.theme.hpgp.vo.IntelligentAnswerVO;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.google.common.collect.Sets;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* @author F_xh * @author F_xh
...@@ -32,6 +34,11 @@ import java.util.Map; ...@@ -32,6 +34,11 @@ import java.util.Map;
public class HpGpIntelligentQAController { public class HpGpIntelligentQAController {
private final static String CONTENT = "Content"; private final static String CONTENT = "Content";
/**
* 打浦桥科室
*/
private final static Set<String> DPQ_DEPARTMENT = Sets.newHashSet("皮肤性病科", "中医科", "儿保科", "全科医疗科");
@SysLog @SysLog
@ApiOperation("智能问答") @ApiOperation("智能问答")
@PostMapping @PostMapping
...@@ -57,10 +64,18 @@ public class HpGpIntelligentQAController { ...@@ -57,10 +64,18 @@ public class HpGpIntelligentQAController {
log.error("孙总接口返回 body = {}", body); log.error("孙总接口返回 body = {}", body);
IntelligentAnswerVO answerVO = new IntelligentAnswerVO(); IntelligentAnswerVO answerVO = new IntelligentAnswerVO();
Map<String, Object> result = XmlUtil.xmlToMap(body); Map<String, Object> result = XmlUtil.xmlToMap(body);
if(result.containsKey(CONTENT)){ if (result.containsKey(CONTENT)) {
answerVO.setAnswer(MapUtil.getStr(result, CONTENT)); answerVO.setAnswer(MapUtil.getStr(result, CONTENT));
if (StrUtil.isNotBlank(current.getHospitalCode())
&& "42502942300".equals(current.getHospitalCode())) {
if (StrUtil.isNotBlank(answerVO.getDeptName())
&& !DPQ_DEPARTMENT.contains(answerVO.getDeptName())) {
String oldDeptName = answerVO.getDeptName();
answerVO.setAnswer(answerVO.getAnswer().replace(oldDeptName, "全科医疗科"));
answerVO.setDeptName("全科医疗科");
}
}
} }
return new R<>(answerVO); return new R<>(answerVO);
} }
} }
...@@ -30,7 +30,6 @@ public class HpStatisticsController { ...@@ -30,7 +30,6 @@ public class HpStatisticsController {
@ApiOperation("统计用户使用情况") @ApiOperation("统计用户使用情况")
@GetMapping("/usage-overview") @GetMapping("/usage-overview")
@SecurityParameter(inDecode = false)
public R statisticsUsage(@RequestParam("startTime") String startTime, public R statisticsUsage(@RequestParam("startTime") String startTime,
@RequestParam("endTime") String endTime) { @RequestParam("endTime") String endTime) {
log.error("统计用户使用情况:startTime = {}, token = {}", startTime, endTime); log.error("统计用户使用情况:startTime = {}, token = {}", startTime, endTime);
......
...@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author gao * @author gao
...@@ -42,6 +43,14 @@ public interface HpStatisticsMapper { ...@@ -42,6 +43,14 @@ public interface HpStatisticsMapper {
* @return * @return
*/ */
Long countLoginUser(@Param("startTime") String startTime, Long countLoginUser(@Param("startTime") String startTime,
@Param("endTime") String endTime); @Param("endTime") String endTime,
@Param("appId") String appId);
/**
* 统计卫管中心预约人数
*
* @return
*/
Map<String, Long> countHealthManagementCenter();
} }
...@@ -2,16 +2,14 @@ package cn.sh.stc.sict.theme.hphy.service.impl; ...@@ -2,16 +2,14 @@ package cn.sh.stc.sict.theme.hphy.service.impl;
import cn.sh.stc.sict.theme.hphy.dao.HpAppointmentMapper; import cn.sh.stc.sict.theme.hphy.dao.HpAppointmentMapper;
import cn.sh.stc.sict.theme.hphy.dao.HpStatisticsMapper; import cn.sh.stc.sict.theme.hphy.dao.HpStatisticsMapper;
import cn.sh.stc.sict.theme.hphy.dao.HphyPatientBaseMapper;
import cn.sh.stc.sict.theme.hphy.model.HphyPatientBase;
import cn.sh.stc.sict.theme.hphy.service.HpStatisticsService; import cn.sh.stc.sict.theme.hphy.service.HpStatisticsService;
import cn.sh.stc.sict.theme.hphy.vo.StatisticsUsageVO; import cn.sh.stc.sict.theme.hphy.vo.StatisticsUsageVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 黄埔医导用户使用情况查询 * 黄埔医导用户使用情况查询
...@@ -39,10 +37,19 @@ public class HpStatisticsServiceImpl implements HpStatisticsService { ...@@ -39,10 +37,19 @@ public class HpStatisticsServiceImpl implements HpStatisticsService {
@Override @Override
public StatisticsUsageVO getUsageOverviewStatistics(String startTime, String endTime) { public StatisticsUsageVO getUsageOverviewStatistics(String startTime, String endTime) {
Long loginUserCount = hpStatisticsMapper.countLoginUser(startTime, endTime); Long loginUserCount = hpStatisticsMapper.countLoginUser(startTime, endTime, null);
Long newUserCount = hpStatisticsMapper.countNewUser(startTime, endTime); Long newUserCount = hpStatisticsMapper.countNewUser(startTime, endTime);
List<StatisticsUsageVO.HosUsageStatistics> hosUsageStatisticsList = hpStatisticsMapper.queryAppointmentUserGroupByHos(startTime, endTime); List<StatisticsUsageVO.HosUsageStatistics> hosUsageStatisticsList = hpStatisticsMapper.queryAppointmentUserGroupByHos(startTime, endTime);
return StatisticsUsageVO.builder().newUserCount(newUserCount).loginUserCount(loginUserCount).hosAppointmentStatistics(hosUsageStatisticsList).build(); // 统计卫管中心数据
Map<String, Long> hmcStatistics = hpStatisticsMapper.countHealthManagementCenter();
Long hmcloginUserCount = hpStatisticsMapper.countLoginUser(startTime, endTime, "wx24c55f38b535cd96");
hmcStatistics.put("卫管中心登录人数", hmcloginUserCount);
return StatisticsUsageVO.builder()
.newUserCount(newUserCount)
.loginUserCount(loginUserCount)
.hosAppointmentStatistics(hosUsageStatisticsList)
.healthManagementCenterStatistics(hmcStatistics)
.build();
} }
} }
...@@ -5,6 +5,7 @@ import lombok.*; ...@@ -5,6 +5,7 @@ import lombok.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 统计用户使用详情 * 统计用户使用详情
...@@ -29,6 +30,9 @@ public class StatisticsUsageVO implements Serializable { ...@@ -29,6 +30,9 @@ public class StatisticsUsageVO implements Serializable {
@ApiModelProperty(value = "医院预约人数") @ApiModelProperty(value = "医院预约人数")
private List<HosUsageStatistics> hosAppointmentStatistics; private List<HosUsageStatistics> hosAppointmentStatistics;
@ApiModelProperty(value = "卫管中心入口数据统计")
private Map<String, Long> healthManagementCenterStatistics;
@Data @Data
public static class HosUsageStatistics implements Serializable { public static class HosUsageStatistics implements Serializable {
private static final long serialVersionUID = -1088663393589514198L; private static final long serialVersionUID = -1088663393589514198L;
......
...@@ -53,10 +53,22 @@ ...@@ -53,10 +53,22 @@
</if> </if>
<if test="endTime != null and endTime != '' "> <if test="endTime != null and endTime != '' ">
AND create_time &lt;= #{endTime} AND create_time &lt;= #{endTime}
</if>
<if test="appId != null and appId != '' ">
AND create_by like concat('%',#{appId},'%')
</if> </if>
AND `title` LIKE '%用户登录%' AND `title` LIKE '%用户登录%'
AND `exception` = '' AND `exception` = ''
</where> </where>
</select> </select>
<select id="countHealthManagementCenter" resultType="java.util.Map">
SELECT
COUNT(1) AS '卫管中心总预约次' ,
COUNT(IF(length(exception) = 0 OR exception IS NULL ,TRUE,NULL) ) AS '卫管中心成功预约次' ,
COUNT(IF(length(exception) >0,TRUE,NULL) ) AS '卫管中心失败预约次'
FROM `sys_log`
WHERE title = '预约' AND create_by like '%wx24c55f38b535cd96%'
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment