Commit a0102015 by huluobin

Merge branch 'master' into 3.0

# Conflicts:
#	cost-service/src/main/java/com/blt/other/database/model/CostTypeDomain.java
#	cost-service/src/main/java/com/blt/other/module/cost/controller/CostController.java
#	cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostTypeServiceImpl.java
parents c75f9b10 f0f0147a
...@@ -38,6 +38,8 @@ public class CostTypeDomain { ...@@ -38,6 +38,8 @@ public class CostTypeDomain {
private Integer accountingSubjectId; private Integer accountingSubjectId;
private Boolean isManageCost; private Boolean isManageCost;
private String accountingSubjectNo;
private Integer accountingSubjectId;
/** /**
* 形如0b1001 四位二进制 * 形如0b1001 四位二进制
......
...@@ -76,6 +76,49 @@ public class CostController { ...@@ -76,6 +76,49 @@ public class CostController {
public CostResult<Page<CostDto>> queryPage(@RequestBody CostQueryPageReq req) { public CostResult<Page<CostDto>> queryPage(@RequestBody CostQueryPageReq req) {
Page<CostDomain> costDaoPage = costService.queryPage(req); Page<CostDomain> costDaoPage = costService.queryPage(req);
return CostResult.success((Page<CostDto>) costDaoPage.convert(CostDomain::castToDto)); return CostResult.success((Page<CostDto>) costDaoPage.convert(CostDomain::castToDto));
@ApiOperation("搜索")
@PostMapping("/list/search/key")
public GetByKeyResp getByKey(@RequestParam Integer pageNum,
@RequestParam Integer pageSize,
@RequestParam String key) {
costService = CostServiceFactory.getCostService();
return costListSearchService.searchByKey(key, pageNum, pageSize);
}
@ApiOperation("搜索?")
@PostMapping("/list/search/keys")
public GetByKeyResp getByKeys(@RequestBody CostListSearchKeysVo searchKeysVo) {
costService = CostServiceFactory.getCostService();
if (null != searchKeysVo.getParams().getKeys().getCostForm() && 3 == searchKeysVo.getParams().getKeys().getCostForm()) {
searchKeysVo.getParams().getKeys().setIsLend(1);
}
if (null != searchKeysVo.getParams().getKeys().getCostForm() && 4 == searchKeysVo.getParams().getKeys().getCostForm()) {
searchKeysVo.getParams().getKeys().setCostForm(3);
searchKeysVo.getParams().getKeys().setIsLend(2);
}
return costListSearchService.searchByKeys(searchKeysVo);
}
@ApiOperation("获取借支单列表")
@GetMapping("/list/search/getLinkCost")
public List<CostDomain> getLinkCost() {
return costListSearchService.getLinkCost();
}
@ApiOperation("获取所有费用单")
@GetMapping("/list/getAllCost")
public CostPageResult getAllCost(@RequestParam Integer pageNum,
@RequestParam Integer pageSize,
@RequestParam Integer userId,
@RequestParam(defaultValue = "0", required = false) Integer authType,
@RequestParam(required = false) String projectTypes) {
if (authType != 0) {
userId = null;
}
costService = CostServiceFactory.getCostService();
return costService.getAllCost(pageNum, pageSize, userId, projectTypes);
} }
@ApiOperation("获取费用详情") @ApiOperation("获取费用详情")
......
...@@ -18,6 +18,7 @@ import com.blt.other.module.cost.service.impl.costcheck.*; ...@@ -18,6 +18,7 @@ import com.blt.other.module.cost.service.impl.costcheck.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
/** /**
* <p> * <p>
...@@ -97,4 +98,18 @@ public class AppCostServiceImpl implements AppCostService { ...@@ -97,4 +98,18 @@ public class AppCostServiceImpl implements AppCostService {
throw new BizRuntimeException("invalid cost status"); throw new BizRuntimeException("invalid cost status");
} }
} }
public static BigDecimal rece(BigDecimal amount, int months) {
if (months > 1) {
return rece(amount.add(new BigDecimal("10000")).multiply(new BigDecimal("1.1")), months - 1);
} else {
return amount.add(new BigDecimal("10000")).multiply(new BigDecimal("1.1"));
}
}
public static void main(String[] args) {
System.out.println(rece(new BigDecimal("50000"), 12));
}
} }
package com.blt.other.module.cost.service.impl; package com.blt.other.module.cost.service.impl;
import com.blt.other.module.auth.dao.UserDao; import com.bailuntec.cost.api.dto.CostDto;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.blt.other.database.model.CostExpDomain;
import com.blt.other.database.model.UserDomain;
import com.blt.other.module.auth.dao.UserDao;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dao.CostDetailDao; import com.blt.other.module.cost.dao.CostDetailDao;
import com.blt.other.module.cost.dao.CostExpDao; import com.blt.other.module.cost.dao.CostExpDao;
import com.bailuntec.cost.api.dto.CostDto; import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.module.cost.service.CostDetailService; import com.blt.other.module.cost.service.CostDetailService;
import com.blt.other.module.cost.service.CostExportService; import com.blt.other.module.cost.service.CostExportService;
import com.blt.other.module.cost.service.CostService; import com.blt.other.module.cost.service.CostService;
import com.blt.other.module.cost.vo.CostExportVo; import com.blt.other.module.cost.vo.CostExportVo;
import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.database.model.CostExpDomain;
import com.blt.other.database.model.UserDomain;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -53,7 +53,7 @@ public class CostExportServiceImpl implements CostExportService { ...@@ -53,7 +53,7 @@ public class CostExportServiceImpl implements CostExportService {
} }
// 设置表头 // 设置表头
String[] headers = {"费用单号", "费用类型", "费用单大类", "费用单小类", "费用单状态", "借支/借还", "关联借支单号", "借支单状态", "是否抵个税", "付款主体", "收款单位", "付款理由", "付款金额", "币种", "创建人名称", "下单时间", "用途", "付款时间", "发票状态" String[] headers = {"费用单号", "费用类型", "费用单大类", "费用单小类", "费用单状态", "借支/借还", "关联借支单号", "借支单状态", "是否抵个税", "付款主体", "收款单位", "付款理由", "付款金额", "币种", "创建人名称", "下单时间", "用途", "付款时间", "发票状态"
, "项目", "客户编号"}; , "项目", "客户编号", "会计科目"};
HSSFRow row0 = sheet.createRow(0); HSSFRow row0 = sheet.createRow(0);
for (int i = 0; i < headers.length; i++) { for (int i = 0; i < headers.length; i++) {
HSSFCell cell = row0.createCell(i); HSSFCell cell = row0.createCell(i);
...@@ -116,6 +116,7 @@ public class CostExportServiceImpl implements CostExportService { ...@@ -116,6 +116,7 @@ public class CostExportServiceImpl implements CostExportService {
} }
row.createCell(19).setCellValue(costDto.getProjectType()); row.createCell(19).setCellValue(costDto.getProjectType());
row.createCell(20).setCellValue(costDto.getCustomerNum()); row.createCell(20).setCellValue(costDto.getCustomerNum());
row.createCell(21).setCellValue(costDto.getAccountingSubjectName());
rows++; rows++;
} }
// 保存到本地,并且返回路径 // 保存到本地,并且返回路径
......
...@@ -20,6 +20,7 @@ import com.blt.other.module.cost.dto.response.GetLogisticsBankResp; ...@@ -20,6 +20,7 @@ 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;
...@@ -42,6 +43,9 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain ...@@ -42,6 +43,9 @@ 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());
...@@ -49,6 +53,7 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain ...@@ -49,6 +53,7 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
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.setIsManageCost(req.getIsManageCost()); costTypeDomain.setIsManageCost(req.getIsManageCost());
...@@ -57,13 +62,18 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain ...@@ -57,13 +62,18 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
this.save(costTypeDomain); this.save(costTypeDomain);
if (req.getType().equals(1)) { if (req.getType().equals(1)) {
AccountingSubject lendAccountingSubject = accountingSubjectMapper.selectByName("其他应收款");
CostTypeDomain lendCostTypeDomain = new CostTypeDomain(); CostTypeDomain lendCostTypeDomain = new CostTypeDomain();
lendCostTypeDomain.setCostTemplateType(CostTypeDomain.borrow); lendCostTypeDomain.setCostTemplateType(CostTypeDomain.borrow);
lendCostTypeDomain.setAccountingSubjectId(43); lendCostTypeDomain.setAccountingSubjectId(43);
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); this.save(lendCostTypeDomain);
lendCostTypeDomain.setAccountingSubjectId(lendAccountingSubject.getId());
} }
} }
......
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