Commit 0543ddbf by huluobin

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

# Conflicts:
#	bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/CostApiService.java
#	bailuntec-cost-core/src/main/resources/mapper/Cost.xml
parents 068665af e737220c
......@@ -9,6 +9,7 @@ import com.bailuntec.cost.api.response.CostResult;
import com.blt.other.module.cost.service.CostApiService;
import com.blt.other.module.cost.model.CostDomain;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -75,6 +78,7 @@ public class CostApiController implements CostApi {
}
@SneakyThrows
@ApiOperation("查询所有的费用单和采购单")
@Override
@GetMapping("/manageCostList")
......@@ -87,18 +91,21 @@ public class CostApiController implements CostApi {
@RequestParam(name = "departmentName", required = false) String departmentName,
@RequestParam(name = "createUserId", required = false) Integer createUserId,
@RequestParam(name = "payUserId", required = false) Integer payUserId) {
try {
if (!StringUtils.isEmpty(departmentName)) {
departmentName = departmentName.toLowerCase();
}
List<ManageCostDto> manageCostDtoList = costApiService.getMangeCostList(startDateStr, endDateStr, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId);
return CostResult.success(manageCostDtoList);
} catch (Exception e) {
e.printStackTrace();
return CostResult.error();
if (!StringUtils.isEmpty(departmentName)) {
departmentName = departmentName.toLowerCase();
}
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime startDate = LocalDateTime.parse(startDateStr, df);
LocalDateTime endDate = LocalDateTime.parse(endDateStr, df);
List<ManageCostDto> manageCostDtoList = costApiService.getMangeCostList(startDate, endDate, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId);
return CostResult.success(manageCostDtoList);
}
@SneakyThrows
@ApiOperation("查询所有的物流费用单和采购单")
@Override
@GetMapping("/logisticsCostList")
......@@ -111,16 +118,17 @@ public class CostApiController implements CostApi {
@RequestParam(name = "departmentName", required = false) String departmentName,
@RequestParam(name = "createUserId", required = false) Integer createUserId,
@RequestParam(name = "payUserId", required = false) Integer payUserId) {
try {
if (!StringUtils.isEmpty(departmentName)) {
departmentName = departmentName.toLowerCase();
}
List<ManageCostDto> manageCostDtoList = costApiService.getLogisticsCostList(startDateStr, endDateStr, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId);
return CostResult.success(manageCostDtoList);
} catch (Exception e) {
e.printStackTrace();
return CostResult.error();
if (!StringUtils.isEmpty(departmentName)) {
departmentName = departmentName.toLowerCase();
}
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime startDate = LocalDateTime.parse(startDateStr, df);
LocalDateTime endDate = LocalDateTime.parse(endDateStr, df);
List<ManageCostDto> manageCostDtoList = costApiService.getLogisticsCostList(startDate, endDate, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId);
return CostResult.success(manageCostDtoList);
}
......
......@@ -8,6 +8,7 @@ import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.vo.CostExportVo;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
......@@ -92,8 +93,8 @@ public interface CostDao extends BaseMapper<CostDomain> {
* @param payUserId payUserId
* @return
*/
List<ManageCostDto> selectManageCost(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
List<ManageCostDto> selectManageCost(@Param("startDate") LocalDateTime startDate,
@Param("endDate") LocalDateTime endDate,
@Param("feeSuperType") String feeSuperType,
@Param("feeSubType") String feeSubType,
@Param("companyValueList") List<Integer> companyValueList,
......@@ -118,8 +119,8 @@ public interface CostDao extends BaseMapper<CostDomain> {
* @param payUserId payUserId
* @return
*/
List<ManageCostDto> getLogisticsCostList(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
List<ManageCostDto> getLogisticsCostList(@Param("startDate") LocalDateTime startDate,
@Param("endDate") LocalDateTime endDate,
@Param("feeSuperType") String feeSuperType,
@Param("feeSubType") String feeSubType,
@Param("companyValueList") List<Integer> companyValueList,
......
......@@ -4,9 +4,11 @@ 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;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.database.model.CostDomain;
import org.springframework.cglib.core.Local;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
......@@ -36,7 +38,7 @@ public interface CostApiService {
* @param payUserId 支付用户id
* @return 单据
*/
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(LocalDateTime startDateStr, LocalDateTime endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception;
/**
......@@ -55,7 +57,7 @@ public interface CostApiService {
* @param payUserId 支付用户id
* @return 单据
*/
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(LocalDateTime startDateS, LocalDateTime endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception;
/**
* 查询资产负债表相关费用单
......
......@@ -4,11 +4,10 @@ import com.alibaba.fastjson.JSONObject;
import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.module.cost.model.CostDomain;
import com.bailuntec.cost.api.dto.*;
import com.blt.other.module.auth.dao.UserDao;
import com.blt.other.common.util.CurUtils;
import com.blt.other.common.util.DateTimeUtil;
import com.blt.other.common.util.HttpUtil;
import com.blt.other.common.util.PathUtil;
import com.blt.other.module.auth.dao.UserDao;
import com.blt.other.module.cost.dao.*;
import com.blt.other.module.cost.service.CostApiService;
import com.blt.other.module.cost.service.CostService;
......@@ -23,12 +22,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -153,8 +152,8 @@ public class CostApiServiceImpl implements CostApiService {
}
@Override
public List<ManageCostDto> getMangeCostList(String startDateStr,
String endDateStr,
public List<ManageCostDto> getMangeCostList(LocalDateTime startDateStr,
LocalDateTime endDateStr,
String feeSuperType,
String feeSubType,
Integer companyValue,
......@@ -162,14 +161,7 @@ public class CostApiServiceImpl implements CostApiService {
String departmentName,
Integer createUserId,
Integer payUserId) {
Date startDate = null;
Date endDate = null;
if (!StringUtils.isEmpty(startDateStr)) {
startDate = DateTimeUtil.stringToDate(startDateStr, DateTimeUtil.DATE_FORMAT);
}
if (!StringUtils.isEmpty(endDateStr)) {
endDate = DateTimeUtil.stringToDate(endDateStr, DateTimeUtil.DATE_FORMAT);
}
ArrayList<Integer> companyValueList = new ArrayList<>(6);
if (companyValue != null) {
companyValueList.add(companyValue);
......@@ -179,11 +171,18 @@ public class CostApiServiceImpl implements CostApiService {
companyValueList.add(60);
companyValueList.add(61);
companyValueList.add(66);
companyValueList.add(78);
companyValueList.add(72);
companyValueList.add(71);
companyValueList.add(67);
companyValueList.add(58);
companyValueList.add(64);
companyValueList.add(46);
}
}
List<ManageCostDto> manageCostDtoList = costDao.selectManageCost(startDate, DateTimeUtil.addDays(endDate, 1), feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId);
List<ManageCostDto> manageCostDtoList = costDao.selectManageCost(startDateStr, endDateStr, feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId);
if (manageCostDtoList != null && !manageCostDtoList.isEmpty()) {
for (ManageCostDto manageCostDto : manageCostDtoList) {
if (!manageCostDto.getCurrency().equals("CNY")) {
......@@ -225,15 +224,9 @@ public class CostApiServiceImpl implements CostApiService {
}
@Override
public List<ManageCostDto> getLogisticsCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception {
Date startDate = null;
Date endDate = null;
if (!StringUtils.isEmpty(startDateStr)) {
startDate = DateTimeUtil.stringToDate(startDateStr, DateTimeUtil.DATE_FORMAT);
}
if (!StringUtils.isEmpty(endDateStr)) {
endDate = DateTimeUtil.stringToDate(endDateStr, DateTimeUtil.DATE_FORMAT);
}
public List<ManageCostDto> getLogisticsCostList(LocalDateTime startDateStr, LocalDateTime endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception {
ArrayList<Integer> companyValueList = new ArrayList<>(6);
if (companyValue != null) {
companyValueList.add(companyValue);
......@@ -243,9 +236,16 @@ public class CostApiServiceImpl implements CostApiService {
companyValueList.add(60);
companyValueList.add(61);
companyValueList.add(66);
companyValueList.add(78);
companyValueList.add(72);
companyValueList.add(71);
companyValueList.add(67);
companyValueList.add(58);
companyValueList.add(64);
companyValueList.add(46);
}
}
return costDao.getLogisticsCostList(startDate, DateTimeUtil.addDays(endDate, 1), feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId);
return costDao.getLogisticsCostList(startDateStr, endDateStr, feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId);
}
@Override
......
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