Commit d71c11c7 by zhengxj

finish 技工认证--身份证照片保存 on 20191020 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@24383 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent faadffa2
...@@ -35,6 +35,12 @@ public interface Constants { ...@@ -35,6 +35,12 @@ public interface Constants {
// 服务商邀请技工注册二维码Key // 服务商邀请技工注册二维码Key
public static final String SYS_MECHANIC_INVITE = "sys_mechanic_invite"; public static final String SYS_MECHANIC_INVITE = "sys_mechanic_invite";
// 身份证人像面
public static final String SYS_FRONT_ID_CARD = "sys_front_ID_card";
// 身份证国徽面
public static final String SYS_BACK_ID_CARD = "sys_back_ID_card";
/** /**
* 技工列表类型(0:技工管理列表;1:技工审核列表;2:商户管理列表;3:服务商资源管理列表;4:技工资源管理列表) * 技工列表类型(0:技工管理列表;1:技工审核列表;2:商户管理列表;3:服务商资源管理列表;4:技工资源管理列表)
*/ */
......
...@@ -24,16 +24,15 @@ ...@@ -24,16 +24,15 @@
*/ */
package com.glsx.usercenter.service.impl; package com.glsx.usercenter.service.impl;
import javax.annotation.Resource;
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 com.glsx.common.utils.map.AMapUtils;
import com.glsx.usercenter.constants.Constants; import com.glsx.usercenter.constants.Constants;
import com.glsx.usercenter.mapper.SysMechanicMapper; import com.glsx.usercenter.mapper.SysMechanicMapper;
import com.glsx.usercenter.mapper.SysUserImageMapper;
import com.glsx.usercenter.mapper.SysUserServicesMapper; import com.glsx.usercenter.mapper.SysUserServicesMapper;
import com.glsx.usercenter.pojo.user.SysMechanicEntity; import com.glsx.usercenter.pojo.user.SysMechanicEntity;
import com.glsx.usercenter.pojo.user.SysUserImage;
import com.glsx.usercenter.pojo.user.SysUserServices; import com.glsx.usercenter.pojo.user.SysUserServices;
import com.glsx.usercenter.service.IMechanicService; import com.glsx.usercenter.service.IMechanicService;
...@@ -54,6 +53,8 @@ public class MechanicServiceImpl implements IMechanicService { ...@@ -54,6 +53,8 @@ public class MechanicServiceImpl implements IMechanicService {
private SysUserServicesMapper sysUserServicesMapper; private SysUserServicesMapper sysUserServicesMapper;
@Autowired
private SysUserImageMapper sysUserImageMapper;
/** /**
* 技工认证 * 技工认证
...@@ -72,7 +73,10 @@ public class MechanicServiceImpl implements IMechanicService { ...@@ -72,7 +73,10 @@ public class MechanicServiceImpl implements IMechanicService {
SysMechanicEntity sm = sysMechanicMapper.selectByUserIdAndCheckStatus(sysMechanicEntity.getUserId(), null); SysMechanicEntity sm = sysMechanicMapper.selectByUserIdAndCheckStatus(sysMechanicEntity.getUserId(), null);
sysMechanicEntity.setId(sm.getId()); sysMechanicEntity.setId(sm.getId());
sysMechanicEntity.setMechanicStatus(Constants.SYS_USER_STATUS_CHECKING); sysMechanicEntity.setMechanicStatus(Constants.SYS_USER_STATUS_CHECKING);
sysMechanicMapper.updateByPrimaryKeySelective(sysMechanicEntity); sysMechanicEntity.setBankCardNo(sysMechanicEntity.getBankCardNo());
sysMechanicEntity.setRealName(sysMechanicEntity.getRealName());
sysMechanicEntity.setAddress(sysMechanicEntity.getAddress());
String[] items = sysMechanicEntity.getServiceItemsKey(); String[] items = sysMechanicEntity.getServiceItemsKey();
for (int i = 0; i < items.length; i++) { for (int i = 0; i < items.length; i++) {
SysUserServices record = new SysUserServices(); SysUserServices record = new SysUserServices();
...@@ -81,6 +85,34 @@ public class MechanicServiceImpl implements IMechanicService { ...@@ -81,6 +85,34 @@ public class MechanicServiceImpl implements IMechanicService {
sysUserServicesMapper.deleteByUserIdAndServiceId(sysMechanicEntity.getUserId(), items[i]); sysUserServicesMapper.deleteByUserIdAndServiceId(sysMechanicEntity.getUserId(), items[i]);
sysUserServicesMapper.insertSelective(record); sysUserServicesMapper.insertSelective(record);
} }
// 保存人像面照片
SysUserImage record = sysUserImageMapper.selectByUserIdAndImageKey(sm.getUserId(), Constants.SYS_FRONT_ID_CARD);
if (record == null) {
record = new SysUserImage();
record.setUserId(sm.getUserId());
record.setUrl(sysMechanicEntity.getIdcardFront());
record.setImageKey(com.glsx.usercenter.constants.Constants.SYS_FRONT_ID_CARD);
sysUserImageMapper.insertSelective(record);
} else {
record.setUrl(sysMechanicEntity.getIdcardFront());
sysUserImageMapper.updateByPrimaryKeySelective(record);
}
// 保存国徽面照片
SysUserImage idcardBack = sysUserImageMapper.selectByUserIdAndImageKey(sm.getUserId(),
Constants.SYS_FRONT_ID_CARD);
if (idcardBack == null) {
idcardBack = new SysUserImage();
idcardBack.setUserId(sm.getUserId());
idcardBack.setUrl(sysMechanicEntity.getIdcardFront());
idcardBack.setImageKey(com.glsx.usercenter.constants.Constants.SYS_BACK_ID_CARD);
sysUserImageMapper.insertSelective(idcardBack);
} else {
record.setUrl(sysMechanicEntity.getIdcardFront());
sysUserImageMapper.updateByPrimaryKeySelective(idcardBack);
}
sysMechanicMapper.updateByPrimaryKeySelective(sysMechanicEntity);
} }
/* /*
......
...@@ -15,15 +15,11 @@ ...@@ -15,15 +15,11 @@
<result column="work_status" jdbcType="TINYINT" property="workStatus" /> <result column="work_status" jdbcType="TINYINT" property="workStatus" />
<result column="send_type" jdbcType="TINYINT" property="sendType" /> <result column="send_type" jdbcType="TINYINT" property="sendType" />
<result column="bank_card_no" jdbcType="VARCHAR" property="bankCardNo" /> <result column="bank_card_no" jdbcType="VARCHAR" property="bankCardNo" />
<result column="IDCard_front" jdbcType="VARCHAR" property="idcardFront" />
<result column="IDCard_back" jdbcType="VARCHAR" property="idcardBack" />
<result column="bank_card_img" jdbcType="VARCHAR" property="bankCardImg" />
<result column="real_name" jdbcType="VARCHAR" property="realName" /> <result column="real_name" jdbcType="VARCHAR" property="realName" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, user_id, district, address, work_time_start, work_time_end, dispatch_type, service_type, id, user_id, district, address, work_time_start, work_time_end, dispatch_type, service_type,
IDCard, mechanic_status, work_status, send_type, bank_card_no, IDCard_front, IDCard_back, IDCard, mechanic_status, work_status, send_type, bank_card_no, real_name
bank_card_img, real_name
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
...@@ -43,14 +39,13 @@ ...@@ -43,14 +39,13 @@
work_time_start, work_time_end, dispatch_type, work_time_start, work_time_end, dispatch_type,
service_type, IDCard, mechanic_status, service_type, IDCard, mechanic_status,
work_status, send_type, bank_card_no, work_status, send_type, bank_card_no,
IDCard_front, IDCard_back, bank_card_img,
real_name) real_name)
values (#{userId,jdbcType=INTEGER}, #{district,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, values (#{userId,jdbcType=INTEGER}, #{district,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{workTimeStart,jdbcType=VARCHAR}, #{workTimeEnd,jdbcType=VARCHAR}, #{dispatchType,jdbcType=TINYINT}, #{workTimeStart,jdbcType=VARCHAR}, #{workTimeEnd,jdbcType=VARCHAR}, #{dispatchType,jdbcType=TINYINT},
#{serviceType,jdbcType=TINYINT}, #{idcard,jdbcType=VARCHAR}, #{mechanicStatus,jdbcType=VARCHAR}, #{serviceType,jdbcType=TINYINT}, #{idcard,jdbcType=VARCHAR}, #{mechanicStatus,jdbcType=VARCHAR},
#{workStatus,jdbcType=TINYINT}, #{sendType,jdbcType=TINYINT}, #{bankCardNo,jdbcType=VARCHAR}, #{workStatus,jdbcType=TINYINT}, #{sendType,jdbcType=TINYINT}, #{bankCardNo,jdbcType=VARCHAR},
#{idcardFront,jdbcType=VARCHAR}, #{idcardBack,jdbcType=VARCHAR}, #{bankCardImg,jdbcType=VARCHAR}, #{realName,jdbcType=VARCHAR})
#{realName,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.user.SysMechanicEntity"> <insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.user.SysMechanicEntity">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
...@@ -94,15 +89,6 @@ ...@@ -94,15 +89,6 @@
<if test="bankCardNo != null"> <if test="bankCardNo != null">
bank_card_no, bank_card_no,
</if> </if>
<if test="idcardFront != null">
IDCard_front,
</if>
<if test="idcardBack != null">
IDCard_back,
</if>
<if test="bankCardImg != null">
bank_card_img,
</if>
<if test="realName != null"> <if test="realName != null">
real_name, real_name,
</if> </if>
...@@ -143,16 +129,7 @@ ...@@ -143,16 +129,7 @@
</if> </if>
<if test="bankCardNo != null"> <if test="bankCardNo != null">
#{bankCardNo,jdbcType=VARCHAR}, #{bankCardNo,jdbcType=VARCHAR},
</if> </if>
<if test="idcardFront != null">
#{idcardFront,jdbcType=VARCHAR},
</if>
<if test="idcardBack != null">
#{idcardBack,jdbcType=VARCHAR},
</if>
<if test="bankCardImg != null">
#{bankCardImg,jdbcType=VARCHAR},
</if>
<if test="realName != null"> <if test="realName != null">
#{realName,jdbcType=VARCHAR}, #{realName,jdbcType=VARCHAR},
</if> </if>
...@@ -197,15 +174,6 @@ ...@@ -197,15 +174,6 @@
<if test="bankCardNo != null"> <if test="bankCardNo != null">
bank_card_no = #{bankCardNo,jdbcType=VARCHAR}, bank_card_no = #{bankCardNo,jdbcType=VARCHAR},
</if> </if>
<if test="idcardFront != null">
IDCard_front = #{idcardFront,jdbcType=VARCHAR},
</if>
<if test="idcardBack != null">
IDCard_back = #{idcardBack,jdbcType=VARCHAR},
</if>
<if test="bankCardImg != null">
bank_card_img = #{bankCardImg,jdbcType=VARCHAR},
</if>
<if test="realName != null"> <if test="realName != null">
real_name = #{realName,jdbcType=VARCHAR}, real_name = #{realName,jdbcType=VARCHAR},
</if> </if>
...@@ -225,10 +193,7 @@ ...@@ -225,10 +193,7 @@
mechanic_status = #{mechanicStatus,jdbcType=VARCHAR}, mechanic_status = #{mechanicStatus,jdbcType=VARCHAR},
work_status = #{workStatus,jdbcType=TINYINT}, work_status = #{workStatus,jdbcType=TINYINT},
send_type = #{sendType,jdbcType=TINYINT}, send_type = #{sendType,jdbcType=TINYINT},
bank_card_no = #{bankCardNo,jdbcType=VARCHAR}, bank_card_no = #{bankCardNo,jdbcType=VARCHAR},
IDCard_front = #{idcardFront,jdbcType=VARCHAR},
IDCard_back = #{idcardBack,jdbcType=VARCHAR},
bank_card_img = #{bankCardImg,jdbcType=VARCHAR},
real_name = #{realName,jdbcType=VARCHAR} real_name = #{realName,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!