|
@@ -9,6 +9,7 @@ import com.kexun.model.dto.ReportInfoDTO;
|
|
|
import com.kexun.model.ro.ReportInfoRO;
|
|
|
import com.kexun.service.ReportInfoService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.omg.CORBA.IRObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -29,34 +30,44 @@ public class ReportInfoServiceImpl extends ServiceImpl<ReportInfoMapper, ReportI
|
|
|
|
|
|
@Autowired
|
|
|
private ReportInfoMapper reportInfoMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 保存报文信息
|
|
|
+ *
|
|
|
* @param reportInfo
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void saveReportInfo(ReportInfo reportInfo){
|
|
|
- super.save(reportInfo);
|
|
|
+ public void saveReportInfo(ReportInfo reportInfo) {
|
|
|
+ //根据business_id查询是否存在,存在的话,执行update语句
|
|
|
+ QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
+ queryWrapper.eq("business_id", reportInfo.getBusinessId());
|
|
|
+ ReportInfo reportInfoResult = super.getOne(queryWrapper);
|
|
|
+ if (reportInfoResult != null) {
|
|
|
+ reportInfo.setId(reportInfoResult.getId());
|
|
|
+ }
|
|
|
+ super.saveOrUpdate(reportInfo);
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void updateReportInfo(ReportInfoDTO reportInfoDTO){
|
|
|
+ public void updateReportInfo(ReportInfoDTO reportInfoDTO) {
|
|
|
reportInfoMapper.updateReportInfo(reportInfoDTO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 按条件查询报文信息
|
|
|
+ *
|
|
|
* @param reportInfoDTO
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public List<ReportInfo> listReportInfo(ReportInfoDTO reportInfoDTO) {
|
|
|
QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
- if (reportInfoDTO.getStatus()!=null){
|
|
|
- queryWrapper.eq("status",reportInfoDTO.getStatus());
|
|
|
- }else {
|
|
|
+ if (reportInfoDTO.getStatus() != null) {
|
|
|
+ queryWrapper.eq("status", reportInfoDTO.getStatus());
|
|
|
+ } else {
|
|
|
queryWrapper.eq("status", ReportStatusEnum.NO_PRASE.getValue());
|
|
|
}
|
|
|
List<ReportInfo> list = reportInfoMapper.selectList(queryWrapper);
|
|
@@ -65,11 +76,12 @@ public class ReportInfoServiceImpl extends ServiceImpl<ReportInfoMapper, ReportI
|
|
|
|
|
|
/**
|
|
|
* 根据主键查询报文信息
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public ReportInfo getReportInfo(Long id){
|
|
|
- return reportInfoMapper.selectById(id);
|
|
|
+ public ReportInfo getReportInfo(Long id) {
|
|
|
+ return reportInfoMapper.selectById(id);
|
|
|
}
|
|
|
|
|
|
|