Commit 068665af by huluobin

update

parent 6a1533ee
package com.bailuntec.cost.api.dto; package com.bailuntec.cost.api.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
...@@ -53,10 +53,10 @@ public class CostListAddController { ...@@ -53,10 +53,10 @@ public class CostListAddController {
AxiosUtil.setCors(response, request); AxiosUtil.setCors(response, request);
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
String costNo = CostUtils.getIdNum(costService); String costNo = CostUtils.getIdNum();
CostDomain costDomainByNo = costDao.selectByCostNo(costNo); CostDomain costDomainByNo = costDao.selectByCostNo(costNo);
while (null != costDomainByNo && null != costDomainByNo.getId()) { while (null != costDomainByNo && null != costDomainByNo.getId()) {
costNo = CostUtils.getIdNum(costService); costNo = CostUtils.getIdNum();
} }
CostDomain costDomain = CostUtils.createCostDomain(request, costNo); CostDomain costDomain = CostUtils.createCostDomain(request, costNo);
...@@ -96,10 +96,10 @@ public class CostListAddController { ...@@ -96,10 +96,10 @@ public class CostListAddController {
AxiosUtil.setCors(response, request); AxiosUtil.setCors(response, request);
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
String costNo = CostUtils.getIdNum(costService); String costNo = CostUtils.getIdNum();
CostDomain costDomainByNo = costDao.selectByCostNo(costNo); CostDomain costDomainByNo = costDao.selectByCostNo(costNo);
while (null != costDomainByNo && null != costDomainByNo.getId()) { while (null != costDomainByNo && null != costDomainByNo.getId()) {
costNo = CostUtils.getIdNum(costService); costNo = CostUtils.getIdNum();
} }
CostDomain costDomain = CostUtils.createCostDomain(request, costNo); CostDomain costDomain = CostUtils.createCostDomain(request, costNo);
// 保存表单中的银行卡信息 // 保存表单中的银行卡信息
......
...@@ -4,7 +4,9 @@ import com.bailuntec.cost.api.dto.CostDto; ...@@ -4,7 +4,9 @@ import com.bailuntec.cost.api.dto.CostDto;
import com.blt.other.common.util.AxiosUtil; import com.blt.other.common.util.AxiosUtil;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.*; import com.blt.other.module.cost.service.CostCashiercallbackService;
import com.blt.other.module.cost.service.CostLogService;
import com.blt.other.module.cost.service.CostService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -20,7 +22,6 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -20,7 +22,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -40,14 +41,6 @@ public class CostCheckController { ...@@ -40,14 +41,6 @@ public class CostCheckController {
@Autowired @Autowired
private CostService costService; private CostService costService;
@Autowired @Autowired
private CostCompanyService costCompanyService;
@Autowired
private RestTemplate restTemplate;
@Autowired
private CostTofinanceService costTofinanceService;
@Autowired
private CostApplycallbackService costApplycallbackService;
@Autowired
private CostCashiercallbackService costCashiercallbackService; private CostCashiercallbackService costCashiercallbackService;
@Autowired @Autowired
private CostLogService costLogService; private CostLogService costLogService;
......
package com.blt.other.module.cost.controller.cost; //package com.blt.other.module.cost.controller.cost;
//
import com.blt.other.common.util.AxiosUtil; //import com.blt.other.common.util.AxiosUtil;
import com.blt.other.module.cost.model.CostDomain; //import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.*; //import com.blt.other.module.cost.service.*;
import org.slf4j.Logger; //import org.slf4j.Logger;
import org.slf4j.LoggerFactory; //import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; //import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping; //import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate; //import org.springframework.web.client.RestTemplate;
//
import javax.servlet.http.HttpServletRequest; //import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; //import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; //import java.math.BigDecimal;
import java.util.Map; //import java.util.Map;
//
@RestController //@RestController
@RequestMapping("cost/check/lend") //@RequestMapping("cost/check/lend")
public class CostCheckLendController { //public class CostCheckLendController {
//
private static Logger logger = LoggerFactory.getLogger(CostCheckLendController.class); // private static Logger logger = LoggerFactory.getLogger(CostCheckLendController.class);
//
@Autowired // @Autowired
private CostService costService; // private CostService costService;
@Autowired // @Autowired
private CostLogService costLogService; // private CostLogService costLogService;
@Autowired // @Autowired
private CostCompanyService costCompanyService; // private CostCompanyService costCompanyService;
@Autowired // @Autowired
private RestTemplate restTemplate; // private RestTemplate restTemplate;
@Autowired // @Autowired
private CostTofinanceService costTofinanceService; // private CostTofinanceService costTofinanceService;
@Autowired // @Autowired
private CostApplycallbackService costApplycallbackService; // private CostApplycallbackService costApplycallbackService;
@Autowired // @Autowired
private CostCashiercallbackService costCashiercallbackService; // private CostCashiercallbackService costCashiercallbackService;
//
///http://api.fee.bailuntec.com/purchase/other/cost/check/lend/ApplyCallbackUrl // ///http://api.fee.bailuntec.com/purchase/other/cost/check/lend/ApplyCallbackUrl
@Value("${url.my.lendCostApplyCallBackUrlPost}") // @Value("${url.my.lendCostApplyCallBackUrlPost}")
private String lendCostApplyCallBackUrlPost; // private String lendCostApplyCallBackUrlPost;
//
///purchase/other/cost/check/lend/CashierCallbackUrl // ///purchase/other/cost/check/lend/CashierCallbackUrl
@Value("${url.my.lendCostCashierCallbackUrlPost}") // @Value("${url.my.lendCostCashierCallbackUrlPost}")
private String lendCostCashierCallbackUrlPost; // private String lendCostCashierCallbackUrlPost;
//
//http://cw.bailuntec.com/API/API/Apply // //http://cw.bailuntec.com/API/API/Apply
@Value("${url.api.postApplyApi}") // @Value("${url.api.postApplyApi}")
private String postApplyApi; // private String postApplyApi;
//
//http://oa.bailuntec.com/api/ExchangeRate/GetExchangeRate // //http://oa.bailuntec.com/api/ExchangeRate/GetExchangeRate
@Value("${url.api.getExchangeRateApi}") // @Value("${url.api.getExchangeRateApi}")
private String getExchangeRateApi; // private String getExchangeRateApi;
//
//
//
//
} //}
...@@ -9,7 +9,6 @@ import com.blt.other.common.util.MyMapperUtil; ...@@ -9,7 +9,6 @@ import com.blt.other.common.util.MyMapperUtil;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.dto.CostPageResult;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostExportService; import com.blt.other.module.cost.service.CostExportService;
import com.blt.other.module.cost.service.CostListSearchService; import com.blt.other.module.cost.service.CostListSearchService;
...@@ -19,6 +18,7 @@ import com.blt.other.module.cost.service.impl.cost.CostServiceFactory; ...@@ -19,6 +18,7 @@ import com.blt.other.module.cost.service.impl.cost.CostServiceFactory;
import com.blt.other.module.cost.service.impl.costcheck.*; import com.blt.other.module.cost.service.impl.costcheck.*;
import com.blt.other.module.cost.vo.*; import com.blt.other.module.cost.vo.*;
import com.blt.other.module.database.model.CostExpDomain; import com.blt.other.module.database.model.CostExpDomain;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -64,29 +64,26 @@ public class CostController { ...@@ -64,29 +64,26 @@ public class CostController {
@ApiOperation("获取前端要打印的费用单列表") @ApiOperation("获取前端要打印的费用单列表")
@PostMapping("/list/print/list") @PostMapping("/list/print/list")
public CostApiDto.PrintListResp printList(@RequestBody CostListPrintVo costListPrintVo) { public CostResult<List<CostListPrintDto>> printList(@RequestBody CostListPrintVo costListPrintVo) {
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
List<CostListPrintDto> listPrintDtos = costService.printList(costListPrintVo.getPrintNos()); List<CostListPrintDto> listPrintDtos = costService.printList(costListPrintVo.getPrintNos());
CostApiDto.PrintListResp resp = new CostApiDto.PrintListResp(); return CostResult.success(listPrintDtos);
resp.setSuccess(true);
resp.setPrintList(listPrintDtos);
return resp;
} }
@ApiOperation("搜索") @ApiOperation("搜索")
@PostMapping("/list/search/key") @PostMapping("/list/search/key")
public CostApiDto.GetByKeyResp getByKey(@RequestParam Integer pageNum, public CostResult<PageInfo<CostDto>> getByKey(@RequestParam Integer pageNum,
@RequestParam Integer pageSize, @RequestParam Integer pageSize,
@RequestParam String key) { @RequestParam String key) {
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
return costListSearchService.searchByKey(key, pageNum, pageSize); PageInfo<CostDto> pageInfo = costListSearchService.searchByKey(key, pageNum, pageSize);
return CostResult.success(pageInfo);
} }
@ApiOperation("搜索?") @ApiOperation("搜索?")
@PostMapping("/list/search/keys") @PostMapping("/list/search/keys")
public CostApiDto.GetByKeyResp getByKeys(@RequestBody CostListSearchKeysVo searchKeysVo) { public CostResult<PageInfo<CostDto>> getByKeys(@RequestBody CostListSearchKeysVo searchKeysVo) {
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
if (null != searchKeysVo.getParams().getKeys().getCostForm() && 3 == searchKeysVo.getParams().getKeys().getCostForm()) { if (null != searchKeysVo.getParams().getKeys().getCostForm() && 3 == searchKeysVo.getParams().getKeys().getCostForm()) {
...@@ -96,8 +93,8 @@ public class CostController { ...@@ -96,8 +93,8 @@ public class CostController {
searchKeysVo.getParams().getKeys().setCostForm(3); searchKeysVo.getParams().getKeys().setCostForm(3);
searchKeysVo.getParams().getKeys().setIsLend(2); searchKeysVo.getParams().getKeys().setIsLend(2);
} }
return costListSearchService.searchByKeys(searchKeysVo); PageInfo<CostDto> pageInfo = costListSearchService.searchByKeys(searchKeysVo);
return CostResult.success(pageInfo);
} }
@ApiOperation("获取借支单列表") @ApiOperation("获取借支单列表")
...@@ -109,7 +106,7 @@ public class CostController { ...@@ -109,7 +106,7 @@ public class CostController {
@ApiOperation("获取所有费用单") @ApiOperation("获取所有费用单")
@GetMapping("/list/getAllCost") @GetMapping("/list/getAllCost")
public CostPageResult getAllCost(@RequestParam Integer pageNum, public CostResult<PageInfo<CostDto>> getAllCost(@RequestParam Integer pageNum,
@RequestParam Integer pageSize, @RequestParam Integer pageSize,
@RequestParam Integer userId, @RequestParam Integer userId,
@RequestParam(defaultValue = "0", required = false) Integer authType, @RequestParam(defaultValue = "0", required = false) Integer authType,
...@@ -118,7 +115,8 @@ public class CostController { ...@@ -118,7 +115,8 @@ public class CostController {
userId = null; userId = null;
} }
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
return costService.getAllCost(pageNum, pageSize, userId, projectTypes); PageInfo<CostDto> pageInfo = costService.getAllCost(pageNum, pageSize, userId, projectTypes);
return CostResult.success(pageInfo);
} }
@ApiOperation("获取费用详情") @ApiOperation("获取费用详情")
......
...@@ -14,16 +14,6 @@ public interface CostPlanDao extends BaseMapper<CostPlanDomain> { ...@@ -14,16 +14,6 @@ public interface CostPlanDao extends BaseMapper<CostPlanDomain> {
/** /**
* <p> * <p>
* 根据计划单号更新计划单
* </p>
*
* @param costPlanDomain 计划单
* @return res
*/
Integer updateByNo(CostPlanDomain costPlanDomain);
/**
* <p>
* 根据计划单号删除计划单 * 根据计划单号删除计划单
* </p> * </p>
* *
......
package com.blt.other.module.cost.service; package com.blt.other.module.cost.service;
import com.bailuntec.cost.api.dto.CostDto;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.vo.CostListSearchKeysVo; import com.blt.other.module.cost.vo.CostListSearchKeysVo;
import com.github.pagehelper.PageInfo;
import java.util.List; import java.util.List;
...@@ -14,7 +16,7 @@ public interface CostListSearchService { ...@@ -14,7 +16,7 @@ public interface CostListSearchService {
* @param key key * @param key key
* @return res * @return res
*/ */
CostApiDto.GetByKeyResp searchByKey(String key, int pageNum, int pageSize); PageInfo<CostDto> searchByKey(String key, int pageNum, int pageSize);
/** /**
* 多条件筛选 * 多条件筛选
...@@ -22,7 +24,7 @@ public interface CostListSearchService { ...@@ -22,7 +24,7 @@ public interface CostListSearchService {
* @param searchKeysVo param * @param searchKeysVo param
* @return res * @return res
*/ */
CostApiDto.GetByKeyResp searchByKeys(CostListSearchKeysVo searchKeysVo); PageInfo<CostDto> searchByKeys(CostListSearchKeysVo searchKeysVo);
/** /**
* 获取借支单列表 * 获取借支单列表
......
package com.blt.other.module.cost.service; package com.blt.other.module.cost.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.blt.other.module.cost.dto.CostPlanApiDto; import com.blt.other.module.cost.dto.CostPlanApiDto;
import com.blt.other.module.database.model.CostPlanDomain; import com.blt.other.module.database.model.CostPlanDomain;
......
...@@ -2,12 +2,14 @@ package com.blt.other.module.cost.service; ...@@ -2,12 +2,14 @@ package com.blt.other.module.cost.service;
import com.bailuntec.cost.api.dto.CostDto; import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.dto.CostListPrintDto; import com.bailuntec.cost.api.dto.CostListPrintDto;
import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.dto.CostPageResult; import com.blt.other.module.cost.dto.CostPageResult;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.vo.ApplyCallbackUrlVo; import com.blt.other.module.cost.vo.ApplyCallbackUrlVo;
import com.blt.other.module.cost.vo.CashierCallbackUrlVo; import com.blt.other.module.cost.vo.CashierCallbackUrlVo;
import com.github.pagehelper.PageInfo;
import java.util.List; import java.util.List;
...@@ -27,7 +29,7 @@ public interface CostService { ...@@ -27,7 +29,7 @@ public interface CostService {
* *
* @return allCost * @return allCost
*/ */
CostPageResult getAllCost(Integer pageNum, Integer pageSize, Integer userId, String projectTypes); PageInfo<CostDto> getAllCost(Integer pageNum, Integer pageSize, Integer userId, String projectTypes);
/** /**
* 根据 costNo 获取 cost * 根据 costNo 获取 cost
......
...@@ -62,7 +62,7 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -62,7 +62,7 @@ public class CostApiServiceImpl implements CostApiService {
@Transactional @Transactional
public String generateLogisticsCost(int costForm, LogisticsCostDto logisticsCostDto) throws Exception { public String generateLogisticsCost(int costForm, LogisticsCostDto logisticsCostDto) throws Exception {
CostDomain costDomain = new CostDomain(); CostDomain costDomain = new CostDomain();
String costNo = CostUtils.getIdNum(costService); String costNo = CostUtils.getIdNum();
costDomain.setCostNo(costNo); costDomain.setCostNo(costNo);
costDomain.setCostForm(costForm); // 付款费用单 1付款 2收款 3借支/借还 costDomain.setCostForm(costForm); // 付款费用单 1付款 2收款 3借支/借还
costDomain.setCostStatus(0); // 0 待提交 1待审核 2待出纳付款 3被驳回 4已支付 5已作废 costDomain.setCostStatus(0); // 0 待提交 1待审核 2待出纳付款 3被驳回 4已支付 5已作废
...@@ -266,7 +266,7 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -266,7 +266,7 @@ public class CostApiServiceImpl implements CostApiService {
@Override @Override
public String pushWageCost(WageCostDto wageCostDto) throws IOException { public String pushWageCost(WageCostDto wageCostDto) throws IOException {
CostDomain costDomain = new CostDomain(); CostDomain costDomain = new CostDomain();
String costNo = CostUtils.getIdNum(costService); String costNo = CostUtils.getIdNum();
costDomain.setCostNo(costNo); costDomain.setCostNo(costNo);
// 付款费用单 1付款 2收款 3借支/借还 // 付款费用单 1付款 2收款 3借支/借还
costDomain.setCostForm(1); costDomain.setCostForm(1);
......
...@@ -3,7 +3,6 @@ package com.blt.other.module.cost.service.impl; ...@@ -3,7 +3,6 @@ package com.blt.other.module.cost.service.impl;
import com.bailuntec.cost.api.dto.CostDto; import com.bailuntec.cost.api.dto.CostDto;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dao.CostListSearchDao; import com.blt.other.module.cost.dao.CostListSearchDao;
import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostListSearchService; import com.blt.other.module.cost.service.CostListSearchService;
import com.blt.other.module.cost.service.CostService; import com.blt.other.module.cost.service.CostService;
...@@ -14,7 +13,6 @@ import com.google.common.collect.Lists; ...@@ -14,7 +13,6 @@ import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -30,41 +28,27 @@ public class CostListSearchServiceImpl implements CostListSearchService { ...@@ -30,41 +28,27 @@ public class CostListSearchServiceImpl implements CostListSearchService {
CostDao costDao; CostDao costDao;
@Override @Override
public CostApiDto.GetByKeyResp searchByKey(String key, int pageNum, int pageSize) { public PageInfo<CostDto> searchByKey(String key, int pageNum, int pageSize) {
CostApiDto.GetByKeyResp resp = new CostApiDto.GetByKeyResp();
PageHelper.startPage(pageNum, pageSize);
List<CostDomain> costDomains = costListSearchDao.selectByKey(Lists.newArrayList(key.split(",")).stream().filter(Objects::nonNull).collect(Collectors.toList()));
List<CostDto> dtos = costDomains.stream().map(CostDomain::castToDto).collect(Collectors.toList());
PageInfo<CostDomain> pageInfo = new PageInfo<>(costDomains); PageHelper.startPage(pageNum, pageSize);
resp.setCosts(dtos); List<CostDto> costDtos = costListSearchDao.selectByKey(Lists.newArrayList(key.split(","))
resp.setPageInfo(pageInfo); .stream()
resp.setSuccess(true); .filter(Objects::nonNull)
return resp; .collect(Collectors.toList()))
.stream()
.map(CostDomain::castToDto)
.collect(Collectors.toList());
return new PageInfo<>(costDtos);
} }
@Override @Override
public CostApiDto.GetByKeyResp searchByKeys(CostListSearchKeysVo searchKeysVo) { public PageInfo<CostDto> searchByKeys(CostListSearchKeysVo searchKeysVo) {
CostApiDto.GetByKeyResp resp = new CostApiDto.GetByKeyResp();
PageHelper.startPage(searchKeysVo.getParams().getPageNum(), searchKeysVo.getParams().getPageSize()); PageHelper.startPage(searchKeysVo.getParams().getPageNum(), searchKeysVo.getParams().getPageSize());
List<CostDomain> domains = costListSearchDao.selectByKeys(searchKeysVo); List<CostDomain> domains = costListSearchDao.selectByKeys(searchKeysVo);
PageInfo<CostDomain> pageInfo = new PageInfo<>(domains);
if (null != searchKeysVo.getParams().getKeys().getLinkCost() && !searchKeysVo.getParams().getKeys().getLinkCost().isEmpty()) {
List<CostDomain> list = new ArrayList<>();
CostDomain supCost = costDao.selectByCostNo(searchKeysVo.getParams().getKeys().getLinkCost()); CostDomain supCost = costDao.selectByCostNo(searchKeysVo.getParams().getKeys().getLinkCost());
list.add(supCost); domains.add(supCost);
if (null != domains && domains.size() >= 1) { return new PageInfo<>(domains.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
list.addAll(domains);
}
resp.setCosts(list.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
} else {
resp.setCosts(domains.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
}
resp.setPageInfo(pageInfo);
resp.setSuccess(true);
return resp;
} }
@Override @Override
......
...@@ -17,7 +17,6 @@ import com.blt.other.module.cost.dao.CostDao; ...@@ -17,7 +17,6 @@ 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.CostTypeKindDao; import com.blt.other.module.cost.dao.CostTypeKindDao;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.dto.CostPageResult;
import com.blt.other.module.cost.model.CostDetailDomain; import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.*; import com.blt.other.module.cost.service.*;
...@@ -94,7 +93,7 @@ public abstract class AbstractCostService implements CostService { ...@@ -94,7 +93,7 @@ public abstract class AbstractCostService implements CostService {
} }
@Override @Override
public CostPageResult getAllCost(Integer pageNum, public PageInfo<CostDto> getAllCost(Integer pageNum,
Integer pageSize, Integer pageSize,
Integer userId, Integer userId,
String projectTypes) { String projectTypes) {
...@@ -104,11 +103,7 @@ public abstract class AbstractCostService implements CostService { ...@@ -104,11 +103,7 @@ public abstract class AbstractCostService implements CostService {
projectTypeList = Lists.newArrayList(projectTypes.split(",")).stream().filter(str -> !StringUtils.isEmpty(str)).collect(Collectors.toList()); projectTypeList = Lists.newArrayList(projectTypes.split(",")).stream().filter(str -> !StringUtils.isEmpty(str)).collect(Collectors.toList());
} }
List<CostDomain> costDomains = costDao.selectAll(userId, projectTypeList); List<CostDomain> costDomains = costDao.selectAll(userId, projectTypeList);
return new PageInfo<>(costDomains.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
CostPageResult result = new CostPageResult();
result.setCosts(costDomains.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
result.setPageInfo(new PageInfo<>(costDomains));
return result;
} }
@Override @Override
......
...@@ -32,7 +32,7 @@ public class UnSubmitState extends CostState { ...@@ -32,7 +32,7 @@ public class UnSubmitState extends CostState {
} }
//更新费用单 //更新费用单
costDomain.setCostStatus(1); costDomain.setCostStatus(CostDomain.STATUS_DEPARTMENT_CHECK);
costDao.updateById(costDomain); costDao.updateById(costDomain);
costLogService.save(costDomain.getCostNo(), costContext.currentUserId, "提交费用单"); costLogService.save(costDomain.getCostNo(), costContext.currentUserId, "提交费用单");
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.bailuntec.common.ListUtil;
import com.bailuntec.cost.api.dto.CostPlanDto; import com.bailuntec.cost.api.dto.CostPlanDto;
import com.blt.other.module.auth.dao.UserDao; import com.blt.other.module.auth.dao.UserDao;
import com.blt.other.module.cost.dao.*; import com.blt.other.module.cost.dao.*;
...@@ -51,20 +52,17 @@ public abstract class AbstractCostPlanService implements CostPlanService { ...@@ -51,20 +52,17 @@ public abstract class AbstractCostPlanService implements CostPlanService {
@Autowired @Autowired
CostTypeKindDao costTypeKindDao; CostTypeKindDao costTypeKindDao;
@Autowired @Autowired
CostService costService;
@Autowired
CostPlanTempService costPlanTempService; CostPlanTempService costPlanTempService;
@Autowired @Autowired
ICostTemplateService costTemplateService; ICostTemplateService costTemplateService;
@Value("${url.api.getExchangeRateApi}") @Value("${url.api.getExchangeRateApi}")
String getExchangeRateApi; String getExchangeRateApi;
@Autowired @Autowired
CostLogService costLogService; CostLogService costLogService;
@Autowired @Autowired
CostDetailDao costDetailDao; CostDetailDao costDetailDao;
/** /**
* <p> * <p>
* 保存填写的财务信息到历史记录 * 保存填写的财务信息到历史记录
...@@ -88,19 +86,25 @@ public abstract class AbstractCostPlanService implements CostPlanService { ...@@ -88,19 +86,25 @@ public abstract class AbstractCostPlanService implements CostPlanService {
protected void completedCostPlan(CostPlanDomain costPlanDomain) { protected void completedCostPlan(CostPlanDomain costPlanDomain) {
CostCompanyDomain companyDomain = costCompanyDao.selectByNo(costPlanDomain.getCompanyNo()); CostCompanyDomain companyDomain = costCompanyDao.selectByNo(costPlanDomain.getCompanyNo());
if (companyDomain != null) {
costPlanDomain.setCompanyName(companyDomain.getCompanyName()); costPlanDomain.setCompanyName(companyDomain.getCompanyName());
costPlanDomain.setCompanyValue(companyDomain.getValue()); costPlanDomain.setCompanyValue(companyDomain.getValue());
}
UserDomain user = userDao.select(costPlanDomain.getCreateUsercode()); UserDomain user = userDao.select(costPlanDomain.getCreateUsercode());
if (user != null) {
costPlanDomain.setCreateUserid(user.getUserid()); costPlanDomain.setCreateUserid(user.getUserid());
costPlanDomain.setCreateUsername(user.getUsername()); costPlanDomain.setCreateUsername(user.getUsername());
costPlanDomain.setCreateTime(new Date()); costPlanDomain.setCreateTime(new Date());
costPlanDomain.setPayCur(costPlanDomain.getCur()); costPlanDomain.setPayCur(costPlanDomain.getCur());
}
if (ListUtil.isNotEmpty(costPlanDomain.getAttach())) {
costPlanDomain.getAttach().forEach(costAttach -> { costPlanDomain.getAttach().forEach(costAttach -> {
CostTemplateBaseCol costTemplateBaseCol = costTemplateBaseColMapper.selectById(costAttach.getCostTemplateBaseColId()); CostTemplateBaseCol costTemplateBaseCol = costTemplateBaseColMapper.selectById(costAttach.getCostTemplateBaseColId());
BeanUtils.copyProperties(costTemplateBaseCol, costAttach, "id"); BeanUtils.copyProperties(costTemplateBaseCol, costAttach, "id");
}); });
}
} }
...@@ -192,10 +196,10 @@ public abstract class AbstractCostPlanService implements CostPlanService { ...@@ -192,10 +196,10 @@ public abstract class AbstractCostPlanService implements CostPlanService {
* @return costNo * @return costNo
*/ */
protected String getCostNo() { protected String getCostNo() {
String costNo = CostUtils.getIdNum(costService); String costNo = CostUtils.getIdNum();
CostDomain costByNo = costDao.selectByCostNo(costNo); CostDomain costByNo = costDao.selectByCostNo(costNo);
while (null != costByNo && null != costByNo.getId()) { while (null != costByNo && null != costByNo.getId()) {
costNo = CostUtils.getIdNum(costService); costNo = CostUtils.getIdNum();
} }
return costNo; return costNo;
} }
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.module.cost.service.CostPlanService; import com.blt.other.module.cost.service.CostPlanService;
...@@ -56,7 +57,8 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme ...@@ -56,7 +57,8 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
planDomain.setKindName(costTypeKindDomain.getKindName()); planDomain.setKindName(costTypeKindDomain.getKindName());
planDomain.setTypeNo(costTypeKindDomain.getTypeNo()); planDomain.setTypeNo(costTypeKindDomain.getTypeNo());
planDomain.setTypeName(costTypeKindDomain.getTypeName()); planDomain.setTypeName(costTypeKindDomain.getTypeName());
costPlanDao.updateByNo(planDomain); costPlanDao.update(planDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, planDomain.getCostPlanNo()));
} }
@Override @Override
...@@ -66,7 +68,8 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme ...@@ -66,7 +68,8 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
throw new BizRuntimeException("只能更新待确认的计划单"); throw new BizRuntimeException("只能更新待确认的计划单");
} }
costPlanDomain.setCostPlanStatus(1); costPlanDomain.setCostPlanStatus(1);
costPlanDao.updateByNo(costPlanDomain); costPlanDao.update(costPlanDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, costPlanDomain.getCostPlanNo()));
CostDomain costDomain = planToCost(costPlanDomain.getCostPlanNo()); CostDomain costDomain = planToCost(costPlanDomain.getCostPlanNo());
String costNo = getCostNo(); String costNo = getCostNo();
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
...@@ -56,7 +57,9 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme ...@@ -56,7 +57,9 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
planDomain.setTypeNo(costTypeKindDomain.getTypeNo()); planDomain.setTypeNo(costTypeKindDomain.getTypeNo());
planDomain.setTypeName(costTypeKindDomain.getTypeName()); planDomain.setTypeName(costTypeKindDomain.getTypeName());
costPlanDao.updateByNo(planDomain); costPlanDao.update(planDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, planDomain.getCostPlanNo()));
} }
@Override @Override
...@@ -68,7 +71,8 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme ...@@ -68,7 +71,8 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
} }
//已确认 //已确认
costPlanDomain.setCostPlanStatus(1); costPlanDomain.setCostPlanStatus(1);
costPlanDao.updateByNo(costPlanDomain); costPlanDao.update(costPlanDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, costPlanDomain.getCostPlanNo()));
// 借还单确认时,根据借支单金额、冲销金额、余额拆单 // 借还单确认时,根据借支单金额、冲销金额、余额拆单
//关联的借支单 //关联的借支单
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.blt.other.module.cost.model.CostDetailDomain; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostPlanService; import com.blt.other.module.cost.service.CostPlanService;
import com.blt.other.module.cost.utils.CostUtils; import com.blt.other.module.cost.utils.CostUtils;
import com.blt.other.module.database.model.*; import com.blt.other.module.database.model.CostPlanDomain;
import com.blt.other.module.database.model.CostPlanTempDomain;
import com.blt.other.module.database.model.CostTypeDomain;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -48,7 +51,8 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -48,7 +51,8 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
List<CostPlanTempDomain> list = costPlanTempDao.selectListByPlanNo(planDomain.getCostPlanNo()); List<CostPlanTempDomain> list = costPlanTempDao.selectListByPlanNo(planDomain.getCostPlanNo());
BigDecimal planAmount = list.stream().map(CostPlanTempDomain::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal planAmount = list.stream().map(CostPlanTempDomain::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
planDomain.setPlanAmount(planAmount); planDomain.setPlanAmount(planAmount);
costPlanDao.updateByNo(planDomain); costPlanDao.update(planDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, planDomain.getCostPlanNo()));
} }
@Override @Override
...@@ -59,7 +63,8 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -59,7 +63,8 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
throw new BizRuntimeException("只能更新待确认的计划单"); throw new BizRuntimeException("只能更新待确认的计划单");
} }
costPlanDomain.setCostPlanStatus(1); costPlanDomain.setCostPlanStatus(1);
costPlanDao.updateByNo(costPlanDomain); costPlanDao.update(costPlanDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, costPlanDomain.getCostPlanNo()));
List<CostPlanTempDomain> costPlanTempDomains = costPlanTempDao.selectListByPlanNo(costPlanNo); List<CostPlanTempDomain> costPlanTempDomains = costPlanTempDao.selectListByPlanNo(costPlanNo);
...@@ -84,14 +89,14 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -84,14 +89,14 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
detailMap.forEach((typeNo, costDetailDomains) -> { detailMap.forEach((typeNo, costDetailDomains) -> {
// 生成付款费用单 // 生成付款费用单
CostDomain costDomain = this.planToCost(costPlanNo); CostDomain costDomain = this.planToCost(costPlanNo);
String costNo = CostUtils.getIdNum(costService); String costNo = CostUtils.getIdNum();
// 差额单(冲销借支单自动生成的补差额的付款费用)的单号以 “S” 打头 // 差额单(冲销借支单自动生成的补差额的付款费用)的单号以 “S” 打头
if (costPlanNo.startsWith("S")) { if (costPlanNo.startsWith("S")) {
costNo = "S" + costNo; costNo = "S" + costNo;
} }
CostDomain costByNo = costDao.selectByCostNo(costNo); CostDomain costByNo = costDao.selectByCostNo(costNo);
while (null != costByNo && null != costByNo.getId()) { while (null != costByNo && null != costByNo.getId()) {
costNo = CostUtils.getIdNum(costService); costNo = CostUtils.getIdNum();
if (costPlanNo.startsWith("S")) { if (costPlanNo.startsWith("S")) {
costNo = "S" + costNo; costNo = "S" + costNo;
} }
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.module.cost.service.CostPlanService;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostPlanService;
import com.blt.other.module.database.model.CostPlanDomain; import com.blt.other.module.database.model.CostPlanDomain;
import com.blt.other.module.database.model.CostTypeKindDomain; import com.blt.other.module.database.model.CostTypeKindDomain;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -45,11 +46,14 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple ...@@ -45,11 +46,14 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple
CostTypeKindDomain costTypeKindDomain = costTypeKindDao.selectByKindNo(planDomain.getKindNo()); CostTypeKindDomain costTypeKindDomain = costTypeKindDao.selectByKindNo(planDomain.getKindNo());
if (costTypeKindDomain != null) {
planDomain.setKindName(costTypeKindDomain.getKindName()); planDomain.setKindName(costTypeKindDomain.getKindName());
planDomain.setTypeNo(costTypeKindDomain.getTypeNo()); planDomain.setTypeNo(costTypeKindDomain.getTypeNo());
planDomain.setTypeName(costTypeKindDomain.getTypeName()); planDomain.setTypeName(costTypeKindDomain.getTypeName());
}
costPlanDao.updateByNo(planDomain); costPlanDao.update(planDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, planDomain.getCostPlanNo()));
} }
@Override @Override
...@@ -59,7 +63,8 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple ...@@ -59,7 +63,8 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple
throw new BizRuntimeException("只能更新待确认的计划单"); throw new BizRuntimeException("只能更新待确认的计划单");
} }
costPlanDomain.setCostPlanStatus(1); costPlanDomain.setCostPlanStatus(1);
costPlanDao.updateByNo(costPlanDomain); costPlanDao.update(costPlanDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, costPlanDomain.getCostPlanNo()));
CostDomain costDomain = planToCost(costPlanNo); CostDomain costDomain = planToCost(costPlanNo);
String costNo = getCostNo(); String costNo = getCostNo();
......
package com.blt.other.module.cost.service.impl.costplan; package com.blt.other.module.cost.service.impl.costplan;
import com.bailuntec.cost.api.dto.CostPlanTempDto; import com.bailuntec.cost.api.dto.CostPlanTempDto;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.blt.other.module.cost.dao.CostPlanDao; import com.blt.other.module.cost.dao.CostPlanDao;
...@@ -88,7 +89,8 @@ public class CostPlanTempServiceImpl implements CostPlanTempService { ...@@ -88,7 +89,8 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
CostPlanDomain costPlanDomain = costPlanDao.selectByNo(costPlanTempDomain.getCostPlanNo()); CostPlanDomain costPlanDomain = costPlanDao.selectByNo(costPlanTempDomain.getCostPlanNo());
if (costPlanDomain != null) { if (costPlanDomain != null) {
costPlanDomain.setPlanAmount(costPlanDomain.getPlanAmount().add(costPlanTempDomain.getAmount())); costPlanDomain.setPlanAmount(costPlanDomain.getPlanAmount().add(costPlanTempDomain.getAmount()));
costPlanDao.updateByNo(costPlanDomain); costPlanDao.update(costPlanDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, costPlanDomain.getCostPlanNo()));
} }
CostPlanTempApiDto.AddItemResp resp = new CostPlanTempApiDto.AddItemResp(); CostPlanTempApiDto.AddItemResp resp = new CostPlanTempApiDto.AddItemResp();
...@@ -132,7 +134,8 @@ public class CostPlanTempServiceImpl implements CostPlanTempService { ...@@ -132,7 +134,8 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
if (costPlanDomain != null) { if (costPlanDomain != null) {
costPlanDomain.setPlanAmount(costPlanDomain.getPlanAmount().subtract(costPlanTempDomain.getAmount())); costPlanDomain.setPlanAmount(costPlanDomain.getPlanAmount().subtract(costPlanTempDomain.getAmount()));
costPlanDao.updateByNo(costPlanDomain); costPlanDao.update(costPlanDomain, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, costPlanDomain.getCostPlanNo()));
return costPlanDomain.getPlanAmount(); return costPlanDomain.getPlanAmount();
} }
return BigDecimal.ZERO; return BigDecimal.ZERO;
...@@ -184,7 +187,8 @@ public class CostPlanTempServiceImpl implements CostPlanTempService { ...@@ -184,7 +187,8 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
if (1 == plan.getCostForm() && (null != plan.getIsLend() && 2 == plan.getIsLend())) { if (1 == plan.getCostForm() && (null != plan.getIsLend() && 2 == plan.getIsLend())) {
plan.setPayPlanAmount(newAmount.divide(plan.getPayCur(), 4)); plan.setPayPlanAmount(newAmount.divide(plan.getPayCur(), 4));
} }
costPlanDao.updateByNo(plan); costPlanDao.update(plan, new LambdaQueryWrapper<CostPlanDomain>()
.eq(CostPlanDomain::getCostPlanNo, plan.getCostPlanNo()));
} }
return costPlanTempDomain; return costPlanTempDomain;
} }
......
...@@ -4,6 +4,7 @@ import com.bailuntec.common.SpringContextUtil; ...@@ -4,6 +4,7 @@ import com.bailuntec.common.SpringContextUtil;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostService; import com.blt.other.module.cost.service.CostService;
import com.blt.other.module.cost.service.impl.cost.CostServiceFactory;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -14,7 +15,8 @@ import java.text.NumberFormat; ...@@ -14,7 +15,8 @@ import java.text.NumberFormat;
*/ */
public class CostUtils { public class CostUtils {
public static String getIdNum(CostService costService) { public static String getIdNum() {
NumberFormat nf = NumberFormat.getInstance(); NumberFormat nf = NumberFormat.getInstance();
nf.setGroupingUsed(false); nf.setGroupingUsed(false);
nf.setMaximumIntegerDigits(6); nf.setMaximumIntegerDigits(6);
......
...@@ -409,7 +409,7 @@ public class BuyServiceImpl implements BuyService { ...@@ -409,7 +409,7 @@ public class BuyServiceImpl implements BuyService {
CostDomain backCost = new CostDomain(); CostDomain backCost = new CostDomain();
BeanUtils.copyProperties(linkLendCost, backCost); BeanUtils.copyProperties(linkLendCost, backCost);
backCost.setCostPlanNo(null); backCost.setCostPlanNo(null);
backCost.setCostNo(CostUtils.getIdNum(costService)); backCost.setCostNo(CostUtils.getIdNum());
backCost.setCostReason("采购单【" + buyListDto.getBuyno() + "】冲销借支单【" + linkLendCost.getCostNo() + "】"); backCost.setCostReason("采购单【" + buyListDto.getBuyno() + "】冲销借支单【" + linkLendCost.getCostNo() + "】");
backCost.setCostRemark("采购单【" + buyListDto.getBuyno() + "】冲销借支单【" + linkLendCost.getCostNo() + "】,财务审核采购单通过后由系统自动生成本借还单"); backCost.setCostRemark("采购单【" + buyListDto.getBuyno() + "】冲销借支单【" + linkLendCost.getCostNo() + "】,财务审核采购单通过后由系统自动生成本借还单");
backCost.setCreateTime(new Date()); backCost.setCreateTime(new Date());
......
...@@ -13,55 +13,6 @@ ...@@ -13,55 +13,6 @@
WHERE cost_plan_no = #{costPlanNo} WHERE cost_plan_no = #{costPlanNo}
</select> </select>
<update id="updateByNo" parameterType="com.blt.other.module.cost.model.CostDomain">
UPDATE
cost_plan
<set>
<if test=" companyNo!=null">company_no=#{companyNo},</if>
<if test=" companyName!=null">company_name=#{companyName},</if>
<if test=" typeNo!=null">type_no=#{typeNo},</if>
<if test=" typeName!=null">type_name=#{typeName},</if>
<if test=" kindNo!=null">kind_no=#{kindNo},</if>
<if test=" kindName!=null">kind_name=#{kindName},</if>
<if test=" createUserid!=null">create_userid=#{createUserid},</if>
<if test=" createUsercode!=null">create_usercode=#{createUsercode},</if>
<if test=" createUsername!=null">create_username=#{createUsername},</if>
<if test=" costRemark!=null">cost_remark=#{costRemark},</if>
<if test=" createTime!=null">create_time=#{createTime},</if>
<if test=" sonCostNo!=null">son_cost_no=#{sonCostNo},</if>
<if test=" supCostNo!=null">sup_cost_no=#{supCostNo},</if>
<if test=" costPlanStatus!=null">cost_plan_status=#{costPlanStatus},</if>
<if test=" filePath!=null">file_path=#{filePath},</if>
<if test=" morFilePath!=null">mor_file_path=#{morFilePath},</if>
<if test=" planAmount!=null">plan_amount=#{planAmount},</if>
<if test=" subLogisticsSupplierId!=null">sub_logistics_supplier_id=#{subLogisticsSupplierId},</if>
<if test=" logisticsSupplierId!=null">logistics_supplier_id=#{logisticsSupplierId},</if>
<if test=" bankName!=null">bank_name=#{bankName},</if>
<if test=" bankCard!=null">bank_card=#{bankCard},</if>
<if test=" bankCardUser!=null">bank_card_user=#{bankCardUser},</if>
<if test=" morRemark!=null">mor_remark=#{morRemark},</if>
<if test=" costForm!=null">cost_form=#{costForm},</if>
<if test=" costReason!=null">cost_reason=#{costReason},</if>
<if test=" isLend!=null">is_lend=#{isLend},</if>
<if test=" hadPay!=null">had_pay=#{hadPay},</if>
<if test=" lendStatus!=null">lend_status=#{lendStatus},</if>
<if test=" compensate!=null">compensate=#{compensate},</if>
<if test=" counteract!=null">counteract=#{counteract},</if>
<if test=" lendBalance!=null">lend_balance=#{lendBalance},</if>
<if test=" rejectReason!=null">reject_reason=#{rejectReason},</if>
<if test=" dic!=null">dic=#{dic},</if>
<if test=" payCounteract!=null">pay_counteract=#{payCounteract},</if>
<if test=" payLendBalance!=null">pay_lend_balance=#{payLendBalance},</if>
<if test=" payPlanAmount!=null">pay_plan_amount=#{payPlanAmount},</if>
<if test=" payDic!=null">pay_dic=#{payDic},</if>
<if test=" payCur!=null">pay_cur=#{payCur},</if>
<if test=" isTax!=null">is_tax=#{isTax},</if>
<if test=" bankCompany!=null">bank_company=#{bankCompany},</if>
<if test=" companyValue!=null">company_value=#{companyValue}</if>
</set>
WHERE
cost_plan_no = #{costPlanNo}
</update>
<delete id="deleteByNo"> <delete id="deleteByNo">
DELETE DELETE
......
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