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

Merge branch 'release' into dev-130

# Conflicts:
#	server/pom.xml
流水线 #16635 已失败 于阶段
in 0 second
...@@ -81,12 +81,27 @@ public class Test { ...@@ -81,12 +81,27 @@ public class Test {
System.out.println("--------------------登录接口-------------"); System.out.println("--------------------登录接口-------------");
String publicKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa6j3SJwXr/pLLwb6Pq8pi9StPq+Wvm6vu+LWQB1hNqClWk0jQm5GnF6Kj0ac2gqgsMsutc3hhMaaX2QZvLX+gFQHC/ufGBdBbpPtDeGWsQItsMf/xqqlkLPkc7eVTyfsmrpQM7BG9LVvaPVXPVUcZfJNBaYuR4+Sf6Zi2ayI/hQIDAQAB"; String publicKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa6j3SJwXr/pLLwb6Pq8pi9StPq+Wvm6vu+LWQB1hNqClWk0jQm5GnF6Kj0ac2gqgsMsutc3hhMaaX2QZvLX+gFQHC/ufGBdBbpPtDeGWsQItsMf/xqqlkLPkc7eVTyfsmrpQM7BG9LVvaPVXPVUcZfJNBaYuR4+Sf6Zi2ayI/hQIDAQAB";
BaseRequest login = new BaseRequest(); BaseRequest login = new BaseRequest();
login.setMobile("130241112588"); login.setMobile("13024112588");
login.setPassword("D0DCBF0D12A6B1E7FBFA2CE5848F3EFF"); login.setPassword("d0dcbf0d12a6b1e7fbfa2ce5848f3eff");
String con = JSONObject.toJSONString(login); String con = JSONObject.toJSONString(login);
String contentResult = AESUtil.aesEncrypt(con, "YCPQPx4qpQjEjDea"); String contentResult = AESUtil.aesEncrypt(con, "YCPQPx4qpQjEjDea");
String keyResult = RSAUtil.encrypt("YCPQPx4qpQjEjDea",publicKey); String keyResult = RSAUtil.encrypt("YCPQPx4qpQjEjDea",publicKey);
EncryptEntity encryptTest = new EncryptEntity(); EncryptEntity encryptTest = new EncryptEntity();
encryptTest.setContent(contentResult); encryptTest.setContent(contentResult);
encryptTest.setKey(keyResult); encryptTest.setKey(keyResult);
......
package com.pica.cloud.account.account.server.controller; package com.pica.cloud.account.account.server.controller;
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.entity.Doctor;
import com.pica.cloud.account.account.server.entity.EncryptEntity; import com.pica.cloud.account.account.server.entity.EncryptEntity;
import com.pica.cloud.account.account.server.enums.AccountExceptionEnum;
import com.pica.cloud.account.account.server.enums.AccountTypeEnum; import com.pica.cloud.account.account.server.enums.AccountTypeEnum;
import com.pica.cloud.account.account.server.exception.AccountException;
import com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper; import com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper;
import com.pica.cloud.account.account.server.req.BaseRequest; import com.pica.cloud.account.account.server.req.BaseRequest;
import com.pica.cloud.account.account.server.service.AccountInfoService; import com.pica.cloud.account.account.server.service.AccountInfoService;
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.service.ModifyMobileService; import com.pica.cloud.account.account.server.service.ModifyMobileService;
import com.pica.cloud.account.account.server.service.impl.AccountServiceImpl;
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.account.account.server.util.CryptoUtil; import com.pica.cloud.account.account.server.util.CryptoUtil;
...@@ -19,7 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -19,7 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@Api(description="修改手机号资源") @Api(description = "修改手机号资源")
@RestController @RestController
public class ModifyMobileController extends AccountBaseController { public class ModifyMobileController extends AccountBaseController {
...@@ -32,6 +36,9 @@ public class ModifyMobileController extends AccountBaseController { ...@@ -32,6 +36,9 @@ public class ModifyMobileController extends AccountBaseController {
@Autowired @Autowired
private DoctorService doctorService; private DoctorService doctorService;
@Autowired
private AccountServiceImpl accountService;
@ApiOperation("修改手机号") @ApiOperation("修改手机号")
@PostMapping("/mobile/modify") @PostMapping("/mobile/modify")
...@@ -43,7 +50,13 @@ public class ModifyMobileController extends AccountBaseController { ...@@ -43,7 +50,13 @@ public class ModifyMobileController extends AccountBaseController {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class); BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
String mobile = request.getMobile(); String mobile = request.getMobile();
accountUtils.checkMobilePhoneAndAuthCode(mobile, AccountTypeEnum.SYSCODE_TYPE_MODIFY_MOBILE.getCode() + "", request.getAuthCode()); accountUtils.checkMobilePhoneAndAuthCode(mobile, AccountTypeEnum.SYSCODE_TYPE_MODIFY_MOBILE.getCode() + "", request.getAuthCode());
modifyMobileService.modify(acctId, mobile); //判断当前手机号是否已经注册过
return PicaResponse.toResponse(); AccountInfoEntity accountInfoEntity = accountService.getAccountByMobilePhone(mobile);
if (accountInfoEntity == null) {
modifyMobileService.modify(acctId, mobile);
return PicaResponse.toResponse();
} else {
return PicaResponse.toResponse(null,AccountExceptionEnum.PICA_ALREADY_REGISTER.getCode(),AccountExceptionEnum.PICA_ALREADY_REGISTER.getMessage());
}
} }
} }
...@@ -48,7 +48,6 @@ public class PasswordController extends AccountBaseController { ...@@ -48,7 +48,6 @@ public class PasswordController extends AccountBaseController {
@PostMapping(value = "/modify") @PostMapping(value = "/modify")
public PicaResponse modifyPassword(@RequestBody EncryptEntity entity) throws Exception { public PicaResponse modifyPassword(@RequestBody EncryptEntity entity) throws Exception {
Long doctorId= super.getDoctorIdByToken(); Long doctorId= super.getDoctorIdByToken();
// AESUtil.encryptV0(picaUser.getMobile())
Doctor doctorInfo = doctorService.getDoctorInfo(doctorId.intValue()); Doctor doctorInfo = doctorService.getDoctorInfo(doctorId.intValue());
String mobile = doctorInfo.getMobilePhone(); String mobile = doctorInfo.getMobilePhone();
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobile); AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobile);
......
...@@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
public class RegisterController extends AccountBaseController { public class RegisterController extends AccountBaseController {
private final String REPEAT_REGISTER_PREFIX = "repeat-register—";
@Autowired @Autowired
private RegisterService registerService; private RegisterService registerService;
...@@ -46,32 +46,18 @@ public class RegisterController extends AccountBaseController { ...@@ -46,32 +46,18 @@ public class RegisterController extends AccountBaseController {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class); BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
String mobile = request.getMobile(); String mobile = request.getMobile();
//接口幂等性处理(redis中没有就进行注册逻辑,如果已经存在,就不处理) //接口幂等性处理(redis中没有就进行注册逻辑,如果已经存在,就不处理)
String exist = redisClient.get(REPEAT_REGISTER_PREFIX + mobile); String authCode = request.getAuthCode();
if (StringUtils.isBlank(exist)) { String flag = AccountTypeEnum.SYSCODE_TYPE_REGISTER.getCode() + "";
String authCode = request.getAuthCode(); accountUtils.checkMobilePhoneAndAuthCode(mobile, flag, authCode);
String flag = AccountTypeEnum.SYSCODE_TYPE_REGISTER.getCode() + ""; accountUtils.checkPassword(request.getPassword());
accountUtils.checkMobilePhoneAndAuthCode(mobile, flag, authCode);
accountUtils.checkPassword(request.getPassword()); LoginResult result = null;
redisClient.set(REPEAT_REGISTER_PREFIX + mobile, mobile, 30); request.setFlag(AccountTypeEnum.SYSCODE_TYPE_REGISTER.getCode());
LoginResult result = null; request.setProductType(super.getProductType());
try { request.setSourceType(super.getSourceType());
request.setFlag(AccountTypeEnum.SYSCODE_TYPE_REGISTER.getCode()); request.setLoginIp(super.getIpAddr());
request.setProductType(super.getProductType()); result = registerService.register(request);
request.setSourceType(super.getSourceType()); return PicaResponse.toResponse(result);
request.setLoginIp(super.getIpAddr());
result = registerService.register(request);
} catch (Exception e) {
//向上抛出异常,让异常处理框架捕获到
throw new AccountException(AccountExceptionEnum.PICA_REGISTER_FAIL);
} finally {
//如果在注册过程中抛出异常,就删除redis中的注册标记
redisClient.del(REPEAT_REGISTER_PREFIX + mobile);
}
redisClient.del(REPEAT_REGISTER_PREFIX + mobile);
return PicaResponse.toResponse(result);
} else {
return PicaResponse.toResponse(null, AccountExceptionEnum.PICA_ALREADY_REGISTER.getCode(), "正在注册中,请勿重复提交");
}
} }
//"sourceType":6 表示长海项目 //"sourceType":6 表示长海项目
......
package com.pica.cloud.account.account.server.job;
import com.pica.cloud.account.account.server.mapper.DoctorMapper;
import com.pica.cloud.foundation.redis.ICacheClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* Created on 2019/10/29 15:37
* author:crs
* Description:doctor表重复记录处理
*/
@Component
public class DoctorRepeatDataJob {
private final String KEY = "cacheProcessDoctorRepeat";
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ICacheClient cacheClient;
@Autowired
private DoctorMapper doctorMapper;
/**
* 1、使用分布式锁保证一个微服务执行;
* 2、定时任务;
*/
@Scheduled(cron = "0 0 0 * * ?")
public void processDoctorRepeatData() {
//通过接口幂等性逻辑处理
String exist = cacheClient.get(KEY);
if (exist==null){
cacheClient.set(KEY,"1");
cacheClient.expire(KEY, 60 * 10);
logger.info("开始执行刷新doctor表中重复的记录");
int row = doctorMapper.processDoctorRepeatData();
logger.info("此次数据刷新影响的行数:{}", row);
try {
//防止任务一秒跑完,其他机器的时间晚了几秒
Thread.sleep(30*1000);
} catch (InterruptedException ex) {
logger.error(ex.getMessage(), ex);
}
//释放锁
cacheClient.del(KEY);
}
}
}
...@@ -10,6 +10,8 @@ import com.pica.cloud.account.account.server.mapper.LogLoginMapper; ...@@ -10,6 +10,8 @@ import com.pica.cloud.account.account.server.mapper.LogLoginMapper;
import com.pica.cloud.account.account.server.mapper.LogPWDModifyMapper; import com.pica.cloud.account.account.server.mapper.LogPWDModifyMapper;
import com.pica.cloud.account.account.server.mapper.LogUserInfoMapper; import com.pica.cloud.account.account.server.mapper.LogUserInfoMapper;
import com.pica.cloud.account.account.server.util.BeanUtil; import com.pica.cloud.account.account.server.util.BeanUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Created on 2019/08/27 * Created on 2019/08/27
...@@ -18,6 +20,8 @@ import com.pica.cloud.account.account.server.util.BeanUtil; ...@@ -18,6 +20,8 @@ import com.pica.cloud.account.account.server.util.BeanUtil;
*/ */
public class AccountLogTask implements Runnable { public class AccountLogTask implements Runnable {
private Logger logger = LoggerFactory.getLogger(this.getClass());
private LogLoginMapper loginLogMapper; private LogLoginMapper loginLogMapper;
private LogPWDModifyMapper logPWDModifyMapper; private LogPWDModifyMapper logPWDModifyMapper;
...@@ -44,12 +48,18 @@ public class AccountLogTask implements Runnable { ...@@ -44,12 +48,18 @@ public class AccountLogTask implements Runnable {
@Override @Override
public void run() { public void run() {
if (type == AccountTypeEnum.LOG_TYPE_LOGIN.getCode()) { try {
loginLogMapper.insertSelective((LogLoginEntity) picaLogEntity); logger.info("log record......");
} else if (type == AccountTypeEnum.LOG_TYPE_PASSWORD.getCode()) { if (type == AccountTypeEnum.LOG_TYPE_LOGIN.getCode()) {
logPWDModifyMapper.insert((LogPWDModifyEntity) picaLogEntity); logger.info("login record......");
} else if (type == AccountTypeEnum.LOG_TYPE_USER_INFO.getCode()) { loginLogMapper.insert((LogLoginEntity) picaLogEntity);
logUserInfoMapper.insertSelective((LogUserInfoEntity) picaLogEntity); } else if (type == AccountTypeEnum.LOG_TYPE_PASSWORD.getCode()) {
logPWDModifyMapper.insert((LogPWDModifyEntity) picaLogEntity);
} else if (type == AccountTypeEnum.LOG_TYPE_USER_INFO.getCode()) {
logUserInfoMapper.insertSelective((LogUserInfoEntity) picaLogEntity);
}
} catch (Exception e) {
logger.error("log record......"+e.getMessage(),e);
} }
} }
} }
...@@ -44,10 +44,16 @@ public interface DoctorMapper { ...@@ -44,10 +44,16 @@ public interface DoctorMapper {
/** /**
* 通过账户id更新用户信息 * 通过账户id更新用户信息
*
* @param doctor * @param doctor
*/ */
void updateByAcctId(Doctor doctor); void updateByAcctId(Doctor doctor);
/**
* 处理重复的记录(相同手机号多条记录一致)
*/
int processDoctorRepeatData();
void updateByMobile(Doctor doctor); void updateByMobile(Doctor doctor);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
...@@ -60,6 +66,7 @@ public interface DoctorMapper { ...@@ -60,6 +66,7 @@ public interface DoctorMapper {
/** /**
* 绑定微信 * 绑定微信
*
* @param acctId * @param acctId
* @param unionId * @param unionId
* @return * @return
...@@ -68,6 +75,7 @@ public interface DoctorMapper { ...@@ -68,6 +75,7 @@ public interface DoctorMapper {
/** /**
* 解绑微信 * 解绑微信
*
* @param acctId * @param acctId
* @return * @return
*/ */
...@@ -78,7 +86,6 @@ public interface DoctorMapper { ...@@ -78,7 +86,6 @@ public interface DoctorMapper {
void updateDeleteByPrimaryKey(Integer id); void updateDeleteByPrimaryKey(Integer id);
/** /**
* 通过手机号获取用户id * 通过手机号获取用户id
* @param mobile * @param mobile
......
...@@ -10,40 +10,40 @@ import org.springframework.context.annotation.Configuration; ...@@ -10,40 +10,40 @@ import org.springframework.context.annotation.Configuration;
* author:crs * author:crs
* Description:消息队列配置 * Description:消息队列配置
*/ */
@Configuration //@Configuration
public class QueueConfig { //public class QueueConfig {
//
public final static String QUEUE_NAME = "register_queue_account_13201"; // public final static String QUEUE_NAME = "register_queue_account_13201";
public final static String EXCHANGE_NAME = "register_exchange"; // public final static String EXCHANGE_NAME = "register_exchange";
public final static String ROUTE_KEY_NAME = "register_finish"; // public final static String ROUTE_KEY_NAME = "register_finish";
//
/** // /**
* 创建一个消息队列 // * 创建一个消息队列
* // *
* @return // * @return
*/ // */
@Bean // @Bean
public Queue queue() { // public Queue queue() {
return new Queue(QUEUE_NAME, true, false, true); // return new Queue(QUEUE_NAME, true, false, true);
} // }
//
/** // /**
* 创建交换机 // * 创建交换机
* // *
* @return // * @return
*/ // */
@Bean // @Bean
public TopicExchange directExchange() { // public TopicExchange directExchange() {
return new TopicExchange(EXCHANGE_NAME); // return new TopicExchange(EXCHANGE_NAME);
} // }
//
/** // /**
* 把消息队里和交换机进行绑定 // * 把消息队里和交换机进行绑定
* // *
* @return // * @return
*/ // */
@Bean // @Bean
public Binding binding() { // public Binding binding() {
return BindingBuilder.bind(queue()).to(directExchange()).with(ROUTE_KEY_NAME); // return BindingBuilder.bind(queue()).to(directExchange()).with(ROUTE_KEY_NAME);
} // }
} //}
...@@ -9,18 +9,18 @@ import org.springframework.stereotype.Component; ...@@ -9,18 +9,18 @@ import org.springframework.stereotype.Component;
* author:crs * author:crs
* Description:消息生产者 * Description:消息生产者
*/ */
@Component //@Component
public class QueueProducer { //public class QueueProducer {
//
@Autowired // @Autowired
private AmqpTemplate amqpTemplate; // private AmqpTemplate amqpTemplate;
//
/** // /**
* 发送消息 // * 发送消息
* // *
* @param message // * @param message
*/ // */
public void send(byte[] message) { // public void send(byte[] message) {
amqpTemplate.convertAndSend(QueueConfig.EXCHANGE_NAME, QueueConfig.ROUTE_KEY_NAME, message); // amqpTemplate.convertAndSend(QueueConfig.EXCHANGE_NAME, QueueConfig.ROUTE_KEY_NAME, message);
} // }
} //}
...@@ -38,6 +38,7 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -38,6 +38,7 @@ public class DoctorServiceImpl implements DoctorService {
return doctorMapper.selectByPrimaryKey(id); return doctorMapper.selectByPrimaryKey(id);
} }
@Transactional
@Override @Override
public void modifyDoctorInfo(Doctor doctor) { public void modifyDoctorInfo(Doctor doctor) {
Integer id = doctor.getId(); Integer id = doctor.getId();
...@@ -55,9 +56,16 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -55,9 +56,16 @@ public class DoctorServiceImpl implements DoctorService {
doctor.setMobilePhone(AESUtil.encryptV0(mobilePhone)); doctor.setMobilePhone(AESUtil.encryptV0(mobilePhone));
doctor.setModifyTime(new Date()); doctor.setModifyTime(new Date());
doctorMapper.updateByPrimaryKeySelective(doctor); doctorMapper.updateByPrimaryKeySelective(doctor);
Integer acctId = entity.getAcctId();
AccountInfoEntity accountInfoEntity = new AccountInfoEntity();
accountInfoEntity.setMobilePhone(AESUtil.encryptV0(mobilePhone));
accountInfoEntity.setId(acctId);
accountInfoEntity.setModifiedId(1580052);
accountInfoEntity.setModifiedTime(new Date());
accountInfoDetailMapper.updateByPrimaryKeySelective(accountInfoEntity);
} }
@Transactional() @Transactional
@Override @Override
public void deleteDoctorInfo(Integer id) { public void deleteDoctorInfo(Integer id) {
//p_doctor表修改记录状态 //p_doctor表修改记录状态
...@@ -96,7 +104,7 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -96,7 +104,7 @@ public class DoctorServiceImpl implements DoctorService {
entity.setPassword(password); entity.setPassword(password);
entity.setCreatedTime(currentTime); entity.setCreatedTime(currentTime);
entity.setModifiedTime(currentTime); entity.setModifiedTime(currentTime);
entity.setModifiedId(0); entity.setModifiedId(1580052);
entity.setRegisterProduct(1); entity.setRegisterProduct(1);
entity.setRegTime(currentTime); entity.setRegTime(currentTime);
entity.setRegisterSource(3); entity.setRegisterSource(3);
...@@ -110,7 +118,7 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -110,7 +118,7 @@ public class DoctorServiceImpl implements DoctorService {
accountInfoDetailMapper.insertSelective(entity); accountInfoDetailMapper.insertSelective(entity);
doctor.setAcctId(entity.getId()); doctor.setAcctId(entity.getId());
doctor.setMobilePhone(mobileEncrypt); doctor.setMobilePhone(mobileEncrypt);
doctor.setModifyId(0); doctor.setModifyId(1580052);
doctor.setCreatId(0); doctor.setCreatId(0);
doctor.setCreatTime(currentTime); doctor.setCreatTime(currentTime);
doctor.setModifyTime(new Date()); doctor.setModifyTime(new Date());
......
...@@ -125,10 +125,12 @@ public class LoginServiceImpl implements LoginService { ...@@ -125,10 +125,12 @@ public class LoginServiceImpl implements LoginService {
if (productType == AccountTypeEnum.PRODUCT_TYPE_DOCTOR.getCode()) { if (productType == AccountTypeEnum.PRODUCT_TYPE_DOCTOR.getCode()) {
result.setEntireFlag(doctorInfo.getEntireFlag()); result.setEntireFlag(doctorInfo.getEntireFlag());
} }
LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(acctId, productType, sourceType, LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(acctId, productType, sourceType,
AccountTypeEnum.LOGIN_PWD.getCode(), request.getLoginIp(), AccountTypeEnum.LOGIN_STATUS_SUCCESS.getCode(), AccountTypeEnum.LOGIN_PWD.getCode(), request.getLoginIp(), AccountTypeEnum.LOGIN_STATUS_SUCCESS.getCode(),
AccountTypeEnum.LOG_TYPE_LOGIN.getCode()); AccountTypeEnum.LOG_TYPE_LOGIN.getCode());
picaLogUtils.info(entity); picaLogUtils.info(entity);
return result; return result;
} else { } else {
logger.info("login failure:" + mobile); logger.info("login failure:" + mobile);
......
...@@ -9,28 +9,27 @@ import com.pica.cloud.account.account.server.exception.AccountException; ...@@ -9,28 +9,27 @@ import com.pica.cloud.account.account.server.exception.AccountException;
import com.pica.cloud.account.account.server.log.AccountLogEntityUtils; import com.pica.cloud.account.account.server.log.AccountLogEntityUtils;
import com.pica.cloud.account.account.server.log.AccountLogUtils; import com.pica.cloud.account.account.server.log.AccountLogUtils;
import com.pica.cloud.account.account.server.mapper.*; import com.pica.cloud.account.account.server.mapper.*;
import com.pica.cloud.account.account.server.queue.QueueProducer;
import com.pica.cloud.account.account.server.req.BaseRequest; import com.pica.cloud.account.account.server.req.BaseRequest;
import com.pica.cloud.account.account.server.service.RegisterService; import com.pica.cloud.account.account.server.service.RegisterService;
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.account.account.server.util.ExecutorServiceUtils; import com.pica.cloud.account.account.server.util.ExecutorServiceUtils;
import com.pica.cloud.account.account.server.util.TokenUtils; import com.pica.cloud.account.account.server.util.TokenUtils;
import com.pica.cloud.foundation.redis.ICacheClient;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
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 java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Date; import java.util.Date;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@Service @Service
public class RegisterServiceImpl implements RegisterService { public class RegisterServiceImpl implements RegisterService {
private final String REPEAT_REGISTER_PREFIX = "repeat-register—";
private Logger logger = LoggerFactory.getLogger(this.getClass()); private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
...@@ -51,8 +50,8 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -51,8 +50,8 @@ public class RegisterServiceImpl implements RegisterService {
@Autowired @Autowired
private TokenUtils tokenUtils; private TokenUtils tokenUtils;
@Autowired // @Autowired
private QueueProducer queueProducer; // private QueueProducer queueProducer;
@Autowired @Autowired
private AgreementEntityMapper agreementEntityMapper; private AgreementEntityMapper agreementEntityMapper;
...@@ -61,7 +60,7 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -61,7 +60,7 @@ public class RegisterServiceImpl implements RegisterService {
private AgreementLogEntityMapper agreementLogEntityMapper; private AgreementLogEntityMapper agreementLogEntityMapper;
@Autowired @Autowired
private DoctorMapper doctorMapper; private ICacheClient redisClient;
/** /**
* 1)注册功能:默认未完善信息; * 1)注册功能:默认未完善信息;
...@@ -74,83 +73,99 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -74,83 +73,99 @@ public class RegisterServiceImpl implements RegisterService {
@Override @Override
public LoginResult register(BaseRequest baseRequest) { public LoginResult register(BaseRequest baseRequest) {
String mobile = baseRequest.getMobile(); String mobile = baseRequest.getMobile();
String mobileEncrypt = AESUtil.encryptV0(mobile); //对注册接口做幂等性处理:注册成功,删除缓存,注册失败提示用户
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt); String exist = redisClient.get(REPEAT_REGISTER_PREFIX + mobile);
if (accountInfoEntity == null) { if (StringUtils.isBlank(exist)) {
Date currentTime = new Date(); String mobileEncrypt = AESUtil.encryptV0(mobile);
int productType = baseRequest.getProductType(); AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt);
int sourceType = baseRequest.getSourceType(); if (accountInfoEntity == null) {
String password = baseRequest.getPassword(); redisClient.set(REPEAT_REGISTER_PREFIX + mobile, mobile, 30);
AccountInfoEntity accountInfo = new AccountInfoEntity(); try {
accountInfo.setMobilePhone(mobileEncrypt); Date currentTime = new Date();
if (StringUtils.isEmpty(password)) { int productType = baseRequest.getProductType();
password = ""; int sourceType = baseRequest.getSourceType();
} String password = baseRequest.getPassword();
accountInfo.setPassword(password); AccountInfoEntity accountInfo = new AccountInfoEntity();
accountInfo.setCreatedTime(currentTime); accountInfo.setMobilePhone(mobileEncrypt);
accountInfo.setCreatedId(0); if (StringUtils.isEmpty(password)) {
accountInfo.setModifiedId(0); password = "";
accountInfo.setModifiedTime(currentTime); }
accountInfo.setRegTime(currentTime); accountInfo.setPassword(password);
accountInfo.setDeleteFlag(1); accountInfo.setCreatedTime(currentTime);
accountInfo.setSex(0); accountInfo.setCreatedId(0);
accountInfo.setRegisterProduct(productType); accountInfo.setModifiedId(0);
accountInfo.setRegisterSource(sourceType); accountInfo.setModifiedTime(currentTime);
accountInfoDetailMapper.insertSelective(accountInfo); accountInfo.setRegTime(currentTime);
Integer acctId = accountInfo.getId(); accountInfo.setDeleteFlag(1);
accountInfoDetailMapper.updateCreateInfo(acctId); accountInfo.setSex(0);
if (productType == AccountTypeEnum.PRODUCT_TYPE_HEALTH.getCode()) { accountInfo.setRegisterProduct(productType);
AccountPatientInfoEntity accountPatientInfoEntity = new AccountPatientInfoEntity(); accountInfo.setRegisterSource(sourceType);
accountPatientInfoEntity.setAcctId(acctId); accountInfoDetailMapper.insertSelective(accountInfo);
accountPatientInfoEntity.setDeleteFlag(1); Integer acctId = accountInfo.getId();
accountPatientInfoEntity.setCreateId(acctId); accountInfoDetailMapper.updateCreateInfo(acctId);
accountPatientInfoEntity.setModifyId(acctId); if (productType == AccountTypeEnum.PRODUCT_TYPE_HEALTH.getCode()) {
accountPatientInfoEntity.setCreateTime(currentTime); AccountPatientInfoEntity accountPatientInfoEntity = new AccountPatientInfoEntity();
accountPatientInfoEntity.setModifyTime(currentTime); accountPatientInfoEntity.setAcctId(acctId);
accountUserInfoMapper.insertSelective(accountPatientInfoEntity); accountPatientInfoEntity.setDeleteFlag(1);
accountPatientInfoEntity.setCreateId(acctId);
accountPatientInfoEntity.setModifyId(acctId);
accountPatientInfoEntity.setCreateTime(currentTime);
accountPatientInfoEntity.setModifyTime(currentTime);
accountUserInfoMapper.insertSelective(accountPatientInfoEntity);
} else {
Account account = new Account();
account.setAcctId(acctId);
account.setMobilePhone(mobileEncrypt);
account.setDeleteFlag(1);
account.setCreatId(0L);
account.setModifyId(0L);
account.setCreatTime(currentTime);
account.setModifyTime(currentTime);
account.setFirstLoginTime(currentTime);
account.setLastLoginTime(currentTime);
account.setPassword(password);
accountMapper.insertSelective(account);
}
Long userId = accountUtils.getUserIdByAcctId(productType, acctId);
Account account = new Account();
account.setId(userId);
account.setAcctId(acctId);
account.setCreatTime(currentTime);
account.setMobilePhone(mobile);
account.setRegisterSource(sourceType);
String newToken = tokenUtils.generateToken(account);
LoginResult result = new LoginResult();
result.setToken(newToken);
result.setUserId(userId);
result.setEntireFlag(1);
/* ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
try {
dos.writeLong(userId);
} catch (IOException e) {
e.printStackTrace();
}
queueProducer.send(bos.toByteArray());*/
LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(acctId, productType, baseRequest.getSourceType(),
AccountTypeEnum.LOGIN_REGISTER.getCode(), baseRequest.getLoginIp(), AccountTypeEnum.LOGIN_STATUS_SUCCESS.getCode(),
AccountTypeEnum.LOG_TYPE_LOGIN.getCode());
picaLogUtils.info(entity);
processAgreement(userId);
redisClient.del(REPEAT_REGISTER_PREFIX + mobile);
return result;
} catch (Exception e) {
//向上抛出异常,让异常处理框架捕获到
throw new AccountException(AccountExceptionEnum.PICA_REGISTER_FAIL);
} finally {
//如果在注册过程中抛出异常,就删除redis中的注册标记
redisClient.del(REPEAT_REGISTER_PREFIX + mobile);
}
} else { } else {
Account account = new Account(); throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER);
account.setAcctId(acctId);
account.setMobilePhone(mobileEncrypt);
account.setDeleteFlag(1);
account.setCreatId(0L);
account.setModifyId(0L);
account.setCreatTime(currentTime);
account.setModifyTime(currentTime);
account.setFirstLoginTime(currentTime);
account.setLastLoginTime(currentTime);
account.setPassword(password);
accountMapper.insertSelective(account);
} }
Long userId = accountUtils.getUserIdByAcctId(productType, acctId);
Account account = new Account();
account.setId(userId);
account.setAcctId(acctId);
account.setCreatTime(currentTime);
account.setMobilePhone(mobile);
account.setRegisterSource(sourceType);
String newToken = tokenUtils.generateToken(account);
LoginResult result = new LoginResult();
result.setToken(newToken);
result.setUserId(userId);
result.setEntireFlag(1);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
try {
dos.writeLong(userId);
} catch (IOException e) {
e.printStackTrace();
}
queueProducer.send(bos.toByteArray());
LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(acctId, productType, baseRequest.getSourceType(),
AccountTypeEnum.LOGIN_REGISTER.getCode(), baseRequest.getLoginIp(), AccountTypeEnum.LOGIN_STATUS_SUCCESS.getCode(),
AccountTypeEnum.LOG_TYPE_LOGIN.getCode());
picaLogUtils.info(entity);
processAgreement(userId);
return result;
} else { } else {
throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER); throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER);
} }
} }
...@@ -162,6 +177,7 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -162,6 +177,7 @@ public class RegisterServiceImpl implements RegisterService {
@Override @Override
public void ocinRegister(OCINRequest request) { public void ocinRegister(OCINRequest request) {
String mobile = request.getMobile(); String mobile = request.getMobile();
String name = request.getName();
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobile); AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobile);
if (accountInfoEntity == null) { if (accountInfoEntity == null) {
Date currentTime = new Date(); Date currentTime = new Date();
...@@ -177,6 +193,7 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -177,6 +193,7 @@ public class RegisterServiceImpl implements RegisterService {
accountInfo.setRegTime(currentTime); accountInfo.setRegTime(currentTime);
accountInfo.setDeleteFlag(1); accountInfo.setDeleteFlag(1);
accountInfo.setSex(0); accountInfo.setSex(0);
accountInfo.setName(name);
accountInfo.setRegisterProduct(productType); accountInfo.setRegisterProduct(productType);
accountInfo.setRegisterSource(sourceType); accountInfo.setRegisterSource(sourceType);
accountInfoDetailMapper.insertSelective(accountInfo); accountInfoDetailMapper.insertSelective(accountInfo);
...@@ -194,6 +211,7 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -194,6 +211,7 @@ public class RegisterServiceImpl implements RegisterService {
account.setFirstLoginTime(currentTime); account.setFirstLoginTime(currentTime);
account.setLastLoginTime(currentTime); account.setLastLoginTime(currentTime);
account.setPassword(""); account.setPassword("");
account.setName(name);
accountMapper.insertSelective(account); accountMapper.insertSelective(account);
Long userId = accountUtils.getUserIdByAcctId(productType, acctId); Long userId = accountUtils.getUserIdByAcctId(productType, acctId);
processAgreement(userId); processAgreement(userId);
...@@ -204,7 +222,7 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -204,7 +222,7 @@ public class RegisterServiceImpl implements RegisterService {
doctorServiceClient.prefectInfo(prefectInfoReq); doctorServiceClient.prefectInfo(prefectInfoReq);
*/ */
} else { } else {
throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER.getCode(), AccountExceptionEnum.PICA_ALREADY_REGISTER.getCode()); throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER.getCode(), AccountExceptionEnum.PICA_ALREADY_REGISTER.getCode());
} }
} }
......
...@@ -168,7 +168,7 @@ public class AESUtil { ...@@ -168,7 +168,7 @@ 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 = "13024112588"; String content = "13024112666";
System.out.println("加密前:" + content); System.out.println("加密前:" + content);
System.out.println("加密密钥和解密密钥:" + KEY); System.out.println("加密密钥和解密密钥:" + KEY);
...@@ -179,11 +179,11 @@ public class AESUtil { ...@@ -179,11 +179,11 @@ public class AESUtil {
System.out.println("解密后:" + decrypt); System.out.println("解密后:" + decrypt);
//请求参数解密处理 //请求参数解密处理
// String encrypt="eZujXEvfG80W1Jp4yUnGqrnwedYIng+Sk3+BGN01B9TgXRwijp0Gd0DtJBDnrAJ/LIZqh2vVcb46IMtv5Yx1CL53ohUCThsp2cBxlFgpD8btBHKn+3I7J7D2Hyttl8RxjckhlChCKs/kZ9HWNn+XcBBO14I33ydNmmNjzUyTO9w="; // String encrypt="DC7Sc7ydClKJztuIz/E/5fXuQ8hqdr4W8mxL/XACtqT2wzK3jBiRXnoPOvR9lANIinXInrdbY5rCIwTiI9DeWFiwPP7cSF0cjnQOY11oJLjVg9qV9VZQXbFyDYVhRv8bbto5hD4evryzbdPTq6A23fD5LmXFYnWKdbSzZfFUl/w=";
// String decrypt = RSAUtil.decrypt(encrypt,privateKey); // String decrypt = RSAUtil.decrypt(encrypt,privateKey);
// System.out.println(decrypt); // System.out.println(decrypt);
// //System.out.println("YCPQPx4qpQjEjDea"); // //System.out.println("YCPQPx4qpQjEjDea");
// String content="6fz7TiskNgfoKxl20O8MlKEiY3BQ3iF6wccrs3BO72QukkK8iTdugr27yCwv5ogFSJtgz3gRuMu5LfQlFyoK2aGxHpnxVIHB43LVoDbLLGE="; // String content="z9zZyUYwKkYy08l0s1qH9CSnoNnXZbbhHVbAUwGIsOXKPGeTkZFnbL1HYJQXBdKqGzKZt8E5lDzdTGUiUVkkK8GO27fsSrRMewY5T6ndSuo=";
// String result = AESUtil.aesDecrypt(content, decrypt); // String result = AESUtil.aesDecrypt(content, decrypt);
// System.out.println(result); // System.out.println(result);
...@@ -199,6 +199,9 @@ public class AESUtil { ...@@ -199,6 +199,9 @@ public class AESUtil {
} }
......
...@@ -10,7 +10,9 @@ import java.util.concurrent.Executors; ...@@ -10,7 +10,9 @@ import java.util.concurrent.Executors;
*/ */
public class ExecutorServiceUtils { public class ExecutorServiceUtils {
private static ExecutorService executorService = Executors.newFixedThreadPool(30);
public static ExecutorService getExecutor() { public static ExecutorService getExecutor() {
return Executors.newFixedThreadPool(30); return executorService;
} }
} }
...@@ -123,7 +123,7 @@ public class RSAUtil { ...@@ -123,7 +123,7 @@ public class RSAUtil {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
//生成公钥和私钥 //生成公钥和私钥
//genKeyPair(); // genKeyPair();
// keyMap.put(0, publicKey); // keyMap.put(0, publicKey);
// keyMap.put(1, privateKey); // keyMap.put(1, privateKey);
// //加密字符串 // //加密字符串
......
...@@ -44,4 +44,8 @@ spring.rabbitmq.host=192.168.110.206 ...@@ -44,4 +44,8 @@ spring.rabbitmq.host=192.168.110.206
spring.rabbitmq.port=5672 spring.rabbitmq.port=5672
spring.rabbitmq.username=appuser spring.rabbitmq.username=appuser
spring.rabbitmq.password=AqLfvyWOvLQEUzdI spring.rabbitmq.password=AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host=account-register-vhost spring.rabbitmq.virtual-host=account-register-vhost
\ No newline at end of file
management.security.enabled=false
management.endpoint.health.show-details=always
...@@ -41,3 +41,6 @@ weChatURL=https://api.weixin.qq.com/sns/userinfo? ...@@ -41,3 +41,6 @@ weChatURL=https://api.weixin.qq.com/sns/userinfo?
#是否开启双写模式,是否需要向p_doctor表写数据 #是否开启双写模式,是否需要向p_doctor表写数据
doubleWritingMode=true doubleWritingMode=true
management.security.enabled=false
management.endpoint.health.show-details=always
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP"/> <result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, mobile_phone, password, register_product, register_source, name, age, birthday, id, mobile_phone, password, register_product, register_source, name, age, birthday,
sex, id_card, reg_time, delete_flag, created_id, created_time, modified_id, modified_time sex, id_card, reg_time, delete_flag, created_id, created_time, modified_id, modified_time
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from account_info from account_info
where mobile_phone = #{mobile} and delete_flag=1 where mobile_phone = #{mobile} and delete_flag=1 limit 1
</select> </select>
<!--通过电话号码查询账号信息--> <!--通过电话号码查询账号信息-->
...@@ -72,16 +72,16 @@ ...@@ -72,16 +72,16 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AccountInfoEntity"> <insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AccountInfoEntity">
insert into account_info (id, mobile_phone, password, insert into account_info (id, mobile_phone, password,
register_product, register_source, name, register_product, register_source, name,
age, birthday, sex, id_card, age, birthday, sex, id_card,
reg_time, delete_flag, created_id, reg_time, delete_flag, created_id,
created_time, modified_id, modified_time created_time, modified_id, modified_time
) )
values (#{id,jdbcType=INTEGER}, #{mobilePhone,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{mobilePhone,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{registerProduct,jdbcType=INTEGER}, #{registerSource,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{registerProduct,jdbcType=INTEGER}, #{registerSource,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{age,jdbcType=TINYINT}, #{birthday,jdbcType=DATE}, #{sex,jdbcType=TINYINT}, #{idCard,jdbcType=VARCHAR}, #{age,jdbcType=TINYINT}, #{birthday,jdbcType=DATE}, #{sex,jdbcType=TINYINT}, #{idCard,jdbcType=VARCHAR},
#{regTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER}, #{regTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER},
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP} #{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP}
) )
</insert> </insert>
......
...@@ -82,6 +82,14 @@ ...@@ -82,6 +82,14 @@
and delete_flag = 1 and delete_flag = 1
</select> </select>
<!--刷新重复的记录-->
<update id="processDoctorRepeatData">
update p_doctor set delete_flag=2, modify_id=101432928, modify_time=now() where id in (
select id from (select pd.id from account_info pd
inner JOIN (SELECT mobile_phone,MIN(id) as id FROM account_info WHERE delete_flag=1 and mobile_phone is not null GROUP BY mobile_phone having count(*)>1) inn
on pd.id <![CDATA[!= ]]> inn.id and pd.mobile_phone = inn.mobile_phone) ttt )
</update>
<!--通过手机号查询用户id--> <!--通过手机号查询用户id-->
<select id="selectDoctorIdByMobile" parameterType="java.lang.String" resultType="java.lang.Long"> <select id="selectDoctorIdByMobile" parameterType="java.lang.String" resultType="java.lang.Long">
SELECT id SELECT id
...@@ -752,7 +760,6 @@ ...@@ -752,7 +760,6 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.Doctor"> <update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.Doctor">
update p_doctor update p_doctor
<set> <set>
...@@ -822,9 +829,6 @@ ...@@ -822,9 +829,6 @@
<if test="personalSign != null"> <if test="personalSign != null">
personal_sign = #{personalSign,jdbcType=VARCHAR}, personal_sign = #{personalSign,jdbcType=VARCHAR},
</if> </if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="creatId != null"> <if test="creatId != null">
creat_id = #{creatId,jdbcType=INTEGER}, creat_id = #{creatId,jdbcType=INTEGER},
</if> </if>
...@@ -840,9 +844,6 @@ ...@@ -840,9 +844,6 @@
<if test="praiseNum != null"> <if test="praiseNum != null">
praise_num = #{praiseNum,jdbcType=INTEGER}, praise_num = #{praiseNum,jdbcType=INTEGER},
</if> </if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="info != null"> <if test="info != null">
info = #{info,jdbcType=VARCHAR}, info = #{info,jdbcType=VARCHAR},
</if> </if>
...@@ -930,9 +931,7 @@ ...@@ -930,9 +931,7 @@
<if test="showFlag != null"> <if test="showFlag != null">
show_flag = #{showFlag,jdbcType=INTEGER}, show_flag = #{showFlag,jdbcType=INTEGER},
</if> </if>
<if test="acctId != null">
acct_id = #{acctId,jdbcType=INTEGER},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
...@@ -31,18 +31,21 @@ ...@@ -31,18 +31,21 @@
delete from log_login delete from log_login
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.LogLoginEntity" > <insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.LogLoginEntity" >
insert into log_login (id, acct_id, acct_name, insert into log_login ( acct_id, acct_name,
product_type, source_type, login_type, product_type, source_type, login_type,
login_ip, login_time, login_status, login_ip, login_time, login_status,
create_id, create_time, modify_id, create_id, create_time, modify_id,
modify_time, delete_flag) modify_time, delete_flag)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}, #{acctName,jdbcType=VARCHAR}, values (#{acctId,jdbcType=INTEGER}, #{acctName,jdbcType=VARCHAR},
#{productType,jdbcType=TINYINT}, #{sourceType,jdbcType=TINYINT}, #{loginType,jdbcType=TINYINT}, #{productType,jdbcType=TINYINT}, #{sourceType,jdbcType=TINYINT}, #{loginType,jdbcType=TINYINT},
#{loginIp,jdbcType=VARCHAR}, #{loginTime,jdbcType=TIMESTAMP}, #{loginStatus,jdbcType=TINYINT}, #{loginIp,jdbcType=VARCHAR}, #{loginTime,jdbcType=TIMESTAMP}, #{loginStatus,jdbcType=TINYINT},
#{createId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER}, #{createId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=TINYINT}) #{modifyTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=TINYINT})
</insert> </insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.LogLoginEntity" > <insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.LogLoginEntity" >
insert into log_login insert into log_login
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides="," >
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册