no message
This commit is contained in:
@ -3,14 +3,9 @@ package com.sczx.sync.service.impl;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.nacos.common.utils.MD5Utils;
|
import com.alibaba.nacos.common.utils.MD5Utils;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.sczx.sync.mapper.*;
|
|
||||||
import com.sczx.sync.po.StoreInfo;
|
|
||||||
import com.sczx.sync.po.CompanyInfo;
|
|
||||||
import com.sczx.sync.po.BaseUser;
|
|
||||||
import com.sczx.sync.po.BatteryRule;
|
|
||||||
import com.sczx.sync.po.SyncRequest;
|
|
||||||
import com.sczx.sync.entity.UserInfo;
|
import com.sczx.sync.entity.UserInfo;
|
||||||
import com.sczx.sync.po.UserStore;
|
import com.sczx.sync.mapper.*;
|
||||||
|
import com.sczx.sync.po.*;
|
||||||
import com.sczx.sync.service.ReceiveService;
|
import com.sczx.sync.service.ReceiveService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -22,8 +17,6 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.sczx.sync.common.enums.ApiErrorCode.NOT_PERMISSION;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Component
|
@Component
|
||||||
@ -59,8 +52,7 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
BatteryRule batteryRule = new BatteryRule();
|
BatteryRule batteryRule = new BatteryRule();
|
||||||
try {
|
try {
|
||||||
batteryRule = JSON.parseObject(String.valueOf(syncRequest.getData()), BatteryRule.class);
|
batteryRule = JSON.parseObject(String.valueOf(syncRequest.getData()), BatteryRule.class);
|
||||||
}catch (Exception e)
|
} catch (Exception e) {
|
||||||
{
|
|
||||||
map.put("msg", "数据格式错误");
|
map.put("msg", "数据格式错误");
|
||||||
map.put("exception", e.getMessage());
|
map.put("exception", e.getMessage());
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
@ -71,15 +63,18 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
map.put("msg", "套餐名称不能为空");
|
map.put("msg", "套餐名称不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (batteryRule.getDetail() == null || batteryRule.getDetail().isEmpty()){
|
}
|
||||||
|
if (batteryRule.getDetail() == null || batteryRule.getDetail().isEmpty()) {
|
||||||
map.put("msg", "套餐详情不能为空");
|
map.put("msg", "套餐详情不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (batteryRule.getVoltage() == null){
|
}
|
||||||
|
if (batteryRule.getVoltage() == null) {
|
||||||
map.put("msg", "套餐电压不能为空");
|
map.put("msg", "套餐电压不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (batteryRule.getAh() == null){
|
}
|
||||||
|
if (batteryRule.getAh() == null) {
|
||||||
map.put("msg", "套餐Ah不能为空");
|
map.put("msg", "套餐Ah不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
@ -173,7 +168,8 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
map.put("msg", "用户认证状态不能为空");
|
map.put("msg", "用户认证状态不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (user.getIsmerchant() == null) {
|
}
|
||||||
|
if (user.getIsmerchant() == null) {
|
||||||
map.put("msg", "用户类型不能为空");
|
map.put("msg", "用户类型不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
@ -196,7 +192,8 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
baseUser.setIdNo(user.getCardno());
|
baseUser.setIdNo(user.getCardno());
|
||||||
baseUser.setAuthed(user.getIsauthentication());
|
baseUser.setAuthed(user.getIsauthentication());
|
||||||
baseUser.setIsStore(user.getIsmerchant());
|
baseUser.setIsStore(user.getIsmerchant());
|
||||||
baseUser.setFrontPhoto(user.getCard1());;
|
baseUser.setFrontPhoto(user.getCard1());
|
||||||
|
;
|
||||||
baseUser.setBackPhoto(user.getCard2());
|
baseUser.setBackPhoto(user.getCard2());
|
||||||
baseUser.setDelFlag("0");
|
baseUser.setDelFlag("0");
|
||||||
|
|
||||||
@ -212,6 +209,7 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
UserStore userStore = new UserStore();
|
UserStore userStore = new UserStore();
|
||||||
String storeIds = user.getStoreId();
|
String storeIds = user.getStoreId();
|
||||||
|
|
||||||
|
if (user.getIsmerchant() == 1) {
|
||||||
String[] storeIdsArray = storeIds.split(",");
|
String[] storeIdsArray = storeIds.split(",");
|
||||||
for (String storeId : storeIdsArray) {
|
for (String storeId : storeIdsArray) {
|
||||||
userStore.setStoreId(Long.parseLong(storeId));
|
userStore.setStoreId(Long.parseLong(storeId));
|
||||||
@ -222,6 +220,8 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
userStore.setUpdateTime(LocalDateTime.now());
|
userStore.setUpdateTime(LocalDateTime.now());
|
||||||
userStoreMapper.insertUserStore(userStore);
|
userStoreMapper.insertUserStore(userStore);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
map.put("msg", "成功");
|
map.put("msg", "成功");
|
||||||
map.put("code", "200");
|
map.put("code", "200");
|
||||||
|
|
||||||
@ -245,27 +245,33 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
map.put("msg", "公司名称不能为空");
|
map.put("msg", "公司名称不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (companyInfo.getContact_name() == null || companyInfo.getContact_name().isEmpty()){
|
}
|
||||||
|
if (companyInfo.getContact_name() == null || companyInfo.getContact_name().isEmpty()) {
|
||||||
map.put("msg", "联系人不能为空");
|
map.put("msg", "联系人不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (companyInfo.getPhone() == null || companyInfo.getPhone().isEmpty()) {
|
}
|
||||||
|
if (companyInfo.getPhone() == null || companyInfo.getPhone().isEmpty()) {
|
||||||
map.put("msg", "手机号不能为空");
|
map.put("msg", "手机号不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (companyInfo.getAddress() == null || companyInfo.getAddress().isEmpty()){
|
}
|
||||||
|
if (companyInfo.getAddress() == null || companyInfo.getAddress().isEmpty()) {
|
||||||
map.put("msg", "地址不能为空");
|
map.put("msg", "地址不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (companyInfo.getCitys() == null || companyInfo.getCitys().isEmpty()){
|
}
|
||||||
|
if (companyInfo.getCitys() == null || companyInfo.getCitys().isEmpty()) {
|
||||||
map.put("msg", "城市不能为空");
|
map.put("msg", "城市不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (companyInfo.getIs_delete() == null || companyInfo.getIs_delete().isEmpty()){
|
}
|
||||||
|
if (companyInfo.getIs_delete() == null || companyInfo.getIs_delete().isEmpty()) {
|
||||||
map.put("msg", "删除状态不能为空");
|
map.put("msg", "删除状态不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (companyInfo.getbOpId() == null){
|
}
|
||||||
|
if (companyInfo.getbOpId() == null) {
|
||||||
map.put("msg", "租电平台运营商id不能为空,请补传'bOpId'");
|
map.put("msg", "租电平台运营商id不能为空,请补传'bOpId'");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
@ -306,43 +312,53 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
map.put("msg", "门店名称不能为空");
|
map.put("msg", "门店名称不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getPhone() == null || storeInfo.getPhone().isEmpty()){
|
}
|
||||||
|
if (storeInfo.getPhone() == null || storeInfo.getPhone().isEmpty()) {
|
||||||
map.put("msg", "门店手机号不能为空");
|
map.put("msg", "门店手机号不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getProvince() == null || storeInfo.getProvince().isEmpty()){
|
}
|
||||||
|
if (storeInfo.getProvince() == null || storeInfo.getProvince().isEmpty()) {
|
||||||
map.put("msg", "门店省份不能为空");
|
map.put("msg", "门店省份不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getCity() == null || storeInfo.getCity().isEmpty()){
|
}
|
||||||
|
if (storeInfo.getCity() == null || storeInfo.getCity().isEmpty()) {
|
||||||
map.put("msg", "门店城市不能为空");
|
map.put("msg", "门店城市不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getAddress() == null || storeInfo.getAddress().isEmpty()){
|
}
|
||||||
|
if (storeInfo.getAddress() == null || storeInfo.getAddress().isEmpty()) {
|
||||||
map.put("msg", "门店地址不能为空");
|
map.put("msg", "门店地址不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getImage() == null || storeInfo.getImage().isEmpty()){
|
}
|
||||||
|
if (storeInfo.getImage() == null || storeInfo.getImage().isEmpty()) {
|
||||||
map.put("msg", "门店照片不能为空");
|
map.put("msg", "门店照片不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getLatitude() == null ){
|
}
|
||||||
|
if (storeInfo.getLatitude() == null) {
|
||||||
map.put("msg", "门店纬度不能为空");
|
map.put("msg", "门店纬度不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getLongitude() == null){
|
}
|
||||||
|
if (storeInfo.getLongitude() == null) {
|
||||||
map.put("msg", "门店经度不能为空");
|
map.put("msg", "门店经度不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getIs_delete() == null){
|
}
|
||||||
|
if (storeInfo.getIs_delete() == null) {
|
||||||
map.put("msg", "门店删除状态不能为空");
|
map.put("msg", "门店删除状态不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getContact_name() == null || storeInfo.getContact_name().isEmpty()){
|
}
|
||||||
|
if (storeInfo.getContact_name() == null || storeInfo.getContact_name().isEmpty()) {
|
||||||
map.put("msg", "门店联系人不能为空");
|
map.put("msg", "门店联系人不能为空");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
}if (storeInfo.getBpStoreId() == null){
|
}
|
||||||
|
if (storeInfo.getBpStoreId() == null) {
|
||||||
map.put("msg", "租电平台门店id不能为空,请补传'bpStoreId'");
|
map.put("msg", "租电平台门店id不能为空,请补传'bpStoreId'");
|
||||||
map.put("code", "500");
|
map.put("code", "500");
|
||||||
return map;
|
return map;
|
||||||
|
|||||||
Reference in New Issue
Block a user