Commit 6e5b7fb7 by zhengxj

finish 技工认证 on 20191017 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@24338 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent b49c1fae
...@@ -6,6 +6,8 @@ import com.glsx.usercenter.pojo.user.SysAreaExample; ...@@ -6,6 +6,8 @@ import com.glsx.usercenter.pojo.user.SysAreaExample;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysAreaMapper { public interface SysAreaMapper {
long countByExample(SysAreaExample example); long countByExample(SysAreaExample example);
...@@ -24,4 +26,7 @@ public interface SysAreaMapper { ...@@ -24,4 +26,7 @@ public interface SysAreaMapper {
int updateByPrimaryKey(SysArea record); int updateByPrimaryKey(SysArea record);
List<SysArea> getAllChargeItems(Integer parentId); List<SysArea> getAllChargeItems(Integer parentId);
String getFullAreaByDistrictId(@Param("districtId") Integer districtId);
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.usercenter.mapper; package com.glsx.usercenter.mapper;
import org.apache.ibatis.annotations.Param;
import com.glsx.usercenter.pojo.user.SysMechanicEntity; import com.glsx.usercenter.pojo.user.SysMechanicEntity;
public interface SysMechanicMapper { public interface SysMechanicMapper {
...@@ -15,4 +17,7 @@ public interface SysMechanicMapper { ...@@ -15,4 +17,7 @@ public interface SysMechanicMapper {
int updateByPrimaryKeySelective(SysMechanicEntity record); int updateByPrimaryKeySelective(SysMechanicEntity record);
int updateByPrimaryKey(SysMechanicEntity record); int updateByPrimaryKey(SysMechanicEntity record);
SysMechanicEntity selectByUserIdAndCheckStatus(@Param("userId") Integer userId,
@Param("mechanicStatus") String mechanicStatus);
} }
\ No newline at end of file \ No newline at end of file
...@@ -42,4 +42,6 @@ public interface IAreaService { ...@@ -42,4 +42,6 @@ public interface IAreaService {
List<SysArea> selectByExample(SysAreaExample example); List<SysArea> selectByExample(SysAreaExample example);
SysArea getAllChargeItems(Integer id); SysArea getAllChargeItems(Integer id);
String getFullAreaByDistrictId(Integer id);
} }
...@@ -36,4 +36,6 @@ import com.glsx.usercenter.pojo.user.SysMechanicEntity; ...@@ -36,4 +36,6 @@ import com.glsx.usercenter.pojo.user.SysMechanicEntity;
public interface IMechanicService { public interface IMechanicService {
void verify(SysMechanicEntity sysMechanicEntity); void verify(SysMechanicEntity sysMechanicEntity);
void selectByUserIdAndCheckStatus(SysMechanicEntity sysMechanicEntity);
} }
...@@ -76,4 +76,16 @@ public class AreaServiceImpl implements IAreaService { ...@@ -76,4 +76,16 @@ public class AreaServiceImpl implements IAreaService {
return prandPa; return prandPa;
} }
/*
* (non-Javadoc)
*
* @see
* com.glsx.usercenter.service.IAreaService#getFullAreaByDistrictId(java.
* lang.Integer)
*/
@Override
public String getFullAreaByDistrictId(Integer id) {
return sysAreaMapper.getFullAreaByDistrictId(id);
}
} }
...@@ -24,9 +24,12 @@ ...@@ -24,9 +24,12 @@
*/ */
package com.glsx.usercenter.service.impl; package com.glsx.usercenter.service.impl;
import java.util.Map;
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.DictionaryTypeMapper; import com.glsx.usercenter.mapper.DictionaryTypeMapper;
import com.glsx.usercenter.mapper.SysMechanicMapper; import com.glsx.usercenter.mapper.SysMechanicMapper;
...@@ -48,16 +51,27 @@ public class MechanicServiceImpl implements IMechanicService { ...@@ -48,16 +51,27 @@ public class MechanicServiceImpl implements IMechanicService {
@Autowired @Autowired
private SysMechanicMapper sysMechanicMapper; private SysMechanicMapper sysMechanicMapper;
@Autowired @Autowired
private SysUserServicesMapper sysUserServicesMapper; private SysUserServicesMapper sysUserServicesMapper;
@Autowired
private AMapUtils mapUtils;
/** /**
* 技工认证 * 技工认证
*/ */
@Override @Override
public void verify(SysMechanicEntity sysMechanicEntity) { public void verify(SysMechanicEntity sysMechanicEntity) {
// 修改状态,插入资料 // 修改状态,插入资料
// 解析地址信息
/*
* Map<String, String> map =
* mapUtils.parseAddress(sysMechanicEntity.getAddress()); if
* (map.containsKey("adcode") && !map.get("adcode").isEmpty()) {
* sysMechanicEntity.setDistrict(map.get("adcode")); }
*/
sysMechanicEntity.setMechanicStatus(Constants.SYS_USER_STATUS_CHECKING); sysMechanicEntity.setMechanicStatus(Constants.SYS_USER_STATUS_CHECKING);
sysMechanicMapper.updateByPrimaryKeySelective(sysMechanicEntity); sysMechanicMapper.updateByPrimaryKeySelective(sysMechanicEntity);
String[] items = sysMechanicEntity.getServiceItemsKey(); String[] items = sysMechanicEntity.getServiceItemsKey();
...@@ -69,4 +83,18 @@ public class MechanicServiceImpl implements IMechanicService { ...@@ -69,4 +83,18 @@ public class MechanicServiceImpl implements IMechanicService {
sysUserServicesMapper.insertSelective(record); sysUserServicesMapper.insertSelective(record);
} }
} }
/*
* (non-Javadoc)
*
* @see
* com.glsx.usercenter.service.IMechanicService#selectByUserIdAndCheckStatus
* (com.glsx.usercenter.pojo.user.SysMechanicEntity)
*/
@Override
public void selectByUserIdAndCheckStatus(SysMechanicEntity sysMechanicEntity) {
sysMechanicMapper.selectByUserIdAndCheckStatus(sysMechanicEntity.getUserId(),
Constants.SYS_USER_STATUS_CHECKING);
}
} }
...@@ -158,8 +158,14 @@ ...@@ -158,8 +158,14 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from sys_area WHERE parent_id = #{id} from sys_area WHERE parent_id = #{id}
</select> </select>
<select id="getFullAreaByDistrictId" parameterType="java.lang.Integer"
resultType="java.lang.String">
SELECT
CONCAT_WS('', sa2.area_name, sa1.area_name, sa.area_name) AS fullArea
FROM sys_area sa
LEFT JOIN sys_area sa1 ON sa.parent_id = sa1.id
LEFT JOIN sys_area sa2 ON sa1.parent_id = sa2.id
WHERE sa.id = #{districtId }
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -232,4 +232,12 @@ ...@@ -232,4 +232,12 @@
real_name = #{realName,jdbcType=VARCHAR} real_name = #{realName,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="selectByUserIdAndCheckStatus" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_mechanic
where user_id = #{userId,jdbcType=INTEGER}
and mechanic_status = #{mechanicStatus,jdbcType=VARCHAR}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!