Commit 92d94e31 by huluobin

# 更新

parent b634ee16
...@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.blt.other.database.model.CostTypeDomain; import com.blt.other.database.model.CostTypeDomain;
import com.blt.other.module.cost.dao.AccountingSubjectMapper;
import com.blt.other.module.cost.dao.CostDetailDao; import com.blt.other.module.cost.dao.CostDetailDao;
import com.blt.other.module.cost.dao.CostTypeDao; import com.blt.other.module.cost.dao.CostTypeDao;
import com.blt.other.module.cost.dto.request.ResetReq; import com.blt.other.module.cost.dto.request.ResetReq;
import com.blt.other.module.cost.dto.response.ResetResp; import com.blt.other.module.cost.dto.response.ResetResp;
import com.blt.other.module.cost.model.AccountingSubject;
import com.blt.other.module.cost.model.CostDetailDomain; import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostDetailService; import com.blt.other.module.cost.service.CostDetailService;
...@@ -53,7 +55,8 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail ...@@ -53,7 +55,8 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
@Resource @Resource
CostTypeDao costTypeDao; CostTypeDao costTypeDao;
@Resource
AccountingSubjectMapper accountingSubjectMapper;
@Override @Override
public ResetResp reset(ResetReq req) { public ResetResp reset(ResetReq req) {
...@@ -69,9 +72,14 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail ...@@ -69,9 +72,14 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
} }
if (StringUtils.isNotEmpty(req.getTypeNo())) { if (StringUtils.isNotEmpty(req.getTypeNo())) {
CostTypeDomain costTypeDomain = costTypeDao.selectByNo(req.getTypeNo()); CostTypeDomain costTypeDomain = costTypeDao.selectByNo(req.getTypeNo());
costDetailDomain.setTypeId(costTypeDomain.getId()); AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
costDetailDomain.setAccountingSubjectId(costTypeDomain.getAccountingSubjectId());
costDetailDomain.setTypeNo(costTypeDomain.getTypeNo());
costDetailDomain.setTypeName(costTypeDomain.getTypeName());
costDetailDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDetailDomain.setAccountingSubjectName(accountingSubject.getName());
} }
baseMapper.updateById(costDetailDomain); baseMapper.updateById(costDetailDomain);
......
...@@ -142,6 +142,8 @@ public abstract class AbstractCostService implements CostService { ...@@ -142,6 +142,8 @@ public abstract class AbstractCostService implements CostService {
CostTemplateBaseColMapper costTemplateBaseColMapper; CostTemplateBaseColMapper costTemplateBaseColMapper;
@Resource @Resource
AccountingSubjectMapper accountingSubjectMapper; AccountingSubjectMapper accountingSubjectMapper;
@Resource
CostTypeDao costTypeDao;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
...@@ -166,7 +168,7 @@ public abstract class AbstractCostService implements CostService { ...@@ -166,7 +168,7 @@ public abstract class AbstractCostService implements CostService {
if (StringUtils.isNotEmpty(costDomain.getTypeNo())) { if (StringUtils.isNotEmpty(costDomain.getTypeNo())) {
CostTypeDomain costTypeDomain = new CostTypeDomain(); CostTypeDomain costTypeDomain = costTypeDao.selectByNo(costDomain.getTypeNo());
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId()); AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
costDomain.setTypeNo(costDomain.getTypeNo()); costDomain.setTypeNo(costDomain.getTypeNo());
...@@ -174,6 +176,7 @@ public abstract class AbstractCostService implements CostService { ...@@ -174,6 +176,7 @@ public abstract class AbstractCostService implements CostService {
costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo()); costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDomain.setAccountingSubjectName(accountingSubject.getName()); costDomain.setAccountingSubjectName(accountingSubject.getName());
} }
Integer update = costDao.update(costDomain, new LambdaQueryWrapper<CostDomain>() Integer update = costDao.update(costDomain, new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostNo, costDomain.getCostNo())); .eq(CostDomain::getCostNo, costDomain.getCostNo()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment