This commit is contained in:
xyc 2025-04-28 15:21:05 +08:00
parent 452e18c135
commit 914f1d107d
19 changed files with 440 additions and 70 deletions

View File

@ -386,4 +386,15 @@ public class InspectionInfoController extends BaseController {
public CommonResult<?> meetCarPhoto(@RequestBody InspectionWorkNode inspectionWorkNode) {
return success(inspectionInfoService.meetCarPhoto(inspectionWorkNode));
}
/**
* 修改异常工单
* @param inspectionWorkNode
* @return
*/
@PostMapping("/updateException")
public CommonResult<?> updateException(@RequestBody InspectionWorkNode inspectionWorkNode){
inspectionWorkNodeService.updateException(inspectionWorkNode.getInspectionInfoId(), inspectionWorkNode.getIdList());
return success("操作成功");
}
}

View File

@ -5,10 +5,7 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.inspection.entity.InspectionMeetCarOrder;
import cn.iocoder.yudao.module.inspection.service.InspectionMeetCarOrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @Description: 接车订单
@ -31,9 +28,12 @@ public class InspectionMeetCarOrderController {
*/
@PostMapping("/add")
public CommonResult<?> add(@RequestBody InspectionMeetCarOrder order) {
// 设置接车员id
order.setMeetManId(SecurityFrameworkUtils.getLoginUserId());
inspectionMeetCarOrderService.add(order);
return CommonResult.ok();
}
@GetMapping("/get")
public CommonResult<?> get(Long id){
return CommonResult.success(inspectionMeetCarOrderService.getById(id));
}
}

View File

@ -823,6 +823,18 @@ public class PartnerOwnController extends BaseController {
return success(partnerList.getProjectBelowStandardByIds(ids,status,type));
}
/**
* 根据inspection_info的id查有的项目名称
*
* @param ids inspection_info的id
* @author 小李
* @date 14:52 2024/12/10
**/
@GetMapping("/getProjectExceptionByIds")
public CommonResult<?> getProjectExceptionByIds(@RequestParam(value = "ids") Long[] ids,@RequestParam(value = "status",required = false) String status,@RequestParam(value = "type",required = false) String type) {
return success(partnerList.getProjectExceptionByIds(ids,status,type));
}
/**
* 根据时间查订单
*

View File

@ -75,6 +75,19 @@ public class InspectionAppointment extends TenantBaseDO
// 车辆注册时间
private Date carRegisterDate;
private String address;
private String meetOrderId;
@TableField(exist = false)
private String skuName;
@TableField(exist = false)
private String meetName;
@TableField(exist = false)
private Integer isMeet;
@TableField(exist = false)
private String pickCarAppointmentDay;
@TableField(exist = false)
private String pickCarAppointmentTime;
@TableField(exist = false)
private String adressDetail;
@TableField(exist = false)
private String isUse;
}

View File

@ -184,4 +184,14 @@ public class InspectionInfo extends TenantBaseDO
private Integer sourceType;
@TableField(exist = false)
private String meetCarId;
@TableField(exist = false)
private String meetAddress;
@TableField(exist = false)
private String latitude; // 维度
@TableField(exist = false)
private String longitude; // 经度
@TableField(exist = false)
private String appointmentDay; // 经度
@TableField(exist = false)
private String appointmentTime; // 经度
}

View File

@ -1,7 +1,9 @@
package cn.iocoder.yudao.module.inspection.entity;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@ -28,6 +30,10 @@ public class InspectionMeetCarOrder extends TenantBaseDO {
private String userAddress; // 用户地址
private String meetAddress; // 接车地址
private String latitude; // 维度
private String longitude; // 经度
private String carNum; // 车牌号
private String carNature; // 使用性质
@ -45,4 +51,29 @@ public class InspectionMeetCarOrder extends TenantBaseDO {
private Integer isMeet; // 是否接车 0未接 1已接
private String inspectionInfoId;
private String appointmentDay; // 预约日期
private String appointmentTime; // 预约时间
//客户来源
private String customerSource;
//商品id
private Long goodsId;
//商品名称
private String goodsTitle;
private Long skuId;
private String skuName;
@TableField(exist = false)
private Long appointmentId;
/** 接车拍照的内容*/
@TableField(exist = false)
private String content;
/** 接车拍照 */
@TableField(exist = false)
private String images;
}

View File

