package com.flightfeather.grid.service.impl
|
|
import com.flightfeather.grid.config.exception.BizException
|
import com.flightfeather.grid.constant.ConstantHttp
|
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
|
import com.flightfeather.grid.domain.ds1.entity.ClueTask
|
import com.flightfeather.grid.domain.ds1.mapper.ClueInternalMapper
|
import com.flightfeather.grid.service.ClueInternalService
|
import com.flightfeather.grid.service.ClueTaskService
|
import com.flightfeather.grid.vo.DataHead
|
import com.github.pagehelper.PageHelper
|
import org.springframework.stereotype.Service
|
import org.springframework.transaction.annotation.Transactional
|
|
/**
|
*
|
* @date 2025/4/24
|
* @author feiyu02
|
*/
|
@Service
|
class ClueInternalServiceImpl(
|
private val clueInternalMapper: ClueInternalMapper,
|
private val clueTaskService: ClueTaskService,
|
) : ClueInternalService {
|
|
override fun getClueInternal(
|
sTime: String?,
|
eTime: String?,
|
pageNum: Int?,
|
pageSize: Int?,
|
): Pair<DataHead, List<ClueInternal?>> {
|
val p = PageHelper.startPage<ClueInternal>(pageNum ?: ConstantHttp.DEFAULT_PAGE_NUM,
|
pageSize ?: ConstantHttp.DEFAULT_PAGE_SIZE)
|
val res = clueInternalMapper.getClue(sTime, eTime)
|
return DataHead(p.pageNum, p.pages, p.total) to res
|
}
|
|
override fun searchClueInternal(clueInternal: ClueInternal): List<ClueInternal?> {
|
return clueInternalMapper.select(clueInternal)
|
}
|
|
override fun createClueInternal(clueInternal: ClueInternal): Int {
|
return clueInternalMapper.insert(clueInternal)
|
}
|
|
override fun updateClueInternal(clueInternal: ClueInternal): Int {
|
return clueInternalMapper.updateByPrimaryKey(clueInternal)
|
}
|
|
@Transactional
|
override fun deleteClueInternal(clueInternal: ClueInternal): Int {
|
clueInternal.cId ?: throw BizException("删除内部线索失败,缺少线索主键cId")
|
|
clueTaskService.deleteClueTask(ClueTask().apply {
|
clueId = clueInternal.cId
|
internalTask = true
|
})
|
return clueInternalMapper.delete(clueInternal)
|
}
|
}
|