维修工单车辆、施工人员、销售人员非空判断

This commit is contained in:
xiaofajia 2024-10-25 22:13:14 +08:00
parent 13273992ed
commit 950f014f0f

View File

@ -164,6 +164,30 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
@Override
@DSTransactional
public DlRepairTicketsRespVO createTickets(DlRepairTicketsRespVO ticketsRespVO) {
// 验证
if (ObjectUtil.isEmpty(ticketsRespVO.getCarId())){
throw exception0(500, "车辆信息为空");
}
if (ObjectUtil.isEmpty(ticketsRespVO.getAdviserId())){
throw exception0(500, "服务顾问为空");
}
ticketsRespVO.getItemList().forEach(item -> {
if (ObjectUtil.isEmpty(item.getRepairIds()) || ObjectUtil.isEmpty(item.getSaleId())){
String message = "";
switch (item.getItemType()){
case "01":
message += "项目:";
break;
case "02":
message += "配件:";
break;
case "03":
message += "其他:";
}
message += (item.getItemName() + (ObjectUtil.isEmpty(item.getRepairIds()) ? "施工人员" : "销售人员") + "为空");
throw exception0(500, message);
}
});
// 门店信息
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();