@ -108,4 +108,6 @@ public class InspectionWorkNode extends TenantBaseDO {
/** 接车时所传的id*/
@TableField(exist = false)
private String meetCarId;
@TableField(exist = false)
private List<String> idList;
}

View File

@ -40,4 +40,11 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
void recheck(@Param("list") List<InspectionWorkNode> workNodes, @Param("status") String status);
List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);
/**
* 根据检测id获取异常节点
* @param idList
* @return
*/
List<Map<String, Object>> selectExceptionNodesByInspectionIds(@Param("ids") List<Long> idList);
}

View File

@ -187,6 +187,15 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
**/
Map<Long, List<Map<String, String>>> getProjectBelowStandardByIds(Long[] ids, String status, String type);
/**
* 根据inspection_info的id查有的项目名称
*
* @param ids inspection_info的id
* @author 小李
* @date 14:52 2024/12/10
**/
Map<Long, List<Map<String, String>>> getProjectExceptionByIds(Long[] ids, String status, String type);
/**
* 根据时间查订单
*

View File

@ -75,4 +75,18 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
* @return
*/
List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);
/**
* 根据检测id获取异常节点
*
* @param idList
* @return
*/
List<Map<String, Object>> selectExceptionNodesByInspectionIds(List<Long> idList);
/**
* 完成异常节点
* @param idList
*/
void updateException(Long inspectionInfoId,List<String> idList);
}

View File

