Compare commits

...

5 Commits

Author SHA1 Message Date
许允枞
0205bedce1 更新 2024-11-14 10:20:43 +08:00
许允枞
8ff6bfb8e5 Merge branch 'dev'
# Conflicts:
#	dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java
2024-11-14 10:20:27 +08:00
许允枞
5179cbb013 更新 2024-11-14 10:19:16 +08:00
许允枞
e95320be7f 更新 2024-11-14 10:08:11 +08:00
许允枞
fc12805d24 更新 2024-11-13 17:32:00 +08:00
7 changed files with 37 additions and 56 deletions

View File

@ -117,7 +117,7 @@ public class InspectionMallPartnersController extends BaseController {
ShopMallPartners partner = new ShopMallPartners();
if (roles.contains("jcshop")){
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
partner = shopMallPartnersService.getOne(queryWrapper);
if (ObjectUtil.isEmpty(partner)){
return error();
@ -150,7 +150,7 @@ public class InspectionMallPartnersController extends BaseController {
ShopMallPartners partner = new ShopMallPartners();
if (roles.contains("jcshop")){
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
partner = shopMallPartnersService.getOne(queryWrapper);
if (ObjectUtil.isEmpty(partner)){
return error();
@ -270,7 +270,7 @@ public class InspectionMallPartnersController extends BaseController {
ShopMallPartners partner = new ShopMallPartners();
if (roles.contains("jcshop")){
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
partner = shopMallPartnersService.getOne(queryWrapper);
if (ObjectUtil.isEmpty(partner)){
return CommonResult.error(-1,"信息有误");

View File

@ -186,7 +186,7 @@ public class ShopInspectionGoodsController extends BaseController
ShopMallPartners partner = new ShopMallPartners();
if (roles.contains("jcshop")){
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
partner = appInspectionPartnerService.getOne(queryWrapper);
if (ObjectUtil.isEmpty(partner)){
return error();

View File

@ -174,7 +174,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
ShopMallPartners partner = new ShopMallPartners();
if (roles.contains("jcshop")){
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
partner = this.getOne(queryWrapper);
if (ObjectUtil.isEmpty(partner)){
throw new Exception("信息有误");

View File

@ -248,7 +248,9 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
//根据角色id获取所有用户
List<UserDTO> listByUserId = roleService.getListByUserId(roleId);
List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList());
ids.add(inspectionInfo.getLeadManId());
if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())) {
ids.add(inspectionInfo.getLeadManId());
}
// 获取当前共单引车员的id
if (CollUtil.isNotEmpty(ids)) {
for (Long id : ids) {

View File

@ -246,11 +246,13 @@ public class ShopInspectionGoodsServiceImpl extends ServiceImpl<ShopInspectionGo
public List<ShopInspectionCategory> categoryList() throws Exception {
ShopMallPartners one = appInspectionPartnerService.shopInfoByUserId();
List<ShopInspectionCategory> shopInspectionCategories = appInspectionPartnerService.categoryList(one.getPartnerId());
for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) {
LambdaQueryWrapper<InspectionCategoryTemplate> templateLambdaQueryWrapper =new LambdaQueryWrapper<>();
templateLambdaQueryWrapper.eq(InspectionCategoryTemplate::getCategoryId,shopInspectionCategory.getId()).orderByAsc(InspectionCategoryTemplate::getSkuPrice);
List<InspectionCategoryTemplate> list = categoryTemplateService.list(templateLambdaQueryWrapper);
shopInspectionCategory.setTemplates(list);
if (CollectionUtil.isNotEmpty(shopInspectionCategories)) {
for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) {
LambdaQueryWrapper<InspectionCategoryTemplate> templateLambdaQueryWrapper = new LambdaQueryWrapper<>();
templateLambdaQueryWrapper.eq(InspectionCategoryTemplate::getCategoryId, shopInspectionCategory.getId()).orderByAsc(InspectionCategoryTemplate::getSkuPrice);
List<InspectionCategoryTemplate> list = categoryTemplateService.list(templateLambdaQueryWrapper);
shopInspectionCategory.setTemplates(list);
}
}
return shopInspectionCategories;
}

View File

@ -65,12 +65,6 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
private PartnerCustomerInfoMapper customerInfoMapper;
@Autowired
private PartnerCustomerInfoMapper partnerCustomerInfoMapper;
@Resource
private CustomerMainService customerMainService;
@Autowired
private CarMainService carMainService;
@Resource
private CustomerCarService customerCarService;
/**
* 查询客户信息列表
@ -237,26 +231,6 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
throw new Exception("手机号不符合规范");
}
// 创建客户信息
CustomerMain customerMain = new CustomerMain();
customerMain.setId(UUID.randomUUID().toString().replace("-", ""));
customerMain.setUserId(user.getId());
customerMain.setCusName(partnerCustomerInfo.getCustomerName());
customerMain.setPhoneNumber(partnerCustomerInfo.getCustomerPhone());
customerMain.setSex(partnerCustomerInfo.getSex());
customerMain.setIsHangAccount("0");
customerMain.setTypeCode("01");
// 设置客户初始来源
//customerMain.setDataFrom("01");
// 设置注册方式
customerMain.setInviterType("01");
// 保存客户信息
customerMainService.saveOrUpdate(customerMain);
// 保存车辆信息和客户与车辆关联关系
carMainService.saveOrUpdateBatch(saveCarList);
customerCarService.saveBatch(saveCustomerCarList);
// 保存用户车辆信息
for (ShopUserCar userCar : saveUserCarList) {

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.rescue.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.CoordinateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import cn.iocoder.yudao.module.custom.entity.CarMain;
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
@ -591,27 +592,34 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl<RescueDriverInfoMap
detailService.save(rescueInfoDetail);
rescueInfo.setRescueStatus("5");
rescueInfoService.updateById(rescueInfo);
/** 将车辆推送到维修中*/
CustomerMainSaveReqVO saveReqVO = new CustomerMainSaveReqVO();
// 绑定用户id
saveReqVO.setUserId(rescueInfo.getUserId());
// 绑定用户手机号
saveReqVO.setPhoneNumber(rescueInfo.getConnectionPhone());
// 客户名称
saveReqVO.setCusName(rescueInfo.getConnectionName());
// 车辆信息
CarMain carMain = new CarMain();
carMain.setCarLicenseImg(rescueInfo.getLicenseNum());
saveReqVO.setCar(carMain);
//推送到维修中
customerCarService.saveCustomerAndCar(saveReqVO);
//处理司机状态
//查询司机是否还存在未结束的救援订单
//处理redis
DriverInfo driverInfo = driverInfoService.getById(rescueInfo.getDriverId());
AdminUserRespDTO user = userService.getUser(driverInfo.getUserId());
try {
/** 将车辆推送到维修中*/
CustomerMainSaveReqVO saveReqVO = new CustomerMainSaveReqVO();
// 绑定用户id
saveReqVO.setUserId(rescueInfo.getUserId());
// 绑定用户手机号
saveReqVO.setPhoneNumber(rescueInfo.getConnectionPhone());
// 客户名称
if(ObjectUtil.isNotEmpty(rescueInfo.getConnectionName())) {
saveReqVO.setCusName(rescueInfo.getConnectionName());
}else {
saveReqVO.setCusName(rescueInfo.getConnectionPhone());
}
// 车辆信息
CarMain carMain = new CarMain();
carMain.setLicenseNumber(rescueInfo.getLicenseNum());
saveReqVO.setCar(carMain);
//推送到维修中
customerCarService.saveCustomerAndCar(saveReqVO);
// 收集客户信息
PartnerCustomerInfo customerInfo = new PartnerCustomerInfo();
customerInfo.setCustomerName(rescueInfo.getConnectionName());
@ -629,11 +637,6 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl<RescueDriverInfoMap
customerInfo.setUserCarList(userCarList);
// 设置客户来源
CustomerMain customerMain = new CustomerMain();
customerMain.setDataFrom("02");
customerMainService.saveOrUpdate(customerMain);
// 调用插入客户信息的方法
customerInfoService.insertPartnerCustomerInfo(customerInfo);
} catch (Exception ignored) {