Commit abc3609a by huluobin

# update

parent a0102015
package com.blt.other.database.model; package com.blt.other.database.model;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -33,13 +32,11 @@ public class CostTypeDomain { ...@@ -33,13 +32,11 @@ public class CostTypeDomain {
@ApiModelProperty("费用类型标题") @ApiModelProperty("费用类型标题")
private String typeName; private String typeName;
// private String accountingSubjectNo;
private Integer accountingSubjectId; private Integer accountingSubjectId;
private Boolean isManageCost; private Boolean isManageCost;
private String accountingSubjectNo; private String accountingSubjectNo;
private Integer accountingSubjectId;
/** /**
* 形如0b1001 四位二进制 * 形如0b1001 四位二进制
......
...@@ -20,7 +20,6 @@ import com.blt.other.module.cost.dto.response.GetLogisticsBankResp; ...@@ -20,7 +20,6 @@ import com.blt.other.module.cost.dto.response.GetLogisticsBankResp;
import com.blt.other.module.cost.dto.response.GetLogisticsCodeResp; import com.blt.other.module.cost.dto.response.GetLogisticsCodeResp;
import com.blt.other.module.cost.model.AccountingSubject; import com.blt.other.module.cost.model.AccountingSubject;
import com.blt.other.module.cost.service.CostTypeKindService; import com.blt.other.module.cost.service.CostTypeKindService;
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;
...@@ -43,20 +42,16 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain ...@@ -43,20 +42,16 @@ 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();
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(req.getAccountingSubjectId()); AccountingSubject accountingSubject = accountingSubjectMapper.selectById(req.getAccountingSubjectId());
costTypeDomain.setAccountingSubjectId(accountingSubject.getId()); costTypeDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
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.setAccountingSubjectId(accountingSubject.getId());
costTypeDomain.setIsManageCost(req.getIsManageCost()); costTypeDomain.setIsManageCost(req.getIsManageCost());
costTypeDomain.setCostTemplateType(this.getCostTemplateType(req.getType())); costTypeDomain.setCostTemplateType(this.getCostTemplateType(req.getType()));
this.save(costTypeDomain); this.save(costTypeDomain);
...@@ -67,13 +62,13 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain ...@@ -67,13 +62,13 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
CostTypeDomain lendCostTypeDomain = new CostTypeDomain(); CostTypeDomain lendCostTypeDomain = new CostTypeDomain();
lendCostTypeDomain.setCostTemplateType(CostTypeDomain.borrow); lendCostTypeDomain.setCostTemplateType(CostTypeDomain.borrow);
lendCostTypeDomain.setAccountingSubjectId(43);
lendCostTypeDomain.setAccountingSubjectNo(lendAccountingSubject.getSubjectNo()); 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());
this.save(lendCostTypeDomain);
lendCostTypeDomain.setAccountingSubjectId(lendAccountingSubject.getId()); lendCostTypeDomain.setAccountingSubjectId(lendAccountingSubject.getId());
this.save(lendCostTypeDomain);
} }
} }
...@@ -103,10 +98,8 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain ...@@ -103,10 +98,8 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
lendCostTypeDomain.setUpdateUserId(oaUser.getOaUserId()); lendCostTypeDomain.setUpdateUserId(oaUser.getOaUserId());
lendCostTypeDomain.setUpdateUser(oaUser.getUserName()); lendCostTypeDomain.setUpdateUser(oaUser.getUserName());
lendCostTypeDomain.setLastUpdateTime(LocalDateTime.now()); lendCostTypeDomain.setLastUpdateTime(LocalDateTime.now());
if (req.getAccountingSubjectId() != null) {
lendCostTypeDomain.setAccountingSubjectId(req.getAccountingSubjectId());
}
lendCostTypeDomain.setIsManageCost(req.getIsManageCost()); lendCostTypeDomain.setIsManageCost(req.getIsManageCost());
this.updateById(lendCostTypeDomain); this.updateById(lendCostTypeDomain);
} }
......
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