Commit 80e4e8bb authored by zhangwanglin's avatar zhangwanglin

Merge remote-tracking branch 'origin/dev_ch_master' into dev_nursing_records_20230214

parents 389ffd87 055cf33a
...@@ -126,7 +126,7 @@ public class DisableController { ...@@ -126,7 +126,7 @@ public class DisableController {
/** /**
* 查询机构下或者包含子机构下的所有护理机构 * 查询机构下或者包含子机构下的所有护理机构
* *
* @param 机构id * @param token 机构id
*/ */
@RequestMapping("/srvOrganListByIsInvolveChild") @RequestMapping("/srvOrganListByIsInvolveChild")
public Result<List<ChSrvOrgan>> srvOrganListByIsInvolveChild(@RequestHeader("Authorization") String token, Boolean isInvolveChild) { public Result<List<ChSrvOrgan>> srvOrganListByIsInvolveChild(@RequestHeader("Authorization") String token, Boolean isInvolveChild) {
......
...@@ -59,11 +59,13 @@ public class TaskController { ...@@ -59,11 +59,13 @@ public class TaskController {
* @param taskName 评定人员姓名 * @param taskName 评定人员姓名
* @param taskTel 评定人员手机号码 * @param taskTel 评定人员手机号码
* @param daysRemaining 评定剩余天数 * @param daysRemaining 评定剩余天数
* @param status 任务状态 * @param taskStatus 任务状态
* @param isReturn 是否退回 * @param isReturn 是否退回
* @param pageNum 当前页 * @param pageNum 当前页
* @param pageSize 每页几条数据 * @param pageSize 每页几条数据
* @param type 1评定报告录入查询失能人员
*/ */
@RequestMapping("/taskDistributionList") @RequestMapping("/taskDistributionList")
public Result<Page<TaskDistributionVO>> taskDistributionList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, public Result<Page<TaskDistributionVO>> taskDistributionList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize,
String organId, String provincial, String city, String organId, String provincial, String city,
...@@ -229,7 +231,7 @@ public class TaskController { ...@@ -229,7 +231,7 @@ public class TaskController {
/** /**
* 添加评估公示信息 * 添加评估公示信息
* @param taskId * @param token
* @return * @return
*/ */
@RequestMapping("/updateReportPublicityInfo") @RequestMapping("/updateReportPublicityInfo")
......
...@@ -438,8 +438,11 @@ public class TaskServiceImpl implements TaskService { ...@@ -438,8 +438,11 @@ public class TaskServiceImpl implements TaskService {
taskMapper.updateById(task); taskMapper.updateById(task);
//更新失能人员信息 //更新失能人员信息
ChDisableInfo chDisableInfo = disableInfoMapper.selectById(task.getDisableInfoId()); ChDisableInfo chDisableInfo = disableInfoMapper.selectById(task.getDisableInfoId());
if(chDisableInfo!=null){
chDisableInfo.setLastTaskId(task.getTaskId()); chDisableInfo.setLastTaskId(task.getTaskId());
disableInfoMapper.updateById(chDisableInfo); disableInfoMapper.updateById(chDisableInfo);
}
//生成组 //生成组
ChAprTaskPush taskPush = new ChAprTaskPush(); ChAprTaskPush taskPush = new ChAprTaskPush();
taskPush.setAssignTime(new Date()); taskPush.setAssignTime(new Date());
......
...@@ -143,6 +143,7 @@ ...@@ -143,6 +143,7 @@
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.acpt_srv_area = dis.DISTRICT_CODE) acptSrvArea, (SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.acpt_srv_area = dis.DISTRICT_CODE) acptSrvArea,
info.ACPT_SRV_ADDRESS acptSrvAddress,--接受服务地址详细地址 info.ACPT_SRV_ADDRESS acptSrvAddress,--接受服务地址详细地址
info.ACPT_ADDRESS acptAddress,--接受评定详细地址 info.ACPT_ADDRESS acptAddress,--接受评定详细地址
info.ADRESS_DETAIL operAddress,
lev.DISABLE_LEVEL_NAME riskLevel, lev.DISABLE_LEVEL_NAME riskLevel,
report.EFF_TIME effTime,report.EVALUATE_TYPE report.EFF_TIME effTime,report.EVALUATE_TYPE
FROM ch_apr_report report FROM ch_apr_report report
......
...@@ -6,6 +6,7 @@ import com.hungraim.ltc.util.Result; ...@@ -6,6 +6,7 @@ import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.jwt.JwtHelper; import org.springframework.security.jwt.JwtHelper;
import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.common.OAuth2AccessToken;
...@@ -30,14 +31,18 @@ public class AuthController { ...@@ -30,14 +31,18 @@ public class AuthController {
private final RedisTemplate redisTemplate; private final RedisTemplate redisTemplate;
private final TokenEndpoint tokenEndpoint; private final TokenEndpoint tokenEndpoint;
@Autowired
private CsoftSecurityUtil csoftSecurityUtil;
@PostMapping("/token") @PostMapping("/token")
@SneakyThrows @SneakyThrows
public Result<OAuth2AccessToken> postAccessToken(Principal principal, @RequestParam Map<String, String> parameters) { public Result<OAuth2AccessToken> postAccessToken(Principal principal, @RequestParam Map<String, String> parameters,String publicKeyString) {
String password = parameters.get("password"); String password = parameters.get("password");
if(FALSE.equals(password)){ if(FALSE.equals(password)){
return Result.failed(ResultCode.USER_LOGIN_ERROR); return Result.failed(ResultCode.USER_LOGIN_ERROR);
} }
String decrypt = CsoftSecurityUtil.decryptRSADefault(password); String decrypt = csoftSecurityUtil.decryptRSADefault(password,publicKeyString);
parameters.put("password", decrypt); parameters.put("password", decrypt);
OAuth2AccessToken oAuth2AccessToken = tokenEndpoint.postAccessToken(principal, parameters).getBody(); OAuth2AccessToken oAuth2AccessToken = tokenEndpoint.postAccessToken(principal, parameters).getBody();
return Result.success(oAuth2AccessToken); return Result.success(oAuth2AccessToken);
...@@ -49,7 +54,7 @@ public class AuthController { ...@@ -49,7 +54,7 @@ public class AuthController {
*/ */
@GetMapping("/genKeyPair") @GetMapping("/genKeyPair")
public Result<String> genKeyPair() { public Result<String> genKeyPair() {
Map keyMap = CsoftSecurityUtil.createKeyPairs(); Map keyMap = csoftSecurityUtil.createKeyPairs();
return Result.success(keyMap.get(0).toString()); return Result.success(keyMap.get(0).toString());
} }
......
...@@ -420,4 +420,9 @@ public class ChDisableInfoChange { ...@@ -420,4 +420,9 @@ public class ChDisableInfoChange {
* 待遇类型(1失能、0失智) * 待遇类型(1失能、0失智)
*/ */
private Integer treatmentType; private Integer treatmentType;
/**
*医保统筹区区
*/
private String medicalArea;
} }
...@@ -15,6 +15,10 @@ public class ReportDetailVO { ...@@ -15,6 +15,10 @@ public class ReportDetailVO {
Integer person3; Integer person3;
String evaluateTime; String evaluateTime;
Integer disableLevelId; Integer disableLevelId;
/**
* 现住址
*/
String operAddress;
String applyId; String applyId;
String polNo; String polNo;
String remark; String remark;
......
...@@ -56,6 +56,7 @@ public class TaskReportVO { ...@@ -56,6 +56,7 @@ public class TaskReportVO {
private String adressDistrictProvincial; private String adressDistrictProvincial;
private String adressDistrictCity; private String adressDistrictCity;
private String adressDistrictCode; private String adressDistrictCode;
private String operAddress;
//失能人员接受评定地址 //失能人员接受评定地址
private String acptProvincial; private String acptProvincial;
private String acptCity; private String acptCity;
......
...@@ -20,7 +20,9 @@ import java.util.HashMap; ...@@ -20,7 +20,9 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.crypto.BadPaddingException; import javax.crypto.BadPaddingException;
import javax.crypto.Cipher; import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException; import javax.crypto.IllegalBlockSizeException;
...@@ -37,6 +39,7 @@ import org.apache.commons.codec.digest.DigestUtils; ...@@ -37,6 +39,7 @@ import org.apache.commons.codec.digest.DigestUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
/** /**
* @Description: 中研通用加密工具 RSA+ASE+SHA256(非对称加密(对称秘钥),对称加密数据,Sha256消息摘要,RSA签名) * @Description: 中研通用加密工具 RSA+ASE+SHA256(非对称加密(对称秘钥),对称加密数据,Sha256消息摘要,RSA签名)
...@@ -44,11 +47,15 @@ import com.alibaba.fastjson.JSONObject; ...@@ -44,11 +47,15 @@ import com.alibaba.fastjson.JSONObject;
* @version 1.0 * @version 1.0
*/ */
@Slf4j @Slf4j
@Component
public class CsoftSecurityUtil { public class CsoftSecurityUtil {
private static Map<Integer, String> keyMap = new HashMap<>(); // 用于封装随机产生的公钥与私钥 private static Map<Integer, String> keyMap = new HashMap<>(); // 用于封装随机产生的公钥与私钥
@Resource
private RedisCache redisCache;
// 加密数据和秘钥的编码方式 // 加密数据和秘钥的编码方式
public static final String UTF_8 = "UTF-8"; public static final String UTF_8 = "UTF-8";
...@@ -304,7 +311,7 @@ public class CsoftSecurityUtil { ...@@ -304,7 +311,7 @@ public class CsoftSecurityUtil {
* 创建RSA的公钥和私钥示例 将生成的公钥和私钥用Base64编码后打印出来 * 创建RSA的公钥和私钥示例 将生成的公钥和私钥用Base64编码后打印出来
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
*/ */
public static Map createKeyPairs() { public Map createKeyPairs() {
try { try {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(2048); keyPairGenerator.initialize(2048);
...@@ -315,6 +322,9 @@ public class CsoftSecurityUtil { ...@@ -315,6 +322,9 @@ public class CsoftSecurityUtil {
RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
String publicKeyString = new String(Base64.encodeBase64(publicKey.getEncoded())); String publicKeyString = new String(Base64.encodeBase64(publicKey.getEncoded()));
String privateKeyString = new String(Base64.encodeBase64((privateKey.getEncoded()))); String privateKeyString = new String(Base64.encodeBase64((privateKey.getEncoded())));
log.info("公钥:{}",publicKeyString);
log.info("私钥:{}",privateKeyString);
redisCache.setCacheObject(publicKeyString,privateKeyString,1, TimeUnit.DAYS);
keyMap.put(0, publicKeyString); //0表示公钥 keyMap.put(0, publicKeyString); //0表示公钥
keyMap.put(1, privateKeyString); //1表示私钥 keyMap.put(1, privateKeyString); //1表示私钥
}catch (NoSuchAlgorithmException e){ }catch (NoSuchAlgorithmException e){
...@@ -337,13 +347,13 @@ public class CsoftSecurityUtil { ...@@ -337,13 +347,13 @@ public class CsoftSecurityUtil {
* @throws IllegalBlockSizeException * @throws IllegalBlockSizeException
* @throws BadPaddingException * @throws BadPaddingException
*/ */
public static String decryptRSADefault(String data) throws InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, UnsupportedEncodingException { public String decryptRSADefault(String data,String publicKeyString) throws InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, UnsupportedEncodingException {
KeyFactory keyFactory = KeyFactory.getInstance(RSA_ALGORITHM_NOPADDING); KeyFactory keyFactory = KeyFactory.getInstance(RSA_ALGORITHM_NOPADDING);
byte[] privateKeyArray = keyMap.get(1).getBytes(); String privateKeyString =redisCache.getCacheObject(publicKeyString);
byte[] privateKeyArray =privateKeyString.getBytes();
byte[] dataArray = data.getBytes(); byte[] dataArray = data.getBytes();
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyArray)); PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyArray));
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec); PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
Cipher cipher = Cipher.getInstance(RSA_ALGORITHM_NOPADDING); Cipher cipher = Cipher.getInstance(RSA_ALGORITHM_NOPADDING);
cipher.init(Cipher.DECRYPT_MODE, privateKey); cipher.init(Cipher.DECRYPT_MODE, privateKey);
return new String(cipher.doFinal(Base64.decodeBase64(dataArray)), UTF_8); return new String(cipher.doFinal(Base64.decodeBase64(dataArray)), UTF_8);
......
package com.hungraim.ltc.util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.BoundSetOperations;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* @author root
*/
@Component
public class RedisCache {
@Autowired
public RedisTemplate redisTemplate;
/**
* 缓存基本的对象,Integer、String、实体类等
*
* @param key 缓存的键值
* @param value 缓存的值
*/
public <T> void setCacheObject(final String key, final T value)
{
redisTemplate.opsForValue().set(key, value);
}
/**
* 缓存基本的对象,Integer、String、实体类等
*
* @param key 缓存的键值
* @param value 缓存的值
* @param timeout 时间
* @param timeUnit 时间颗粒度
*/
public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit)
{
redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
}
/**
* 设置有效时间
*
* @param key Redis键
* @param timeout 超时时间
* @return true=设置成功;false=设置失败
*/
public boolean expire(final String key, final long timeout)
{
return expire(key, timeout, TimeUnit.SECONDS);
}
/**
* 设置有效时间
*
* @param key Redis键
* @param timeout 超时时间
* @param unit 时间单位
* @return true=设置成功;false=设置失败
*/
public boolean expire(final String key, final long timeout, final TimeUnit unit)
{
return redisTemplate.expire(key, timeout, unit);
}
/**
* 获得缓存的基本对象。
*
* @param key 缓存键值
* @return 缓存键值对应的数据
*/
public <T> T getCacheObject(final String key)
{
ValueOperations<String, T> operation = redisTemplate.opsForValue();
return operation.get(key);
}
/**
* 删除单个对象
*
* @param key
*/
public boolean deleteObject(final String key)
{
return redisTemplate.delete(key);
}
/**
* 删除集合对象
*
* @param collection 多个对象
* @return
*/
public long deleteObject(final Collection collection)
{
return redisTemplate.delete(collection);
}
/**
* 缓存List数据
*
* @param key 缓存的键值
* @param dataList 待缓存的List数据
* @return 缓存的对象
*/
public <T> long setCacheList(final String key, final List<T> dataList)
{
Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
return count == null ? 0 : count;
}
/**
* 获得缓存的list对象
*
* @param key 缓存的键值
* @return 缓存键值对应的数据
*/
public <T> List<T> getCacheList(final String key)
{
return redisTemplate.opsForList().range(key, 0, -1);
}
/**
* 缓存Set
*
* @param key 缓存键值
* @param dataSet 缓存的数据
* @return 缓存数据的对象
*/
public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
{
BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
Iterator<T> it = dataSet.iterator();
while (it.hasNext())
{
setOperation.add(it.next());
}
return setOperation;
}
/**
* 获得缓存的set
*
* @param key
* @return
*/
public <T> Set<T> getCacheSet(final String key)
{
return redisTemplate.opsForSet().members(key);
}
/**
* 缓存Map
*
* @param key
* @param dataMap
*/
public <T> void setCacheMap(final String key, final Map<String, T> dataMap)
{
if (dataMap != null) {
redisTemplate.opsForHash().putAll(key, dataMap);
}
}
/**
* 获得缓存的Map
*
* @param key
* @return
*/
public <T> Map<String, T> getCacheMap(final String key)
{
return redisTemplate.opsForHash().entries(key);
}
/**
* 往Hash中存入数据
*
* @param key Redis键
* @param hKey Hash键
* @param value 值
*/
public <T> void setCacheMapValue(final String key, final String hKey, final T value)
{
redisTemplate.opsForHash().put(key, hKey, value);
}
/**
* 获取Hash中的数据
*
* @param key Redis键
* @param hKey Hash键
* @return Hash中的对象
*/
public <T> T getCacheMapValue(final String key, final String hKey)
{
HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash();
return opsForHash.get(key, hKey);
}
/**
* 删除Hash中的数据
*
* @param key
* @param hkey
*/
public void delCacheMapValue(final String key, final String hkey)
{
HashOperations hashOperations = redisTemplate.opsForHash();
hashOperations.delete(key, hkey);
}
/**
* 获取多个Hash中的数据
*
* @param key Redis键
* @param hKeys Hash键集合
* @return Hash对象集合
*/
public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys)
{
return redisTemplate.opsForHash().multiGet(key, hKeys);
}
/**
* 获得缓存的基本对象列表
*
* @param pattern 字符串前缀
* @return 对象列表
*/
public Collection<String> keys(final String pattern)
{
return redisTemplate.keys(pattern);
}
}
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