Commit f0f0147a by huluobin

# update

parent 60d44582
......@@ -33,6 +33,7 @@ public class CostTypeDomain {
private String typeName;
private String accountingSubjectNo;
private Integer accountingSubjectId;
/**
* 形如0b1001 四位二进制
......
......@@ -14,6 +14,7 @@ import com.blt.other.module.cost.dto.request.CostTypeAddReq;
import com.blt.other.module.cost.dto.request.CostTypeModifyReq;
import com.blt.other.module.cost.dto.request.CostTypeQueryPageReq;
import com.blt.other.module.cost.dto.response.CostTypeResult;
import com.blt.other.module.cost.model.AccountingSubject;
import com.blt.other.module.cost.service.CostTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
......@@ -31,23 +32,30 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
@Override
public void addCostType(CostTypeAddReq req) {
AccountingSubject accountingSubject = accountingSubjectMapper.selectByNo(req.getAccountingSubjectNo());
CostTypeDomain costTypeDomain = new CostTypeDomain();
costTypeDomain.setAccountingSubjectNo(req.getAccountingSubjectNo());
costTypeDomain.setTypeNo(IdWorker.getIdStr());
costTypeDomain.setTypeName(req.getTypeName());
costTypeDomain.setDescription(req.getDescription());
costTypeDomain.setAccountingSubjectId(accountingSubject.getId());
costTypeDomain.setCostTemplateType(this.getCostTemplateType(req.getType()));
this.save(costTypeDomain);
if (req.getType().equals(1)) {
AccountingSubject lendAccountingSubject = accountingSubjectMapper.selectByName("其他应收款");
CostTypeDomain lendCostTypeDomain = new CostTypeDomain();
lendCostTypeDomain.setCostTemplateType(CostTypeDomain.borrow);
lendCostTypeDomain.setAccountingSubjectNo("1345912843756503041");
lendCostTypeDomain.setAccountingSubjectNo(lendAccountingSubject.getSubjectNo());
lendCostTypeDomain.setTypeNo(IdWorker.getIdStr());
lendCostTypeDomain.setTypeName(req.getTypeName());
lendCostTypeDomain.setDescription(req.getDescription());
lendCostTypeDomain.setAccountingSubjectId(lendAccountingSubject.getId());
}
}
......
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