Merge branch 'dev' of http://122.51.230.86:3000/dianliang/lanan-system into dev
This commit is contained in:
commit
8ed75b1daf
@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.util.ExcelUtil;
|
import cn.iocoder.yudao.util.ExcelUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@ -39,7 +41,12 @@ public class WarnMessageController extends BaseController
|
|||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/pageList")
|
||||||
|
public CommonResult pageList(WarnMessage warnMessage,Integer pageNo,Integer pageSize) throws Exception {
|
||||||
|
Page page =new Page(pageNo,pageSize);
|
||||||
|
IPage<WarnMessage> list = warnMessageService.pageList(page,warnMessage);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, WarnMessage warnMessage) throws Exception {
|
public void export(HttpServletResponse response, WarnMessage warnMessage) throws Exception {
|
||||||
List<WarnMessage> list = warnMessageService.selectWarnMessageList(warnMessage);
|
List<WarnMessage> list = warnMessageService.selectWarnMessageList(warnMessage);
|
||||||
|
@ -4,7 +4,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
|
import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* warnMsgMapper接口
|
* warnMsgMapper接口
|
||||||
@ -31,4 +35,6 @@ public interface WarnMessageMapper extends BaseMapper<WarnMessage>
|
|||||||
*/
|
*/
|
||||||
public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage);
|
public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage);
|
||||||
|
|
||||||
|
IPage<WarnMessage> pageList(Page page,@Param("warnMessage") WarnMessage warnMessage);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.inspection.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
|
import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
|
||||||
|
|
||||||
@ -28,6 +30,7 @@ public interface IWarnMessageService extends IService<WarnMessage>
|
|||||||
* @return warnMsg集合
|
* @return warnMsg集合
|
||||||
*/
|
*/
|
||||||
public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage) throws Exception;
|
public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage) throws Exception;
|
||||||
|
IPage<WarnMessage> pageList(Page page,WarnMessage warnMessage) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增warnMsg
|
* 新增warnMsg
|
||||||
|
@ -195,7 +195,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
customerInfo.setCustomerName(user.getNickname());
|
customerInfo.setCustomerName(user.getNickname());
|
||||||
customerInfo.setSex("0");
|
customerInfo.setSex("0");
|
||||||
customerInfo.setUserAge(user.getUserAge());
|
customerInfo.setUserAge(user.getUserAge());
|
||||||
customerInfoService.save(customerInfo);
|
customerInfoService.insertPartnerCustomerInfo(customerInfo);
|
||||||
}
|
}
|
||||||
//追加订单明细记录
|
//追加订单明细记录
|
||||||
orderInfoDetailService.save(new OrderInfoDetail(orderInfo.getId(),"线下订单创建",new Date(),0L,"1"));
|
orderInfoDetailService.save(new OrderInfoDetail(orderInfo.getId(),"线下订单创建",new Date(),0L,"1"));
|
||||||
|
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.inspection.service.impl;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import cn.iocoder.yudao.util.DateUtils;
|
import cn.iocoder.yudao.util.DateUtils;
|
||||||
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
||||||
@ -53,6 +55,15 @@ public class WarnMessageServiceImpl extends ServiceImpl<WarnMessageMapper,WarnMe
|
|||||||
return warnMessages;
|
return warnMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<WarnMessage> pageList(Page page, WarnMessage warnMessage) throws Exception {
|
||||||
|
ShopMallPartners partners = partnerService.shopInfo();
|
||||||
|
warnMessage.setPartnerId(partners.getPartnerId());
|
||||||
|
warnMessage.setIsRead("0");
|
||||||
|
IPage<WarnMessage> warnMessages = baseMapper.pageList(page,warnMessage);
|
||||||
|
return warnMessages;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增warnMsg
|
* 新增warnMsg
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.partner.service.impl;
|
package cn.iocoder.yudao.module.partner.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.CarMain;
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.CustomerCar;
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.UserCar;
|
||||||
|
import cn.iocoder.yudao.module.custom.service.CarMainService;
|
||||||
|
import cn.iocoder.yudao.module.custom.service.CustomerCarService;
|
||||||
|
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
|
||||||
|
import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
||||||
import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo;
|
import cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo;
|
||||||
import cn.iocoder.yudao.module.partner.mapper.PartnerCustomerInfoMapper;
|
import cn.iocoder.yudao.module.partner.mapper.PartnerCustomerInfoMapper;
|
||||||
@ -27,10 +35,12 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.math.BigDecimal;
|
||||||
import java.util.HashSet;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.time.ZoneId;
|
||||||
import java.util.Set;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.common.BaseConstants.SIGN_CREATE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户信息Service业务层处理
|
* 客户信息Service业务层处理
|
||||||
@ -55,6 +65,12 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
|
|||||||
private PartnerCustomerInfoMapper customerInfoMapper;
|
private PartnerCustomerInfoMapper customerInfoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private PartnerCustomerInfoMapper partnerCustomerInfoMapper;
|
private PartnerCustomerInfoMapper partnerCustomerInfoMapper;
|
||||||
|
@Resource
|
||||||
|
private CustomerMainService customerMainService;
|
||||||
|
@Autowired
|
||||||
|
private CarMainService carMainService;
|
||||||
|
@Resource
|
||||||
|
private CustomerCarService customerCarService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询客户信息列表
|
* 查询客户信息列表
|
||||||
@ -112,20 +128,27 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int insertPartnerCustomerInfo(PartnerCustomerInfo partnerCustomerInfo) throws Exception {
|
public int insertPartnerCustomerInfo(PartnerCustomerInfo partnerCustomerInfo) throws Exception {
|
||||||
|
// 获取当前商户信息
|
||||||
ShopMallPartners partners = partnerService.shopInfo();
|
ShopMallPartners partners = partnerService.shopInfo();
|
||||||
LambdaQueryWrapper<PartnerCustomerInfo> queryWrapper =new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(PartnerCustomerInfo::getPartnerId,partners.getPartnerId()).eq(PartnerCustomerInfo::getCustomerPhone,partnerCustomerInfo.getCustomerPhone());
|
// 检查客户是否已存在
|
||||||
|
LambdaQueryWrapper<PartnerCustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(PartnerCustomerInfo::getPartnerId, partners.getPartnerId())
|
||||||
|
.eq(PartnerCustomerInfo::getCustomerPhone, partnerCustomerInfo.getCustomerPhone());
|
||||||
|
|
||||||
PartnerCustomerInfo customerInfo = this.getOne(queryWrapper);
|
PartnerCustomerInfo customerInfo = this.getOne(queryWrapper);
|
||||||
if (ObjectUtils.isNotEmpty(customerInfo)){
|
if (ObjectUtils.isNotEmpty(customerInfo)) {
|
||||||
throw new Exception("客户已存在");
|
throw new Exception("客户已存在");
|
||||||
}
|
}
|
||||||
AdminUserDO user = userService.selectUserByPhone(partnerCustomerInfo.getCustomerPhone());
|
|
||||||
if (ObjectUtils.isEmpty(user)){
|
|
||||||
RoleDO role = roleService.queryRole("jcyh");
|
|
||||||
|
|
||||||
|
// 查找或创建用户
|
||||||
|
AdminUserDO user = userService.selectUserByPhone(partnerCustomerInfo.getCustomerPhone());
|
||||||
|
if (ObjectUtils.isEmpty(user)) {
|
||||||
|
RoleDO role = roleService.queryRole("jcyh");
|
||||||
|
if (role != null) {
|
||||||
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
||||||
user = new AdminUserDO();
|
user = new AdminUserDO();
|
||||||
BeanUtils.copyProperties(partnerCustomerInfo,user);
|
BeanUtils.copyProperties(partnerCustomerInfo, user);
|
||||||
userSaveReqVO.setUsername(partnerCustomerInfo.getCustomerPhone());
|
userSaveReqVO.setUsername(partnerCustomerInfo.getCustomerPhone());
|
||||||
userSaveReqVO.setNickname(partnerCustomerInfo.getCustomerName());
|
userSaveReqVO.setNickname(partnerCustomerInfo.getCustomerName());
|
||||||
userSaveReqVO.setPassword("123456");
|
userSaveReqVO.setPassword("123456");
|
||||||
@ -133,62 +156,151 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
|
|||||||
user.setId(uid);
|
user.setId(uid);
|
||||||
Set<Long> ids = new HashSet<>();
|
Set<Long> ids = new HashSet<>();
|
||||||
ids.add(role.getId());
|
ids.add(role.getId());
|
||||||
permissionService.assignUserRole(uid,ids);
|
permissionService.assignUserRole(uid, ids);
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("无法找到角色 'jcyh'");
|
||||||
}
|
}
|
||||||
if (!StringUtils.isEmpty(partnerCustomerInfo.getCustomerPhone())&&!StringUtils.isEmpty(partnerCustomerInfo.getRoleCode())){
|
}
|
||||||
|
|
||||||
|
// 角色分配
|
||||||
|
if (!StringUtils.isEmpty(partnerCustomerInfo.getRoleCode())) {
|
||||||
RoleDO sysRole = roleService.queryRole(partnerCustomerInfo.getRoleCode());
|
RoleDO sysRole = roleService.queryRole(partnerCustomerInfo.getRoleCode());
|
||||||
Set<Long> ids = new HashSet<>();
|
Set<Long> ids = new HashSet<>();
|
||||||
ids.add(sysRole.getId());
|
ids.add(sysRole.getId());
|
||||||
permissionService.assignUserRole(user.getId(),ids);
|
permissionService.assignUserRole(user.getId(), ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 车辆信息处理
|
||||||
List<ShopUserCar> userCarList = partnerCustomerInfo.getUserCarList();
|
List<ShopUserCar> userCarList = partnerCustomerInfo.getUserCarList();
|
||||||
if (CollectionUtil.isNotEmpty(userCarList)){
|
List<CarMain> saveCarList = new ArrayList<>();
|
||||||
|
List<CustomerCar> saveCustomerCarList = new ArrayList<>();
|
||||||
|
List<ShopUserCar> saveUserCarList = new ArrayList<>();
|
||||||
|
|
||||||
|
UserCar userCar1 = new UserCar();
|
||||||
|
if (CollectionUtil.isNotEmpty(userCarList)) {
|
||||||
for (ShopUserCar shopUserCar : userCarList) {
|
for (ShopUserCar shopUserCar : userCarList) {
|
||||||
LambdaQueryWrapper<ShopUserCar> queryWrapper1 =new LambdaQueryWrapper<>();
|
// 生成车辆ID
|
||||||
queryWrapper1.eq(ShopUserCar::getUserId,user.getId()).eq(ShopUserCar::getCarNo,shopUserCar.getCarNo());
|
String carId = UUID.randomUUID().toString().replace("-", "");
|
||||||
ShopUserCar one = userCarService.getOne(queryWrapper1);
|
CarMain carMain = new CarMain();
|
||||||
if (ObjectUtils.isNotEmpty(one)){
|
carMain.setId(carId);
|
||||||
//保养日期
|
carMain.setUserId(user.getId());
|
||||||
if (null!=shopUserCar.getMaintenanceDate()){
|
carMain.setLicenseNumber(shopUserCar.getCarNo());
|
||||||
one.setMaintenanceDate(shopUserCar.getMaintenanceDate());
|
carMain.setEngineNumber(userCar1.getEngineNumber());
|
||||||
|
carMain.setVin(userCar1.getVin());
|
||||||
|
carMain.setCarModel(shopUserCar.getCarModel());
|
||||||
|
// 设置其它车辆信息
|
||||||
|
carMain.setMaintenanceDate(convertToLocalDateTime(shopUserCar.getMaintenanceDate()));
|
||||||
|
carMain.setMaintenanceMileage(convertToBigDecimal(shopUserCar.getMaintenanceMileage()));
|
||||||
|
carMain.setInspectionDate(convertToLocalDateTime(shopUserCar.getInspectionDate()));
|
||||||
|
carMain.setInsuranceDate(convertToLocalDateTime(shopUserCar.getInsuranceDate()));
|
||||||
|
carMain.setNextMaintenanceDate(convertToLocalDateTime(shopUserCar.getNextMaintenanceDate()));
|
||||||
|
carMain.setNextMaintenanceMileage(convertToBigDecimal(shopUserCar.getNextMaintenanceMileage()));
|
||||||
|
carMain.setNextInspectionDate(convertToLocalDateTime(shopUserCar.getNextInspectionDate()));
|
||||||
|
carMain.setInsuranceExpiryDate(convertToLocalDateTime(shopUserCar.getInsuranceExpiryDate()));
|
||||||
|
carMain.setCarBrand(shopUserCar.getCarBrand());
|
||||||
|
carMain.setCarNature(shopUserCar.getCarNature());
|
||||||
|
carMain.setCarCategory(userCar1.getCarCategory());
|
||||||
|
carMain.setCarRegisterDate(convertToLocalDateTime(shopUserCar.getCarRegisterDate()));
|
||||||
|
carMain.setCarLicenseImg(shopUserCar.getCarLicenseImg());
|
||||||
|
carMain.setCheckDate(convertToLocalDateTime(shopUserCar.getCheckDate()));
|
||||||
|
carMain.setNextCheckDate(convertToLocalDateTime(shopUserCar.getNextCheckDate()));
|
||||||
|
|
||||||
|
// 保存车辆信息
|
||||||
|
saveCarList.add(carMain);
|
||||||
|
|
||||||
|
// 客户与车辆的关联关系
|
||||||
|
CustomerCar customerCar = new CustomerCar();
|
||||||
|
customerCar.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
customerCar.setCusId(user.getId().toString());
|
||||||
|
customerCar.setCarId(carId);
|
||||||
|
customerCar.setIsOwner(userCar1.getIsOwner()); // 是否为车主
|
||||||
|
saveCustomerCarList.add(customerCar);
|
||||||
|
|
||||||
|
// 保存用户车辆信息
|
||||||
|
ShopUserCar userCar = new ShopUserCar();
|
||||||
|
userCar.setUserId(user.getId());
|
||||||
|
userCar.setCarNo(shopUserCar.getCarNo());
|
||||||
|
userCar.setCarModel(shopUserCar.getCarModel());
|
||||||
|
userCar.setMaintenanceDate(shopUserCar.getMaintenanceDate());
|
||||||
|
userCar.setMaintenanceMileage(shopUserCar.getMaintenanceMileage());
|
||||||
|
userCar.setInspectionDate(shopUserCar.getInspectionDate());
|
||||||
|
userCar.setInsuranceDate(shopUserCar.getInsuranceDate());
|
||||||
|
userCar.setNextMaintenanceDate(shopUserCar.getNextMaintenanceDate());
|
||||||
|
userCar.setNextMaintenanceMileage(shopUserCar.getNextMaintenanceMileage());
|
||||||
|
userCar.setNextInspectionDate(shopUserCar.getNextInspectionDate());
|
||||||
|
userCar.setInsuranceExpiryDate(shopUserCar.getInsuranceExpiryDate());
|
||||||
|
saveUserCarList.add(userCar);
|
||||||
}
|
}
|
||||||
if (null!=shopUserCar.getMaintenanceMileage()){
|
|
||||||
one.setMaintenanceMileage(shopUserCar.getMaintenanceMileage());
|
|
||||||
}
|
|
||||||
if (null!=shopUserCar.getInspectionDate()){
|
|
||||||
one.setInspectionDate(shopUserCar.getInspectionDate());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null!=shopUserCar.getInsuranceDate()){
|
// 验证手机号
|
||||||
one.setInsuranceDate(shopUserCar.getInsuranceDate());
|
if (!StringUtils.isMobile(partnerCustomerInfo.getCustomerPhone())) {
|
||||||
}
|
throw new Exception("手机号不符合规范");
|
||||||
if (null!=shopUserCar.getNextMaintenanceDate()){
|
|
||||||
one.setNextMaintenanceDate(shopUserCar.getNextMaintenanceDate());
|
|
||||||
}
|
|
||||||
if (null!=shopUserCar.getNextMaintenanceMileage()){
|
|
||||||
one.setNextMaintenanceMileage(shopUserCar.getNextMaintenanceMileage());
|
|
||||||
}
|
|
||||||
if (null!=shopUserCar.getNextInspectionDate()){
|
|
||||||
one.setNextInspectionDate(shopUserCar.getNextInspectionDate());
|
|
||||||
}
|
|
||||||
if (null!=shopUserCar.getInsuranceExpiryDate()){
|
|
||||||
one.setInsuranceExpiryDate(shopUserCar.getInsuranceExpiryDate());
|
|
||||||
}
|
|
||||||
userCarService.updateById(one);
|
|
||||||
}else {
|
|
||||||
shopUserCar.setUserId(user.getId());
|
|
||||||
userCarService.save(shopUserCar);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 创建客户信息
|
||||||
|
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) {
|
||||||
|
// 检查是否已存在
|
||||||
|
LambdaQueryWrapper<ShopUserCar> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper1.eq(ShopUserCar::getUserId, userCar.getUserId()).eq(ShopUserCar::getCarNo, userCar.getCarNo());
|
||||||
|
ShopUserCar existingUserCar = userCarService.getOne(queryWrapper1);
|
||||||
|
if (existingUserCar != null) {
|
||||||
|
// 更新用户车辆信息
|
||||||
|
userCarService.updateById(userCar);
|
||||||
|
} else {
|
||||||
|
// 保存新用户车辆信息
|
||||||
|
userCarService.save(userCar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 填充 partnerCustomerInfo
|
||||||
partnerCustomerInfo.setPartnerId(partners.getPartnerId());
|
partnerCustomerInfo.setPartnerId(partners.getPartnerId());
|
||||||
partnerCustomerInfo.setUserId(user.getId());
|
partnerCustomerInfo.setUserId(user.getId());
|
||||||
|
|
||||||
|
// 插入 partner_customer_info
|
||||||
return baseMapper.insertPartnerCustomerInfo(partnerCustomerInfo);
|
return baseMapper.insertPartnerCustomerInfo(partnerCustomerInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Date转换为LocalDateTime */
|
||||||
|
private LocalDateTime convertToLocalDateTime(Date date) {
|
||||||
|
if (date != null) {
|
||||||
|
return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Long转换为BigDecimal */
|
||||||
|
private BigDecimal convertToBigDecimal(Long value) {
|
||||||
|
if (value != null) {
|
||||||
|
return BigDecimal.valueOf(value);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改客户信息
|
* 修改客户信息
|
||||||
*
|
*
|
||||||
|
@ -607,4 +607,19 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号格式验证
|
||||||
|
* @author lzt
|
||||||
|
* @param customerPhone 手机号
|
||||||
|
* @return 验证结果
|
||||||
|
* @date 2024年10月22日
|
||||||
|
*/
|
||||||
|
public static boolean isMobile(String customerPhone) {
|
||||||
|
if (customerPhone == null || customerPhone.length() != 11) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String regex = "^1[358]\\d{9}$";
|
||||||
|
return customerPhone.matches(regex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,8 +209,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="pageWorkOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
<select id="pageWorkOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||||
select ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
select distinct ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
||||||
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,ins.create_time
|
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price
|
||||||
from inspection_info ins
|
from inspection_info ins
|
||||||
left join order_info oi on oi.id = ins.inspection_order_id
|
left join order_info oi on oi.id = ins.inspection_order_id
|
||||||
left join system_users su on su.id = ins.user_id
|
left join system_users su on su.id = ins.user_id
|
||||||
|
@ -20,7 +20,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select * from warn_message
|
select * from warn_message
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="pageList" resultType="cn.iocoder.yudao.module.inspection.entity.WarnMessage">
|
||||||
|
select * from warn_message
|
||||||
|
<where>
|
||||||
|
and warn_time <![CDATA[<=]]> NOW()
|
||||||
|
<if test="warnMessage.title != null and warnMessage.title != ''"> and title = #{warnMessage.title}</if>
|
||||||
|
<if test="warnMessage.partnerId != null "> and partner_id = #{warnMessage.partnerId}</if>
|
||||||
|
<if test="warnMessage.isRead != null and warnMessage.isRead != ''"> and is_read = #{warnMessage.isRead}</if>
|
||||||
|
</where>
|
||||||
|
order by create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -19,7 +19,7 @@ public interface RepairRecordsService extends IService<RepairRecords> {
|
|||||||
* 保存维修记录
|
* 保存维修记录
|
||||||
*
|
*
|
||||||
* @param ticketId 工单id
|
* @param ticketId 工单id
|
||||||
* @param repairItemId 工单子表id
|
// * @param repairItemId 工单子表id
|
||||||
* @param type 工作类型(数据字典:repair_records_type;后端对应 RecordTypeEnum 枚举)
|
* @param type 工作类型(数据字典:repair_records_type;后端对应 RecordTypeEnum 枚举)
|
||||||
* @param remark 备注
|
* @param remark 备注
|
||||||
* @param images 图片(相对路径按照“,”分隔)
|
* @param images 图片(相对路径按照“,”分隔)
|
||||||
|
@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
|||||||
import cn.iocoder.yudao.module.tickets.vo.CustomerAndCarVO;
|
import cn.iocoder.yudao.module.tickets.vo.CustomerAndCarVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
|
import cn.iocoder.yudao.module.tickets.vo.NoticeCusVO;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -293,5 +294,31 @@ public class DlRepairTicketsController {
|
|||||||
dlRepairTicketsService.confirm(respVO);
|
dlRepairTicketsService.confirm(respVO);
|
||||||
return CommonResult.ok();
|
return CommonResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从总检的角度差维修中、已完成的工单数量
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 11:29 2024/10/24
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||||
|
**/
|
||||||
|
@GetMapping("/getBossNum")
|
||||||
|
@Operation(summary = "从总检的角度差维修中、已完成的工单数量")
|
||||||
|
public CommonResult<?> getBossNum() {
|
||||||
|
return success(dlRepairTicketsService.getBossNum());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务顾问通知客户取车
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 22:40 2024/10/23
|
||||||
|
* @param noticeCusVO 请求对象
|
||||||
|
**/
|
||||||
|
@PostMapping("/noticeCus")
|
||||||
|
@Operation(summary = "服务顾问通知客户取车")
|
||||||
|
public CommonResult<?> noticeCus(@RequestBody NoticeCusVO noticeCusVO) {
|
||||||
|
dlRepairTicketsService.noticeCus(noticeCusVO);
|
||||||
|
return CommonResult.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,11 +4,13 @@ import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
|||||||
import cn.iocoder.yudao.module.tickets.vo.CustomerAndCarVO;
|
import cn.iocoder.yudao.module.tickets.vo.CustomerAndCarVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
|
import cn.iocoder.yudao.module.tickets.vo.NoticeCusVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对表【dl_repair_tickets(维修工单表)】的数据库操作Service
|
* 针对表【dl_repair_tickets(维修工单表)】的数据库操作Service
|
||||||
@ -163,4 +165,21 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
|||||||
* @param respVO 请求对象
|
* @param respVO 请求对象
|
||||||
**/
|
**/
|
||||||
void confirm(DlRepairTicketsRespVO respVO);
|
void confirm(DlRepairTicketsRespVO respVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从总检的角度差维修中、已完成的工单数量
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 11:30 2024/10/24
|
||||||
|
* @return java.util.Map<java.lang.String,java.lang.Integer>
|
||||||
|
**/
|
||||||
|
Map<String,Integer> getBossNum();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务顾问通知客户取车
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 22:40 2024/10/23
|
||||||
|
* @param noticeCusVO 请求对象
|
||||||
|
**/
|
||||||
|
void noticeCus(NoticeCusVO noticeCusVO);
|
||||||
}
|
}
|
||||||
|
@ -43,10 +43,7 @@ import cn.iocoder.yudao.module.tickets.mapper.DlRepairTicketsMapper;
|
|||||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
||||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
|
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
|
||||||
import cn.iocoder.yudao.module.tickets.tools.WordUtil;
|
import cn.iocoder.yudao.module.tickets.tools.WordUtil;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.CustomerAndCarVO;
|
import cn.iocoder.yudao.module.tickets.vo.*;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO;
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@ -55,6 +52,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.ss.formula.functions.Na;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -63,6 +62,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -431,15 +431,15 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
public IPage<DlRepairTickets> getPageType(DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page) {
|
public IPage<DlRepairTickets> getPageType(DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page) {
|
||||||
String userRoleCode = getUserRole();
|
String userRoleCode = getUserRole();
|
||||||
if (userRoleCode.equals(RepairRoleEnum.ADMIN.getCode())) {
|
if (userRoleCode.equals(RepairRoleEnum.ADMIN.getCode())) {
|
||||||
//维修管理员和总检,看所有数据
|
//维修管理员看所有数据
|
||||||
} else if(userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())){
|
} else if(userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())){
|
||||||
//总检
|
//总检
|
||||||
if (RepairCons.TICKETS_WAITING.equals(repairTicketsReqVO.getSelectType())) {
|
if (RepairCons.TICKETS_WAITING.equals(repairTicketsReqVO.getSelectType())) {
|
||||||
//查待处理的,查需要自己处理的,否则就是查所有
|
//查待处理的,查需要自己处理的,否则就是查所有
|
||||||
repairTicketsReqVO.setUserId(String.valueOf(SecurityFrameworkUtils.getLoginUserId()));
|
repairTicketsReqVO.setUserIds(Collections.singletonList(SecurityFrameworkUtils.getLoginUserId()));
|
||||||
}
|
}
|
||||||
}else if (userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())) {
|
}else if (userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())) {
|
||||||
//服务顾问看自己的
|
//服务顾问
|
||||||
repairTicketsReqVO.setAdviserId(String.valueOf(SecurityFrameworkUtils.getLoginUserId()));
|
repairTicketsReqVO.setAdviserId(String.valueOf(SecurityFrameworkUtils.getLoginUserId()));
|
||||||
} else if (userRoleCode.equals(RepairRoleEnum.REPAIR_STAFF.getCode())) {
|
} else if (userRoleCode.equals(RepairRoleEnum.REPAIR_STAFF.getCode())) {
|
||||||
//维修工,进一步判断是否是班组长
|
//维修工,进一步判断是否是班组长
|
||||||
@ -460,8 +460,10 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (RepairCons.TICKETS_WAITING.equals(repairTicketsReqVO.getSelectType())) {
|
if (RepairCons.TICKETS_WAITING.equals(repairTicketsReqVO.getSelectType())) {
|
||||||
|
//查待处理
|
||||||
return baseMapper.getPageType(repairTicketsReqVO, page);
|
return baseMapper.getPageType(repairTicketsReqVO, page);
|
||||||
} else {
|
} else {
|
||||||
|
//查所有
|
||||||
return baseMapper.getPageTypeAll(repairTicketsReqVO, page);
|
return baseMapper.getPageTypeAll(repairTicketsReqVO, page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -713,6 +715,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
String userRoleCode = getUserRole();
|
String userRoleCode = getUserRole();
|
||||||
// 当前操作人的id
|
// 当前操作人的id
|
||||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
//设置查询类型---待总检或待出厂检验的工单
|
||||||
|
repairTicketsReqVO.setSelectType("special");
|
||||||
// 维修服务顾问
|
// 维修服务顾问
|
||||||
if (userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())) {
|
if (userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())) {
|
||||||
repairTicketsReqVO.setNowRepairId(loginUserId);
|
repairTicketsReqVO.setNowRepairId(loginUserId);
|
||||||
@ -731,13 +735,13 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
/**
|
/**
|
||||||
* 维修总检完成总检
|
* 维修总检完成总检
|
||||||
*
|
*
|
||||||
|
* @param respVO 请求对象
|
||||||
* @author 小李
|
* @author 小李
|
||||||
* @date 16:48 2024/10/23
|
* @date 16:48 2024/10/23
|
||||||
* @param respVO 请求对象
|
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
@DSTransactional
|
@DSTransactional
|
||||||
public void inspection(DlRepairTicketsRespVO respVO){
|
public void inspection(DlRepairTicketsRespVO respVO) {
|
||||||
// 新增日志
|
// 新增日志
|
||||||
repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.ZJ.getCode(), respVO.getRemark(), respVO.getImage());
|
repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.ZJ.getCode(), respVO.getRemark(), respVO.getImage());
|
||||||
// 更新工单
|
// 更新工单
|
||||||
@ -755,21 +759,94 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
/**
|
/**
|
||||||
* 服务顾问上传出厂检验日志
|
* 服务顾问上传出厂检验日志
|
||||||
*
|
*
|
||||||
|
* @param respVO 请求对象
|
||||||
* @author 小李
|
* @author 小李
|
||||||
* @date 17:47 2024/10/23
|
* @date 17:47 2024/10/23
|
||||||
* @param respVO 请求对象
|
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void confirm(DlRepairTicketsRespVO respVO){
|
public void confirm(DlRepairTicketsRespVO respVO) {
|
||||||
// 更新工单状态
|
// 更新工单状态
|
||||||
baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
|
baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
|
||||||
.set(DlRepairTickets::getTicketsWorkStatus, "03")
|
.set(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.END.getCode())
|
||||||
.eq(DlRepairTickets::getId, respVO.getId())
|
.eq(DlRepairTickets::getId, respVO.getId())
|
||||||
);
|
);
|
||||||
|
|
||||||
// 记录日志
|
// 记录日志
|
||||||
repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.JSGD.getCode(), respVO.getRemark(), respVO.getImage());
|
repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.JSGD.getCode(), respVO.getRemark(), respVO.getImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从总检的角度差维修中、已完成的工单数量
|
||||||
|
*
|
||||||
|
* @return java.util.Map<java.lang.String, java.lang.Integer>
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 11:30 2024/10/24
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> getBossNum() {
|
||||||
|
Map<String,Integer> rtnMap = new HashMap<>();
|
||||||
|
int workingNum = 0;
|
||||||
|
int doneNum = 0;
|
||||||
|
List<DlRepairTickets> repairTickets = this.list();
|
||||||
|
if(!repairTickets.isEmpty()){
|
||||||
|
Map<String,List<DlRepairTickets>> ifFinishMap = repairTickets.stream().collect(Collectors.groupingBy(DlRepairTickets::getIsFinish));
|
||||||
|
if(ifFinishMap.containsKey("0")){
|
||||||
|
workingNum = ifFinishMap.get("0").size();
|
||||||
|
}
|
||||||
|
if(ifFinishMap.containsKey("1")){
|
||||||
|
doneNum = ifFinishMap.get("1").size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rtnMap.put("workingNum",workingNum);
|
||||||
|
rtnMap.put("doneNum",doneNum);
|
||||||
|
return rtnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务顾问通知客户取车
|
||||||
|
*
|
||||||
|
* @param noticeCusVO 请求对象
|
||||||
|
* @author 小李
|
||||||
|
* @date 22:40 2024/10/23
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
@DSTransactional
|
||||||
|
public void noticeCus(NoticeCusVO noticeCusVO) {
|
||||||
|
// 获取客户信息
|
||||||
|
DlRepairTickets tickets = baseMapper.selectById(noticeCusVO.getId());
|
||||||
|
CustomerMain cus = customerService.getById(tickets.getUserId());
|
||||||
|
// 维修项目
|
||||||
|
List<DictDataRespDTO> repairType = dictDataApi.getDictDataList("repair_type");
|
||||||
|
// 默认是维修
|
||||||
|
String type = "维修";
|
||||||
|
DictDataRespDTO dictDataRespDTO = repairType.stream()
|
||||||
|
.filter(item -> item.getValue().equals(tickets.getRepairType()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (dictDataRespDTO != null){
|
||||||
|
type = dictDataRespDTO.getLabel();
|
||||||
|
}
|
||||||
|
// 构建消息
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
String start = format.format(noticeCusVO.getTime()[0]);
|
||||||
|
String end = format.format(noticeCusVO.getTime()[1]);
|
||||||
|
String message = String.format(
|
||||||
|
"尊敬的客户您好:您的爱车%s已%s完毕,请您于%s至%s之内前来取车。若有问题可以联系%s,联系电话:%s"
|
||||||
|
, tickets.getCarNo(), type, start, end, noticeCusVO.getName(), noticeCusVO.getMobile()
|
||||||
|
);
|
||||||
|
// todo 小程序通知客户
|
||||||
|
// todo 短信通知客户
|
||||||
|
// 记录日志
|
||||||
|
String recordStr = noticeCusVO.getName()
|
||||||
|
+ "通知客户:"
|
||||||
|
+ cus.getCusName()
|
||||||
|
+ "于"
|
||||||
|
+ start
|
||||||
|
+ "至"
|
||||||
|
+ end
|
||||||
|
+ "前来取车";
|
||||||
|
repairRecordsService.saveRepairRecord(noticeCusVO.getId(), null, RecordTypeEnum.JSGD.getCode(), recordStr, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.tickets.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class NoticeCusVO {
|
||||||
|
|
||||||
|
/** 维修工单ID */
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 取车时间 */
|
||||||
|
@Schema(pattern = "时间区间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private Date[] time;
|
||||||
|
|
||||||
|
/** 联系人 */
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 联系电话 */
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
private String remark;
|
||||||
|
}
|
@ -182,9 +182,10 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getPageType" resultMap="APPBaseResultMap">
|
<select id="getPageType" resultMap="APPBaseResultMap">
|
||||||
|
-- 查待处理数据 --
|
||||||
select drt.*
|
select drt.*
|
||||||
from dl_repair_tickets drt
|
from dl_repair_tickets drt
|
||||||
where drt.deleted = '0'
|
where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01')
|
||||||
<if test="map.ticketNo != null and map.ticketNo != ''">
|
<if test="map.ticketNo != null and map.ticketNo != ''">
|
||||||
and (
|
and (
|
||||||
drt.ticket_no like concat('%', #{map.ticketNo}, '%')
|
drt.ticket_no like concat('%', #{map.ticketNo}, '%')
|
||||||
@ -199,36 +200,36 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="map.searchTimeArray != null and map.searchTimeArray.length > 0">
|
<if test="map.searchTimeArray != null and map.searchTimeArray.length > 0">
|
||||||
and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}
|
and (drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]})
|
||||||
</if>
|
</if>
|
||||||
<if test="map.adviserId != null and map.adviserId != ''">
|
|
||||||
and drt.adviser_id = #{map.adviserId}
|
|
||||||
</if>
|
|
||||||
<if test="map.isFinish != null and map.isFinish != ''">
|
|
||||||
and drt.is_finish = #{map.isFinish}
|
|
||||||
</if>
|
|
||||||
<if test="map.userIds != null and map.userIds.size > 0 ">
|
|
||||||
and (drt.tickets_status = '05')
|
|
||||||
<choose>
|
<choose>
|
||||||
<when test="map.isFinish == '0'">
|
<when test="map.selectType=='special'">
|
||||||
and (drt.now_repair_id in
|
-- 小李用的逻辑 --
|
||||||
|
<if test="map.isFinish != null and map.isFinish != ''">
|
||||||
|
AND ( drt.is_finish = #{map.isFinish})
|
||||||
|
</if>
|
||||||
|
<if test="map.nowRepairId != null and map.nowRepairId != ''">
|
||||||
|
AND ( drt.now_repair_id = #{map.nowRepairId})
|
||||||
|
</if>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
-- 正常查询用的逻辑 --
|
||||||
|
<if test="map.adviserId != null and map.adviserId != ''">
|
||||||
|
-- 查服务顾问 待处理的 工单未完成并且服务顾问是自己的 工单已完成且当前处理人是自己的--
|
||||||
|
AND ( drt.is_finish = '0' AND drt.adviser_id = #{map.adviserId} )
|
||||||
|
OR (drt.is_finish = '1' AND drt.now_repair_id = #{map.adviserId})
|
||||||
|
</if>
|
||||||
|
<if test="map.userIds != null and map.userIds.size > 0">
|
||||||
|
-- 查维修工、总检待处理的 --
|
||||||
|
AND (drt.is_finish = '0')
|
||||||
|
AND (drt.now_repair_id in
|
||||||
<foreach collection="map.userIds" item="item" index="index" open="(" separator="," close=")">
|
<foreach collection="map.userIds" item="item" index="index" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</when>
|
</if>
|
||||||
<when test="map.isFinish == '1'">
|
</otherwise>
|
||||||
and (
|
|
||||||
<foreach item="item" collection="map.userIds" index="index" open="" separator="or" close="">
|
|
||||||
find_in_set(#{item}, drti.repair_ids) > 0
|
|
||||||
</foreach>
|
|
||||||
)
|
|
||||||
</when>
|
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
|
||||||
<if test="map.nowRepairId != null and map.nowRepairId != ''">
|
|
||||||
and drt.now_repair_id = #{map.nowRepairId}
|
|
||||||
</if>
|
|
||||||
order by drt.create_time desc
|
order by drt.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -279,9 +280,11 @@
|
|||||||
and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}
|
and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}
|
||||||
</if>
|
</if>
|
||||||
<if test="map.adviserId != null and map.adviserId != ''">
|
<if test="map.adviserId != null and map.adviserId != ''">
|
||||||
|
-- 服务顾问查所有的就是服务顾问是自己的 --
|
||||||
and drt.adviser_id = #{map.adviserId}
|
and drt.adviser_id = #{map.adviserId}
|
||||||
</if>
|
</if>
|
||||||
<if test="map.userIds != null and map.userIds.size > 0">
|
<if test="map.userIds != null and map.userIds.size > 0">
|
||||||
|
-- 维修工或维修厂长查所有的就是维修人是自己的或者是自己班组内的 --
|
||||||
and (
|
and (
|
||||||
<foreach item="item" collection="map.userIds" index="index" open="" separator="or" close="">
|
<foreach item="item" collection="map.userIds" index="index" open="" separator="or" close="">
|
||||||
find_in_set(#{item}, drt.now_repair_id) > 0
|
find_in_set(#{item}, drt.now_repair_id) > 0
|
||||||
|
File diff suppressed because one or more lines are too long
@ -19,12 +19,14 @@ import cn.iocoder.yudao.module.system.controller.admin.user.LoginBody;
|
|||||||
import cn.iocoder.yudao.module.system.convert.auth.AuthConvert;
|
import cn.iocoder.yudao.module.system.convert.auth.AuthConvert;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.service.ServicePackageDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum;
|
import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum;
|
||||||
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
|
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.MenuService;
|
import cn.iocoder.yudao.module.system.service.permission.MenuService;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.service.ServicePackageService;
|
||||||
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
|
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
|
||||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@ -32,6 +34,7 @@ import io.swagger.v3.oas.annotations.Parameter;
|
|||||||
import io.swagger.v3.oas.annotations.Parameters;
|
import io.swagger.v3.oas.annotations.Parameters;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -39,6 +42,7 @@ import javax.annotation.Resource;
|
|||||||
import javax.annotation.security.PermitAll;
|
import javax.annotation.security.PermitAll;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -75,6 +79,8 @@ public class AuthController {
|
|||||||
private PermissionApi permissionApi;
|
private PermissionApi permissionApi;
|
||||||
@Resource
|
@Resource
|
||||||
private RoleApi roleApi;
|
private RoleApi roleApi;
|
||||||
|
@Resource
|
||||||
|
private ServicePackageService servicePackageService;
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
@ -185,7 +191,7 @@ public class AuthController {
|
|||||||
|
|
||||||
@GetMapping("/get-permission-info")
|
@GetMapping("/get-permission-info")
|
||||||
@Operation(summary = "获取登录用户的权限信息")
|
@Operation(summary = "获取登录用户的权限信息")
|
||||||
public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() {
|
public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo(String routeCode) {
|
||||||
// 1.1 获得用户信息
|
// 1.1 获得用户信息
|
||||||
AdminUserDO user = userService.getUser(getLoginUserId());
|
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
@ -202,6 +208,12 @@ public class AuthController {
|
|||||||
|
|
||||||
// 1.3 获得菜单列表
|
// 1.3 获得菜单列表
|
||||||
Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId));
|
Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId));
|
||||||
|
//过滤出来当前服务的菜单
|
||||||
|
if (StringUtils.isNotEmpty(routeCode)){
|
||||||
|
ServicePackageDO servicePackage = servicePackageService.getServicePackage(routeCode);
|
||||||
|
Set<Long> servicePackageMenuIds = servicePackage.getMenuIds();
|
||||||
|
menuIds= menuIds.stream().filter(servicePackageMenuIds::contains).collect(Collectors.toSet());
|
||||||
|
}
|
||||||
List<MenuDO> menuList = menuService.getMenuList(menuIds);
|
List<MenuDO> menuList = menuService.getMenuList(menuIds);
|
||||||
menuList = menuService.filterDisableMenus(menuList);
|
menuList = menuService.filterDisableMenus(menuList);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user