2、部分和就诊记录相关的住院接口进行数据加密。 3、用户绑定身份证错误时提示不正确调整。debug
parent
42c6318dc1
commit
c935b675fb
19 changed files with 452 additions and 36 deletions
@ -0,0 +1,107 @@ |
||||
package com.ynxbd.common.action; |
||||
|
||||
import com.ynxbd.common.action.base.BaseAction; |
||||
import com.ynxbd.common.bean.his.HisAuthAgent; |
||||
import com.ynxbd.common.dao.his.HisAuthAgentDao; |
||||
import com.ynxbd.common.helper.common.ParamHelper; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.wx.wxfactory.ReqParamHelper; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.lang3.ObjectUtils; |
||||
import org.apache.struts2.convention.annotation.Action; |
||||
import org.apache.struts2.convention.annotation.Namespace; |
||||
|
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
// 授权委托人
|
||||
|
||||
@Slf4j |
||||
@Namespace("/authAgent") |
||||
public class AuthAgentAction extends BaseAction { |
||||
|
||||
|
||||
@Action("getAuthAgent") |
||||
public Result getAuthAgent(String treatNum, Integer treatType, String itemNo) { |
||||
try { |
||||
treatNum = getDecodeString(treatNum); |
||||
log.info("[委托人信息]查询 treatNum={}, treatType={}", treatNum, treatType); |
||||
if (!ObjectUtils.isEmpty(itemNo)) { |
||||
itemNo = getDecodeString(itemNo); |
||||
if (itemNo == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_INVALID); |
||||
} |
||||
} |
||||
List<HisAuthAgent> dataList = new HisAuthAgentDao().queryAuthAgent(treatNum, treatType); |
||||
|
||||
boolean hasItemNo = !ObjectUtils.isEmpty(itemNo); |
||||
if (hasItemNo) { |
||||
String finalItemNo = itemNo; |
||||
dataList = dataList.stream().filter(o -> finalItemNo.equals(o.getItemNo())).collect(Collectors.toList()); |
||||
} |
||||
for (HisAuthAgent item : dataList) { |
||||
item.setEnItemNo(ReqParamHelper.encode(item.getItemNo())); |
||||
item.setEnPersonId(ReqParamHelper.encode(item.getPersonId())); |
||||
item.setEnPersonTel(ReqParamHelper.encode(item.getPersonTel())); |
||||
item.setShowPersonId(ParamHelper.hideIdCardNo(item.getPersonId())); |
||||
item.setShowPersonTel(ParamHelper.hidTel(item.getPersonTel())); |
||||
|
||||
item.setPersonId(null); |
||||
item.setPersonTel(null); |
||||
} |
||||
return Result.success(dataList); |
||||
} catch (Exception e) { |
||||
return Result.error(e.getMessage()); |
||||
} |
||||
} |
||||
|
||||
@Action("addAuthAgent") |
||||
public Result addAuthAgent(String openid, String treatNum, Integer treatType, String personName, String personSex, String personTel, String personId, String relationship, Integer personAge, String personAddress) { |
||||
try { |
||||
treatNum = getDecodeString(treatNum); |
||||
log.info("[委托人信息]添加 treatNum={}, treatType={}, personName={}, personSex={}, relationship={}", treatNum, treatType, personName, personSex, relationship); |
||||
new HisAuthAgentDao().addAuthAgent(treatNum, treatType, personName, personSex, personTel, personId, relationship, personAge, personAddress); |
||||
return Result.success(); |
||||
} catch (Exception e) { |
||||
return Result.error(e.getMessage()); |
||||
} |
||||
} |
||||
|
||||
@Action("updateAuthAgent") |
||||
public Result updateAuthAgent(String openid, String itemNo, String personName, String personSex, String personTel, String personId, String relationship, String personAge, String personAddress, String enPersonTel, String enPersonId) { |
||||
try { |
||||
if (personId == null || personTel == null || enPersonTel == null || enPersonId == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_INVALID); |
||||
} |
||||
itemNo = getDecodeString(itemNo); |
||||
log.info("[委托人信息]添加 itemNo={},personName={}, personSex={}, relationship={}, enPersonTel={}, enPersonId={}", itemNo, personName, personSex, relationship, enPersonTel, enPersonId); |
||||
if (personId.contains("*")) { // 数据没有变化
|
||||
personId = getDecodeString(enPersonId); |
||||
} |
||||
if (personTel.contains("*")) { |
||||
personTel = getDecodeString(enPersonTel); |
||||
} |
||||
if (ObjectUtils.isEmpty(personId) || ObjectUtils.isEmpty(personTel) || ObjectUtils.isEmpty(itemNo)) { |
||||
return Result.error(ResultEnum.PARAM_IS_INVALID); |
||||
} |
||||
new HisAuthAgentDao().updateAuthAgent(itemNo, personName, personSex, personTel, personId, relationship, personAge, personAddress); |
||||
return Result.success(); |
||||
} catch (Exception e) { |
||||
return Result.error(e.getMessage()); |
||||
} |
||||
} |
||||
|
||||
|
||||
@Action("delAuthAgent") |
||||
public Result delAuthAgent(String itemNo, String openid) { |
||||
try { |
||||
itemNo = getDecodeString(itemNo); |
||||
log.info("[委托人信息]修改 itemNo={}", itemNo); |
||||
new HisAuthAgentDao().delAuthAgent(itemNo); |
||||
return Result.success(); |
||||
} catch (Exception e) { |
||||
return Result.error(e.getMessage()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.ynxbd.common.bean.enums; |
||||
|
||||
import lombok.ToString; |
||||
|
||||
@ToString |
||||
public enum HisAuthAgentRelationEnum { |
||||
_01(1, "配偶"), |
||||
_02(2, "父母"), |
||||
_03(3, "子女"), |
||||
_04(4, "兄弟"), |
||||
_05(5, "姐妹"), |
||||
_06(6, "祖父母"), |
||||
_07(7, "外祖父母"), |
||||
_08(8, "孙子女"), |
||||
_09(9, "外孙子女"), |
||||
; |
||||
|
||||
public final Integer CODE; |
||||
public final String NAME; |
||||
|
||||
HisAuthAgentRelationEnum(Integer CODE, String NAME) { |
||||
this.CODE = CODE; |
||||
this.NAME = NAME; |
||||
} |
||||
|
||||
|
||||
public static HisAuthAgentRelationEnum findEnumByName(String name) { |
||||
if (name == null) { |
||||
return null; |
||||
} |
||||
for (HisAuthAgentRelationEnum item : HisAuthAgentRelationEnum.values()) { |
||||
if(item.NAME.equals(name)) { |
||||
return item; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,44 @@ |
||||
package com.ynxbd.common.bean.his; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.Setter; |
||||
import lombok.ToString; |
||||
|
||||
@Getter |
||||
@Setter |
||||
@ToString |
||||
@NoArgsConstructor |
||||
public class HisAuthAgent { |
||||
// 记录ID
|
||||
private String itemNo; |
||||
// 加密的记录id
|
||||
private String enItemNo; |
||||
// 委托人姓名
|
||||
private String personName; |
||||
// 委托人性别
|
||||
private String personSex; |
||||
// 联系电话
|
||||
private String personTel; |
||||
// 加密联系电话
|
||||
private String enPersonTel; |
||||
// 显示的电话号码
|
||||
private String showPersonTel; |
||||
// 身份证号
|
||||
private String personId; |
||||
// 加密的证件号
|
||||
private String enPersonId; |
||||
// 显示的证件号
|
||||
private String showPersonId; |
||||
// 年龄
|
||||
private String personAge; |
||||
// 住址
|
||||
private String personAddress; |
||||
// 关系
|
||||
private String relationship; |
||||
// 记录创建时间
|
||||
private String createDate; |
||||
|
||||
} |
||||
|
||||
|
@ -0,0 +1,164 @@ |
||||
package com.ynxbd.common.dao.his; |
||||
|
||||
import cn.hutool.core.util.IdcardUtil; |
||||
import cn.hutool.core.util.PhoneUtil; |
||||
import com.ynxbd.common.bean.enums.HisAuthAgentRelationEnum; |
||||
import com.ynxbd.common.bean.his.HisAuthAgent; |
||||
import com.ynxbd.common.helper.his.HisEnum; |
||||
import com.ynxbd.common.helper.his.HisHelper; |
||||
import com.ynxbd.common.result.JsonResult; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.result.ServiceException; |
||||
import org.apache.commons.lang3.ObjectUtils; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
// 授权委托人
|
||||
public class HisAuthAgentDao { |
||||
|
||||
/** |
||||
* 委托人信息查询 |
||||
* |
||||
* @param treatNum 门诊号 |
||||
* @param treatType 1:门诊;2:住院 |
||||
* @return list |
||||
*/ |
||||
public List<HisAuthAgent> queryAuthAgent(String treatNum, Integer treatType) throws ServiceException { |
||||
if (ObjectUtils.isEmpty(treatNum)) { |
||||
throw new ServiceException("就诊号参数为空"); |
||||
} |
||||
if (treatType == null) { |
||||
treatType = 2; |
||||
} |
||||
Map<String, Object> params = new HashMap<>(); |
||||
if (treatType == 1) { |
||||
params.put("MZNum", treatNum); |
||||
} else if (treatType == 2) { |
||||
params.put("ZYNum", treatNum); |
||||
} else { |
||||
throw new ServiceException("就诊类型异常"); |
||||
} |
||||
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.QUERY_AUTH_AGENT, params); |
||||
if (!jsonResult.success()) { |
||||
throw new ServiceException(jsonResult.getMessage()); |
||||
} |
||||
return jsonResult.getDataMapList(HisAuthAgent.class, "Items", "Item"); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 委托人信息查询 |
||||
* |
||||
* @param treatNum 门诊号 |
||||
* @param treatType 1:门诊;2:住院 |
||||
*/ |
||||
public void addAuthAgent(String treatNum, Integer treatType, String personName, String personSex, String personTel, String personId, String relationship, Integer personAge, String personAddress) throws ServiceException { |
||||
if (ObjectUtils.isEmpty(treatNum)) { |
||||
throw new ServiceException("就诊号参数为空"); |
||||
} |
||||
if (ObjectUtils.isEmpty(personName) || ObjectUtils.isEmpty(personTel) || ObjectUtils.isEmpty(personId)) { |
||||
throw new ServiceException("委托人信息为空"); |
||||
} |
||||
if (!PhoneUtil.isPhone(personTel)) { |
||||
throw new ServiceException(ResultEnum.TEL_ERROR); |
||||
} |
||||
|
||||
if (!IdcardUtil.isValidCard(personId)) { |
||||
throw new ServiceException(ResultEnum.ID_CARD_ERROR); |
||||
} |
||||
|
||||
if (treatType == null) { |
||||
treatType = 2; |
||||
} |
||||
|
||||
HisAuthAgentRelationEnum relationEnum = HisAuthAgentRelationEnum.findEnumByName(relationship); |
||||
if (relationEnum == null) { |
||||
throw new ServiceException("关系匹配失败"); |
||||
} |
||||
|
||||
Map<String, Object> params = new HashMap<>(); |
||||
if (treatType == 1) { |
||||
params.put("MZNum", treatNum); |
||||
} else if (treatType == 2) { |
||||
params.put("ZYNum", treatNum); |
||||
} else { |
||||
throw new ServiceException("就诊类型异常"); |
||||
} |
||||
params.put("PersonName", personName); |
||||
params.put("PersonSex", personSex); |
||||
params.put("PersonTel", personTel); |
||||
params.put("PersonID", personId); |
||||
params.put("PersonAge", personAge); |
||||
params.put("PersonAddress", personAddress); |
||||
params.put("Relationship", relationEnum.NAME); |
||||
|
||||
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.ADD_AUTH_AGENT, params); |
||||
if (!jsonResult.success()) { |
||||
throw new ServiceException(jsonResult.getMessage()); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 委托人信息查询 |
||||
* |
||||
* @param itemNo 记录id |
||||
*/ |
||||
public void updateAuthAgent(String itemNo, String personName, String personSex, String personTel, String personId, String relationship, String personAge, String personAddress) throws ServiceException { |
||||
if (ObjectUtils.isEmpty(itemNo)) { |
||||
throw new ServiceException("记录id为空"); |
||||
} |
||||
if (ObjectUtils.isEmpty(personName) || ObjectUtils.isEmpty(personTel) || ObjectUtils.isEmpty(personId)) { |
||||
throw new ServiceException("委托人信息为空"); |
||||
} |
||||
|
||||
if (!PhoneUtil.isPhone(personTel)) { |
||||
throw new ServiceException(ResultEnum.TEL_ERROR); |
||||
} |
||||
|
||||
if (!IdcardUtil.isValidCard(personId)) { |
||||
throw new ServiceException(ResultEnum.ID_CARD_ERROR); |
||||
} |
||||
|
||||
HisAuthAgentRelationEnum relationEnum = HisAuthAgentRelationEnum.findEnumByName(relationship); |
||||
if (relationEnum == null) { |
||||
throw new ServiceException("关系匹配失败"); |
||||
} |
||||
|
||||
Map<String, Object> params = new HashMap<>(); |
||||
params.put("ItemNo", itemNo); |
||||
params.put("PersonName", personName); |
||||
params.put("PersonSex", personSex); |
||||
params.put("PersonTel", personTel); |
||||
params.put("PersonID", personId); |
||||
params.put("PersonAge", personAge); |
||||
params.put("PersonAddress", personAddress); |
||||
params.put("Relationship", relationEnum.NAME); |
||||
|
||||
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.UPDATE_AUTH_AGENT, params); |
||||
if (!jsonResult.success()) { |
||||
throw new ServiceException(jsonResult.getMessage()); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 委托人信息查询 |
||||
* |
||||
* @param itemNo 记录id |
||||
*/ |
||||
public void delAuthAgent(String itemNo) throws ServiceException { |
||||
if (ObjectUtils.isEmpty(itemNo)) { |
||||
throw new ServiceException("记录id为空"); |
||||
} |
||||
|
||||
Map<String, Object> params = new HashMap<>(); |
||||
params.put("ItemNo", itemNo); |
||||
|
||||
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.DELETE_AUTH_AGENT, params); |
||||
if (!jsonResult.success()) { |
||||
throw new ServiceException(jsonResult.getMessage()); |
||||
} |
||||
} |
||||
} |
@ -1 +1 @@ |
||||
# \u5F00\u542F\u5904\u65B9\u9884\u7ED3\u7B97\uFF08\u7B2C2\u5F00\u5173\uFF09\uFF08\u6CE8\u610F\u8BE5\u914D\u7F6E\u9700\u8054\u7CFBhis\u5F00\u53D1\u8005\u786E\u8BA4\u652F\u6301\u624D\u80FD\u5F00\u542F\uFF0C\u5426\u5219\u5B58\u5728\u98CE\u9669\uFF01\uFF09
his.is_recipe_prepay=false
lis.url=192.168.1.185:8090
lis.unifiedEntrance=true
# \u672C\u5730
#his.url=127.0.0.1:8888
# \u6D4B\u8BD5\u73AF\u5883
ali_code=675448357
# \u662F\u5426\u5F3A\u5236\u6253\u5370webservice\u7684xml\u8FD4\u56DE\u6570\u636E
his.is_log_resp=true
# \u662F\u5426\u4F20\u9012openid\u7ED9his\u63A8\u9001\u6D88\u606F
his.is_push_msg=false
#-------------------------------------------------------------
#\u672C\u5730
his.md_url=127.0.0.1:7777
his.dev_url=127.0.0.1:7777
## \u5FB7\u5B8F\u4E2D\u533B
#his.url=200.200.200.60:8888
# \u7EA2\u6CB3\u5DDE\u533B\u9662
his.url=10.20.10.6:8888
# \u5B81\u8497\u5987\u5E7C
#his.url=172.19.3.15:8888
# \u516C\u53F8\u6D4B\u8BD5
#his.url=192.168.12.39:8888
# \u516C\u53F8\u6D4B\u8BD5
#his.url=192.168.12.10:8888
# \u7EA2\u6CB3
#his.url=10.20.10.6:8888
# \u7EA2\u6CB3\u533B\u4FDD
#his.url=10.20.10.6:8888
#his.url=192.168.12.10:8888
#his.md_url=192.168.1.128:7885
#his.dev_url=10.20.10.6:9988
# \u6C38\u80DC
#his.url=200.200.200.20:8888
# \u5FB7\u5B8F\u4E2D\u533B
#his.url=200.200.200.60:8888
# \u534E\u576A
#his.url=192.168.1.115:8888
# \u8499\u81EA\u4E2D\u533B
#his.url=192.168.0.228:8888
# \u7389\u9F99
#his.url=192.168.0.17:8888
# \u4E91\u9F99
#his.url=200.200.200.69:8888
#
#his.url=172.16.10.15:8888
# \u7984\u529D\u949F\u7231
#his.url=200.200.200.5:8888
# \u8499\u81EA\u5E02\u4EBA\u6C11\u533B\u9662
#his.url=200.200.200.174:8080
# \u5143\u8C0B
#his.url=200.200.200.29:8888
# \u5143\u8C0B\u533B\u4FDD
#his.dev_url=200.200.200.36:9999
# \u8292\u5E02
#his.url=192.168.100.8:8888
# \u7EA2\u6CB3\u5987\u5E7C\u4FDD\u5065\u9662
#his.url=192.168.1.204:8888
# \u8292\u5E02\u5987\u5E7C
#his.url=192.168.11.7:8888
#
#his.url=10.10.11.23:8888
# \u77F3\u6797
#his.url=192.168.10.10:8888
# \u5BCC\u6C11
#his.url=200.200.201.27:8888
# \u897F\u53CC\u7248\u7EB3
#his.url=10.10.11.23:8888
#wx.password=ynxbd@6910 |
||||
# \u5F00\u542F\u5904\u65B9\u9884\u7ED3\u7B97\uFF08\u7B2C2\u5F00\u5173\uFF09\uFF08\u6CE8\u610F\u8BE5\u914D\u7F6E\u9700\u8054\u7CFBhis\u5F00\u53D1\u8005\u786E\u8BA4\u652F\u6301\u624D\u80FD\u5F00\u542F\uFF0C\u5426\u5219\u5B58\u5728\u98CE\u9669\uFF01\uFF09
his.is_recipe_prepay=false
lis.url=192.168.1.185:8090
lis.unifiedEntrance=true
# \u672C\u5730
#his.url=127.0.0.1:8888
# \u6D4B\u8BD5\u73AF\u5883
ali_code=675448357
# \u662F\u5426\u5F3A\u5236\u6253\u5370webservice\u7684xml\u8FD4\u56DE\u6570\u636E
his.is_log_resp=true
# \u662F\u5426\u4F20\u9012openid\u7ED9his\u63A8\u9001\u6D88\u606F
his.is_push_msg=false
#-------------------------------------------------------------
#\u672C\u5730
his.md_url=127.0.0.1:7777
his.dev_url=127.0.0.1:7777
## \u5FB7\u5B8F\u4E2D\u533B
his.url=200.200.200.60:8888
## \u7EA2\u6CB3\u5DDE\u533B\u9662
#his.url=10.20.10.6:8888
# \u5B81\u8497\u5987\u5E7C
#his.url=172.19.3.15:8888
# \u516C\u53F8\u6D4B\u8BD5
#his.url=192.168.12.39:8888
# \u516C\u53F8\u6D4B\u8BD5
#his.url=192.168.12.10:8888
# \u7EA2\u6CB3
#his.url=10.20.10.6:8888
# \u7EA2\u6CB3\u533B\u4FDD
#his.url=10.20.10.6:8888
#his.url=192.168.12.10:8888
#his.md_url=192.168.1.128:7885
#his.dev_url=10.20.10.6:9988
# \u6C38\u80DC
#his.url=200.200.200.20:8888
# \u5FB7\u5B8F\u4E2D\u533B
#his.url=200.200.200.60:8888
# \u534E\u576A
#his.url=192.168.1.115:8888
# \u8499\u81EA\u4E2D\u533B
#his.url=192.168.0.228:8888
# \u7389\u9F99
#his.url=192.168.0.17:8888
# \u4E91\u9F99
#his.url=200.200.200.69:8888
#
#his.url=172.16.10.15:8888
# \u7984\u529D\u949F\u7231
#his.url=200.200.200.5:8888
# \u8499\u81EA\u5E02\u4EBA\u6C11\u533B\u9662
#his.url=200.200.200.174:8080
# \u5143\u8C0B
#his.url=200.200.200.29:8888
# \u5143\u8C0B\u533B\u4FDD
#his.dev_url=200.200.200.36:9999
# \u8292\u5E02
#his.url=192.168.100.8:8888
# \u7EA2\u6CB3\u5987\u5E7C\u4FDD\u5065\u9662
#his.url=192.168.1.204:8888
# \u8292\u5E02\u5987\u5E7C
#his.url=192.168.11.7:8888
#
#his.url=10.10.11.23:8888
# \u77F3\u6797
#his.url=192.168.10.10:8888
# \u5BCC\u6C11
#his.url=200.200.201.27:8888
# \u897F\u53CC\u7248\u7EB3
#his.url=10.10.11.23:8888
#wx.password=ynxbd@6910 |
Loading…
Reference in new issue