|
|
@ -75,10 +75,12 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl<IcPlac |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void add(AddPlacePatrolReviewRecordFormDTO formDTO) { |
|
|
|
public PlacePatrolReviewRecordDetailResultDTO add(AddPlacePatrolReviewRecordFormDTO formDTO) { |
|
|
|
PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO(); |
|
|
|
//1.复查记录表新增数据
|
|
|
|
IcPlacePatrolReviewRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class); |
|
|
|
insert(entity); |
|
|
|
|
|
|
|
//2.修改巡查记录数据最新巡查时间和结果
|
|
|
|
IcPlacePatrolRecordEntity recordEntity = new IcPlacePatrolRecordEntity(); |
|
|
|
recordEntity.setId(entity.getPlacePatrolRecordId()); |
|
|
@ -86,6 +88,9 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl<IcPlac |
|
|
|
recordEntity.setFinalTime(entity.getReviewTime()); |
|
|
|
icPlacePatrolRecordService.updateById(recordEntity); |
|
|
|
|
|
|
|
//3.返回详情数据
|
|
|
|
resultDTO = detail(entity.getId()); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -94,7 +99,8 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl<IcPlac |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void edit(EditPlacePatrolReviewRecordFormDTO formDTO) { |
|
|
|
public PlacePatrolReviewRecordDetailResultDTO edit(EditPlacePatrolReviewRecordFormDTO formDTO) { |
|
|
|
PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO(); |
|
|
|
//1.修改复查记录表数据
|
|
|
|
IcPlacePatrolReviewRecordEntity entity = baseDao.selectById(formDTO.getPlacePatrolReviewRecordId()); |
|
|
|
if (null == entity) { |
|
|
@ -103,6 +109,7 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl<IcPlac |
|
|
|
entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class); |
|
|
|
entity.setId(formDTO.getPlacePatrolReviewRecordId()); |
|
|
|
baseDao.updateById(entity); |
|
|
|
|
|
|
|
//2.复查记录修改了复查时间或复查结果时对应修改巡查记录数据最新巡查时间和结果
|
|
|
|
if (StringUtils.isNotEmpty(formDTO.getReviewResult()) || StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) { |
|
|
|
IcPlacePatrolRecordEntity recordEntity = new IcPlacePatrolRecordEntity(); |
|
|
@ -116,6 +123,9 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl<IcPlac |
|
|
|
icPlacePatrolRecordService.updateById(recordEntity); |
|
|
|
} |
|
|
|
|
|
|
|
//3.返回复查记录修改后的详情数据
|
|
|
|
resultDTO = detail(formDTO.getPlacePatrolReviewRecordId()); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|