更新
This commit is contained in:
parent
a8a8fa0aea
commit
5f57de111a
@ -60,7 +60,6 @@ public class InspectionAppointmentController extends BaseController
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appointment:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
@ -80,7 +79,6 @@ public class InspectionAppointmentController extends BaseController
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appointment:edit')")
|
||||
@PutMapping
|
||||
public CommonResult edit(@RequestBody InspectionAppointment inspectionAppointment)
|
||||
{
|
||||
|
@ -96,6 +96,10 @@ public class InspectionInfo extends TenantBaseDO
|
||||
private String customerSource;
|
||||
/** 引车员id*/
|
||||
private Long leadManId;
|
||||
/** 接车员id*/
|
||||
private Long meetManId;
|
||||
/** 是否接车*/
|
||||
private String isMeetCar;
|
||||
@TableField(exist = false)
|
||||
private String lastTitle;
|
||||
|
||||
@ -171,4 +175,6 @@ public class InspectionInfo extends TenantBaseDO
|
||||
private Integer additionalRecording;
|
||||
@TableField(exist = false)
|
||||
private String orderId;
|
||||
@TableField(exist = false)
|
||||
private Long appointmentId;
|
||||
}
|
||||
|
@ -42,8 +42,10 @@ import cn.iocoder.yudao.module.system.dal.mysql.permission.RoleMapper;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import cn.iocoder.yudao.util.SendSmsUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.iocoder.yudao.util.StringUtils;
|
||||
@ -120,6 +122,8 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
private DlInspectionProjectService projectService;
|
||||
@Autowired
|
||||
private FileService fileService;
|
||||
@Autowired
|
||||
private IInspectionAppointmentService inspectionAppointmentService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
@ -205,6 +209,20 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
//赊账的情况
|
||||
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()));
|
||||
|
||||
//修改订单的核销时间
|
||||
orderInfoService.update(Wrappers.<OrderInfo>lambdaUpdate()
|
||||
.eq(OrderInfo::getId, orderInfo.getId())
|
||||
.set(OrderInfo::getValidationTime, new Date()));
|
||||
}
|
||||
inspectionInfo.setInspectionOrderId(orderInfo.getId());
|
||||
inspectionInfo.setPartnerId(partners.getPartnerId());
|
||||
inspectionInfo.setWorkerName(workerUser.getNickname());
|
||||
@ -725,24 +743,23 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
List<UserRoleDO> byUserId = roleService.getByUserId(loginUser.getId());
|
||||
inspectionInfo.setLeadManId(loginUser.getId());
|
||||
List<Long> roleIds = byUserId.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList());
|
||||
|
||||
if (!"1".equals(inspectionInfo.getStatus())) {
|
||||
// 进行中 已完成
|
||||
inspectionInfo.setDealUserId(loginUser.getId());
|
||||
}
|
||||
|
||||
Map<String, Long> result = new ConcurrentHashMap<>(); // 使用ConcurrentHashMap以确保线程安全
|
||||
Map<String, Long> result = new ConcurrentHashMap<>(); // 线程安全
|
||||
|
||||
// 定义一个数组来保存所有的CompletableFuture
|
||||
// 这里 `5` 而不是 `6`,因为 i 从 `0` 开始
|
||||
CompletableFuture<Void>[] futures = new CompletableFuture[6];
|
||||
|
||||
for (int i = 1; i < 6; i++) {
|
||||
final String status = String.valueOf(i);
|
||||
for (int i = 0; i < 6; i++) { // 改为 `0~4`
|
||||
final String status = String.valueOf(i + 1);
|
||||
|
||||
// 复制一份inspectionInfo对象,避免多线程修改同一个对象导致的问题
|
||||
InspectionInfo infoCopy = BeanUtil.toBean(inspectionInfo, InspectionInfo.class);
|
||||
// 深拷贝对象,防止多线程修改冲突
|
||||
InspectionInfo infoCopy = JSON.parseObject(JSON.toJSONString(inspectionInfo), InspectionInfo.class);
|
||||
infoCopy.setStatus(status);
|
||||
|
||||
// 为每个任务创建一个新的Page对象
|
||||
Page<InspectionInfo> page = new Page<>(1, 10);
|
||||
|
||||
futures[i] = CompletableFuture.runAsync(() -> {
|
||||
@ -759,8 +776,15 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to execute tasks in parallel", e);
|
||||
} finally {
|
||||
// 关闭线程池
|
||||
executor.shutdown();
|
||||
try {
|
||||
if (!executor.awaitTermination(10, TimeUnit.SECONDS)) {
|
||||
executor.shutdownNow();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
executor.shutdownNow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,8 +33,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectInspectionAppointmentById" parameterType="Long" resultMap="InspectionAppointmentResult">
|
||||
<include refid="selectInspectionAppointmentVo"/>
|
||||
where id = #{id}
|
||||
select ia.*,su.nickname as buyName, su.mobile as buyPhoneNum
|
||||
from inspection_appointment ia
|
||||
left join system_users su on su.id = ia.user_id
|
||||
where ia.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInspectionAppointment" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionAppointment">
|
||||
|
@ -355,6 +355,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
|
||||
ORDER BY iwn.update_time DESC
|
||||
</if>
|
||||
<!-- 待接车 -->
|
||||
<if test="inspectionInfo.status == 6">
|
||||
AND ii.is_meet_car = '0'
|
||||
AND ii.meet_man_id = #{inspectionInfo.dealUserId}
|
||||
ORDER BY iwn.update_time DESC
|
||||
</if>
|
||||
</where>
|
||||
) AS subquery
|
||||
WHERE rn = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user