提交 37992f34 编写于 作者: yongbo.wang's avatar yongbo.wang

Merge branch 'release' into 'master'

Release



See merge request !62
流水线 #32300 已失败 于阶段
in 0 second
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId>
<version>1.0.4.0</version>
<version>1.0.4.1</version>
<name>pica-cloud-account-client</name>
<packaging>jar</packaging>
......
......@@ -29,4 +29,7 @@ public interface AccountInfoClient {
@PostMapping("/account/info/wechat/batch")
PicaResponse<Map<Integer,String>> getWechatInfoBatch(@RequestBody List<Integer> docIds);
@GetMapping(value = "/account/account/innerDoctors")
PicaResponse<List<Integer>> getDoctorsByInnerOrg();
}
......@@ -75,4 +75,7 @@ public class Constants {
/** 风控记录过数据 */
public static final String RC_RECORDED_DATA_KEY = "risk-{mobile}-{ip}";
/** 内部机构医生ids数据 */
public static final String INNER_ORG_IDS = "inner-org-ids";
}
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.pica.cloud.account.account.server.constants.Constants;
import com.pica.cloud.account.account.server.entity.Account;
import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.entity.EncryptEntity;
import com.pica.cloud.account.account.server.entity.LoginResult;
import com.pica.cloud.account.account.server.enums.AccountTypeEnum;
......@@ -11,6 +12,7 @@ import com.pica.cloud.account.account.server.req.AccountReq;
import com.pica.cloud.account.account.server.req.BaseRequest;
import com.pica.cloud.account.account.server.service.AccountService;
import com.pica.cloud.account.account.server.service.CaptchaService;
import com.pica.cloud.account.account.server.service.DoctorService;
import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.account.account.server.util.CryptoUtil;
import com.pica.cloud.account.account.server.util.IntactUtil;
......@@ -36,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
......@@ -62,6 +65,9 @@ public class AccountController extends AccountBaseController {
@Autowired
private IntactUtil intactUtil;
@Autowired
private DoctorService doctorService;
@GetMapping("/test")
public String test() {
return "{\"status\":\"UP\"}";
......@@ -416,6 +422,12 @@ public class AccountController extends AccountBaseController {
}
}
@ApiOperation("获取内部机构医生ids")
@GetMapping("/innerDoctors")
public PicaResponse<List<Integer>> getDoctorsByInnerOrg(){
return PicaResponse.toResponse(doctorService.getDoctorsByInnerOrg());
}
//手机格式校验
private void checkMobilePhone(String mobilePhone) {
if (StringUtils.isBlank(mobilePhone) || !ValidateUtils.isMobile(mobilePhone)) {
......
......@@ -117,5 +117,7 @@ public interface DoctorMapper {
List<WechatInfoDto> getBatchUnionIdByDoctorId(List<Integer> list);
List<Integer> getDoctorsByInnerOrg(List<String> list);
}
\ No newline at end of file
......@@ -54,4 +54,6 @@ public interface DoctorService {
void unbindWeChat(int acctId);
void revertAccts(List<Integer> doctorIds);
List<Integer> getDoctorsByInnerOrg();
}
package com.pica.cloud.account.account.server.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.pica.cloud.account.account.server.constants.Constants;
import com.pica.cloud.account.account.server.entity.AccountInfoEntity;
import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.enums.AccountExceptionEnum;
......@@ -12,17 +13,16 @@ import com.pica.cloud.account.account.server.util.AESUtil;
import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.foundation.encryption.common.constants.EncryptConstants;
import com.pica.cloud.foundation.encryption.util.EncryptUtils;
import com.pica.cloud.foundation.utils.entity.PicaDoctor;
import com.pica.cloud.foundation.redis.ICacheClient;
import com.pica.cloud.foundation.utils.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -51,6 +51,9 @@ public class DoctorServiceImpl implements DoctorService {
@Autowired
private AccountUnionMapper accountUnionMapper;
@Autowired
private ICacheClient cacheClient;
@Override
public Doctor getDoctorInfo(Integer id) {
return doctorMapper.selectByPrimaryKey(id);
......@@ -60,7 +63,7 @@ public class DoctorServiceImpl implements DoctorService {
@Transactional
@Override
public void modifyDoctorInfo(Doctor doctor,Long doctorId) {
public void modifyDoctorInfo(Doctor doctor, Long doctorId) {
Integer id = doctor.getId();
if (id == null) {
throw new AccountException(AccountExceptionEnum.PICA_PARAMS_ERROR);
......@@ -90,20 +93,20 @@ public class DoctorServiceImpl implements DoctorService {
@Transactional
@Override
public void deleteDoctorInfo(Integer id,Long modifyId) {
public void deleteDoctorInfo(Integer id, Long modifyId) {
//p_doctor表修改记录状态
Doctor doctor = doctorMapper.selectByPrimaryKey(id);
if (doctor != null) {
Integer acctId = doctor.getAcctId();
HashMap<String, Long> map = new HashMap<>();
map.put("id",id.longValue());
map.put("modifyId",modifyId);
map.put("id", id.longValue());
map.put("modifyId", modifyId);
doctorMapper.updateDeleteByPrimaryKey(map);
HashMap<String, Long> acctMap = new HashMap<>();
acctMap.put("modifyId",modifyId);
acctMap.put("acctId",acctId.longValue());
acctMap.put("modifyId", modifyId);
acctMap.put("acctId", acctId.longValue());
accountInfoDetailMapper.updateDeleteByPrimaryKey(acctMap);
logger.info("deleteDoctorInfo acctId:{}",acctId);
logger.info("deleteDoctorInfo acctId:{}", acctId);
accountUnionMapper.deleteByAcctId(acctId);
} else {
throw new AccountException(AccountExceptionEnum.PICA_NOT_REGISTER);
......@@ -121,7 +124,7 @@ public class DoctorServiceImpl implements DoctorService {
*/
@Override
@Transactional
public Integer addDoctorInfo(Doctor doctor,Long doctorId) {
public Integer addDoctorInfo(Doctor doctor, Long doctorId) {
String mobilePhone = doctor.getMobilePhone();
String mobileEncrypt = AESUtil.encryptV0(mobilePhone);
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt);
......@@ -178,13 +181,13 @@ public class DoctorServiceImpl implements DoctorService {
@Transactional(rollbackFor = Exception.class)
public void revertAccts(List<Integer> doctorIds) {
logger.info("revertAccts:{}", JSONObject.toJSONString(doctorIds));
if(doctorIds.size() == 0){
if (doctorIds.size() == 0) {
return;
}
//check docIds 是否都是已经删除了
List<Doctor> docList = doctorMapper.getRevertListByDoctorIds(doctorIds);
if(docList.size() != doctorIds.size()){
if (docList.size() != doctorIds.size()) {
logger.error("revertAccts: 入参中存在未删除的医生id");
return;
}
......@@ -203,4 +206,25 @@ public class DoctorServiceImpl implements DoctorService {
doctorHospitalMapper.updateRevertByDocIds(doctorIds);
logger.info("revertAccts:end");
}
@Override
public List<Integer> getDoctorsByInnerOrg() {
String ids = cacheClient.get(Constants.INNER_ORG_IDS);
if(StringUtil.isEmpty(ids)){
List<Integer> dbIds = doctorMapper.getDoctorsByInnerOrg(null);
String arrStr = "";
for(Integer i : dbIds){
arrStr = arrStr + i + ",";
}
cacheClient.setex(Constants.INNER_ORG_IDS,arrStr,3600);
return dbIds;
}else {
List<Integer> rtnIds = Arrays.asList(ids.split(",")).stream().filter(s -> !"".equals(s)).map(s -> Integer.parseInt(s)).collect(Collectors.toList());
return rtnIds;
}
}
}
......@@ -1083,4 +1083,9 @@
and d.delete_flag = 1 and a.delete_flag = 1 and u.delete_flag = 1
</select>
<select id="getDoctorsByInnerOrg" resultType="java.lang.Integer" parameterType="java.util.List">
select id from p_doctor where (hospital like ('云鹊%') or hospital LIKE ('测试%')) and delete_flag = 1;
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册