|
@ -2,6 +2,7 @@ package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
@ -105,17 +106,12 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void save(IcServiceRecordV2AddEditFormDTO formDTO) { |
|
|
public void save(IcServiceRecordV2AddEditFormDTO formDTO) { |
|
|
//1.获取工作人员缓存信息
|
|
|
//1.服务记录数据
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); |
|
|
|
|
|
if (null == staffInfo) { |
|
|
|
|
|
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//2.新增服务记录数据
|
|
|
|
|
|
IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceRecordV2Entity.class); |
|
|
IcServiceRecordV2Entity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceRecordV2Entity.class); |
|
|
insert(entity); |
|
|
entity.setId(IdWorker.getIdStr()); |
|
|
|
|
|
entity.setServiceStatus("in_service"); |
|
|
|
|
|
|
|
|
//3.新增服务范围数据
|
|
|
//2.新增服务范围数据
|
|
|
List<IcServiceScopeV2Entity> scopeList = new ArrayList<>(); |
|
|
List<IcServiceScopeV2Entity> scopeList = new ArrayList<>(); |
|
|
formDTO.getObjList().stream().forEach(s -> { |
|
|
formDTO.getObjList().stream().forEach(s -> { |
|
|
String[] scopeObjectIdPathAndName = icServiceRecordServiceImpl.getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); |
|
|
String[] scopeObjectIdPathAndName = icServiceRecordServiceImpl.getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); |
|
@ -129,8 +125,9 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor |
|
|
scopeList.add(scope); |
|
|
scopeList.add(scope); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//4.新增服务反馈数据feedback
|
|
|
//3.新增服务反馈数据feedback
|
|
|
if(null != formDTO.getFeedback()){ |
|
|
if(null != formDTO.getFeedback()){ |
|
|
|
|
|
entity.setServiceStatus(formDTO.getFeedback().getServiceStatus()); |
|
|
IcServiceFeedbackV2Entity feedback = ConvertUtils.sourceToTarget(formDTO.getFeedback(), IcServiceFeedbackV2Entity.class); |
|
|
IcServiceFeedbackV2Entity feedback = ConvertUtils.sourceToTarget(formDTO.getFeedback(), IcServiceFeedbackV2Entity.class); |
|
|
feedback.setCustomerId(formDTO.getCustomerId()); |
|
|
feedback.setCustomerId(formDTO.getCustomerId()); |
|
|
feedback.setServiceRecordId(entity.getId()); |
|
|
feedback.setServiceRecordId(entity.getId()); |
|
@ -153,6 +150,8 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
insert(entity); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|