Commit 997cec37 by huluobin

不知道改了什么

parent 58136755
...@@ -12,7 +12,10 @@ import org.springframework.web.bind.annotation.*; ...@@ -12,7 +12,10 @@ import org.springframework.web.bind.annotation.*;
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("/cost/api") @RequestMapping("/cost/api")
...@@ -25,12 +28,13 @@ public class CostApiController { ...@@ -25,12 +28,13 @@ public class CostApiController {
/** /**
* 接收物流单,自动生成付款费用单到财务审核 * 接收物流单,自动生成付款费用单到财务审核
*
* @return * @return
*/ */
@PostMapping("/pushLogisticsCost") @PostMapping("/pushLogisticsCost")
public Map<String, Object> pushLogisticsCost(@RequestBody LogisticsCostDto logisticsCostDto){ public Map<String, Object> pushLogisticsCost(@RequestBody LogisticsCostDto logisticsCostDto) {
logger.warn("接收推送而来的物流单信息:" + logisticsCostDto); logger.warn("接收推送而来的物流单信息:" + logisticsCostDto);
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
try { try {
String costNo = costApiService.generateLogisticsCost(1, logisticsCostDto); String costNo = costApiService.generateLogisticsCost(1, logisticsCostDto);
result.put("success", true); result.put("success", true);
...@@ -43,15 +47,17 @@ public class CostApiController { ...@@ -43,15 +47,17 @@ public class CostApiController {
} }
return result; return result;
} }
/** /**
* 吴通 * 吴通
* 接收物流单,自动生成收款费用单到财务审核 * 接收物流单,自动生成收款费用单到财务审核
*
* @return * @return
*/ */
@PostMapping("/pushLogisticsReceipt") @PostMapping("/pushLogisticsReceipt")
public Map<String, Object> pushLogisticsReceipt(@RequestBody LogisticsCostDto logisticsCostDto){ public Map<String, Object> pushLogisticsReceipt(@RequestBody LogisticsCostDto logisticsCostDto) {
logger.warn("接收推送而来的物流单信息:" + logisticsCostDto); logger.warn("接收推送而来的物流单信息:" + logisticsCostDto);
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
try { try {
String costNo = costApiService.generateLogisticsCost(2, logisticsCostDto); String costNo = costApiService.generateLogisticsCost(2, logisticsCostDto);
result.put("success", true); result.put("success", true);
...@@ -65,6 +71,18 @@ public class CostApiController { ...@@ -65,6 +71,18 @@ public class CostApiController {
return result; return result;
} }
/**
* @param startDateStr
* @param endDateStr
* @param feeSuperType
* @param feeSubType
* @param companyValue
* @param companyName
* @param departmentName
* @param createUserId
* @param payUserId
* @return
*/
@GetMapping("/manageCostList") @GetMapping("/manageCostList")
public Map<String, Object> manageCostList(@RequestParam(name = "startDate", required = false) String startDateStr, public Map<String, Object> manageCostList(@RequestParam(name = "startDate", required = false) String startDateStr,
@RequestParam(name = "endDate", required = false) String endDateStr, @RequestParam(name = "endDate", required = false) String endDateStr,
...@@ -74,10 +92,10 @@ public class CostApiController { ...@@ -74,10 +92,10 @@ public class CostApiController {
@RequestParam(name = "companyName", required = false) String companyName, @RequestParam(name = "companyName", required = false) String companyName,
@RequestParam(name = "departmentName", required = false) String departmentName, @RequestParam(name = "departmentName", required = false) String departmentName,
@RequestParam(name = "createUserId", required = false) Integer createUserId, @RequestParam(name = "createUserId", required = false) Integer createUserId,
@RequestParam(name = "payUserId", required = false) Integer payUserId){ @RequestParam(name = "payUserId", required = false) Integer payUserId) {
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
try { try {
if (!StringUtils.isEmpty(departmentName)){ if (!StringUtils.isEmpty(departmentName)) {
departmentName = departmentName.toLowerCase(); departmentName = departmentName.toLowerCase();
} }
List<ManageCostDto> manageCostDtoList = costApiService.getMangeCostList(startDateStr, endDateStr, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId); List<ManageCostDto> manageCostDtoList = costApiService.getMangeCostList(startDateStr, endDateStr, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId);
...@@ -104,9 +122,9 @@ public class CostApiController { ...@@ -104,9 +122,9 @@ public class CostApiController {
@RequestParam(name = "createUserId", required = false) Integer createUserId, @RequestParam(name = "createUserId", required = false) Integer createUserId,
@RequestParam(name = "payUserId", required = false) Integer payUserId) { @RequestParam(name = "payUserId", required = false) Integer payUserId) {
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
try { try {
if (!StringUtils.isEmpty(departmentName)){ if (!StringUtils.isEmpty(departmentName)) {
departmentName = departmentName.toLowerCase(); departmentName = departmentName.toLowerCase();
} }
List<ManageCostDto> manageCostDtoList = costApiService.getLogisticsCostList(startDateStr, endDateStr, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId); List<ManageCostDto> manageCostDtoList = costApiService.getLogisticsCostList(startDateStr, endDateStr, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId);
...@@ -125,9 +143,9 @@ public class CostApiController { ...@@ -125,9 +143,9 @@ public class CostApiController {
@GetMapping("/balanceSheetCost") @GetMapping("/balanceSheetCost")
public Map<String, Object> balanceSheetCostList(@RequestParam(name = "startDate") String startDateStr, public Map<String, Object> balanceSheetCostList(@RequestParam(name = "startDate") String startDateStr,
@RequestParam(name = "endDate") String endDateStr){ @RequestParam(name = "endDate") String endDateStr) {
logger.warn("获取资产负债表相关费用单"); logger.warn("获取资产负债表相关费用单");
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
try { 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);
...@@ -135,7 +153,7 @@ public class CostApiController { ...@@ -135,7 +153,7 @@ public class CostApiController {
List<CostDomain> balanceSheetCostList = costApiService.getBalanceSheetCost(startDate, endDate); List<CostDomain> balanceSheetCostList = costApiService.getBalanceSheetCost(startDate, endDate);
result.put("success", true); result.put("success", true);
result.put("data", balanceSheetCostList); result.put("data", balanceSheetCostList);
} catch (ParseException e){ } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
result.put("success", false); result.put("success", false);
} }
...@@ -143,13 +161,13 @@ public class CostApiController { ...@@ -143,13 +161,13 @@ public class CostApiController {
} }
@GetMapping("/noPayCost") @GetMapping("/noPayCost")
public Map<String, Object> getNoPayCost(@RequestParam(name = "costNoList") List<String> costNoList){ public Map<String, Object> getNoPayCost(@RequestParam(name = "costNoList") List<String> costNoList) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if(costNoList != null && costNoList.size() > 0){ if (costNoList != null && costNoList.size() > 0) {
List<CostDomain> costDomainList = costApiService.getNoPayCost(costNoList); List<CostDomain> costDomainList = costApiService.getNoPayCost(costNoList);
result.put("success", true); result.put("success", true);
result.put("data", costDomainList); result.put("data", costDomainList);
}else{ } else {
result.put("success", false); result.put("success", false);
result.put("data", null); result.put("data", null);
} }
...@@ -159,13 +177,14 @@ public class CostApiController { ...@@ -159,13 +177,14 @@ public class CostApiController {
/** /**
* 吴通新增 * 吴通新增
* 根据费用单号获取费用单大类 * 根据费用单号获取费用单大类
*
* @param costNo * @param costNo
* @return * @return
*/ */
@GetMapping("/type/{costNo}") @GetMapping("/type/{costNo}")
public Map<String,Object> getTypeName(@PathVariable("costNo")String costNo) { public Map<String, Object> getTypeName(@PathVariable("costNo") String costNo) {
// 获取费用单详细信息 // 获取费用单详细信息
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
try { try {
CostDomain costDomain = costApiService.getCostDetails(costNo); CostDomain costDomain = costApiService.getCostDetails(costNo);
result.put("success", true); result.put("success", true);
......
...@@ -10,12 +10,16 @@ import java.util.List; ...@@ -10,12 +10,16 @@ import java.util.List;
public interface CostApiService { public interface CostApiService {
/** /**
* 接收物流单,自动生成付款费用单到财务审核 * 接收物流单,自动生成付款费用单到财务审核
*
* @param logisticsCostDto * @param logisticsCostDto
*/ */
String generateLogisticsCost(int costForm, LogisticsCostDto logisticsCostDto) throws Exception; String generateLogisticsCost(int costForm, LogisticsCostDto logisticsCostDto) throws Exception;
/** /**
* <p>
* 查询管理成本费用列表 * 查询管理成本费用列表
* </p>
*
* @param startDateStr * @param startDateStr
* @param endDateStr * @param endDateStr
* @param feeSuperType * @param feeSuperType
...@@ -27,12 +31,14 @@ public interface CostApiService { ...@@ -27,12 +31,14 @@ public interface CostApiService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
List<ManageCostDto> getMangeCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName,Integer createUserId, Integer payUserId) throws Exception; List<ManageCostDto> getMangeCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception;
List<ManageCostDto> getLogisticsCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName,Integer createUserId, Integer payUserId) throws Exception; List<ManageCostDto> getLogisticsCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception;
/** /**
* 查询资产负债表相关费用单 * 查询资产负债表相关费用单
*
* @param startDate * @param startDate
* @param endDate * @param endDate
* @return * @return
...@@ -41,6 +47,7 @@ public interface CostApiService { ...@@ -41,6 +47,7 @@ public interface CostApiService {
/** /**
* 查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单 * 查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单
*
* @param costNoList * @param costNoList
* @return * @return
*/ */
......
...@@ -341,7 +341,7 @@ ...@@ -341,7 +341,7 @@
FROM user u, cost c, cost_detail d, type_relation t 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 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 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) AND 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) AND
d.kind_name not in ('百伦咨询服务费') d.kind_name not in ('百伦咨询服务费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if> <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="feeSubType != null and feeSubType != ''">AND d.kind_name = #{feeSubType}</if>
...@@ -391,7 +391,7 @@ ...@@ -391,7 +391,7 @@
-c1.amount * c1.to_rmb_rate amountRmb -c1.amount * c1.to_rmb_rate amountRmb
FROM user u, type_relation t ,cost c1 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 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) 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,72,67,58,54) 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 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.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) AND c2.logistics_supplier_id is null)
...@@ -418,7 +418,7 @@ ...@@ -418,7 +418,7 @@
FROM user u, cost c, type_relation t 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 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 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) 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,72,67,58,54) AND c.kind_name not in ('百伦咨询服务费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if> <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="feeSubType != null and feeSubType != ''">AND c.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if> <if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
...@@ -438,7 +438,7 @@ ...@@ -438,7 +438,7 @@
manageCostType,b.departmentname departmentName, manageCostType,b.departmentname departmentName,
b.company_value companyValue,b.company companyName,b.sku_type_name feeSuperType,b.sku_type_name feeSubType, 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 FROM buy b
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 ('固定资产','低值易耗品') 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) AND b.sku_type_name in ('固定资产','低值易耗品')
and b.buystatus <![CDATA[>]]> 3 and b.buystatus <![CDATA[<]]> 7 and b.buy_type <![CDATA[<]]> 3 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="feeSuperType != null and feeSuperType != ''">AND b.sku_type_name = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND b.sku_type_name = #{feeSubType}</if> <if test="feeSubType != null and feeSubType != ''">AND b.sku_type_name = #{feeSubType}</if>
......
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