Commit 2b302fa7 by huluobin

api

parent a5fdbb78
......@@ -81,6 +81,16 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
......
......@@ -6,58 +6,32 @@ import com.bailuntec.cost.api.dto.LogisticsCostDto;
import com.bailuntec.cost.api.dto.ManageCostDto;
import com.bailuntec.cost.api.dto.WageCostDto;
import com.bailuntec.cost.api.response.CostResult;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@FeignClient(name = "bailuntec-cost-api", url = "")
@FeignClient(name = "bailuntec-cost-api", url = "http://api.fee.bailuntec.com/fee/api/cost/api")
public interface CostApi {
/**
* <p>
* 推送工资单到财务审核
* </p>
*
* @param wageCostDto 工资单入参
* @return 费用单No
*/
@ApiOperation("接受工资单,自动生成付款费用单到财务审核")
@PostMapping("/pushWageCost")
CostResult<Void> pushWageCost(@RequestBody WageCostDto wageCostDto);
/**
* 接收物流单,自动生成付款费用单到财务审核
*
* @return 费用单No
*/
@ApiOperation("接收物流单,自动生成付款费用单到财务审核")
@PostMapping("/pushLogisticsCost")
CostResult<Void> pushLogisticsCost(@RequestBody LogisticsCostDto logisticsCostDto);
/**
* 吴通
* 接收物流单,自动生成收款费用单到财务审核
*
* @return costNo
*/
@ApiOperation("吴通接收物流单,自动生成收款费用单到财务审核")
@PostMapping("/pushLogisticsReceipt")
CostResult<Void> pushLogisticsReceipt(@RequestBody LogisticsCostDto logisticsCostDto);
/**
* 获取所有费用单和采购单
*
* @param startDateStr date
* @param endDateStr date
* @param feeSuperType 大类
* @param feeSubType 小类
* @param companyValue 公司
* @param companyName 公司
* @param departmentName 部门
* @param createUserId 创建用户id
* @param payUserId 支付用户id
* @return 所有费用单和采购单
*/
@ApiOperation("获取所有费用单和采购单")
@GetMapping("/manageCostList")
CostResult<List<ManageCostDto>> manageCostList(@RequestParam(name = "startDate", required = false) String startDateStr,
@RequestParam(name = "endDate", required = false) String endDateStr,
......@@ -69,20 +43,7 @@ public interface CostApi {
@RequestParam(name = "createUserId", required = false) Integer createUserId,
@RequestParam(name = "payUserId", required = false) Integer payUserId);
/**
* 获取所有物流的费用单
*
* @param startDateStr date
* @param endDateStr date
* @param feeSuperType 大类
* @param feeSubType 小类
* @param companyValue 公司
* @param companyName 公司
* @param departmentName 部门
* @param createUserId 创建用户id
* @param payUserId 支付用户id
* @return 所有费用单和采购单
*/
@ApiOperation("查询所有的物流费用单和采购单")
@GetMapping("/logisticsCostList")
CostResult<List<ManageCostDto>> logisticsCostList(@RequestParam(name = "startDate", required = false) String startDateStr,
@RequestParam(name = "endDate", required = false) String endDateStr,
......@@ -94,20 +55,24 @@ public interface CostApi {
@RequestParam(name = "createUserId", required = false) Integer createUserId,
@RequestParam(name = "payUserId", required = false) Integer payUserId);
@ApiOperation("获取资产负债表相关费用单")
@GetMapping("/balanceSheetCost")
CostResult<List<CostDto>> balanceSheetCostList(@RequestParam(name = "startDate") String startDateStr,
@RequestParam(name = "endDate") String endDateStr);
@GetMapping("/noPayCost")
@ApiOperation("查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单")
CostResult<List<CostDto>> getNoPayCost(@RequestParam(name = "costNoList") List<String> costNoList);
/**
* 吴通新增
* 根据费用单号获取费用单大类
*
* @param costNo 费用单号
* @return 费用大类
*/
@ApiOperation("吴通新增 根据费用单号获取费用单大类")
@GetMapping("/type/{costNo}")
CostResult<String> getTypeName(@PathVariable("costNo") String costNo);
@ApiOperation("获取费用系统列表")
@GetMapping({"/getCostList"})
CostResult<PageInfo<CostDto>> getCostList(@RequestParam String startDate,
@RequestParam String endDate,
@RequestParam(name = "pageIndex") Integer pageIndex,
@RequestParam(name = "pageSize") Integer pageSize);
}
......@@ -151,7 +151,6 @@
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.spring.boot.starter}</version>
<exclusions>
<exclusion>
<groupId>org.mybatis</groupId>
......
......@@ -8,6 +8,9 @@ import com.bailuntec.cost.api.dto.WageCostDto;
import com.bailuntec.cost.api.response.CostResult;
import com.blt.other.module.cost.service.CostApiService;
import com.blt.other.module.database.model.CostDomain;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,14 +33,8 @@ public class CostApiController implements CostApi {
private static Logger logger = LoggerFactory.getLogger(CostApiController.class);
/**
* <p>
* 接受工资单,自动生成付款费用单到财务审核
* </p>
*
* @param wageCostDto 工资单入参
* @return 费用单No
*/
@Override
@ApiOperation("接受工资单,自动生成付款费用单到财务审核")
@PostMapping("/pushWageCost")
public CostResult<Void> pushWageCost(@RequestBody WageCostDto wageCostDto) {
logger.info("接收推送而来的工资单信息:" + wageCostDto);
......@@ -50,13 +47,8 @@ public class CostApiController implements CostApi {
}
}
/**
* <p>
* 接收物流单,自动生成付款费用单到财务审核
* </p>
*
* @return 费用单No
*/
@ApiOperation("接收物流单,自动生成付款费用单到财务审核")
@Override
@PostMapping("/pushLogisticsCost")
public CostResult<Void> pushLogisticsCost(@RequestBody LogisticsCostDto logisticsCostDto) {
logger.warn("接收推送而来的物流单信息:" + logisticsCostDto);
......@@ -70,13 +62,8 @@ public class CostApiController implements CostApi {
}
}
/**
* <p>
* 吴通接收物流单,自动生成收款费用单到财务审核
* </p>
*
* @return 费用单No
*/
@ApiOperation("吴通接收物流单,自动生成收款费用单到财务审核")
@Override
@PostMapping("/pushLogisticsReceipt")
public CostResult<Void> pushLogisticsReceipt(@RequestBody LogisticsCostDto logisticsCostDto) {
logger.info("接收推送而来的物流单信息:" + logisticsCostDto);
......@@ -89,22 +76,9 @@ public class CostApiController implements CostApi {
}
}
/**
* <p>
* 查询所有的费用单和采购单
* </p>
*
* @param startDateStr 开始时间
* @param endDateStr 开始时间
* @param feeSuperType 大类
* @param feeSubType 小类
* @param companyValue 公司主体value
* @param companyName 主体名称
* @param departmentName 部门
* @param createUserId 创建用户id
* @param payUserId 支付用户id
* @return 单据
*/
@ApiOperation("查询所有的费用单和采购单")
@Override
@GetMapping("/manageCostList")
public CostResult<List<ManageCostDto>> manageCostList(@RequestParam(name = "startDate", required = false) String startDateStr,
@RequestParam(name = "endDate", required = false) String endDateStr,
......@@ -127,22 +101,8 @@ public class CostApiController implements CostApi {
}
}
/**
* <p>
* 查询所有的物流费用单和采购单
* </p>
*
* @param startDateStr 开始时间
* @param endDateStr 开始时间
* @param feeSuperType 大类
* @param feeSubType 小类
* @param companyValue 公司主体value
* @param companyName 主体名称
* @param departmentName 部门
* @param createUserId 创建用户id
* @param payUserId 支付用户id
* @return 单据
*/
@ApiOperation("查询所有的物流费用单和采购单")
@Override
@GetMapping("/logisticsCostList")
public CostResult<List<ManageCostDto>> logisticsCostList(@RequestParam(name = "startDate", required = false) String startDateStr,
@RequestParam(name = "endDate", required = false) String endDateStr,
......@@ -166,16 +126,22 @@ public class CostApiController implements CostApi {
}
/**
* <p>
* 获取资产负债表相关费用单
* </p>
*
* @param startDateStr 开始时间
* @param endDateStr 结束时间
* @return 资产负债表相关费用单
*/
@ApiOperation("根据最后更新时间查询费用单")
@Override
@GetMapping({"/getCostList"})
public CostResult<PageInfo<CostDto>> getCostList(@RequestParam String startDate,
@RequestParam String endDate,
@RequestParam(name = "pageIndex") Integer pageIndex,
@RequestParam(name = "pageSize") Integer pageSize) {
PageHelper.startPage(pageIndex, pageSize);
List<CostDto> costDtoList = this.costApiService.getCostList(startDate, endDate);
PageInfo<CostDto> pageInfo = new PageInfo<>(costDtoList);
return CostResult.success(pageInfo);
}
@ApiOperation("获取资产负债表相关费用单")
@Override
@GetMapping("/balanceSheetCost")
public CostResult<List<CostDto>> balanceSheetCostList(@RequestParam(name = "startDate") String startDateStr,
@RequestParam(name = "endDate") String endDateStr) {
......@@ -193,14 +159,9 @@ public class CostApiController implements CostApi {
}
}
/**
* <p>
* 查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单
* </p>
*
* @param costNoList 费用单号
* @return 费用单
*/
@Override
@ApiOperation("查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单")
@GetMapping("/noPayCost")
public CostResult<List<CostDto>> getNoPayCost(@RequestParam(name = "costNoList") List<String> costNoList) {
if (costNoList != null && costNoList.size() > 0) {
......@@ -211,13 +172,9 @@ public class CostApiController implements CostApi {
}
}
/**
* 吴通新增
* 根据费用单号获取费用单大类
*
* @param costNo 费用单号
* @return 费用单大类
*/
@Override
@ApiOperation("吴通新增 根据费用单号获取费用单大类")
@GetMapping("/type/{costNo}")
public CostResult<String> getTypeName(@PathVariable("costNo") String costNo) {
// 获取费用单详细信息
......
......@@ -90,22 +90,43 @@ public interface CostDao {
/**
* 查询管理成本费用列表,付款单+借还单
*
* @param startDate
* @param endDate
* @param feeSuperType
* @param feeSubType
* @param companyValueList
* @param companyName
* @param departmentName
* @param createUserId
* @param payUserId
* @param startDate startDate
* @param endDate endDate
* @param feeSuperType feeSuperType
* @param feeSubType feeSubType
* @param companyValueList companyValueList
* @param companyName companyName
* @param departmentName departmentName
* @param createUserId createUserId
* @param payUserId payUserId
* @return
*/
List<ManageCostDto> selectManageCost(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("feeSuperType") String feeSuperType,
@Param("feeSubType") String feeSubType, @Param("companyValueList") List<Integer> companyValueList,
@Param("companyName") String companyName, @Param("departmentName") String departmentName,
@Param("createUserId") Integer createUserId, @Param("payUserId") Integer payUserId);
List<ManageCostDto> selectManageCost(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("feeSuperType") String feeSuperType,
@Param("feeSubType") String feeSubType,
@Param("companyValueList") List<Integer> companyValueList,
@Param("companyName") String companyName,
@Param("departmentName") String departmentName,
@Param("createUserId") Integer createUserId,
@Param("payUserId") Integer payUserId);
/**
* <p>
* 查询所有的物流费用单和采购单
* </p>
*
* @param startDate startDate
* @param endDate endDate
* @param feeSuperType feeSuperType
* @param feeSubType feeSubType
* @param companyValueList companyValueList
* @param companyName companyName
* @param departmentName departmentName
* @param createUserId createUserId
* @param payUserId payUserId
* @return
*/
List<ManageCostDto> getLogisticsCostList(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("feeSuperType") String feeSuperType,
......@@ -142,4 +163,6 @@ public interface CostDao {
List<String> listCostNoAll(CostExportVo costExportVo);
Integer updateCashierAnnex(@Param("costNo") String costNo, @Param("filePath") String filePath, @Param("downloadUrl") String downloadUrl);
List<CostDto> getCostList(@Param("startDate") String startDate, @Param("endDate") String endDate);
}
package com.blt.other.module.cost.service;
import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.dto.LogisticsCostDto;
import com.bailuntec.cost.api.dto.ManageCostDto;
import com.bailuntec.cost.api.dto.WageCostDto;
......@@ -88,4 +89,15 @@ public interface CostApiService {
* @return 费用单costNo
*/
String pushWageCost(WageCostDto wageCostDto) throws IOException;
/**
* <p>
* 根据最后更新时间获取费用单
* </p>
*
* @param startDate 开始时间
* @param endDate 结束时间
* @return 费用单list
*/
List<CostDto> getCostList(String startDate, String endDate);
}
......@@ -352,4 +352,9 @@ public class CostApiServiceImpl implements CostApiService {
return costNo;
}
@Override
public List<CostDto> getCostList(String startDate, String endDate) {
return this.costDao.getCostList(startDate, endDate);
}
}
......@@ -342,8 +342,8 @@
FROM user u, cost c, cost_detail d, type_relation t
WHERE c.create_userid = u.userid AND c.cost_no = d.cost_no AND t.fee_type = c.type_name AND c.cost_form = 1 AND
c.cost_status = 4
AND c.logistics_supplier_id is null AND c.company_value in
(1,3,5,7,8,11,46,48,50,53,59,60,61,66,69,72,67,58,54,74,46) AND d.kind_name not in ('百伦咨询服务费')
AND c.logistics_supplier_id is null AND c.company_value in (1,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND
d.kind_name not in ('百伦咨询服务费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND d.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
......@@ -379,13 +379,11 @@
<if test="companyValue != null and companyValue != 0">#{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c1.company_name = #{companyName}</if>
<if test="createUserId != null and createUserId != ''">AND c1.create_userid = #{createUserId}</if>
<if test="payUserId != null and payUserId != ''">AND c1.pay_user_id = #{payUserId}</if>
<if test="startDate != null">AND c1.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c1.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form
manageCostType,u.departmentname1 departmentName,
......@@ -394,8 +392,7 @@
-c1.amount * c1.to_rmb_rate amountRmb, 0 as costId1, c1.id as costId
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND c1.company_value in (1,3,5,7,8,11,46,48,50,53,59,60,61,66,69,72,67,58,54,74,46) AND c1.kind_name not in
('百伦咨询服务费')
AND c1.company_value in (1,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND c1.kind_name not in ('百伦咨询服务费')
AND exists (SELECT 1 FROM cost c2 WHERE c1.company_value = c2.company_value AND c1.type_name = c2.type_name
AND c2.create_userid = u.userid AND t.fee_type = c2.type_name AND c2.cost_form = 1 AND c2.cost_status = 4
AND c2.logistics_supplier_id is null)
......@@ -422,8 +419,7 @@
FROM user u, cost c, type_relation t
WHERE c.create_userid = u.userid AND t.fee_type = c.type_name AND c.cost_form = 3 AND c.is_lend = 2 AND
c.cost_status = 4
AND c.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69,72,67,58,54,74,46) AND c.kind_name not in
('百伦咨询服务费')
AND c.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND c.kind_name not in ('百伦咨询服务费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND c.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
......@@ -444,8 +440,7 @@
b.company_value companyValue,b.company companyName,b.sku_type_name feeSuperType,b.sku_type_name feeSubType,
b.amount amount,'CNY',b.amount amountRmb, 0 as costId1, b.id as costId
FROM buy b
WHERE b.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69,72,67,58,54,74,46) AND b.sku_type_name in
('固定资产','低值易耗品')
WHERE b.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND b.sku_type_name in ('固定资产','低值易耗品')
and b.buystatus <![CDATA[>]]> 3 and b.buystatus <![CDATA[<]]> 7 and b.buy_type <![CDATA[<]]> 3
<if test="feeSuperType != null and feeSuperType != ''">AND b.sku_type_name = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND b.sku_type_name = #{feeSubType}</if>
......@@ -463,12 +458,13 @@
</select>
<!--查询所有的物流费用单和采购单-->
<select id="getLogisticsCostList" resultType="com.bailuntec.cost.api.dto.ManageCostDto">
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,d.kind_name
feeSubType,d.amount amount,c.dic currency,
d.amount * c.to_rmb_rate amountRmb
d.amount * c.to_rmb_rate amountRmb, d.id as costId1, c.id as costId
FROM user u, cost c, cost_detail d, type_relation t
WHERE c.create_userid = u.userid AND c.cost_no = d.cost_no AND t.fee_type = c.type_name AND c.cost_form = 1 AND
c.cost_status = 4
......@@ -480,18 +476,18 @@
manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name
feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount * c1.to_rmb_rate amountRmb
-c1.amount * c1.to_rmb_rate amountRmb, 0 as costId1, c1.id as costId
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND d.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
AND c1.kind_name = '物流费'
<if test="startDate != null">AND c1.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c1.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c.cost_no no,c.bank_company receiveUnit,c.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,c.kind_name
feeSubType,c.amount amount,c.dic currency,
c.amount * c.to_rmb_rate amountRmb
c.amount * c.to_rmb_rate amountRmb, 0 as costId1, c.id as costId
FROM user u, cost c, type_relation t
WHERE c.create_userid = u.userid AND t.fee_type = c.type_name AND c.cost_form = 3 AND c.is_lend = 2 AND
c.cost_status = 4
......@@ -502,11 +498,13 @@
SELECT b.buyno no,b.suppliername receiveUnit,b.note reason,b.pay_time payTime,0 as
manageCostType,b.departmentname departmentName,
b.company_value companyValue,b.company companyName,b.sku_type_name feeSuperType,b.sku_type_name feeSubType,
b.amount amount,'CNY',b.amount amountRmb FROM buy b
b.amount amount,'CNY',b.amount amountRmb, 0 as costId1, 0 as costId
FROM buy b
WHERE b.sku_type_name = '物流费'
and b.buystatus <![CDATA[>]]> 3 and b.buystatus <![CDATA[<]]> 7 and b.buy_type <![CDATA[<]]> 3
<if test="startDate != null">AND b.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select>
<!--
......@@ -633,7 +631,13 @@
OR
company_name LIKE CONCAT('%',#{params.key},'%'))
</if>
</select>
<select id="getCostList" resultType="com.bailuntec.cost.api.dto.CostDto">
select *
from cost
where last_modify_date &gt;= #{startDate}
and last_modify_date &lt;= #{endDate}
</select>
<update id="updateCashierAnnex">
......
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