@ -2089,6 +2089,40 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
Collectors.toList())));
}
/**
* 根据inspection_info的id查不合格项目名称
*
* @param ids inspection_info的id
* @author 小李
* @date 14:52 2024/12/10
**/
@Override
public Map<Long, List<Map<String, String>>> getProjectExceptionByIds(Long[] ids, String status, String type) {
if (ids == null || ids.length == 0) {
return Collections.emptyMap();
}
// 1. 调用 Mapper 拿到所有异常节点
List<Long> idList = Arrays.asList(ids);
List<Map<String, Object>> raw = inspectionWorkNodeService
.selectExceptionNodesByInspectionIds(idList);
if (raw.isEmpty()) {
return Collections.emptyMap();
}
// 2. inspectionInfoId 分组并转换成 List<Map<String,String>>
return raw.stream()
.collect(Collectors.groupingBy(
m -> ((Number) m.get("inspectionInfoId")).longValue(), // key工单ID
Collectors.mapping(m -> {
Map<String, String> map = new HashMap<>();
map.put("id", m.get("nodeId").toString());
map.put("name", m.get("projectName").toString());
return map;
}, Collectors.toList())
));
}
/**
* 根据时间查订单
*

View File

@ -150,7 +150,7 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl<InspectionAppo
// appointment.getAppointmentDay(),partners.getPartnerName(),partners.getAddress(),sysUser.getNickname()+" "+sysUser.getMobile()
//// },appointment.getOtherPhone(),"1400852709","机动车管家小程序","2112754");
// }
SendSmsUtil.sendMsgCommon(null,appointment.getOtherPhone(),"1400852709","机动车管家小程序","2386324");
SendSmsUtil.sendMsgCommon(null,appointment.getOtherPhone(),"1400852709","蓝安汽车销售有限公司","2386324");
}else {
//给本人发送

View File

@ -171,6 +171,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
String buyName = StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "未知客户";
String buyPhone = StringUtils.isNotEmpty(inspectionInfo.getBuyPhone()) ? inspectionInfo.getBuyPhone() : StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "";
AdminUserDO user = getAdminUserDO(buyPhone);
if (ObjectUtils.isEmpty(user)) {
//新增用户
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
@ -192,35 +193,51 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
InspectionGoodsSku sku = skuService.getById(inspectionInfo.getSkuId());
ShopInspectionGoods goods = goodsService.getById(sku.getGoodsId());
ShopMallPartners partner = appInspectionPartnerService.getById(goods.getPartnerId());
OrderInfo orderInfo = new OrderInfo();
orderInfo.setPartnerId(partners.getPartnerId());
orderInfo.setGoodsId(Long.parseLong(goods.getId().toString()));
orderInfo.setGoodsTitle(goods.getTitle());
orderInfo.setGoodsType("jc");
orderInfo.setGoodNum(1);
orderInfo.setSkuId(Long.parseLong(sku.getId().toString()));
orderInfo.setSkuName(sku.getSkuName());
orderInfo.setGoodsPrice(goods.getPrice());
orderInfo.setStartTime(new Date());
orderInfo.setOrderTime(new Date());
orderInfo.setOrderType("jc");
orderInfo.setUserId(user.getId());
orderInfo.setRealName(user.getNickname());
orderInfo.setIsOnline("0");
orderInfo.setPhonenumber(user.getMobile());
orderInfo.setPartnerName(partner.getPartnerName());
orderInfo.setOrderNo("线下订单-" + System.currentTimeMillis());
//赊账的情况
orderInfo.setOrderStatus("0");
orderInfoService.save(orderInfo);
//判断有没有传预约信息
if (ObjectUtil.isNotNull(inspectionInfo.getAppointmentId())) {
//修改预约信息表的orderId
InspectionAppointment appointment = new InspectionAppointment();
appointment.setOrderId(orderInfo.getId());
inspectionAppointmentService.update(Wrappers.<InspectionAppointment>lambdaUpdate()
.eq(InspectionAppointment::getId, inspectionInfo.getAppointmentId())
.set(InspectionAppointment::getOrderId, orderInfo.getId()));
//根据预约id查询预约信息
InspectionAppointment appointment1 = inspectionAppointmentService.getById(inspectionInfo.getAppointmentId());
if (ObjectUtil.isNotEmpty(appointment1.getOrderId())) {
// 需要核销订单表
//修改订单的核销时间
// orderInfoService.update(Wrappers.<OrderInfo>lambdaUpdate()
// .eq(OrderInfo::getId, appointment1.getOrderId())
// .set(OrderInfo::getValidationTime, new Date()));
// 查询订单
orderInfo = orderInfoService.getById(appointment1.getOrderId());
}else {
orderInfo.setPartnerId(partners.getPartnerId());
orderInfo.setGoodsId(Long.parseLong(goods.getId().toString()));
orderInfo.setGoodsTitle(goods.getTitle());
orderInfo.setGoodsType("jc");
orderInfo.setGoodNum(1);
orderInfo.setSkuId(Long.parseLong(sku.getId().toString()));
orderInfo.setSkuName(sku.getSkuName());
orderInfo.setGoodsPrice(goods.getPrice());
orderInfo.setStartTime(new Date());
orderInfo.setOrderTime(new Date());
orderInfo.setOrderType("jc");
orderInfo.setUserId(user.getId());
orderInfo.setRealName(user.getNickname());
orderInfo.setIsOnline("0");
orderInfo.setPhonenumber(user.getMobile());
orderInfo.setPartnerName(partner.getPartnerName());
orderInfo.setOrderNo("线下订单-" + System.currentTimeMillis());
//赊账的情况
orderInfo.setOrderStatus("0");
orderInfoService.save(orderInfo);
//修改预约信息表的orderId
InspectionAppointment appointment = new InspectionAppointment();
appointment.setOrderId(orderInfo.getId());
inspectionAppointmentService.update(Wrappers.<InspectionAppointment>lambdaUpdate()
.eq(InspectionAppointment::getId, inspectionInfo.getAppointmentId())
.set(InspectionAppointment::getOrderId, orderInfo.getId()));
}
//修改订单的核销时间
orderInfoService.update(Wrappers.<OrderInfo>lambdaUpdate()
@ -851,7 +868,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
int update = baseMapper.update(Wrappers.<InspectionInfo>lambdaUpdate()
.eq(InspectionInfo::getId, inspectionWorkNode.getMeetCarId())
.set(InspectionInfo::getIsMeetCar, InspectionConstants.INSPECTION_MEET_CAR_ORDER_IS_MEET_CAR_YES));
}else if (Objects.equals(inspectionWorkNode.getSourceType(), InspectionConstants.INSPECTION_MEET_CAR_ORDER_IS_MEET_CAR_COMPLETE_TYPE_MEET_CAR_ORDER)) {
} else if (Objects.equals(inspectionWorkNode.getSourceType(), InspectionConstants.INSPECTION_MEET_CAR_ORDER_IS_MEET_CAR_COMPLETE_TYPE_MEET_CAR_ORDER)) {
// 修改接车订单表为已接车
inspectionMeetCarOrderService.update(Wrappers.<InspectionMeetCarOrder>lambdaUpdate()
.eq(InspectionMeetCarOrder::getId, inspectionWorkNode.getMeetCarId())

View File

@ -1,13 +1,24 @@
package cn.iocoder.yudao.module.inspection.service.impl;
import cn.iocoder.yudao.module.inspection.entity.InspectionMeetCarOrder;
import cn.iocoder.yudao.module.inspection.entity.ShopInspectionGoods;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.security.config.SecurityProperties;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.appBase.controller.admin.InspectionSocket;
import cn.iocoder.yudao.module.inspection.entity.*;
import cn.iocoder.yudao.module.inspection.mapper.AppInspectionGoodsMapper;
import cn.iocoder.yudao.module.inspection.mapper.InspectionMeetCarOrderMapper;
import cn.iocoder.yudao.module.inspection.service.AppInspectionGoodsService;
import cn.iocoder.yudao.module.inspection.service.InspectionMeetCarOrderService;
import cn.iocoder.yudao.module.inspection.service.*;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
/**
* @Description: 接车订单
@ -16,14 +27,95 @@ import org.springframework.stereotype.Service;
* @Version: 1.0
*/
@Service
@RequiredArgsConstructor
public class InspectionMeetCarOrderServiceImpl extends ServiceImpl<InspectionMeetCarOrderMapper, InspectionMeetCarOrder> implements InspectionMeetCarOrderService {
private final InspectionSocket inspectionSocket;
private final IInspectionAppointmentService inspectionAppointmentService;
private final IInspectionPickCarService inspectionPickCarService;
private final InspectionStepInfoService inspectionStepInfoService;
private final InspectionGoodsSkuService skuService;
private final IShopInspectionGoodsService goodsService;
/**
* 添加接车订单
*
* @param order 接车订单
*/
@Override
@Transactional
public void add(InspectionMeetCarOrder order) {
boolean ifSendMessage = true;
// 设置接车员id
if (order.getMeetManId() == null) {
order.setMeetManId(SecurityFrameworkUtils.getLoginUserId());
ifSendMessage = false;
}
if (ObjectUtil.isNotEmpty(order.getSkuId())) {
InspectionGoodsSku sku = skuService.getById(order.getSkuId());
ShopInspectionGoods goods = goodsService.getById(sku.getGoodsId());
order.setGoodsId(Long.parseLong(goods.getId().toString()));
order.setGoodsTitle(goods.getTitle());
order.setSkuName(sku.getSkuName());
}
save(order);
//指派的接车人
if (ifSendMessage) {
// 修改预约表的接车订单id字段
inspectionAppointmentService.update(Wrappers.<InspectionAppointment>lambdaUpdate()
.eq(InspectionAppointment::getId, order.getAppointmentId())
.set(InspectionAppointment::getMeetOrderId, order.getId()));
// 获取预约表的信息
InspectionAppointment appointment = inspectionAppointmentService.getById(order.getAppointmentId());
if (ObjectUtil.isNotEmpty(appointment)) {
// 判断是否有上门取车
if (appointment.getIsPickCar().equals("1")) {
InspectionPickCar pickCar = inspectionPickCarService.getById(appointment.getPickCarId());
//获取详细地址和经纬度修改接车订单表
update(Wrappers.<InspectionMeetCarOrder>lambdaUpdate()
.eq(InspectionMeetCarOrder::getId, order.getId())
.set(InspectionMeetCarOrder::getMeetAddress, pickCar.getAdressDetail())
.set(InspectionMeetCarOrder::getLatitude, pickCar.getLatitude())
.set(InspectionMeetCarOrder::getLongitude, pickCar.getLongitude())
.set(InspectionMeetCarOrder::getAppointmentDay, pickCar.getAppointmentDay())
.set(InspectionMeetCarOrder::getAppointmentTime, pickCar.getAppointmentTime()));
} else {
update(Wrappers.<InspectionMeetCarOrder>lambdaUpdate()
.eq(InspectionMeetCarOrder::getId, order.getId())
.set(InspectionMeetCarOrder::getAppointmentDay, appointment.getAppointmentDay()));
}
}
inspectionSocket.sendMessage("接工单", order.getMeetManId().toString());
}
if (StrUtil.isNotEmpty(order.getContent()) || StrUtil.isNotEmpty(order.getImages())) {
// 在步骤表里添加一条记录
InspectionStepInfo inspectionStepInfo = new InspectionStepInfo();
inspectionStepInfo.setInspectionInfoId(order.getId());
//设置开始时间
inspectionStepInfo.setCreateTime(DateUtil.date());
inspectionStepInfo.setCreator(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + ""));
inspectionStepInfo.setTitle("接车拍照");
inspectionStepInfo.setContent(order.getContent());
inspectionStepInfo.setImages(order.getImages());
inspectionStepInfo.setStepNum(1);
inspectionStepInfo.setUpdater(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + ""));
inspectionStepInfo.setUpdateTime(DateUtil.date());
inspectionStepInfoService.save(inspectionStepInfo);
//修改订单表为已接车
update(Wrappers.<InspectionMeetCarOrder>lambdaUpdate()
.eq(InspectionMeetCarOrder::getId, order.getId())
.set(InspectionMeetCarOrder::getIsMeet, 1));
}
}
}

