首页功能处理

master
shijie 4 years ago
parent 4fcd81e15f
commit 44ad7c97c4
  1. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java
  2. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  3. 20
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/HrmsAccessRecordsLogController.java
  4. 17
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/HrmsAccessRecordsLogMapper.java
  5. 11
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/feign/HrmsFeignService.java
  6. 57
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/model/HrmsAccessRecordsLog.java
  7. 16
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/IHrmsAccessRecordsLogService.java
  8. 20
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/HrmsAccessRecordsLogServiceImpl.java
  9. 33
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  10. 115
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/util/MyBatisPlusCodeGenerator.java
  11. 15
      dq-financial-hrms-auth/src/main/resources/mapper/hrauth/HrmsAccessRecordsLogMapper.xml
  12. 5
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountInfo.java
  13. 15
      dq_financial_hrms/src/main/resources/mapper/hrauth/HrmsAccessRecordsLogMapper.xml

@ -206,4 +206,7 @@ public class BusinessApplicationRequest implements Serializable {
@ApiModelProperty(value = "是否存在关联人")
private Integer isExistRelated;
@ApiModelProperty(value = "申请类型:0->员工申请;1->客户申请")
private Integer applyType;
}

@ -145,6 +145,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
dgApplyAmountInfo.setCustomerType(businessApplication.getCustomerType());//客户类型
dgApplyAmountInfo.setApplyType(businessApplication.getApplyType());//申请类型
//设置业务编号,查询今天是否申请过业务
String businessCode=null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@ -370,6 +371,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
dgApplyAmountInfo.setCustomerType(businessApplication.getCustomerType());//客户类型
dgApplyAmountInfo.setApplyType(businessApplication.getApplyType());//申请类型
//根据业务id修改申请贷款信息
this.baseMapper.updateById(dgApplyAmountInfo);

@ -0,0 +1,20 @@
package com.daqing.financial.hrauth.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
/**
* <p>
* 访问记录表 前端控制器
* </p>
*
* @author Qyq
* @since 2021-01-12
*/
@Controller
@RequestMapping("/hrms-access-records-log")
public class HrmsAccessRecordsLogController {
}

@ -0,0 +1,17 @@
package com.daqing.financial.hrauth.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.daqing.financial.hrauth.model.HrmsAccessRecordsLog;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 访问记录表 Mapper 接口
* </p>
*
* @author Qyq
* @since 2021-01-12
*/
@Mapper
public interface HrmsAccessRecordsLogMapper extends BaseMapper<HrmsAccessRecordsLog> {
}

@ -6,10 +6,7 @@ import com.daqing.framework.domain.hrms.RolePermissionEntity;
import com.daqing.framework.model.response.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -29,4 +26,10 @@ public interface HrmsFeignService {
@GetMapping("/hrms/permission/queryRolePermissionList")
ResponseResult<List<RolePermissionEntity>> queryRolePermissionList(@RequestParam("id") Long id);
/**
* 根据userId获取用户名以及部门名称
*/
@PostMapping("hrms/employee/getAccountAndDeptNameById")
ResponseResult getAccountAndDeptNameById(@RequestBody List<Integer> ids);
}

@ -0,0 +1,57 @@
package com.daqing.financial.hrauth.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 访问记录表
* </p>
*
* @author Qyq
* @since 2021-01-12
*/
@Data
@TableName("hrms_access_records_log")
public class HrmsAccessRecordsLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 账号
*/
private String account;
/**
* 姓名
*/
private String name;
/**
* 部门名称
*/
@TableField("deptName")
private String deptName;
/**
* 用户端类型0->PC1->小程序
*/
private Integer type;
/**
* 登录时间
*/
private Date loginTime;
}

@ -0,0 +1,16 @@
package com.daqing.financial.hrauth.service;
import com.daqing.financial.hrauth.model.HrmsAccessRecordsLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 访问记录表 服务类
* </p>
*
* @author Qyq
* @since 2021-01-12
*/
public interface IHrmsAccessRecordsLogService extends IService<HrmsAccessRecordsLog> {
}

@ -0,0 +1,20 @@
package com.daqing.financial.hrauth.service.impl;
import com.daqing.financial.hrauth.model.HrmsAccessRecordsLog;
import com.daqing.financial.hrauth.dao.HrmsAccessRecordsLogMapper;
import com.daqing.financial.hrauth.service.IHrmsAccessRecordsLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 访问记录表 服务实现类
* </p>
*
* @author Qyq
* @since 2021-01-12
*/
@Service
public class HrmsAccessRecordsLogServiceImpl extends ServiceImpl<HrmsAccessRecordsLogMapper, HrmsAccessRecordsLog> implements IHrmsAccessRecordsLogService {
}

