Commit 1b8ca4bc by huluobin

# 更新

parent ccbc5436
...@@ -230,4 +230,7 @@ public class CostDto { ...@@ -230,4 +230,7 @@ public class CostDto {
@TableField(exist = false) @TableField(exist = false)
private List<CostDetailDto> costDetailList; private List<CostDetailDto> costDetailList;
@TableField(exist = false)
private Boolean isManageCost;
} }
...@@ -17,7 +17,9 @@ import com.blt.other.common.util.CurUtils; ...@@ -17,7 +17,9 @@ import com.blt.other.common.util.CurUtils;
import com.blt.other.common.util.MoneyUtil; import com.blt.other.common.util.MoneyUtil;
import com.blt.other.database.mapper.StatusMapper; import com.blt.other.database.mapper.StatusMapper;
import com.blt.other.database.model.CostCompanyDomain; import com.blt.other.database.model.CostCompanyDomain;
import com.blt.other.database.model.CostTypeDomain;
import com.blt.other.database.model.UserDomain; import com.blt.other.database.model.UserDomain;
import com.blt.other.module.cost.dao.AccountingSubjectMapper;
import com.blt.other.module.cost.dao.CostCompanyDao; import com.blt.other.module.cost.dao.CostCompanyDao;
import com.blt.other.module.sys.service.UserService; import com.blt.other.module.sys.service.UserService;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -84,6 +86,8 @@ public class CostDomain implements Serializable { ...@@ -84,6 +86,8 @@ public class CostDomain implements Serializable {
private String typeNo; private String typeNo;
@ApiModelProperty("类型标题") @ApiModelProperty("类型标题")
private String typeName; private String typeName;
@ApiModelProperty("是否管理成本")
private Integer isManageCost;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty("描述") @ApiModelProperty("描述")
...@@ -259,6 +263,19 @@ public class CostDomain implements Serializable { ...@@ -259,6 +263,19 @@ public class CostDomain implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<CostDetailDomain> costDetailDomainList; private List<CostDetailDomain> costDetailDomainList;
public void setCostType(CostTypeDomain costTypeDomain) {
this.setTypeId(costTypeDomain.getId());
this.setTypeNo(costTypeDomain.getTypeNo());
this.setTypeName(costTypeDomain.getTypeName());
AccountingSubjectMapper accountingSubjectMapper = SpringContextUtil.getBean(AccountingSubjectMapper.class);
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
this.setAccountingSubjectName(accountingSubject.getName());
this.setAccountingSubjectNo(accountingSubject.getSubjectNo());
}
private static final String REGEX_CHINESE = "[\u4e00-\u9fa5]";// 中文正则 private static final String REGEX_CHINESE = "[\u4e00-\u9fa5]";// 中文正则
public PostApplyReq buildPostApplyReq() { public PostApplyReq buildPostApplyReq() {
......
...@@ -71,13 +71,7 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -71,13 +71,7 @@ public class CostApiServiceImpl implements CostApiService {
costDomain.setCostReason(logisticsCostDto.getCostReason()); costDomain.setCostReason(logisticsCostDto.getCostReason());
CostTypeDomain costTypeDomain = costTypeDao.selectByNameAndType("物流费", CostTypeDomain.feeType); CostTypeDomain costTypeDomain = costTypeDao.selectByNameAndType("物流费", CostTypeDomain.feeType);
costDomain.setTypeId(costTypeDomain.getId()); costDomain.setCostType(costTypeDomain);
costDomain.setTypeNo(costTypeDomain.getTypeNo());
costDomain.setTypeName(costTypeDomain.getTypeName());
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
costDomain.setAccountingSubjectName(accountingSubject.getName());
costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDomain.setCompanyName("香港百伦科技有限公司"); costDomain.setCompanyName("香港百伦科技有限公司");
costDomain.setCompanyNo("COM1806191800013"); costDomain.setCompanyNo("COM1806191800013");
...@@ -189,14 +183,8 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -189,14 +183,8 @@ public class CostApiServiceImpl implements CostApiService {
//类型信息 //类型信息
CostTypeDomain costTypeDomain = costTypeDao.selectByNameAndType("工资", CostTypeDomain.feeType); CostTypeDomain costTypeDomain = costTypeDao.selectByNameAndType("工资", CostTypeDomain.feeType);
costDomain.setTypeId(costTypeDomain.getId()); costDomain.setCostType(costTypeDomain);
costDomain.setTypeNo(costTypeDomain.getTypeNo());
costDomain.setTypeName(costTypeDomain.getTypeName());
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
costDomain.setAccountingSubjectId(costTypeDomain.getAccountingSubjectId());
costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDomain.setAccountingSubjectName(accountingSubject.getName());
//公司 //公司
CostCompanyDomain costCompany = costCompanyDao.selectByName(wageCostDto.getCompanyName()); CostCompanyDomain costCompany = costCompanyDao.selectByName(wageCostDto.getCompanyName());
......
...@@ -221,13 +221,8 @@ public abstract class AbstractCostService implements CostService { ...@@ -221,13 +221,8 @@ public abstract class AbstractCostService implements CostService {
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
CostTypeDomain costTypeDomain = costTypeDao.selectById(costDetailDomain.getTypeId()); CostTypeDomain costTypeDomain = costTypeDao.selectById(costDetailDomain.getTypeId());
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId()); costDomain.setCostType(costTypeDomain);
costDomain.setTypeId(costTypeDomain.getId());
costDomain.setTypeNo(costTypeDomain.getTypeNo());
costDomain.setTypeName(costTypeDomain.getTypeName());
costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDomain.setAccountingSubjectName(accountingSubject.getName());
costDomain.setLastModifyDate(LocalDateTime.now()); costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain); costDao.updateById(costDomain);
......
...@@ -201,6 +201,9 @@ public abstract class AbstractCostPlanService implements CostPlanService { ...@@ -201,6 +201,9 @@ public abstract class AbstractCostPlanService implements CostPlanService {
CostPlanDomain costPlanDomain = costPlanDao.selectByNo(costPlanNo); CostPlanDomain costPlanDomain = costPlanDao.selectByNo(costPlanNo);
BeanUtils.copyProperties(costPlanDomain, costDomain); BeanUtils.copyProperties(costPlanDomain, costDomain);
CostTypeDomain costTypeDomain = costTypeDao.selectById(costPlanDomain.getTypeId());
costDomain.setCostType(costTypeDomain);
costDomain.setCompanyValue(costCompanyDao.selectByNo(costPlanDomain.getCompanyNo()).getValue()); costDomain.setCompanyValue(costCompanyDao.selectByNo(costPlanDomain.getCompanyNo()).getValue());
costDomain.setAttach(costPlanDomain.getAttach()); costDomain.setAttach(costPlanDomain.getAttach());
return costDomain; return costDomain;
......
...@@ -5,6 +5,7 @@ import com.blt.other.common.exception.BizRuntimeException; ...@@ -5,6 +5,7 @@ import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.database.model.CostPlanDomain; import com.blt.other.database.model.CostPlanDomain;
import com.blt.other.database.model.CostPlanTempDomain; import com.blt.other.database.model.CostPlanTempDomain;
import com.blt.other.database.model.CostTypeDomain;
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.CostPlanService; import com.blt.other.module.cost.service.CostPlanService;
...@@ -106,13 +107,10 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -106,13 +107,10 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
costByNo = costService.getCostByCostNo(costNo); costByNo = costService.getCostByCostNo(costNo);
} }
CostDetailDomain costDetailItem = costDetailDomainList.get(0);
costDomain.setCostNo(costNo); costDomain.setCostNo(costNo);
costDomain.setTypeId(typeId); CostTypeDomain costTypeDomain = costTypeDao.selectById(typeId);
costDomain.setTypeNo(costDetailItem.getTypeNo()); costDomain.setCostType(costTypeDomain);
costDomain.setTypeName(costDetailItem.getTypeName());
costDomain.setAccountingSubjectNo(costDetailItem.getAccountingSubjectNo());
costDomain.setAccountingSubjectName(costDetailItem.getAccountingSubjectName());
costDomain.setAmount(costDetailDomains.stream().map(CostDetailDomain::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add)); costDomain.setAmount(costDetailDomains.stream().map(CostDetailDomain::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
costDomain.setDic(costDetailDomains.get(0).getDic()); costDomain.setDic(costDetailDomains.get(0).getDic());
......
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