Commit 71e36dfb by huluobin

update

parent ef7a363c
......@@ -9,6 +9,7 @@ import com.bailuntec.cost.api.response.CostResult;
import com.blt.other.module.cost.service.CostApiService;
import com.blt.other.module.database.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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
......@@ -101,8 +102,8 @@ public interface CostDao {
* @param payUserId payUserId
* @return
*/
List<ManageCostDto> selectManageCost(@Param("startDate") String startDate,
@Param("endDate") String 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,
......@@ -127,8 +128,8 @@ public interface CostDao {
* @param payUserId payUserId
* @return
*/
List<ManageCostDto> getLogisticsCostList(@Param("startDate") String startDate,
@Param("endDate") String 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,
......
......@@ -5,8 +5,10 @@ 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.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;
/**
* 查询资产负债表相关费用单
......
......@@ -25,6 +25,7 @@ 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;
......@@ -149,8 +150,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,
......@@ -221,7 +222,7 @@ 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 {
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);
......
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