Commit f17ddf8b by huluobin

# update

parent 535e2554
......@@ -14,6 +14,7 @@ import com.blt.other.module.cost.dto.response.GetCostByCostPlanNoResp;
import com.blt.other.module.cost.dto.response.PrintListResp;
import com.blt.other.module.cost.dto.response.UpdateCostResp;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostListSearchService;
import com.blt.other.module.cost.service.CostLogService;
import com.blt.other.module.cost.service.CostService;
import com.blt.other.module.cost.service.impl.cost.CostServiceFactory;
......@@ -56,6 +57,8 @@ public class CostController {
private FinancialCheckState financialCheckState;
@Resource
private HrCheckState hrCheckState;
@Resource
CostListSearchService costListSearchService;
@ApiOperation("获取前端要打印的费用单列表")
......@@ -76,29 +79,8 @@ public class CostController {
public CostResult<Page<CostDto>> queryPage(@RequestBody CostQueryPageReq req) {
Page<CostDomain> costDaoPage = costService.queryPage(req);
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")
......@@ -107,20 +89,6 @@ public class CostController {
}
@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("获取费用详情")
@PostMapping("/list/getCostDetail")
public CostResult<CostDto> getCostDetail(@RequestParam String costNo) {
......
......@@ -102,14 +102,14 @@ public class AppCostServiceImpl implements AppCostService {
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);
return rece(amount.add(new BigDecimal("200")).multiply(new BigDecimal("1.01")), months - 1);
} else {
return amount.add(new BigDecimal("10000")).multiply(new BigDecimal("1.1"));
return amount.add(new BigDecimal("200")).multiply(new BigDecimal("1.01"));
}
}
public static void main(String[] args) {
System.out.println(rece(new BigDecimal("50000"), 12));
System.out.println(rece(new BigDecimal("40000"), 200));
}
}
......@@ -40,6 +40,16 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
@Resource
OaUserMapper oaUserMapper;
@Override
public Page<CostTypeResult> queryPage(CostTypeQueryPageReq req) {
IPage<CostTypeResult> page = new Page<>(req.getPageNum(), req.getPageSize());
req.setCostTemplateType(this.getCostTemplateType((req.getType())));
page = baseMapper.queryPage(page, req);
return (Page<CostTypeResult>) page;
}
@Override
public void addCostType(CostTypeAddReq req) {
CostTypeDomain costTypeDomain = new CostTypeDomain();
......@@ -74,15 +84,6 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
}
@Override
public Page<CostTypeResult> queryPage(CostTypeQueryPageReq req) {
IPage<CostTypeResult> page = new Page<>(req.getPageNum(), req.getPageSize());
req.setCostTemplateType(this.getCostTemplateType((req.getType())));
page = baseMapper.queryPage(page, req);
return (Page<CostTypeResult>) page;
}
@Override
public void modifyCostType(CostTypeModifyReq req) {
OaUser oaUser = oaUserMapper.selectByOaUserId(req.getCurrentUserId());
......
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