Commit 5cdb9a3b by huluobin

# 更新

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