Commit b5cacf8e by hongzhong

等保调整,经纪人登录日志

parent 419951a9
......@@ -237,7 +237,9 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
List<AclCustomerLog> customerLogList = aclCustomerLogDALService.findLogInfoByCustomerId(customerId);
int logTimes = (customerLogList.isEmpty()) ? 0 : customerLogList.size();
//保存用户的登录记录
aclCustomerLogDALService.saveCustomerLog(customerId,2);
requestVO.setMessage(ZHBErrorConfig.getErrorInfo("800000"));
requestVO.setName(customer.getName());
aclCustomerLogDALService.saveCustomerLog(customerId,2,requestVO);
getOpenIdUrl(responseVO,customer);
responseVO.setCustomerId(customerId);
responseVO.setPractitionerId(practitionerId);
......@@ -249,6 +251,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
// }
}else{
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830001")));
requestVO.setMessage(ZHBErrorConfig.getErrorInfo("800000"));
requestVO.setMobileNo(mobileNo);
aclCustomerLogDALService.saveCustomerLog(null,2,requestVO);
}
return responseVO;
}
......
......@@ -4,6 +4,8 @@ public class PractitionerLoginRequestVO {
private String mobileNo;
private String name;
private String email;
private String fromSystemName;
private String message;
public String getMobileNo() {
return mobileNo;
......@@ -28,4 +30,20 @@ public class PractitionerLoginRequestVO {
public void setEmail(String email) {
this.email = email;
}
public String getFromSystemName() {
return fromSystemName;
}
public void setFromSystemName(String fromSystemName) {
this.fromSystemName = fromSystemName;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
......@@ -46,6 +46,10 @@ public class AclCustomerLog implements Serializable {
private Date createdAt;
private Long createdBy;
private String fromSystemName;
private String loginName;
private String mobileNo;
private String message;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
}
package com.yd.dal.service.customer;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
import com.yd.dal.entity.customer.AclCustomerLog;
import org.springframework.stereotype.Service;
......@@ -20,5 +21,5 @@ public interface AclCustomerLogDALService {
* @param customerId 用户id
* @param plateFlag 1-在线平台 2-经纪
*/
void saveCustomerLog(Long customerId, int plateFlag);
void saveCustomerLog(Long customerId, int plateFlag, PractitionerLoginRequestVO requestVO);
}
package com.yd.dal.service.customer.impl;
import com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO;
import com.yd.dal.entity.customer.AclCustomerLog;
import com.yd.dal.mapper.customer.AclCustomerLogMapper;
import com.yd.dal.service.customer.AclCustomerLogDALService;
......@@ -34,12 +35,20 @@ public class AclCustomerLogDALServiceImpl implements AclCustomerLogDALService {
* @param customerId 用户id
* @param plateFlag 1-在线平台 2-经纪
*/
public void saveCustomerLog(Long customerId, int plateFlag) {
public void saveCustomerLog(Long customerId, int plateFlag, PractitionerLoginRequestVO requestVO) {
AclCustomerLog customerLog = new AclCustomerLog();
customerLog.setCustomerId(customerId);
customerLog.setFromPlateform(plateFlag);
customerLog.setFromSystemName(null != requestVO.getFromSystemName() ? requestVO.getFromSystemName().toUpperCase():"");
customerLog.setMobileNo(requestVO.getMobileNo());
customerLog.setLoginTime(new Date());
customerLog.setIsSuccess(1);
if(null ==customerId){
customerLog.setIsSuccess(2);
}else{
customerLog.setIsSuccess(1);
}
customerLog.setLoginName(requestVO.getName());
customerLog.setMessage(requestVO.getMessage());
customerLog.setCreatedAt(new Date());
customerLog.setCreatedBy(-1L);
aclCustomerLogMapper.insert(customerLog);
......
......@@ -39,12 +39,13 @@
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerLog" useGeneratedKeys="true">
insert into ag_acl_customer_log (customer_id, session_id, from_ip,
from_plateform, from_hostname, login_time,
from_plateform, from_hostname, login_time, from_system_name,mobile_no,message,login_name,
logout_time, is_success, created_at,
created_by)
values (#{customerId,jdbcType=BIGINT}, #{sessionId,jdbcType=VARCHAR}, #{fromIp,jdbcType=VARCHAR},
#{fromPlateform,jdbcType=INTEGER}, #{fromHostname,jdbcType=VARCHAR}, #{loginTime,jdbcType=TIMESTAMP},
#{logoutTime,jdbcType=TIMESTAMP}, #{isSuccess,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{fromPlateform,jdbcType=INTEGER}, #{fromHostname,jdbcType=VARCHAR}, #{loginTime,jdbcType=TIMESTAMP},
#{fromSystemName,jdbcType=VARCHAR}, #{mobileNo,jdbcType=VARCHAR}, #{message,jdbcType=VARCHAR},#{loginName,jdbcType=VARCHAR},
#{logoutTime,jdbcType=TIMESTAMP}, #{isSuccess,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerLog" useGeneratedKeys="true">
......@@ -164,4 +165,4 @@
created_by = #{createdBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
</mapper>
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