This commit is contained in:
xyc 2025-05-29 17:40:23 +08:00
parent beb37ddd78
commit b02a3b863a
9 changed files with 81 additions and 4 deletions

View File

@ -387,6 +387,17 @@ public class InspectionInfoController extends BaseController {
return success(inspectionInfoService.meetCarPhoto(inspectionWorkNode));
}
/**
* 还车拍照
*
* @param inspectionWorkNode
* @return
*/
@PostMapping("/returnCarPhoto")
public CommonResult<?> returnCarPhoto(@RequestBody InspectionWorkNode inspectionWorkNode) {
return success(inspectionInfoService.returnCarPhoto(inspectionWorkNode));
}
/**
* 修改异常工单
*

View File

@ -163,6 +163,10 @@ public class InspectionInfo extends TenantBaseDO
private String isPickCar;
/** 当前流程节点 */
private Integer nowOrderNum;
/** 还车人id */
private Long returnCarUserId;
/** 是否还车 */
private Integer isReturnCar;
/** 开始检测时需要 传入 选择项目的id、角色id、排序 */
@TableField(exist = false)

View File

@ -154,6 +154,12 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
*/
Boolean meetCarPhoto(InspectionWorkNode inspectionWorkNode);
/**
* 还车拍照
* @param inspectionWorkNode
*/
Boolean returnCarPhoto(InspectionWorkNode inspectionWorkNode);
/**
* 引车
* @param inspectionInfo

View File

@ -1549,6 +1549,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
Set<Long> userIds = new HashSet<>();
userIds.add(info.getUserId());
userIds.add(info.getWorkId());
userIds.add(info.getReturnCarUserId());
if (info.getLeadManId() != null) userIds.add(info.getLeadManId());
if (info.getMeetManId() != null) userIds.add(info.getMeetManId());
@ -1569,6 +1570,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
res.setInspectionId(info.getId());
res.setBuyUserName(buyUser != null ? buyUser.getNickname() : "");
res.setBuyUserPhone(buyUser != null ? buyUser.getMobile() : "");
res.setReturnCarUserId(info.getReturnCarUserId());
res.setReturnCarUserName(userMap.get(info.getReturnCarUserId()) != null ? userMap.get(info.getReturnCarUserId()).getNickname() : "");
if (worker != null) {
res.setWorkerAvatar(worker.getAvatar());

View File

@ -830,7 +830,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
@Override
public Map<String, Long> getCountByType(Integer partnerId) {
// 创建线程池
ExecutorService executor = Executors.newFixedThreadPool(6);
ExecutorService executor = Executors.newFixedThreadPool(10);
try {
InspectionInfo inspectionInfo = new InspectionInfo();
@ -850,9 +850,9 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
Map<String, Long> result = new ConcurrentHashMap<>(); // 线程安全
// 这里 `5` 而不是 `6`因为 i `0` 开始
CompletableFuture<Void>[] futures = new CompletableFuture[9];
CompletableFuture<Void>[] futures = new CompletableFuture[10];
for (int i = 0; i < 9; i++) { // 改为 `0~4`
for (int i = 0; i < 10; i++) { // 改为 `0~4`
final String status = String.valueOf(i + 1);
// 深拷贝对象防止多线程修改冲突
@ -927,6 +927,38 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
return true;
}
/**
* 还车拍照
*
* @param inspectionWorkNode
*/
@Override
public Boolean returnCarPhoto(InspectionWorkNode inspectionWorkNode) {
//图片和描述
String remark = StrUtil.isNotEmpty(inspectionWorkNode.getRemark()) ? inspectionWorkNode.getRemark() : "";
String dealImages = StrUtil.isNotEmpty(inspectionWorkNode.getDealImages()) ? inspectionWorkNode.getDealImages() : "";
//存入步骤表
InspectionStepInfo stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(inspectionWorkNode.getInspectionInfoId());
stepInfo.setTitle("还车拍照");
stepInfo.setContent(remark);
stepInfo.setImages(dealImages);
stepInfo.setCreator(Math.toIntExact(SecurityFrameworkUtils.getLoginUserId()));
stepInfo.setUpdater(Math.toIntExact(SecurityFrameworkUtils.getLoginUserId()));
stepInfo.setCreateTime(new Date());
stepInfo.setUpdateTime(new Date());
inspectionStepInfoService.save(stepInfo);
// 修改主表为已还车
int update = baseMapper.update(Wrappers.<InspectionInfo>lambdaUpdate()
.eq(InspectionInfo::getId, inspectionWorkNode.getInspectionInfoId())
.set(InspectionInfo::getIsReturnCar, InspectionConstants.INSPECTION_MEET_CAR_ORDER_IS_MEET_CAR_YES)
.set(InspectionInfo::getReturnCarUserId, SecurityFrameworkUtils.getLoginUserId()));
return true;
}
/**
* 引车
*

View File

@ -112,4 +112,9 @@ public class InspectionInfoVo {
private String isMeetCar;
private String otherName;
private String otherPhone;
/** 还车人id */
private Long returnCarUserId;
private String returnCarUserName;
/** 是否还车 */
private Integer isReturnCar;
}

View File

@ -375,6 +375,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND ii.status = '0'
ORDER BY ii.update_time DESC
</if>
<!-- 还车 -->
<if test="inspectionInfo.status == 10">
AND ii.is_return_car != 1
AND ii.status = '1'
ORDER BY ii.update_time DESC
</if>
</where>
) AS subquery
WHERE rn = 1;
@ -566,6 +572,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND ii.lead_man_id IS NULL
AND ii.status = '0'
</if>
<!-- 还车 -->
<if test="inspectionInfo.status == 10">
AND ii.is_return_car != 1
AND ii.status = '1'
ORDER BY ii.update_time DESC
</if>
</where>
</if>
<if test="inspectionInfo.status == 6">

View File

@ -44,4 +44,7 @@ public interface RoleMapper extends BaseMapperX<RoleDO> {
return selectList(new LambdaQueryWrapperX<RoleDO>().in(RoleDO::getCode, codes));
}
default List<RoleDO> selectListByPackageIds(@Nullable Collection<String> packageIds){
return selectList(new LambdaQueryWrapperX<RoleDO>().in(RoleDO::getServicePackageId, packageIds).eq(RoleDO::getTenantId, CommonStr.TENANT_ID));
}
}

View File

@ -259,7 +259,8 @@ public class RoleServiceImpl implements RoleService {
if (CollectionUtil.isEmpty(codes)) {
return Collections.emptyList();
}
return roleMapper.selectListByCodes(codes);
// return roleMapper.selectListByCodes(codes);
return roleMapper.selectListByPackageIds(codes);
}
/**