Browse Source

Merge branch 'dev_ic_v2' into develop

dev_shibei_match
sunyuchao 4 years ago
parent
commit
581559ad06
  1. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java
  2. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java
  3. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java

@ -52,11 +52,10 @@ public class IcPlacePatrolReviewRecordController {
* @Description 新增巡查复查记录 * @Description 新增巡查复查记录
**/ **/
@PostMapping("add") @PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolReviewRecordFormDTO formDTO) { public Result<PlacePatrolReviewRecordDetailResultDTO> add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolReviewRecordFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddPlacePatrolReviewRecordFormDTO.Add.class); ValidatorUtils.validateEntity(formDTO, AddPlacePatrolReviewRecordFormDTO.Add.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
placePatrolReviewRecordService.add(formDTO); return new Result<PlacePatrolReviewRecordDetailResultDTO>().ok(placePatrolReviewRecordService.add(formDTO));
return new Result();
} }
/** /**
@ -64,10 +63,9 @@ public class IcPlacePatrolReviewRecordController {
* @Description 修改巡查复查记录 * @Description 修改巡查复查记录
**/ **/
@PostMapping("edit") @PostMapping("edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) { public Result<PlacePatrolReviewRecordDetailResultDTO> edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Edit.class); ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Edit.class);
placePatrolReviewRecordService.edit(formDTO); return new Result<PlacePatrolReviewRecordDetailResultDTO>().ok(placePatrolReviewRecordService.edit(formDTO));
return new Result();
} }
/** /**

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java

@ -37,13 +37,13 @@ public interface IcPlacePatrolReviewRecordService extends BaseService<IcPlacePat
* @Author sun * @Author sun
* @Description 新增巡查复查记录 * @Description 新增巡查复查记录
**/ **/
void add(AddPlacePatrolReviewRecordFormDTO formDTO); PlacePatrolReviewRecordDetailResultDTO add(AddPlacePatrolReviewRecordFormDTO formDTO);
/** /**
* @Author sun * @Author sun
* @Description 修改巡查复查记录 * @Description 修改巡查复查记录
**/ **/
void edit(EditPlacePatrolReviewRecordFormDTO formDTO); PlacePatrolReviewRecordDetailResultDTO edit(EditPlacePatrolReviewRecordFormDTO formDTO);
/** /**
* @Author sun * @Author sun

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java

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

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml

@ -39,7 +39,7 @@
AND a.id = #{placePatrolReviewRecordId} AND a.id = #{placePatrolReviewRecordId}
</if> </if>
ORDER BY ORDER BY
a.created_time DESC a.created_time ASC
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save