浏览代码

优化修改车辆信息

shuiqilin
zhangxin 1年前
父节点
当前提交
8ddba69d22

+ 11
- 1
src/main/java/com/qtzl/alterSales/manager/handler/AflCenterUserInfoFindByIdHandler.java 查看文件

@@ -1,13 +1,16 @@
package com.qtzl.alterSales.manager.handler;

import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.hutool.core.util.DesensitizedUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.qtzl.alterSales.dao.entity.second.AflCenterUserInfo;
import com.qtzl.alterSales.manager.abstracts.AbstractAfterSalesManager;
import com.qtzl.alterSales.manager.model.protocol.sales.AflCenterUserInfoFindByIdRequest;
import com.qtzl.alterSales.manager.service.AflCenterUserInfoService;
import com.qtzl.alterSales.manager.service.AfterSalesCmd;
import com.txffp.api.core.manager.comm.annotation.ApiHandler;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@@ -28,6 +31,13 @@ public class AflCenterUserInfoFindByIdHandler extends AbstractAfterSalesManager<

@Override
public String handleInternal(String filename, AflCenterUserInfoFindByIdRequest request) throws ServiceHandleException {
return JSON.toJSONString(aflCenterUserInfoService.selectById(request.getId()), SerializerFeature.WriteDateUseDateFormat);
AflCenterUserInfo aflCenterUserInfo = aflCenterUserInfoService.selectById(request.getId());
if (!StringUtils.isEmpty(aflCenterUserInfo.getIdNum())&&aflCenterUserInfo.getIdNum().length()==18){
aflCenterUserInfo.setIdNum(DesensitizedUtil.idCardNum(aflCenterUserInfo.getIdNum(), 3, 4));
}
if (!StringUtils.isEmpty(aflCenterUserInfo.getMobile())&&aflCenterUserInfo.getMobile().length()==11){
aflCenterUserInfo.setIdNum(DesensitizedUtil.mobilePhone(aflCenterUserInfo.getMobile()));
}
return JSON.toJSONString(aflCenterUserInfo, SerializerFeature.WriteDateUseDateFormat);
}
}

+ 7
- 0
src/main/java/com/qtzl/alterSales/manager/handler/AflCenterUserInfoFindPageHandler.java 查看文件

@@ -2,6 +2,7 @@ package com.qtzl.alterSales.manager.handler;

import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.DesensitizedUtil;
import com.google.common.collect.Lists;
import com.qtzl.alterSales.dao.entity.second.AflCenterUserInfo;
import com.qtzl.alterSales.dao.repo.jpa.second.AflCenterUserInfoRepo;
@@ -119,6 +120,12 @@ public class AflCenterUserInfoFindPageHandler extends AbstractAfterSalesManager<
private AflCenterUserInfoVo toVo(AflCenterUserInfo aflCenterUserInfo) {
AflCenterUserInfoVo aflCenterUserInfoVo = new AflCenterUserInfoVo();
BeanUtil.copyProperties(aflCenterUserInfo, aflCenterUserInfoVo);
if (!StringUtils.isEmpty(aflCenterUserInfoVo.getIdNum())&&aflCenterUserInfoVo.getIdNum().length()==18){
aflCenterUserInfoVo.setIdNum(DesensitizedUtil.idCardNum(aflCenterUserInfoVo.getIdNum(), 3, 4));
}
if (!StringUtils.isEmpty(aflCenterUserInfoVo.getMobile())&&aflCenterUserInfoVo.getMobile().length()==11){
aflCenterUserInfoVo.setIdNum(DesensitizedUtil.mobilePhone(aflCenterUserInfoVo.getMobile()));
}
return aflCenterUserInfoVo;
}
}

+ 13
- 2
src/main/java/com/qtzl/alterSales/manager/service/AflCenterUserInfoServiceImpl.java 查看文件

