Commit 9cfb6558 by huluobin

api

parent a4b0c516
package com.bailuntec.cost.api;
import com.bailuntec.cost.api.domain.BuyDomain;
import com.bailuntec.cost.api.response.CostResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.text.ParseException;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/11/3 10:39 上午
*/
@FeignClient(name = "bailuntec-cost-api", url = "http://api.fee.bailuntec.com/purchase/other/buy/api")
public interface BuyApi {
/**
* 获取资产负债表相关采购单
*
* @param startDateStr yyyy-MM-dd
* @param endDateStr yyyy-MM-dd
* @return 资产负债表相关采购单
* @throws ParseException ex
*/
@GetMapping("/balanceSheetBuy")
CostResult<List<BuyDomain>> balanceSheetBuyList(@RequestParam(name = "startDate") String startDateStr,
@RequestParam(name = "endDate") String endDateStr) throws ParseException;
}
package com.blt.other.module.database.model; package com.bailuntec.cost.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
......
package com.blt.other.common.util; package com.blt.other.common.util;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.purchasing.service.BuyService; import com.blt.other.module.purchasing.service.BuyService;
import java.text.NumberFormat; import java.text.NumberFormat;
......
package com.blt.other.module.entrepot.service; package com.blt.other.module.entrepot.service;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.database.model.InventoryLogDomain; import com.blt.other.module.database.model.InventoryLogDomain;
import com.blt.other.module.entrepot.dto.InventoryLogDto; import com.blt.other.module.entrepot.dto.InventoryLogDto;
......
package com.blt.other.module.entrepot.service; package com.blt.other.module.entrepot.service;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.database.model.InventoryDomain; import com.blt.other.module.database.model.InventoryDomain;
import java.util.Map; import java.util.Map;
......
package com.blt.other.module.entrepot.service.impl; package com.blt.other.module.entrepot.service.impl;
import com.blt.other.module.database.mapper.StatusMapper; import com.blt.other.module.database.mapper.StatusMapper;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.database.model.InventoryDomain; import com.blt.other.module.database.model.InventoryDomain;
import com.blt.other.module.database.model.InventoryLogDomain; import com.blt.other.module.database.model.InventoryLogDomain;
import com.blt.other.module.entrepot.dao.InventoryDao; import com.blt.other.module.entrepot.dao.InventoryDao;
......
package com.blt.other.module.entrepot.service.impl; package com.blt.other.module.entrepot.service.impl;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.database.model.InventoryDomain; import com.blt.other.module.database.model.InventoryDomain;
import com.blt.other.module.database.model.SysProductDomain; import com.blt.other.module.database.model.SysProductDomain;
import com.blt.other.module.entrepot.dao.InventoryDao; import com.blt.other.module.entrepot.dao.InventoryDao;
......
package com.blt.other.module.entrepot.service.impl; package com.blt.other.module.entrepot.service.impl;
import com.blt.other.module.database.mapper.StatusMapper; import com.blt.other.module.database.mapper.StatusMapper;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.database.model.StorageDomain; import com.blt.other.module.database.model.StorageDomain;
import com.blt.other.module.entrepot.dao.StorageDao; import com.blt.other.module.entrepot.dao.StorageDao;
import com.blt.other.module.entrepot.dto.StorageDto; import com.blt.other.module.entrepot.dto.StorageDto;
......
package com.blt.other.module.purchasing.controller; package com.blt.other.module.purchasing.controller;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.BuyApi;
import com.bailuntec.cost.api.domain.BuyDomain;
import com.bailuntec.cost.api.response.CostResult;
import com.blt.other.module.purchasing.service.BuyApiService; import com.blt.other.module.purchasing.service.BuyApiService;
import io.swagger.annotations.ApiOperation;
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.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("/buy/api") @RequestMapping("/buy/api")
public class BuyApiController { public class BuyApiController implements BuyApi {
@Autowired @Autowired
private BuyApiService buyApiService; private BuyApiService buyApiService;
private static Logger logger = LoggerFactory.getLogger(BuyApiController.class); private static Logger logger = LoggerFactory.getLogger(BuyApiController.class);
@ApiOperation("获取资产负债表相关采购单")
@GetMapping("/balanceSheetBuy") @GetMapping("/balanceSheetBuy")
public Map<String, Object> balanceSheetBuyList(@RequestParam(name = "startDate") String startDateStr, public CostResult<List<BuyDomain>> balanceSheetBuyList(@RequestParam(name = "startDate") String startDateStr,
@RequestParam(name = "endDate") String endDateStr){ @RequestParam(name = "endDate") String endDateStr) throws ParseException {
logger.warn("获取资产负债表相关采购单"); logger.warn("获取资产负债表相关采购单");
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date startDate = sdf.parse(startDateStr);
Date startDate = sdf.parse(startDateStr); Date endDate = sdf.parse(endDateStr);
Date endDate = sdf.parse(endDateStr); List<BuyDomain> balanceSheetBuyList = buyApiService.getBalanceSheetBuy(startDate, endDate);
List<BuyDomain> balanceSheetBuyList = buyApiService.getBalanceSheetBuy(startDate, endDate); return CostResult.success(balanceSheetBuyList);
result.put("success", true);
result.put("data", balanceSheetBuyList);
} catch (ParseException e){
e.printStackTrace();
result.put("success", false);
}
return result;
} }
} }
package com.blt.other.module.purchasing.controller; package com.blt.other.module.purchasing.controller;
import com.blt.other.common.util.AxiosUtil; import com.blt.other.common.util.AxiosUtil;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.purchasing.service.BuyLogService; import com.blt.other.module.purchasing.service.BuyLogService;
import com.blt.other.module.purchasing.service.BuyService; import com.blt.other.module.purchasing.service.BuyService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
package com.blt.other.module.purchasing.controller; package com.blt.other.module.purchasing.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.common.util.AxiosUtil; import com.blt.other.common.util.AxiosUtil;
import com.blt.other.common.util.IpUtil; import com.blt.other.common.util.IpUtil;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
......
package com.blt.other.module.purchasing.dao; package com.blt.other.module.purchasing.dao;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.purchasing.dto.BuyExportDto; import com.blt.other.module.purchasing.dto.BuyExportDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package com.blt.other.module.purchasing.dao; package com.blt.other.module.purchasing.dao;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.purchasing.vo.PurcharseListSearchKeysVo; import com.blt.other.module.purchasing.vo.PurcharseListSearchKeysVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package com.blt.other.module.purchasing.service; package com.blt.other.module.purchasing.service;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
......
package com.blt.other.module.purchasing.service; package com.blt.other.module.purchasing.service;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.database.model.BuyPlanDetailDomain; import com.blt.other.module.database.model.BuyPlanDetailDomain;
import com.blt.other.module.database.model.BuyPlanDomain; import com.blt.other.module.database.model.BuyPlanDomain;
import com.blt.other.module.database.model.CostDomain; import com.blt.other.module.database.model.CostDomain;
......
package com.blt.other.module.purchasing.service.impl; package com.blt.other.module.purchasing.service.impl;
import com.blt.other.module.database.model.*; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.purchasing.dao.BuyDao; import com.blt.other.module.purchasing.dao.BuyDao;
import com.blt.other.module.purchasing.service.BuyApiService; import com.blt.other.module.purchasing.service.BuyApiService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
package com.blt.other.module.purchasing.service.impl; package com.blt.other.module.purchasing.service.impl;
import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.database.model.*; import com.blt.other.module.database.model.*;
import com.blt.other.module.purchasing.dao.BuyDao; import com.blt.other.module.purchasing.dao.BuyDao;
import com.blt.other.module.purchasing.dao.BuyPlanDao; import com.blt.other.module.purchasing.dao.BuyPlanDao;
......
package com.blt.other.module.purchasing.service.impl; package com.blt.other.module.purchasing.service.impl;
import com.blt.other.module.database.model.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.module.purchasing.dao.BuySearchDao; import com.blt.other.module.purchasing.dao.BuySearchDao;
import com.blt.other.module.purchasing.dto.BuyListDto; import com.blt.other.module.purchasing.dto.BuyListDto;
import com.blt.other.module.purchasing.service.BuySearchService; import com.blt.other.module.purchasing.service.BuySearchService;
......
...@@ -2,6 +2,7 @@ package com.blt.other.module.purchasing.service.impl; ...@@ -2,6 +2,7 @@ package com.blt.other.module.purchasing.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.common.util.BuyUtils; import com.blt.other.common.util.BuyUtils;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.common.util.MoneyUtil; import com.blt.other.common.util.MoneyUtil;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
) )
</insert> </insert>
<select id="selectByNoAndSkucode" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectByNoAndSkucode" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
skucode = #{skucode} skucode = #{skucode}
</select> </select>
<select id="selectAll" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectAll" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
id DESC id DESC
</select> </select>
<select id="selectBySkucode" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectBySkucode" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
skucode = #{skucode} skucode = #{skucode}
</select> </select>
<select id="selectByBuyno" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectByBuyno" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
buyno = #{buyno} buyno = #{buyno}
</select> </select>
<update id="update" parameterType="com.blt.other.module.database.model.BuyDomain"> <update id="update" parameterType="com.bailuntec.cost.api.domain.BuyDomain">
UPDATE UPDATE
buy buy
<set> <set>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
buyno = #{buyno} buyno = #{buyno}
</update> </update>
<update id="updateInstallment" parameterType="com.blt.other.module.database.model.BuyDomain"> <update id="updateInstallment" parameterType="com.bailuntec.cost.api.domain.BuyDomain">
UPDATE UPDATE
buy buy
SET SET
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
delete from buy where buyno = #{buyNo} delete from buy where buyno = #{buyNo}
</delete> </delete>
<select id="selectBuy" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectBuy" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
buyno = #{buyno} buyno = #{buyno}
</select> </select>
<select id="selectByPlanNo" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectByPlanNo" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
no = #{planNo} no = #{planNo}
</select> </select>
<select id="selectBySkuKeyWord" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectBySkuKeyWord" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
skuname LIKE CONCAT('%',#{searchKey},'%') skuname LIKE CONCAT('%',#{searchKey},'%')
</select> </select>
<select id="selectLastBuy" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectLastBuy" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
buyno = #{oldBuyno} buyno = #{oldBuyno}
</update> </update>
<select id="findByBuyNo" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="findByBuyNo" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
LIMIT 1 LIMIT 1
</select> </select>
<select id="selectByIds" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectByIds" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
order by b.id desc order by b.id desc
</select> </select>
<select id="selectBalanceSheetBuy" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectBalanceSheetBuy" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT * FROM buy WHERE pay_time <![CDATA[>=]]> #{startDate} AND pay_time <![CDATA[<]]>#{endDate} AND sku_type_name = '固定资产' and buy_type <![CDATA[<]]> 3 SELECT * FROM buy WHERE pay_time <![CDATA[>=]]> #{startDate} AND pay_time <![CDATA[<]]>#{endDate} AND sku_type_name = '固定资产' and buy_type <![CDATA[<]]> 3
</select> </select>
</mapper> </mapper>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.blt.other.module.purchasing.dao.BuySearchDao"> <mapper namespace="com.blt.other.module.purchasing.dao.BuySearchDao">
<select id="selectByKey" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectByKey" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
DESC DESC
</select> </select>
<select id="selectByKeys" resultType="com.blt.other.module.database.model.BuyDomain"> <select id="selectByKeys" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT SELECT
* *
FROM FROM
......
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