|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.ICargoOwnerInfoService;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IDriverInfoService;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
@@ -298,6 +299,72 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String editUserInfo(CommonUser commonUser) throws ServiceException {
|
|
|
+ //货主
|
|
|
+ if ("1".equals(commonUser.getIdentityFlag())){
|
|
|
+ //查询货主信息
|
|
|
+ HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
|
|
|
+ .eq("common_id",commonUser.getId()).eq("delete_flag","0"));
|
|
|
+ if (hyCargoOwnerInfo != null){
|
|
|
+ //禁用
|
|
|
+ if("1".equals(commonUser.getDisableFlag())){
|
|
|
+ hyCargoOwnerInfo.setDisablingStatusKey(hyCargoOwnerInfo.getAuthenticationStatusKey());
|
|
|
+ hyCargoOwnerInfo.setDisablingStatus(hyCargoOwnerInfo.getAuthenticationStatus());
|
|
|
+ hyCargoOwnerInfo.setDisablingBackStatusKey(hyCargoOwnerInfo.getBackStageStatusKey());
|
|
|
+ hyCargoOwnerInfo.setDisablingBackStatus(hyCargoOwnerInfo.getBackStageStatus());
|
|
|
+ hyCargoOwnerInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED_NO.getFlag());
|
|
|
+ hyCargoOwnerInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED_NO.getName());
|
|
|
+ hyCargoOwnerInfo.setBackStageStatus(StatusEnum.IDENTITY_COMPLETED_NO.getName());
|
|
|
+ hyCargoOwnerInfo.setBackStageStatusKey(StatusEnum.IDENTITY_COMPLETED_NO.getFlag());
|
|
|
+ commonUser.setStatus(0);
|
|
|
+ }
|
|
|
+ //启用
|
|
|
+ else {
|
|
|
+ hyCargoOwnerInfo.setAuthenticationStatusKey(hyCargoOwnerInfo.getDisablingStatusKey());
|
|
|
+ hyCargoOwnerInfo.setAuthenticationStatus(hyCargoOwnerInfo.getDisablingStatus());
|
|
|
+ hyCargoOwnerInfo.setBackStageStatus(hyCargoOwnerInfo.getDisablingBackStatusKey());
|
|
|
+ hyCargoOwnerInfo.setBackStageStatusKey(hyCargoOwnerInfo.getDisablingBackStatus());
|
|
|
+ hyCargoOwnerInfo.setDisablingStatusKey(null);
|
|
|
+ hyCargoOwnerInfo.setDisablingStatus(null);
|
|
|
+ hyCargoOwnerInfo.setDisablingBackStatusKey(null);
|
|
|
+ hyCargoOwnerInfo.setDisablingBackStatus(null);
|
|
|
+ commonUser.setStatus(1);
|
|
|
+ }
|
|
|
+ cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //司机
|
|
|
+ else {
|
|
|
+ //查询司机信息
|
|
|
+ HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
|
|
|
+ .eq("common_id",commonUser.getId()).eq("delete_flag","0"));
|
|
|
+ if (hyDriverInfo != null){
|
|
|
+ //禁用
|
|
|
+ if("1".equals(commonUser.getDisableFlag())){
|
|
|
+ hyDriverInfo.setDisablingStatusKey(hyDriverInfo.getAuthenticationStatusKey());
|
|
|
+ hyDriverInfo.setDisablingStatus(hyDriverInfo.getAuthenticationStatus());
|
|
|
+ hyDriverInfo.setDisablingBackStatusKey(hyDriverInfo.getBackStageStatusKey());
|
|
|
+ hyDriverInfo.setDisablingBackStatus(hyDriverInfo.getBackStageStatus());
|
|
|
+ hyDriverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED_NO.getFlag());
|
|
|
+ hyDriverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED_NO.getName());
|
|
|
+ hyDriverInfo.setBackStageStatus(StatusEnum.IDENTITY_COMPLETED_NO.getName());
|
|
|
+ hyDriverInfo.setBackStageStatusKey(StatusEnum.IDENTITY_COMPLETED_NO.getFlag());
|
|
|
+ commonUser.setStatus(0);
|
|
|
+ }
|
|
|
+ //启用
|
|
|
+ else {
|
|
|
+ hyDriverInfo.setAuthenticationStatusKey(hyDriverInfo.getDisablingStatusKey());
|
|
|
+ hyDriverInfo.setAuthenticationStatus(hyDriverInfo.getDisablingStatus());
|
|
|
+ hyDriverInfo.setBackStageStatus(hyDriverInfo.getDisablingBackStatusKey());
|
|
|
+ hyDriverInfo.setBackStageStatusKey(hyDriverInfo.getDisablingBackStatus());
|
|
|
+ hyDriverInfo.setDisablingStatusKey(null);
|
|
|
+ hyDriverInfo.setDisablingStatus(null);
|
|
|
+ hyDriverInfo.setDisablingBackStatusKey(null);
|
|
|
+ hyDriverInfo.setDisablingBackStatus(null);
|
|
|
+ commonUser.setStatus(1);
|
|
|
+ }
|
|
|
+ driverInfoService.updateById(hyDriverInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
this.updateById(commonUser);
|
|
|
return "ok";
|
|
|
}
|
|
@@ -490,7 +557,6 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
|
|
|
throw new AppServiceException(ExceptionDefinition.USER_PHONE_OR_PASSWORD_NOT_CORRECT);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
CommonUser userDO = this.selectById(user.getId());
|
|
|
//检查帐号是否已经冻结
|
|
|
if (userDO.getStatus() == 0) {
|