@@ -2,6 +2,7 @@ package com.qtzl.alterSales.manager.service;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.hutool.core.util.DesensitizedUtil;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.qtzl.alterSales.dao.entity.second.AflCenterUserInfo;
@@ -86,7 +87,8 @@ public class AflCenterUserInfoServiceImpl implements AflCenterUserInfoService{
try {
response = httpUtil.doPost(ZttxInterfaceCode.UPDATE_PERSONAL_USER_INFO, requestParam);
} catch (ManagerException e) {
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改个人账户信息失败,请重新审核");
e.getMessage();
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改个人账户信息失败,请重新审核,错误原因:"+e.getMessage());
}
if (response == null || response.getRcode() != 0) {
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改个人账户信息失败,请重新审核");
@@ -102,7 +104,8 @@ public class AflCenterUserInfoServiceImpl implements AflCenterUserInfoService{
try {
response = httpUtil.doPost(ZttxInterfaceCode.UPDATE_COMPANY_USER_INFO, requestParam);
} catch (ManagerException e) {
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改单位账户信息失败,请重新审核");
e.getMessage();
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改单位账户信息失败,请重新审核,错误原因:"+e.getMessage());
}
if (response == null || response.getRcode() != 0) {
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改单位账户信息失败,请重新审核");
@@ -188,6 +191,14 @@ public class AflCenterUserInfoServiceImpl implements AflCenterUserInfoService{
if (aflCenterUserInfos==null||aflCenterUserInfos.size()==0) {
pathFile = ExcelUtils.export(null, "账户管理",constantConfig.getFilePath() ,null, AflCenterUserInfo.class);
} else {
for (AflCenterUserInfo aflCenterUserInfo : aflCenterUserInfos) {
if (!StringUtils.isEmpty(aflCenterUserInfo.getIdNum())&&aflCenterUserInfo.getIdNum().length()==18){
aflCenterUserInfo.setIdNum(DesensitizedUtil.idCardNum(aflCenterUserInfo.getIdNum(), 3, 4));
}
if (!StringUtils.isEmpty(aflCenterUserInfo.getMobile())&&aflCenterUserInfo.getMobile().length()==11){
aflCenterUserInfo.setIdNum(DesensitizedUtil.mobilePhone(aflCenterUserInfo.getMobile()));
}
}
pathFile = ExcelUtils.export(null, "账户管理",constantConfig.getFilePath(), aflCenterUserInfos, AflCenterUserInfo.class);
}
if (StringUtils.isEmpty(pathFile)){

+ 4
- 2
src/main/java/com/qtzl/alterSales/manager/service/AflCenterVehicleInfoServiceImpl.java 查看文件

@@ -83,6 +83,7 @@ public class AflCenterVehicleInfoServiceImpl implements AflCenterVehicleInfoServ
try {
aflCenterVehicleInfoRepo.save(aflCenterVehicleInfo);
} catch (Exception e) {
e.getMessage();
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核失败");
}
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核状态变更失败,该车辆所属账户信息不存在。");
@@ -103,7 +104,8 @@ public class AflCenterVehicleInfoServiceImpl implements AflCenterVehicleInfoServ
try {
response = httpUtil.doPost(ZttxInterfaceCode.UPDATE_VEHICLE_INFO, requestParam);
} catch (ManagerException e) {
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改车辆信息失败,请重新审核");
e.getMessage();
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改车辆信息失败,请重新审核,错误原因:"+e.getMessage());
}
if (response == null || response.getRcode() != 0) {
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("修改车辆信息失败,请重新审核");
@@ -119,7 +121,7 @@ public class AflCenterVehicleInfoServiceImpl implements AflCenterVehicleInfoServ
try {
aflCenterVehicleInfoRepo.save(aflCenterVehicleInfo);
} catch (Exception e) {
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核成功");
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("审核失败,保存信息错误");
}
}


+ 8
- 1
src/main/java/com/qtzl/alterSales/manager/service/TokenServiceImpl.java 查看文件

@@ -9,6 +9,7 @@ import com.qtzl.alterSales.zt.utils.ZtHttpResponse;
import com.qtzl.alterSales.zt.utils.ZtHttpUtil;
import com.qtzl.alterSales.zt.vo.RefreshTokenRequestVo;
import com.qtzl.alterSales.zt.vo.RefreshTokenResponseVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@@ -25,6 +26,12 @@ public class TokenServiceImpl implements TokenService{

@Override
public RefreshTokenResponseVo refreshToken(String openId,String accessToken) throws ServiceHandleException {
if (StringUtils.isEmpty(openId)){
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("获取令牌失败,openId必填");
}
if (StringUtils.isEmpty(accessToken)){
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("获取令牌失败,accessToken必填");
}
RefreshTokenRequestVo refreshTokenRequestVo = new RefreshTokenRequestVo();
refreshTokenRequestVo.setOpenId(openId);
refreshTokenRequestVo.setAccessToken(accessToken);
@@ -33,7 +40,7 @@ public class TokenServiceImpl implements TokenService{
try {
response = httpUtil.doPost(ZttxInterfaceCode.REFRESH_TOKEN, requestParam);
} catch (ManagerException e) {
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("获取令牌失败");
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("获取令牌失败"+e.getMessage());
}
if (response != null && response.getRcode() == 0) {
try {

+ 9
- 9
src/main/java/com/qtzl/alterSales/manager/vo/UpdateCompanyAccountInfoVo.java 查看文件

@@ -92,31 +92,31 @@ public class UpdateCompanyAccountInfoVo extends XZRequestVo {

public Map<String, String> getRequestParam() {
Map<String, String> map = Maps.newHashMap();
if (StringUtils.isEmpty(name)){
if (!StringUtils.isEmpty(name)){
map.put("name", name);
}
if (StringUtils.isEmpty(accessToken)){
if (!StringUtils.isEmpty(accessToken)){
map.put("accessToken", accessToken);
}
if (StringUtils.isEmpty(openId)){
if (!StringUtils.isEmpty(openId)){
map.put("openId", openId);
}
if (StringUtils.isEmpty(accountId)){
if (!StringUtils.isEmpty(accountId)){
map.put("accountId", accountId);
}
if (StringUtils.isEmpty(address)){
if (!StringUtils.isEmpty(address)){
map.put("address", address);
}
if (StringUtils.isEmpty(bank)){
if (!StringUtils.isEmpty(bank)){
map.put("bank", bank);
}
if (StringUtils.isEmpty(bankAddr)){
if (!StringUtils.isEmpty(bankAddr)){
map.put("bankAddr", bankAddr);
}
if (StringUtils.isEmpty(bankAccount)){
if (!StringUtils.isEmpty(bankAccount)){
map.put("bankAccount", bankAccount);
}
if (StringUtils.isEmpty(taxpayerCode)){
if (!StringUtils.isEmpty(taxpayerCode)){
map.put("taxpayerCode", taxpayerCode);
}
map.put("uniqueKey", getUniqueKey());

+ 5
- 5
src/main/java/com/qtzl/alterSales/manager/vo/UpdatePersonalAccountInfoVo.java 查看文件

@@ -55,19 +55,19 @@ public class UpdatePersonalAccountInfoVo extends XZRequestVo {
}
public Map<String, String> getRequestParam() {
Map<String, String> map = Maps.newHashMap();
if (StringUtils.isEmpty(name)){
if (!StringUtils.isEmpty(name)){
map.put("name", name);
}
if (StringUtils.isEmpty(accessToken)){
if (!StringUtils.isEmpty(accessToken)){
map.put("accessToken", accessToken);
}
if (StringUtils.isEmpty(openId)){
if (!StringUtils.isEmpty(openId)){
map.put("openId", openId);
}
if (StringUtils.isEmpty(accountId)){
if (!StringUtils.isEmpty(accountId)){
map.put("accountId", accountId);
}
if (StringUtils.isEmpty(address)){
if (!StringUtils.isEmpty(address)){
map.put("address", address);
}
map.put("uniqueKey", getUniqueKey());

+ 2
- 1
src/main/java/com/qtzl/alterSales/zt/vo/FindByVehicleIdRequestVo.java 查看文件

@@ -1,6 +1,7 @@
package com.qtzl.alterSales.zt.vo;

import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

@@ -18,7 +19,7 @@ public class FindByVehicleIdRequestVo extends XZRequestVo{

public Map<String, String> getRequestParam() {
Map<String, String> map = Maps.newHashMap();
if (vehicleId != null){
if (!StringUtils.isEmpty(vehicleId)){
map.put("vehicleId", vehicleId.toString());
}
map.put("uniqueKey", getUniqueKey().toString());

+ 4
- 3
src/main/java/com/qtzl/alterSales/zt/vo/RefreshTokenRequestVo.java 查看文件

@@ -1,6 +1,7 @@
package com.qtzl.alterSales.zt.vo;

import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

@@ -31,10 +32,10 @@ public class RefreshTokenRequestVo extends XZRequestVo {
}
public Map<String, String> getRequestParam() {
Map<String, String> map = Maps.newHashMap();
if (openId != null){
map.put("accessToken", accessToken.toString());
if (!StringUtils.isEmpty(openId)){
map.put("openId", openId.toString());
}
if (accessToken != null){
if (!StringUtils.isEmpty(accessToken)){
map.put("accessToken", accessToken.toString());
}
map.put("uniqueKey", getUniqueKey().toString());

+ 10
- 10
src/main/java/com/qtzl/alterSales/zt/vo/UpdateVehicleInfoRequestVo.java 查看文件

@@ -113,34 +113,34 @@ public class UpdateVehicleInfoRequestVo extends XZRequestVo{

public Map<String, String> getRequestParam() {
Map<String, String> map = Maps.newHashMap();
if (StringUtils.isEmpty(vehicleId)){
if (!StringUtils.isEmpty(vehicleId)){
map.put("vehicleId", vehicleId);
}
if (StringUtils.isEmpty(accessToken)){
if (!StringUtils.isEmpty(accessToken)){
map.put("accessToken", accessToken);
}
if (StringUtils.isEmpty(openId)){
if (!StringUtils.isEmpty(openId)){
map.put("openId", openId);
}
if (StringUtils.isEmpty(accountId)){
if (!StringUtils.isEmpty(accountId)){
map.put("accountId", accountId);
}
if (StringUtils.isEmpty(engineNum)){
if (!StringUtils.isEmpty(engineNum)){
map.put("engineNum", engineNum);
}
if (StringUtils.isEmpty(issueDate)){
if (!StringUtils.isEmpty(issueDate)){
map.put("issueDate", issueDate);
}
if (StringUtils.isEmpty(registerDate)){
if (!StringUtils.isEmpty(registerDate)){
map.put("registerDate", registerDate);
}
if (StringUtils.isEmpty(vehicleModel)){
if (!StringUtils.isEmpty(vehicleModel)){
map.put("vehicleModel", vehicleModel);
}
if (StringUtils.isEmpty(testRecord)){
if (!StringUtils.isEmpty(testRecord)){
map.put("testRecord", testRecord);
}
if (StringUtils.isEmpty(axisType)){
if (!StringUtils.isEmpty(axisType)){
map.put("axisType", axisType);
}
map.put("uniqueKey", getUniqueKey());

+ 4
- 3
src/main/java/com/qtzl/alterSales/zt/vo/UserInfoAuthenticationRequestVo.java 查看文件

@@ -1,6 +1,7 @@
package com.qtzl.alterSales.zt.vo;

import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

@@ -49,16 +50,16 @@ public class UserInfoAuthenticationRequestVo extends XZRequestVo{
}
public Map<String, String> getRequestParam() {
Map<String, String> map = Maps.newHashMap();
if (mobile != null){
if (StringUtils.isEmpty(mobile)){
map.put("mobile", mobile.toString());
}
if (name != null){
if (!StringUtils.isEmpty(name)){
map.put("name", name.toString());
}
if (userIdType != null){
map.put("userIdType", userIdType.toString());
}
if (id != null){
if (!StringUtils.isEmpty(id )){
map.put("id", id.toString());
}
map.put("uniqueKey", getUniqueKey().toString());

正在加载...
取消
保存