|
@@ -2,9 +2,14 @@ package com.dayou.service.impl;
|
|
|
|
|
|
import com.dayou.common.DropDownBoxData;
|
|
|
import com.dayou.entity.TmplAssetCalculate;
|
|
|
+import com.dayou.entity.TmplAssetCalculateSection;
|
|
|
import com.dayou.mapper.TmplAssetCalculateMapper;
|
|
|
+import com.dayou.mapper.TmplAssetCalculateSectionMapper;
|
|
|
import com.dayou.service.TmplAssetCalculateService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.dayou.vo.TmplAssetCalculateDetailVO;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -14,8 +19,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+
|
|
|
import java.util.List;
|
|
|
import java.util.ArrayList;
|
|
|
+
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
/**
|
|
@@ -32,36 +39,44 @@ public class TmplAssetCalculateServiceImpl extends ServiceImpl<TmplAssetCalculat
|
|
|
@Autowired
|
|
|
private TmplAssetCalculateMapper tmplAssetCalculateMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TmplAssetCalculateSectionMapper tmplAssetCalculateSectionMapper;
|
|
|
+
|
|
|
@Override
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- public Page<TmplAssetCalculate> selectPage(Page page,TmplAssetCalculate tmplAssetCalculate){
|
|
|
- return this.page(page, new QueryWrapper<TmplAssetCalculate>(tmplAssetCalculate));
|
|
|
+ public PageInfo<TmplAssetCalculate> selectPage(PageInfo page, TmplAssetCalculate tmplAssetCalculate) {
|
|
|
+ PageHelper.startPage(page.getPageNum(), page.getPageSize());
|
|
|
+ PageInfo<TmplAssetCalculate> pageInfo = new PageInfo<>(this.list(new QueryWrapper<TmplAssetCalculate>(tmplAssetCalculate)));
|
|
|
+ return pageInfo;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
- public TmplAssetCalculate detail(Long id){
|
|
|
- return this.getById(id);
|
|
|
+ public TmplAssetCalculateDetailVO detail(Long id) {
|
|
|
+ TmplAssetCalculateDetailVO detail = tmplAssetCalculateMapper.getTmplAssetCalculateDetailById(id);
|
|
|
+ detail.setSectionList(tmplAssetCalculateSectionMapper.selectList(new LambdaQueryWrapper<TmplAssetCalculateSection>().eq(TmplAssetCalculateSection::getTemplateCalculateId, id)));
|
|
|
+ return detail;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Boolean add(TmplAssetCalculate tmplAssetCalculate){
|
|
|
- return this.save(tmplAssetCalculate);
|
|
|
+ public Boolean add(TmplAssetCalculate tmplAssetCalculate) {
|
|
|
+ return this.save(tmplAssetCalculate);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Boolean update(TmplAssetCalculate tmplAssetCalculate){
|
|
|
- return this.updateById(tmplAssetCalculate);
|
|
|
+ public Boolean update(TmplAssetCalculate tmplAssetCalculate) {
|
|
|
+ return this.updateById(tmplAssetCalculate);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Boolean delete(Long id){
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean delete(Long id) {
|
|
|
+ tmplAssetCalculateSectionMapper.updateDeleteStatusByTCId(id);
|
|
|
//逻辑删除
|
|
|
return this.removeById(id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取资产测算表的下拉框数据
|
|
|
+ *
|
|
|
* @return List<DropDownBoxData>
|
|
|
*/
|
|
|
@Override
|