Commit f0f0147a by huluobin

# update

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