Commit 5cdb9a3b by huluobin

# 更新

parent 4b8216b3
......@@ -13,12 +13,20 @@ import java.time.LocalDateTime;
@TableName(value = "cost_type")
public class CostTypeDomain {
//费用类型 包括付款 借还
public static final Integer feeType = 0b1001;
//收入类别 包括收款
public static final Integer incomeType = 0b0100;
//借支类别 包括借支
public static final Integer borrow = 0b0010;
/**
* 费用类型 包括付款 借还
*/
public static final Integer FEE_TYPE = 0b1001;
/**
* 收入类别 包括收款
*/
public static final Integer INCOME_TYPE = 0b0100;
/**
* 借支类别 包括借支
*/
public static final Integer BORROW = 0b0010;
@TableId(type = IdType.AUTO)
private Integer id;
......@@ -65,7 +73,6 @@ public class CostTypeDomain {
@ApiModelProperty(value = "最后更新时间")
private LocalDateTime lastUpdateTime;
@ApiModelProperty(value = "ns会计科目Id")
private Integer nsAccountingSubjectId;
}
package com.blt.other.module.cost.model;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
......@@ -21,7 +21,7 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="AccountingSubject对象", description="")
@ApiModel(value = "AccountingSubject对象", description = "")
public class AccountingSubject implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -49,5 +49,7 @@ public class AccountingSubject implements Serializable {
@ApiModelProperty(value = "最后更新时间")
private LocalDateTime lastUpdateTime;
@ApiModelProperty(value = "ns会计科目Id")
private Integer nsAccountingSubjectId;
}
......@@ -94,8 +94,9 @@ public class CostDomain implements Serializable {
@ApiModelProperty("描述")
private String description;
@TableField(exist = false)
// @TableField(exist = false)
private Integer accountingSubjectId;
@ApiModelProperty("会计一级科目")
private String accountingSubjectNo;
@ApiModelProperty("会计一级科目")
......@@ -279,14 +280,20 @@ public class CostDomain implements Serializable {
AccountingSubjectMapper accountingSubjectMapper = SpringContextUtil.getBean(AccountingSubjectMapper.class);
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
this.setAccountingSubjectName(accountingSubject.getName());
this.setAccountingSubjectNo(accountingSubject.getSubjectNo());
this.setAccountingSubjectId(accountingSubject.getId());
this.setNsAccountingSubjectId(accountingSubject.getNsAccountingSubjectId());
this.setIsManageCost(costTypeDomain.getIsManageCost());
this.setNsAccountingSubjectId(costTypeDomain.getNsAccountingSubjectId());
}
private static final String REGEX_CHINESE = "[\u4e00-\u9fa5]";// 中文正则
/**
* 中文正则
*/
private static final String REGEX_CHINESE = "[\u4e00-\u9fa5]";
public PostApplyReq buildPostApplyReq() {
......
......@@ -69,7 +69,7 @@ public class CostApiServiceImpl implements CostApiService {
costDomain.setCostRemark(logisticsCostDto.getCostRemark() + "【WMS系统推送】");
costDomain.setCostReason(logisticsCostDto.getCostReason());
CostTypeDomain costTypeDomain = costTypeDao.selectByNameAndType("物流费", CostTypeDomain.feeType);
CostTypeDomain costTypeDomain = costTypeDao.selectByNameAndType("物流费", CostTypeDomain.FEE_TYPE);
costDomain.setCostType(costTypeDomain);
costDomain.setCompanyName("香港百伦科技有限公司");
......@@ -179,7 +179,7 @@ public class CostApiServiceImpl implements CostApiService {
costDomain.setCostStatus(CostDomain.STATUS_FINANCIAL_CHECK);
//类型信息
CostTypeDomain costTypeDomain = costTypeDao.selectByNameAndType("工资", CostTypeDomain.feeType);
CostTypeDomain costTypeDomain = costTypeDao.selectByNameAndType("工资", CostTypeDomain.FEE_TYPE);
costDomain.setCostType(costTypeDomain);
......
......@@ -73,7 +73,7 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
AccountingSubject lendAccountingSubject = accountingSubjectMapper.selectByName("其他应收款");
CostTypeDomain lendCostTypeDomain = new CostTypeDomain();
lendCostTypeDomain.setCostTemplateType(CostTypeDomain.borrow);
lendCostTypeDomain.setCostTemplateType(CostTypeDomain.BORROW);
lendCostTypeDomain.setAccountingSubjectNo(lendAccountingSubject.getSubjectNo());
lendCostTypeDomain.setTypeNo(IdWorker.getIdStr());
lendCostTypeDomain.setTypeName(req.getTypeName());
......@@ -94,8 +94,8 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
if (StringUtils.isNotEmpty(req.getTypeNo())) {
CostTypeDomain costTypeDomain = baseMapper.selectByNo(req.getTypeNo());
if (costTypeDomain.getCostTemplateType().equals(CostTypeDomain.feeType)) {
CostTypeDomain lendCostTypeDomain = baseMapper.selectByNameAndType(costTypeDomain.getTypeName(), CostTypeDomain.borrow);
if (costTypeDomain.getCostTemplateType().equals(CostTypeDomain.FEE_TYPE)) {
CostTypeDomain lendCostTypeDomain = baseMapper.selectByNameAndType(costTypeDomain.getTypeName(), CostTypeDomain.BORROW);
if (lendCostTypeDomain != null) {
lendCostTypeDomain.setTypeName(req.getTypeName().trim());
......@@ -211,11 +211,11 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
*/
private Integer getCostTemplateType(Integer type) {
if (type.equals(1)) {
return CostTypeDomain.feeType;
return CostTypeDomain.FEE_TYPE;
} else if (type.equals(2)) {
return CostTypeDomain.incomeType;
return CostTypeDomain.INCOME_TYPE;
} else if (type.equals(3)) {
return CostTypeDomain.borrow;
return CostTypeDomain.BORROW;
} else {
throw new BizRuntimeException("invalid type");
}
......
......@@ -229,9 +229,9 @@ public class OtherApplicationTests {
private void syncData() {
Map<Integer, Integer> map = new HashMap<>();
map.put(1, CostTypeDomain.feeType);
map.put(2, CostTypeDomain.incomeType);
map.put(3, CostTypeDomain.borrow);
map.put(1, CostTypeDomain.FEE_TYPE);
map.put(2, CostTypeDomain.INCOME_TYPE);
map.put(3, CostTypeDomain.BORROW);
list.forEach(item -> {
AccountingSubjectMapper accountingSubjectMapper = SpringContextUtil.getBean(AccountingSubjectMapper.class);
......@@ -435,7 +435,7 @@ public class OtherApplicationTests {
costTypeDao.selectTestType()
.forEach(costTypeDomain -> {
CostTypeDomain item = new CostTypeDomain();
item.setCostTemplateType(CostTypeDomain.borrow);
item.setCostTemplateType(CostTypeDomain.BORROW);
item.setDescription(costTypeDomain.getDescription());
item.setTypeNo(IdWorker.getIdStr());
item.setTypeName(costTypeDomain.getTypeName());
......
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