提交 fbddd1ab 编写于 作者: xixian.wang@picahealth.com's avatar xixian.wang@picahealth.com

Merge branch 'dev-20200102-repeat' into 'release'

Dev 20200102 repeat



See merge request !9
流水线 #20473 已失败 于阶段
in 0 second
...@@ -86,6 +86,11 @@ ...@@ -86,6 +86,11 @@
<version>2.1.0</version> <version>2.1.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.pica.cloud.base.doctor</groupId>
<artifactId>pica-cloud-doctor-client</artifactId>
<version>1.1.0.4-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>com.pica.cloud.foundation</groupId> <groupId>com.pica.cloud.foundation</groupId>
......
...@@ -11,9 +11,13 @@ import com.pica.cloud.foundation.encryption.util.EncryptUtils; ...@@ -11,9 +11,13 @@ import com.pica.cloud.foundation.encryption.util.EncryptUtils;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.entity.PicaResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
* Created on 2019/9/10 18:51 * Created on 2019/9/10 18:51
* author:crs * author:crs
...@@ -24,6 +28,8 @@ import org.springframework.web.bind.annotation.*; ...@@ -24,6 +28,8 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/doctor") @RequestMapping("/doctor")
public class DoctorController extends AccountBaseController { public class DoctorController extends AccountBaseController {
private Logger logger= LoggerFactory.getLogger(DoctorController.class);
@Autowired @Autowired
private DoctorService doctorService; private DoctorService doctorService;
...@@ -75,6 +81,7 @@ public class DoctorController extends AccountBaseController { ...@@ -75,6 +81,7 @@ public class DoctorController extends AccountBaseController {
@ApiOperation("客服系统删除医生信息") @ApiOperation("客服系统删除医生信息")
@DeleteMapping(value = "/delete/{id}") @DeleteMapping(value = "/delete/{id}")
public PicaResponse deleteDoctor(@PathVariable("id") Integer id) { public PicaResponse deleteDoctor(@PathVariable("id") Integer id) {
logger.info("id,super.getDoctorIdByToken()"+id+"------>"+super.getDoctorIdByToken());
doctorService.deleteDoctorInfo(id,super.getDoctorIdByToken()); doctorService.deleteDoctorInfo(id,super.getDoctorIdByToken());
return PicaResponse.toResponse(); return PicaResponse.toResponse();
} }
......
...@@ -10,13 +10,13 @@ import com.pica.cloud.account.account.server.mapper.DoctorMapper; ...@@ -10,13 +10,13 @@ import com.pica.cloud.account.account.server.mapper.DoctorMapper;
import com.pica.cloud.account.account.server.service.DoctorService; import com.pica.cloud.account.account.server.service.DoctorService;
import com.pica.cloud.account.account.server.util.AESUtil; import com.pica.cloud.account.account.server.util.AESUtil;
import com.pica.cloud.account.account.server.util.AccountUtils; import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.base.doctor.doctor.client.DoctorServiceClient;
import com.pica.cloud.base.doctor.doctor.common.dto.DoctorDeleteDto;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.codehaus.groovy.transform.tailrec.VariableAccessReplacer;
import org.springframework.beans.factory.annotation.Autowired; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -32,6 +32,9 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -32,6 +32,9 @@ public class DoctorServiceImpl implements DoctorService {
@Autowired @Autowired
private DoctorMapper doctorMapper; private DoctorMapper doctorMapper;
@Autowired
private DoctorServiceClient doctorServiceClient;
@Autowired @Autowired
private AccountInfoDetailMapper accountInfoDetailMapper; private AccountInfoDetailMapper accountInfoDetailMapper;
...@@ -42,7 +45,7 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -42,7 +45,7 @@ public class DoctorServiceImpl implements DoctorService {
@Transactional @Transactional
@Override @Override
public void modifyDoctorInfo(Doctor doctor,Long doctorId) { public void modifyDoctorInfo(Doctor doctor, Long doctorId) {
Integer id = doctor.getId(); Integer id = doctor.getId();
if (id == null) { if (id == null) {
throw new AccountException(AccountExceptionEnum.PICA_PARAMS_ERROR); throw new AccountException(AccountExceptionEnum.PICA_PARAMS_ERROR);
...@@ -69,18 +72,22 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -69,18 +72,22 @@ public class DoctorServiceImpl implements DoctorService {
@Transactional @Transactional
@Override @Override
public void deleteDoctorInfo(Integer id,Long modifyId) { public void deleteDoctorInfo(Integer id, Long modifyId) {
//p_doctor表修改记录状态 //p_doctor表修改记录状态
Doctor doctor = doctorMapper.selectByPrimaryKey(id); Doctor doctor = doctorMapper.selectByPrimaryKey(id);
if (doctor != null) { if (doctor != null) {
Integer acctId = doctor.getAcctId(); Integer acctId = doctor.getAcctId();
HashMap<String, Long> map = new HashMap<>(); //HashMap<String, Long> map = new HashMap<>();
map.put("id",id.longValue()); //map.put("id", id.longValue());
map.put("modifyId",modifyId); //map.put("modifyId", modifyId);
doctorMapper.updateDeleteByPrimaryKey(map); DoctorDeleteDto doctorDeleteDto = new DoctorDeleteDto();
doctorDeleteDto.setId(id.longValue());
doctorDeleteDto.setModifyId(modifyId);
doctorServiceClient.deleteDoctor(doctorDeleteDto);
//doctorMapper.updateDeleteByPrimaryKey(map);
HashMap<String, Long> acctMap = new HashMap<>(); HashMap<String, Long> acctMap = new HashMap<>();
acctMap.put("modifyId",modifyId); acctMap.put("modifyId", modifyId);
acctMap.put("acctId",acctId.longValue()); acctMap.put("acctId", acctId.longValue());
accountInfoDetailMapper.updateDeleteByPrimaryKey(acctMap); accountInfoDetailMapper.updateDeleteByPrimaryKey(acctMap);
} else { } else {
throw new AccountException(AccountExceptionEnum.PICA_NOT_REGISTER); throw new AccountException(AccountExceptionEnum.PICA_NOT_REGISTER);
...@@ -98,7 +105,7 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -98,7 +105,7 @@ public class DoctorServiceImpl implements DoctorService {
*/ */
@Override @Override
@Transactional @Transactional
public Integer addDoctorInfo(Doctor doctor,Long doctorId) { public Integer addDoctorInfo(Doctor doctor, Long doctorId) {
String mobilePhone = doctor.getMobilePhone(); String mobilePhone = doctor.getMobilePhone();
String mobileEncrypt = AESUtil.encryptV0(mobilePhone); String mobileEncrypt = AESUtil.encryptV0(mobilePhone);
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt); AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt);
......
...@@ -179,27 +179,27 @@ public class AESUtil { ...@@ -179,27 +179,27 @@ public class AESUtil {
* 测试 * 测试
*/ */
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// String KEY="zJJ$c5md3$yuuhWW"; String KEY="zJJ$c5md3$yuuhWW";
// System.out.println("-------------加密---------"); System.out.println("-------------加密---------");
// String content = "18621903846"; String content = "17521591001";
//
//
// System.out.println("加密前:" + content); System.out.println("加密前:" + content);
// System.out.println("加密密钥和解密密钥:" + KEY); System.out.println("加密密钥和解密密钥:" + KEY);
//
// System.out.println("-------------解密---------"); System.out.println("-------------解密---------");
// String encrypt = aesEncrypt(content, KEY); String encrypt = aesEncrypt(content, KEY);
// System.out.println("加密后:" + encrypt); System.out.println("加密后:" + encrypt);
// String decrypt = aesDecrypt("ieE4wN+GkIxm8S8tSVqTow==", KEY); String decrypt = aesDecrypt(encrypt, KEY);
// System.out.println("解密后:" + decrypt); System.out.println("解密后:" + decrypt);
//请求参数解密处理 //请求参数解密处理
String key="aPzpkXKhX0xsgwG0L7uOiz47fKQKKW1pzzIyx9wRSoCtm4vux1+ctjKzQ77jb+Vvt4zB/z0wr7U5nszk7kXLKQR4A6nU5nt8O44CHjCHUU0dWbpPyd2TKFdZ58ZyKLsk1+Xc4wJ1HB0FQjxJefWvo5ioFYLasOpxSbKU7oHqXq4="; // String key="aPzpkXKhX0xsgwG0L7uOiz47fKQKKW1pzzIyx9wRSoCtm4vux1+ctjKzQ77jb+Vvt4zB/z0wr7U5nszk7kXLKQR4A6nU5nt8O44CHjCHUU0dWbpPyd2TKFdZ58ZyKLsk1+Xc4wJ1HB0FQjxJefWvo5ioFYLasOpxSbKU7oHqXq4=";
String decrypt = RSAUtil.decrypt(key,procPrivateKey); // String decrypt = RSAUtil.decrypt(key,procPrivateKey);
System.out.println(decrypt); // System.out.println(decrypt);
String content="x/119w4nmos1xMG1DFNzBDeUP7BmyGViwXB66UCCk2HaCoJWhNg6qL1WoDMLGkiMJni8GV8fzEpd+1h9z4LA99wEkn47rbK6+MLaGkMIv+QmXzMLxThpLJNxadb2ltRyKgz5wERoFB/AH/xxgRn8kw=="; // String content="x/119w4nmos1xMG1DFNzBDeUP7BmyGViwXB66UCCk2HaCoJWhNg6qL1WoDMLGkiMJni8GV8fzEpd+1h9z4LA99wEkn47rbK6+MLaGkMIv+QmXzMLxThpLJNxadb2ltRyKgz5wERoFB/AH/xxgRn8kw==";
String result = AESUtil.aesDecrypt(content, decrypt); // String result = AESUtil.aesDecrypt(content, decrypt);
System.out.println(result); // System.out.println(result);
// ArrayList<String> list = new ArrayList<>(); // ArrayList<String> list = new ArrayList<>();
......
spring.profiles.active=dev spring.profiles.active=test1
\ No newline at end of file \ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册