View File

@ -388,7 +388,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
stepInfo.setCreator(Integer.parseInt(loginUser.getId().toString()));
if (ObjectUtil.isNotEmpty(workNodes.getRemark())) {
stepInfo.setContent(workNodes.getRemark());
}else {
} else {
stepInfo.setContent("重审了" + projectNames + "项目");
}
if (ObjectUtil.isNotEmpty(workNodes.getDealImages())) {
@ -429,6 +429,38 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
return baseMapper.getStaffCount(dlInspectionProject);
}
/**
* 根据检测id获取异常节点
*
* @param idList
* @return
*/
@Override
public List<Map<String, Object>> selectExceptionNodesByInspectionIds(List<Long> idList) {
return baseMapper.selectExceptionNodesByInspectionIds(idList);
}
/**
* 完成异常节点
*
* @param idList
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateException(Long inspectionInfoId, List<String> idList) {
// 1. 修改工单表为已完成
inspectionInfoService.update(Wrappers.lambdaUpdate(InspectionInfo.class)
.eq(InspectionInfo::getId, inspectionInfoId)
.set(InspectionInfo::getIsPass, "1")
.set(InspectionInfo::getStatus, "1"));
// 2.修改工单节点表为已完成
update(Wrappers.lambdaUpdate(InspectionWorkNode.class)
.in(InspectionWorkNode::getId, idList)
.set(InspectionWorkNode::getStatus, "2")
.set(InspectionWorkNode::getType, "1"));
}
/**
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
*
@ -551,4 +583,4 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
}
}
}
}
}

View File

@ -239,4 +239,29 @@
ORDER BY
orderCount DESC; -- 根据接单数量进行降序排序
</select>
<select id="selectExceptionNodesByInspectionIds" resultType="java.util.Map">
SELECT
w.inspection_info_id AS inspectionInfoId,
w.id AS nodeId,
p.project_name AS projectName
FROM inspection_work_node w
INNER JOIN inspection_project p
ON p.id = w.project_id
WHERE w.inspection_info_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
AND w.status &lt;&gt; '2' <!-- 未完成 -->
AND EXISTS ( <!-- 同时“制证”节点已完成 -->
SELECT 1
FROM inspection_work_node w2
INNER JOIN inspection_project p2
ON p2.id = w2.project_id
WHERE w2.inspection_info_id = w.inspection_info_id
AND p2.project_name LIKE '%制证%'
AND w2.status = '2'
AND w2.type = 1
)
ORDER BY w.order_num
</select>
</mapper>

View File

@ -220,34 +220,82 @@ where sig.partner_id =#{partnerId}
</if>
order by pw.create_time desc
</select>
<select id="inspectionList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
SELECT
info.id,info.worker_name,info.worker_phone,info.worker_avatar,info.`status`,info.is_pass,info.start_time,info.end_time,step.title as lastTitle,
su.nickname buyName,su.mobile as buyPhone,oi.order_no as orderNo,oi.pay_money+oi.balance as realPayMoney,oi.goods_title as goodsName,info.car_num,info.is_retrial,
info.customer_source as customerSource, info.other_phone as otherPhone,oi.sku_id as skuId, oi.sku_name as skuName,oi.goods_price as goodsPrice
from
inspection_info info
LEFT JOIN inspection_step_info step ON info.id = step.inspection_info_id
LEFT JOIN
inspection_work_node iwn ON info.id = iwn.inspection_info_id
INNER JOIN system_users su on su.id = info.user_id
INNER JOIN order_info oi on oi.id = info.inspection_order_id
WHERE info.partner_id = #{partnerId}
<!-- 待复检 -->
<if test="status == 4">
-- AND ii.status = '2'
AND iwn.status = '3'
AND info.status != '1'
</if>
<if test="status != 4">
AND info.status = #{status}
</if>
<if test="carNum!=null and carNum!=''">
and info.car_num like concat('%',#{carNum},'%')
</if>
GROUP BY info.id
order by info.create_time desc
</select>
<select id="inspectionList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
SELECT
info.id,
info.worker_name,
info.worker_phone,
info.worker_avatar,
info.`status`,
info.is_pass,
info.start_time,
info.end_time,
step.title AS lastTitle,
su.nickname AS buyName,
su.mobile AS buyPhone,
oi.order_no AS orderNo,
oi.pay_money + oi.balance AS realPayMoney,
oi.goods_title AS goodsName,
info.car_num,
info.is_retrial,
info.customer_source AS customerSource,
info.other_phone AS otherPhone,
oi.sku_id AS skuId,
oi.sku_name AS skuName,
oi.goods_price AS goodsPrice
FROM inspection_info info
LEFT JOIN inspection_step_info step
ON info.id = step.inspection_info_id
LEFT JOIN inspection_work_node iwn
ON info.id = iwn.inspection_info_id
INNER JOIN system_users su
ON su.id = info.user_id
INNER JOIN order_info oi
ON oi.id = info.inspection_order_id
WHERE info.partner_id = #{partnerId}
<!-- 待复检 -->
<if test="status == 4">
AND iwn.status = '3'
AND info.status != '1'
</if>
<!-- 异常工单 -->
<if test="status == 5">
<!-- 有“制证”节点已完成 -->
AND EXISTS (
SELECT 1
FROM inspection_work_node w
JOIN inspection_project p
ON p.id = w.project_id
WHERE w.inspection_info_id = info.id
AND p.project_name LIKE '%制证%'
AND w.status = '2'
AND w.type = '1'
)
<!-- 同一工单还有其它节点未完成 -->
AND EXISTS (
SELECT 1
FROM inspection_work_node w2
WHERE w2.inspection_info_id = info.id
AND w2.status &lt;&gt; '2'
)
</if>
<!-- 其它普通状态 -->
<if test="status != 4 and status != 5">
AND info.status = #{status}
</if>
<!-- 车牌号模糊 -->
<if test="carNum != null and carNum != ''">
AND info.car_num LIKE CONCAT('%', #{carNum}, '%')
</if>
GROUP BY info.id
ORDER BY info.create_time DESC
</select>
<select id="workerInspectionList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
SELECT
info.id,info.worker_name,info.worker_phone,info.worker_avatar,info.`status`,info.is_pass,info.start_time,info.end_time,step.title as lastTitle,

View File

@ -32,10 +32,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectInspectionAppointmentById" parameterType="Long" resultMap="InspectionAppointmentResult">
select ia.*,su.nickname as buyName, su.mobile as buyPhoneNum
<select id="selectInspectionAppointmentById" parameterType="Long" >
select ia.*,su.nickname as buyName, su.mobile as buyPhoneNum,su2.nickname as meetName,imco.is_meet,ic.appointment_day as pickCarAppointmentDay,ic.appointment_time as pickCarAppointmentTime,ic.adress_detail,ia.is_use
from inspection_appointment ia
left join system_users su on su.id = ia.user_id
LEFT JOIN inspection_meet_car_order imco ON imco.id = ia.meet_order_id
LEFT JOIN system_users su2 on su2.id = imco.meet_man_id
LEFT JOIN inspection_pick_car ic on ic.id = ia.pick_car_id
where ia.id = #{id}
</select>

View File

@ -388,6 +388,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ii.meet_man_id AS meet_id,
ii.tenant_id,
ii.create_time,
null AS meetAddress,
null AS latitude,
null AS longitude,
null AS appointmentDay,
null AS appointmentTime,
0 AS source_type
FROM inspection_info ii
WHERE ii.deleted = 0 AND ii.meet_man_id = #{inspectionInfo.dealUserId} AND ii.is_meet_car = '0' AND ii.status != '1'
@ -411,6 +416,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
imco.meet_man_id,
imco.tenant_id,
imco.create_time,
imco.meet_address AS meetAddress,
imco.latitude,
imco.longitude,
imco.appointment_day,
imco.appointment_time,
1 AS source_type
FROM inspection_meet_car_order imco
WHERE imco.deleted = 0 AND imco.meet_man_id = #{inspectionInfo.dealUserId} AND imco.is_meet = '0'