Commit ba8d25a4 by huluobin

Merge branch 'cost-check-flow-master' into cost-check-flow

# Conflicts:
#	bailuntec-cost-core/src/main/java/com/blt/other/module/purchasing/controller/PurchasingListDetailController.java
parents 84e2d41d 9cfb6558
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 lombok.Data;
......
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 java.text.NumberFormat;
......
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.entrepot.dto.InventoryLogDto;
......
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 java.util.Map;
......
package com.blt.other.module.entrepot.service.impl;
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.InventoryLogDomain;
import com.blt.other.module.entrepot.dao.InventoryDao;
......
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.SysProductDomain;
import com.blt.other.module.entrepot.dao.InventoryDao;
......
package com.blt.other.module.entrepot.service.impl;
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.entrepot.dao.StorageDao;
import com.blt.other.module.entrepot.dto.StorageDto;
......
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 io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/buy/api")
public class BuyApiController {
public class BuyApiController implements BuyApi {
@Autowired
private BuyApiService buyApiService;
private static Logger logger = LoggerFactory.getLogger(BuyApiController.class);
@ApiOperation("获取资产负债表相关采购单")
@GetMapping("/balanceSheetBuy")
public Map<String, Object> balanceSheetBuyList(@RequestParam(name = "startDate") String startDateStr,
@RequestParam(name = "endDate") String endDateStr){
public CostResult<List<BuyDomain>> balanceSheetBuyList(@RequestParam(name = "startDate") String startDateStr,
@RequestParam(name = "endDate") String endDateStr) throws ParseException {
logger.warn("获取资产负债表相关采购单");
Map<String,Object> result = new HashMap<>();
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = sdf.parse(startDateStr);
Date endDate = sdf.parse(endDateStr);
List<BuyDomain> balanceSheetBuyList = buyApiService.getBalanceSheetBuy(startDate, endDate);
result.put("success", true);
result.put("data", balanceSheetBuyList);
} catch (ParseException e){
e.printStackTrace();
result.put("success", false);
}
return result;
Map<String, Object> result = new HashMap<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = sdf.parse(startDateStr);
Date endDate = sdf.parse(endDateStr);
List<BuyDomain> balanceSheetBuyList = buyApiService.getBalanceSheetBuy(startDate, endDate);
return CostResult.success(balanceSheetBuyList);
}
}
package com.blt.other.module.purchasing.controller;
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.BuyService;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -3,6 +3,7 @@ package com.blt.other.module.purchasing.controller;
import com.alibaba.fastjson.JSON;
import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.model.CostDomain;
import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.common.util.AxiosUtil;
import com.blt.other.common.util.IpUtil;
import com.blt.other.common.util.PathUtil;
......
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......
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.List;
......
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.BuyPlanDomain;
import com.blt.other.module.cost.model.CostDomain;
......
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.service.BuyApiService;
import org.springframework.beans.factory.annotation.Autowired;
......
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.purchasing.dao.BuyDao;
import com.blt.other.module.purchasing.dao.BuyPlanDao;
......
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.dto.BuyListDto;
import com.blt.other.module.purchasing.service.BuySearchService;
......
......@@ -2,6 +2,7 @@ package com.blt.other.module.purchasing.service.impl;
import com.alibaba.fastjson.JSON;
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.CurUtils;
import com.blt.other.common.util.MoneyUtil;
......
......@@ -24,7 +24,7 @@
)
</insert>
<select id="selectByNoAndSkucode" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectByNoAndSkucode" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -35,7 +35,7 @@
skucode = #{skucode}
</select>
<select id="selectAll" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectAll" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -44,7 +44,7 @@
id DESC
</select>
<select id="selectBySkucode" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectBySkucode" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -53,7 +53,7 @@
skucode = #{skucode}
</select>
<select id="selectByBuyno" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectByBuyno" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -62,7 +62,7 @@
buyno = #{buyno}
</select>
<update id="update" parameterType="com.blt.other.module.database.model.BuyDomain">
<update id="update" parameterType="com.bailuntec.cost.api.domain.BuyDomain">
UPDATE
buy
<set>
......@@ -123,7 +123,7 @@
buyno = #{buyno}
</update>
<update id="updateInstallment" parameterType="com.blt.other.module.database.model.BuyDomain">
<update id="updateInstallment" parameterType="com.bailuntec.cost.api.domain.BuyDomain">
UPDATE
buy
SET
......@@ -137,7 +137,7 @@
delete from buy where buyno = #{buyNo}
</delete>
<select id="selectBuy" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectBuy" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -146,7 +146,7 @@
buyno = #{buyno}
</select>
<select id="selectByPlanNo" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectByPlanNo" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -155,7 +155,7 @@
no = #{planNo}
</select>
<select id="selectBySkuKeyWord" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectBySkuKeyWord" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -164,7 +164,7 @@
skuname LIKE CONCAT('%',#{searchKey},'%')
</select>
<select id="selectLastBuy" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectLastBuy" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -186,7 +186,7 @@
buyno = #{oldBuyno}
</update>
<select id="findByBuyNo" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="findByBuyNo" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -196,7 +196,7 @@
LIMIT 1
</select>
<select id="selectByIds" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectByIds" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
FROM
......@@ -232,7 +232,7 @@
order by b.id desc
</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>
</mapper>
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<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
*
FROM
......@@ -30,7 +30,7 @@
DESC
</select>
<select id="selectByKeys" resultType="com.blt.other.module.database.model.BuyDomain">
<select id="selectByKeys" resultType="com.bailuntec.cost.api.domain.BuyDomain">
SELECT
*
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