更正患者注册的mapper
parent
8747dd90b2
commit
1b94640aeb
|
@ -21,7 +21,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.health</groupId>
|
<groupId>com.health</groupId>
|
||||||
<artifactId>health-common-core</artifactId>
|
<artifactId>health-common-core</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.health.system.common.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户银行卡实体类
|
||||||
|
* @date 2023/10/28 15:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BankCard {
|
||||||
|
|
||||||
|
/*
|
||||||
|
银行卡主键id
|
||||||
|
*/
|
||||||
|
private Integer bankId;
|
||||||
|
/*
|
||||||
|
银行卡号
|
||||||
|
*/
|
||||||
|
private String bankNumber;
|
||||||
|
/*
|
||||||
|
发卡银行名称
|
||||||
|
*/
|
||||||
|
private String bankName;
|
||||||
|
/*
|
||||||
|
用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.health.system.common.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户身份证实体类
|
||||||
|
* @date 2023/10/28 15:01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IdCard {
|
||||||
|
|
||||||
|
/*
|
||||||
|
身份证id
|
||||||
|
*/
|
||||||
|
private Integer cardId;
|
||||||
|
/*
|
||||||
|
用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/*
|
||||||
|
身份证真实姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/*
|
||||||
|
性别
|
||||||
|
*/
|
||||||
|
private String sex;
|
||||||
|
/*
|
||||||
|
民族
|
||||||
|
*/
|
||||||
|
private String nation;
|
||||||
|
/*
|
||||||
|
生日
|
||||||
|
*/
|
||||||
|
private String birthday;
|
||||||
|
|
||||||
|
/*
|
||||||
|
籍贯地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/*
|
||||||
|
身份证号码
|
||||||
|
*/
|
||||||
|
private String idNumber;
|
||||||
|
/*
|
||||||
|
签发机关
|
||||||
|
*/
|
||||||
|
private String issueOffice;
|
||||||
|
}
|
|
@ -112,7 +112,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.health</groupId>
|
<groupId>com.health</groupId>
|
||||||
<artifactId>health-common-core</artifactId>
|
<artifactId>health-common-core</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.7</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dtflys.forest</groupId>
|
||||||
|
<artifactId>forest-spring-boot-starter</artifactId>
|
||||||
|
<version>1.5.33</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package com.health.system.server;
|
package com.health.system.server;
|
||||||
|
|
||||||
|
import com.dtflys.forest.springboot.annotation.ForestScan;
|
||||||
import com.health.common.security.annotation.EnableCustomConfig;
|
import com.health.common.security.annotation.EnableCustomConfig;
|
||||||
import com.health.common.security.annotation.EnableRyFeignClients;
|
import com.health.common.security.annotation.EnableRyFeignClients;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统模块
|
* 系统模块
|
||||||
|
@ -12,7 +14,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
* @author health
|
* @author health
|
||||||
*/
|
*/
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
|
@Configuration(value = "com.health.common.core.utils.userSelf.ForestClientInterface")
|
||||||
@EnableRyFeignClients
|
@EnableRyFeignClients
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan(value = "com.health.system.server.mapper")
|
@MapperScan(value = "com.health.system.server.mapper")
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.health.system.server.config;
|
||||||
|
|
||||||
|
import com.health.common.core.domain.Configure;
|
||||||
|
import com.health.common.core.utils.userSelf.ForestClientInterface;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description:
|
||||||
|
* @date 2023/10/28 19:40
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class AppConfig implements ForestClientInterface{
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map helloForestFace(String s) {
|
||||||
|
return helloForestFace(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map helloForestBack(String s, Configure configure) {
|
||||||
|
return helloForestBack(s,configure);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map helloForestBank(String s) {
|
||||||
|
return helloForestBank(s);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.health.system.server.controller;
|
||||||
|
|
||||||
|
import com.health.common.core.domain.Result;
|
||||||
|
import com.health.system.server.service.SysBankCardService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户银行卡控制层接口
|
||||||
|
* @date 2023/10/28 15:10
|
||||||
|
*/
|
||||||
|
@RestController("/bankCard")
|
||||||
|
public class SysBankCardController {
|
||||||
|
/*
|
||||||
|
用户银行卡业务逻辑层接口
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private SysBankCardService sysBankCardService;
|
||||||
|
|
||||||
|
@PostMapping("/bindUserBank")
|
||||||
|
public Result bindUserBank(@RequestParam("bankImage") MultipartFile bankImage){
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.health.system.server.controller;
|
||||||
|
|
||||||
|
import com.health.common.core.domain.Configure;
|
||||||
|
import com.health.common.core.domain.Result;
|
||||||
|
import com.health.common.core.enums.IdCardConfigureType;
|
||||||
|
import com.health.common.core.utils.userSelf.ForestClientInterface;
|
||||||
|
import com.health.common.security.utils.SecurityUtils;
|
||||||
|
import com.health.system.common.domain.IdCard;
|
||||||
|
import com.health.system.server.service.SysIdCardService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.rmi.ServerException;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 用户身份证控制层
|
||||||
|
* @date 2023/10/28 15:06
|
||||||
|
*/
|
||||||
|
@RestController("/idCard")
|
||||||
|
public class SysIdCardController {
|
||||||
|
|
||||||
|
/*
|
||||||
|
注入forest远程调用工具接口
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private ForestClientInterface forestClientInterface;
|
||||||
|
/*
|
||||||
|
注入用户身份证业务逻辑层接口
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private SysIdCardService sysIdCardService;
|
||||||
|
|
||||||
|
@PostMapping("/bindIdCard")
|
||||||
|
public Result bindIdCard(@RequestParam("faceImage")MultipartFile faceImage,@RequestParam("backImage") MultipartFile backImage) throws IOException {
|
||||||
|
//获取正面头像照片的字节流
|
||||||
|
String username = SecurityUtils.getUsername();
|
||||||
|
byte[] faceImageBytes = faceImage.getBytes();
|
||||||
|
//获取反面国徽面的字节流
|
||||||
|
byte[] backImageBytes = backImage.getBytes();
|
||||||
|
String face = Base64.getEncoder().encodeToString(faceImageBytes);
|
||||||
|
Map faceMap = forestClientInterface.helloForestFace(face);
|
||||||
|
String address = (String) faceMap.get("address");
|
||||||
|
String birthday = (String) faceMap.get("birth");
|
||||||
|
String name = (String) faceMap.get("name");
|
||||||
|
String sex = (String) faceMap.get("sex");
|
||||||
|
String nation = (String) faceMap.get("nationality");
|
||||||
|
String num = (String) faceMap.get("num");
|
||||||
|
if (!name.equals(username)){
|
||||||
|
throw new ServerException("请选择自己的身份证进行绑定");
|
||||||
|
}
|
||||||
|
String back = Base64.getEncoder().encodeToString(backImageBytes);
|
||||||
|
Configure configure = new Configure();
|
||||||
|
configure.setSide(IdCardConfigureType.Back.getType());
|
||||||
|
Map backMap = forestClientInterface.helloForestBack(back, configure);
|
||||||
|
String issueOffice = (String) backMap.get("issue");
|
||||||
|
IdCard idCard = new IdCard();
|
||||||
|
idCard.setName(name);
|
||||||
|
idCard.setBirthday(birthday);
|
||||||
|
idCard.setName(name);
|
||||||
|
idCard.setSex(sex);
|
||||||
|
idCard.setNation(nation);
|
||||||
|
idCard.setIdNumber(num);
|
||||||
|
idCard.setIssueOffice(issueOffice);
|
||||||
|
idCard.setAddress(address);
|
||||||
|
idCard.setUserId(SecurityUtils.getUserId());
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.health.system.server.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description:用户银行卡持久层接口
|
||||||
|
* @date 2023/10/28 15:12
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysBankCardMapper {
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.health.system.server.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description:用户身份证持久层接口
|
||||||
|
* @date 2023/10/28 15:09
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysIdCardMapper {
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.health.system.server.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description:用户银行卡业务逻辑层接口
|
||||||
|
* @date 2023/10/28 15:11
|
||||||
|
*/
|
||||||
|
public interface SysBankCardService {
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.health.system.server.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description:用户身份证业务逻辑层接口
|
||||||
|
* @date 2023/10/28 15:08
|
||||||
|
*/
|
||||||
|
public interface SysIdCardService {
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.health.system.server.service.impl;
|
||||||
|
|
||||||
|
import com.health.system.server.mapper.SysBankCardMapper;
|
||||||
|
import com.health.system.server.service.SysBankCardService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description:用户银行卡业务逻辑层接口
|
||||||
|
* @date 2023/10/28 15:12
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysBankCardServiceImpl implements SysBankCardService {
|
||||||
|
|
||||||
|
/*
|
||||||
|
用户银行卡持久层接口
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private SysBankCardMapper sysBankCardMapper;
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.health.system.server.service.impl;
|
||||||
|
|
||||||
|
import com.health.system.server.mapper.SysIdCardMapper;
|
||||||
|
import com.health.system.server.service.SysIdCardService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 冯凯
|
||||||
|
* @version 1.0
|
||||||
|
* @description:用户身份证业务逻辑层接口实现类
|
||||||
|
* @date 2023/10/28 15:08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysIdCardServiceImpl implements SysIdCardService {
|
||||||
|
|
||||||
|
/*
|
||||||
|
注入用户身份证持久层接口
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private SysIdCardMapper sysIdCardMapper;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?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.health.system.server.mapper.SysBankCardMapper">
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?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.health.system.server.mapper.SysIdCardMapper">
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.health.system.server.mapper.SysRoleMapper">
|
<mapper namespace="com.health.system.server.mapper.SysRoleMapper">
|
||||||
|
|
||||||
<resultMap type="SysRole" id="SysRoleResult">
|
<resultMap type="com.health.system.common.domain.SysRole" id="SysRoleResult">
|
||||||
<id property="roleId" column="role_id" />
|
<id property="roleId" column="role_id" />
|
||||||
<result property="roleName" column="role_name" />
|
<result property="roleName" column="role_name" />
|
||||||
<result property="roleKey" column="role_key" />
|
<result property="roleKey" column="role_key" />
|
||||||
|
@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
<select id="selectRoleList" parameterType="com.health.system.common.domain.SysRole" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.del_flag = '0'
|
where r.del_flag = '0'
|
||||||
<if test="roleId != null and roleId != 0">
|
<if test="roleId != null and roleId != 0">
|
||||||
|
@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<!--用户角色sql-->
|
<!--用户角色sql-->
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
<insert id="insertRole" parameterType="com.health.system.common.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||||
insert into sys_role(
|
insert into sys_role(
|
||||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||||
|
@ -129,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateRole" parameterType="SysRole">
|
<update id="updateRole" parameterType="com.health.system.common.domain.SysRole">
|
||||||
update sys_role
|
update sys_role
|
||||||
<set>
|
<set>
|
||||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||||
|
|
Loading…
Reference in New Issue