Commit f058d5b7 by zhengxj

finish 技工认证 on 20191104 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@24592 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 8b2a29c3
...@@ -125,8 +125,7 @@ public class MechanicController extends BaseReportController { ...@@ -125,8 +125,7 @@ public class MechanicController extends BaseReportController {
} }
sysMechanicEntity.setUserId(ShiroUtil.getUserId()); sysMechanicEntity.setUserId(ShiroUtil.getUserId());
mechanicService.verify(sysMechanicEntity); return mechanicService.verify(sysMechanicEntity);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), "资料已提交,请等待审核!", null);
} }
@RequestMapping(value = "/IdCardOcr2", method = RequestMethod.POST) @RequestMapping(value = "/IdCardOcr2", method = RequestMethod.POST)
......
...@@ -254,15 +254,17 @@ public class UserController extends BaseController { ...@@ -254,15 +254,17 @@ public class UserController extends BaseController {
@Log(menuName = "商户管理", operateType = com.glsx.common.constants.Constants.SYS_LOG_OPERATE_TYPE_SAVE) @Log(menuName = "商户管理", operateType = com.glsx.common.constants.Constants.SYS_LOG_OPERATE_TYPE_SAVE)
@RequestMapping(value = "/saveSysMerchant", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/saveSysMerchant", method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody @ResponseBody
public ResultObject saveSysMerchant(@Validated(value = {Default.class})SysMerchant sysMerchant, BindingResult bindingResult, @RequestBody MerchantReq merchantReq) { public ResultObject saveSysMerchant(@Validated(value = { Default.class }) SysMerchant sysMerchant,
BindingResult bindingResult, @RequestBody MerchantReq merchantReq) {
logger.info("(新增, 编辑)商户传入的参数为" + sysMerchant.toString()); logger.info("(新增, 编辑)商户传入的参数为" + sysMerchant.toString());
logger.info("派单自动创建商户通过feign接口调用merchantReq===" + merchantReq.toString()); logger.info("派单自动创建商户通过feign接口调用merchantReq===" + merchantReq.toString());
if (merchantReq != null) { if (merchantReq != null) {
BeanUtils.copyBeanProp(sysMerchant, merchantReq); BeanUtils.copyBeanProp(sysMerchant, merchantReq);
} }
Map<String, String> errorMap = getErrors(sysMerchant); Map<String, String> errorMap = getErrors(sysMerchant);
if (errorMap.size() >0) { if (errorMap.size() > 0) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg(), errorMap); return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg(),
errorMap);
} }
if (StringUtils.isEmpty(sysMerchant.getPassword())) { if (StringUtils.isEmpty(sysMerchant.getPassword())) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg()); return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
...@@ -286,7 +288,7 @@ public class UserController extends BaseController { ...@@ -286,7 +288,7 @@ public class UserController extends BaseController {
if (merchants != null && merchants.size() == 1) { if (merchants != null && merchants.size() == 1) {
merchant = merchants.get(0); merchant = merchants.get(0);
} }
//标准接口派单,用户是未登录状态 // 标准接口派单,用户是未登录状态
Integer currentUserId = ShiroUtil.getUserId(); Integer currentUserId = ShiroUtil.getUserId();
currentUserId = currentUserId == null ? -1 : currentUserId; currentUserId = currentUserId == null ? -1 : currentUserId;
if (sysMerchant.getId() == null) { if (sysMerchant.getId() == null) {
...@@ -357,7 +359,7 @@ public class UserController extends BaseController { ...@@ -357,7 +359,7 @@ public class UserController extends BaseController {
@RequestMapping(value = "/saveSysMechanic", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/saveSysMechanic", method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody @ResponseBody
@Log(menuName = "技工管理目录-技工管理", operateType = com.glsx.common.constants.Constants.SYS_LOG_OPERATE_TYPE_SAVE) @Log(menuName = "技工管理目录-技工管理", operateType = com.glsx.common.constants.Constants.SYS_LOG_OPERATE_TYPE_SAVE)
public ResultObject saveSysMechanic(@Validated(value = {Default.class}) SysMechanic sysMechanic, BindingResult bindingResult, Integer serviceId) { public ResultObject saveSysMechanic(SysMechanic sysMechanic, BindingResult bindingResult, Integer serviceId) {
logger.info("新增技工传入的参数为" + sysMechanic.toString()); logger.info("新增技工传入的参数为" + sysMechanic.toString());
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
Map<String, String> errorMap = getErrors(bindingResult); Map<String, String> errorMap = getErrors(bindingResult);
...@@ -879,19 +881,19 @@ public class UserController extends BaseController { ...@@ -879,19 +881,19 @@ public class UserController extends BaseController {
} }
} else { } else {
/* /*
*技工端需要判断用户是否审核通过,通过才能登录 V1.5.0--任何状态都可以登录 * 技工端需要判断用户是否审核通过,通过才能登录 V1.5.0--任何状态都可以登录
*/
/*
* if (Constants.USER_TYPE_MECHANIC == userType) { SysMechanic
* mechanic = sysUserService.getMechanicByUserId(id); if
* (mechanic != null) { String mechanicStatus =
* mechanic.getMechanicStatus(); if
* (!com.glsx.usercenter.constants.Constants.
* MECHANIC_STATUS_PASS_CHECK.equals(mechanicStatus)) {
* logger.info("技工审核未通过,该账号暂无权限登录"); return new
* ResultObject(ResultCodeEnum.USER_LOGIN_NO_AUTH.getCode(),
* ResultCodeEnum.USER_LOGIN_NO_AUTH.getMsg()); } } }
*/ */
/*if (Constants.USER_TYPE_MECHANIC == userType) {
SysMechanic mechanic = sysUserService.getMechanicByUserId(id);
if (mechanic != null) {
String mechanicStatus = mechanic.getMechanicStatus();
if (!com.glsx.usercenter.constants.Constants.MECHANIC_STATUS_PASS_CHECK.equals(mechanicStatus)) {
logger.info("技工审核未通过,该账号暂无权限登录");
return new ResultObject(ResultCodeEnum.USER_LOGIN_NO_AUTH.getCode(),
ResultCodeEnum.USER_LOGIN_NO_AUTH.getMsg());
}
}
}*/
} }
/* /*
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
package com.glsx.usercenter.service; package com.glsx.usercenter.service;
import com.glsx.common.constants.ResultObject;
import com.glsx.usercenter.pojo.user.SysMechanicEntity; import com.glsx.usercenter.pojo.user.SysMechanicEntity;
/** /**
...@@ -35,7 +36,7 @@ import com.glsx.usercenter.pojo.user.SysMechanicEntity; ...@@ -35,7 +36,7 @@ import com.glsx.usercenter.pojo.user.SysMechanicEntity;
*/ */
public interface IMechanicService { public interface IMechanicService {
void verify(SysMechanicEntity sysMechanicEntity); ResultObject verify(SysMechanicEntity sysMechanicEntity);
void selectByUserIdAndCheckStatus(SysMechanicEntity sysMechanicEntity); void selectByUserIdAndCheckStatus(SysMechanicEntity sysMechanicEntity);
} }
...@@ -27,8 +27,10 @@ package com.glsx.usercenter.service.impl; ...@@ -27,8 +27,10 @@ package com.glsx.usercenter.service.impl;
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.constants.ResultObject;
import com.glsx.common.feign.client.CommonClient; import com.glsx.common.feign.client.CommonClient;
import com.glsx.usercenter.constants.Constants; import com.glsx.usercenter.constants.Constants;
import com.glsx.usercenter.constants.ResultCodeEnum;
import com.glsx.usercenter.mapper.SysMechanicMapper; import com.glsx.usercenter.mapper.SysMechanicMapper;
import com.glsx.usercenter.mapper.SysUserImageMapper; import com.glsx.usercenter.mapper.SysUserImageMapper;
import com.glsx.usercenter.mapper.SysUserServicesMapper; import com.glsx.usercenter.mapper.SysUserServicesMapper;
...@@ -63,7 +65,7 @@ public class MechanicServiceImpl implements IMechanicService { ...@@ -63,7 +65,7 @@ public class MechanicServiceImpl implements IMechanicService {
*/ */
@Override @Override
public void verify(SysMechanicEntity sysMechanicEntity) { public ResultObject verify(SysMechanicEntity sysMechanicEntity) {
// 修改状态,插入资料 // 修改状态,插入资料
// 解析地址信息 // 解析地址信息
/* /*
...@@ -73,6 +75,10 @@ public class MechanicServiceImpl implements IMechanicService { ...@@ -73,6 +75,10 @@ public class MechanicServiceImpl implements IMechanicService {
* sysMechanicEntity.setDistrict(map.get("adcode")); } * sysMechanicEntity.setDistrict(map.get("adcode")); }
*/ */
SysMechanicEntity sm = sysMechanicMapper.selectByUserIdAndCheckStatus(sysMechanicEntity.getUserId(), null); SysMechanicEntity sm = sysMechanicMapper.selectByUserIdAndCheckStatus(sysMechanicEntity.getUserId(), null);
if (Constants.MECHANIC_STATUS_PASS_CHECK == sm.getMechanicStatus()) {
return new ResultObject(ResultCodeEnum.FAIL.getCode(), "您已经是认证用户请勿提交申请!", null);
}
// 是否为修改后提交 // 是否为修改后提交
boolean isUpdate = Constants.SYS_USER_STATUS_CHECKING == sm.getMechanicStatus() ? true : false; boolean isUpdate = Constants.SYS_USER_STATUS_CHECKING == sm.getMechanicStatus() ? true : false;
sysMechanicEntity.setId(sm.getId()); sysMechanicEntity.setId(sm.getId());
...@@ -132,6 +138,7 @@ public class MechanicServiceImpl implements IMechanicService { ...@@ -132,6 +138,7 @@ public class MechanicServiceImpl implements IMechanicService {
} }
sysMechanicMapper.updateByPrimaryKeySelective(sysMechanicEntity); sysMechanicMapper.updateByPrimaryKeySelective(sysMechanicEntity);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), "您已经是认证用户请勿提交申请!", null);
} }
/* /*
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!