Commit fd03ecb9 by huluobin

update

parent bf1f053d
...@@ -4,10 +4,13 @@ import com.bailuntec.common.BeanUtils; ...@@ -4,10 +4,13 @@ import com.bailuntec.common.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.module.cost.dao.CostDao; 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.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.service.CostDetailService; import com.blt.other.module.cost.service.CostDetailService;
import com.blt.other.module.cost.service.CostService; import com.blt.other.module.cost.service.CostService;
...@@ -50,6 +53,11 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail ...@@ -50,6 +53,11 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
.eq(CostDetailDomain::getDetailNo, domain.getDetailNo())); .eq(CostDetailDomain::getDetailNo, domain.getDetailNo()));
} }
@Resource
CostTypeDao costTypeDao;
@Resource
AccountingSubjectMapper accountingSubjectMapper;
@Override @Override
public ResetResp reset(ResetReq req) { public ResetResp reset(ResetReq req) {
CostDetailDomain costDetailDomain = this.getCostDetailByDetailNo(req.getDetailNo()); CostDetailDomain costDetailDomain = this.getCostDetailByDetailNo(req.getDetailNo());
...@@ -62,6 +70,16 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail ...@@ -62,6 +70,16 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
String path = CostFileUtil.upload(req.getFileSelect2(), filePath); String path = CostFileUtil.upload(req.getFileSelect2(), filePath);
costDetailDomain.setFilePath(path); costDetailDomain.setFilePath(path);
} }
if (req.getTypeNo() != null) {
CostTypeDomain costTypeDomain = costTypeDao.selectByNo(req.getTypeNo());
costDetailDomain.setTypeName(costTypeDomain.getTypeName());
}
if (req.getAccountingSubjectNo() != null) {
AccountingSubject accountingSubject = accountingSubjectMapper.selectByNo(req.getAccountingSubjectNo());
costDetailDomain.setAccountingSubjectName(accountingSubject.getName());
}
baseMapper.updateById(costDetailDomain); baseMapper.updateById(costDetailDomain);
costService.resetCost(costDetailDomain.getCostNo()); costService.resetCost(costDetailDomain.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