@ -1,14 +1,18 @@
package com.daqing.financial.hrauth.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.hrauth.config.WeChatConfig;
import com.daqing.financial.hrauth.dao.AuthEmployeeRoleDao;
import com.daqing.financial.hrauth.dao.HrmsAccessRecordsLogMapper;
import com.daqing.financial.hrauth.dao.UserLoginDao;
import com.daqing.financial.hrauth.feign.HrmsFeignService;
import com.daqing.financial.hrauth.model.HrmsAccessRecordsLog;
import com.daqing.financial.hrauth.service.LoginLogService;
import com.daqing.financial.hrauth.service.TokenService;
import com.daqing.financial.hrauth.service.UserLoginService;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.*;
import com.daqing.framework.domain.hrms.request.*;
import com.daqing.framework.domain.hrms.response.HrmsCode;
@ -27,10 +31,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @auther River
@ -57,6 +58,9 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
@Resource
private AuthEmployeeRoleDao authEmployeeRoleDao;
@Resource
private HrmsAccessRecordsLogMapper hrmsAccessRecordsLogMapper;
/* @Autowired
private OdcProperties properties;*/
@ -208,6 +212,27 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
headImg = employeeEntity.getHeadPortaritUrl();
System.out.println("headImg================"+headImg);
//根据用户id查询部门名称
List<Integer> arr = new ArrayList<>();
arr.add(userEntity.getId().intValue());
//根据提单人id查询其部门名称
ResponseResult res = hrmsFeignService.getAccountAndDeptNameById(arr);
List<LinkedHashMap> employeeMessage = new ArrayList();
if(res.getData() != null){
employeeMessage = (List<LinkedHashMap>) res.getData();
}
//新增一条PC端的访问记录
HrmsAccessRecordsLog recordsLog = new HrmsAccessRecordsLog();
for(LinkedHashMap res2 : employeeMessage) {
//recordsLog.setDeptName(res2.getDeptName());
recordsLog.setDeptName(JSONObject.toJSONString(res2.get("deptName")).replace("\"", ""));
}
recordsLog.setAccount(userEntity.getAccount());
recordsLog.setName(name);
recordsLog.setType(1);
recordsLog.setLoginTime(new Date());
hrmsAccessRecordsLogMapper.insert(recordsLog);
//返回用户信息
LoginResponse loginResponse = new LoginResponse();
loginResponse.setAccount(name);

@ -0,0 +1,115 @@
package com.daqing.financial.hrauth.util;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: LvFang
* @Date: Created in 2019/6/11.
* @Description:
*/
public class MyBatisPlusCodeGenerator {
//包名
public static final String PACKAGE_NAME = "com.daqing.financial.hrauth";
public static void main(String[] args) {
String[] tables = new String[] {"hrms_access_records_log"};//表名数组
String[] tablePrefixs = new String[] {""};//去掉前缀
executeCode(PACKAGE_NAME,tables,tablePrefixs);
}
private static void executeCode(String pack,String[] tables,String[] tablePrefixs) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
// 是否覆盖已有文件
gc.setFileOverride(false);
// 生成文件的输出目录
String projectPath = System.getProperty("user.dir");//user.dir 表示当前工程路径无需替换
gc.setOutputDir(projectPath + "/dq-financial-hrms-auth/src/main/java");
//设置bean命名规范
gc.setEntityName("%s");
// 开发人员
gc.setAuthor("Qyq");
// 是否打开输出目录
gc.setOpen(false);
// 开启 BaseResultMap
gc.setBaseResultMap(true);
// 指定生成的主键的ID类型
gc.setIdType(IdType.ID_WORKER);
// 时间类型对应策略: 只使用 java.util.date 代替
gc.setDateType(DateType.ONLY_DATE);
mpg.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig config= new DataSourceConfig();
// 从试图获取
config.setUrl("jdbc:mysql://192.168.31.140:3306/dq_financial_hrms?serverTimezone=UTC");
config.setDriverName("com.mysql.cj.jdbc.Driver");
config.setUsername("root");
config.setPassword("root");
mpg.setDataSource(config);
// 包配置
PackageConfig pc = new PackageConfig();
// 父包名。如果为空,将下面子包名必须写全部, 否则就只需写子包名
pc.setParent(pack);
// Entity包名
pc.setEntity("hrms");
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
List<FileOutConfig> focList = new ArrayList<>();
focList.add(new FileOutConfig("/templates/mapper.xml.ftl") {
public String outputFile(TableInfo tableInfo) {
// 自定义输入文件名称
if (StringUtils.isEmpty(pc.getModuleName())) {
return projectPath + "/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/" + tableInfo.getXmlName() + StringPool.DOT_XML;
}else {
return projectPath + "/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/" + pc.getModuleName() + "/" + tableInfo.getXmlName() + StringPool.DOT_XML;
}
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
mpg.setTemplate(new TemplateConfig().setXml(null));
// 策略配置
StrategyConfig strategy = new StrategyConfig();
// 数据库表映射到实体的命名策略: 下划线转驼峰命名
strategy.setNaming(NamingStrategy.underline_to_camel);
// 数据库表字段映射到实体的命名策略: 下划线转驼峰命名
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// 【实体】是否为lombok模型(默认 false)
strategy.setEntityLombokModel(false);
// 需要包含的表名,允许正则表达式(与exclude二选一配置)
strategy.setInclude(tables);
// 驼峰转连字符
strategy.setControllerMappingHyphenStyle(true);
// 表前缀
strategy.setTablePrefix(tablePrefixs);
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
}

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrauth.dao.HrmsAccessRecordsLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.financial.hrauth.model.HrmsAccessRecordsLog">
<id column="id" property="id" />
<result column="account" property="account" />
<result column="name" property="name" />
<result column="deptName" property="deptName" />
<result column="type" property="type" />
<result column="login_time" property="loginTime" />
</resultMap>
</mapper>

@ -126,4 +126,9 @@ public class DgApplyAmountInfo implements Serializable {
*/
private String businessCode;
/**
* 申请类型
*/
private Integer applyType;
}

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrauth.mapper.HrmsAccessRecordsLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.financial.hrauth.hrms.HrmsAccessRecordsLog">
<id column="id" property="id" />
<result column="account" property="account" />
<result column="name" property="name" />
<result column="deptName" property="deptName" />
<result column="type" property="type" />
<result column="login_time" property="loginTime" />
</resultMap>
</mapper>
Loading…
Cancel
Save