Commit 45f46b5d by huluobin

付款计划详情 一级科目

parent b0543c49
package com.bailuntec.cost.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
......@@ -20,5 +21,10 @@ public class CostPlanTempDto {
private String kindNameDto; // 小类标题
private String dic; // 币种
@ApiModelProperty("会计一级科目")
private String accountingSubjectNo;
@ApiModelProperty("会计一级科目")
private String accountingSubjectName;
}
......@@ -61,9 +61,9 @@ public class CostDetailController {
//类型标题 大类
String typeName = detail.getTypeName();
//种类标题 小类
String kindName = detail.getKindName();
String accountingSubjectName = detail.getAccountingSubjectName();
if ((typeName.contains("工资") ||
kindName.contains("工资")) &&
accountingSubjectName.contains("工资")) &&
!(user.getUseraccount().equals("程文爱")
|| user.getUseraccount().equals("苏佩虹")
|| user.getUseraccount().equals("张晓雯")
......@@ -200,12 +200,10 @@ public class CostDetailController {
domain.setCostReason(costReason);
domain.setAmount(new BigDecimal(amount));
domain.setKindNo(kindNo);
domain.setCostNo(costNo);
domain.setDetailNo(detailNo);
CostTypeKindDomain kindByKindNo = costTypeKindService.getKindByKindNo(kindNo);
domain.setKindName(kindByKindNo.getKindName());
return domain;
}
......
......@@ -41,26 +41,6 @@ public class CostDetailServiceImpl implements CostDetailService {
@Transactional
@Override
public Integer update(CostDetailDomain domain) {
List<CostDetailDomain> costDetailDomainList = costDetailDao.selectListByCostNo(domain.getCostNo());
CostDomain costDomain = costDao.selectByCostNo(domain.getCostNo());
// //费用单总金额重新计算
// if (costDetailDomainList.stream().collect(Collectors.groupingBy(CostDetailDomain::getDic)).keySet().size() > 1) {
// throw new RuntimeException("请统一货币单位");
// }
// BigDecimal totalAmount = costDetailDomainList.stream().map(CostDetailDomain::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
// BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
//
// costDomain.setToRmbRate(toRmbRate);
// costDomain.setAmount(totalAmount);
// costDomain.setAmountRmb(totalAmount.multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
// costDomain.setDic(domain.getDic())
//更新费用单
return costDetailDao.update(domain);
}
......
......@@ -3,6 +3,7 @@ package com.blt.other.module.cost.service.impl.costplan;
import com.bailuntec.common.ListUtil;
import com.bailuntec.cost.api.dto.CostPlanDto;
import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.database.model.*;
import com.blt.other.module.auth.dao.UserDao;
import com.blt.other.module.cost.dao.*;
import com.blt.other.module.cost.dto.request.GetAllCostPlanReq;
......@@ -13,7 +14,6 @@ import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.model.CostTemplateBaseCol;
import com.blt.other.module.cost.service.*;
import com.blt.other.module.cost.utils.CostUtils;
import com.blt.other.database.model.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.BeanUtils;
......@@ -188,24 +188,20 @@ public abstract class AbstractCostPlanService implements CostPlanService {
BeanUtils.copyProperties(costPlanDomain, costDomain);
costDomain.setCompanyValue(costCompanyDao.selectByNo(costPlanDomain.getCompanyNo()).getValue());
if (costDomain.getTypeNo() != null) {
// CostTypeDomain costTypeDomain = costTypeDao.selectByTypeNo(costDomain.getTypeNo());
// if (costTypeDomain != null) {
// costDomain.setSubjectCode(costTypeDomain.getSubjectCode());
// }
}
costDomain.setAttach(costPlanDomain.getAttach());
return costDomain;
}
protected CostDetailDomain tempToDetail(CostPlanTempDomain costPlanTempDomain, CostPlanDomain costPlanDomain, Integer index) {
protected CostDetailDomain tempToDetail(CostPlanTempDomain costPlanTempDomain,
CostPlanDomain costPlanDomain,
Integer index) {
CostDetailDomain costDetailDomain = new CostDetailDomain();
BeanUtils.copyProperties(costPlanDomain, costDetailDomain);
BeanUtils.copyProperties(costPlanTempDomain, costDetailDomain);
costDetailDomain.setDetailNo(costPlanDomain.getCostPlanNo() + "-" + index);
CostTypeKindDomain costTypeKindDomain = costTypeKindDao.selectByKindNo(costPlanTempDomain.getKindNo());
costDetailDomain.setKindName(costTypeKindDomain.getKindName());
costDetailDomain.setTypeNo(costTypeKindDomain.getTypeNo());
costDetailDomain.setTypeName(costTypeKindDomain.getTypeName());
return costDetailDomain;
......
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