Compare commits

...

2 Commits

  1. 38
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/BillDataController.java
  2. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/IndexCountController.java
  3. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/BillDataMapper.java
  4. 20
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/BillDataMapper.xml
  5. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/BillingService.java
  6. 86
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/BillingServiceImpl.java
  7. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/BillingDataVo.java
  8. 4
      blade-service/logpm-report/src/main/resources/application-dev.yml

38
blade-service/logpm-report/src/main/java/com/logpm/report/controller/BillDataController.java

@ -0,0 +1,38 @@
package com.logpm.report.controller;
import com.logpm.report.service.BillingService;
import com.logpm.report.vo.indexCount.BillingDataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
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;
@AllArgsConstructor
@RestController
@RequestMapping("/bill_data")
@Api(value = "首页开单数据",tags = "首页开单数据")
public class BillDataController {
private BillingService billingService;
/**
* 获取开单数据
* @return
*/
@GetMapping("/bill_data")
@ApiOperation(value = "",tags = "")
public BillingDataVo billData(){
return billingService.BillData();
}
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/controller/IndexCountController.java

@ -40,7 +40,7 @@ public class IndexCountController {
return R.data(theNumberOfShelvesInTheLibrary);
}
@GetMapping("/index_number_in_the_library")
@GetMapping("/index_number_no_the_library")
@ApiOperation(value = "定制品在库订单未上架总数",tags = "定制品在库订单未上架总数")
public R<Integer> getTheNumberOfShelvesNoTheLibrary(@RequestParam("id") Long id){
Integer theNumberOfShelvesInTheLibrary= inLibraryDeliverService.theNumberOfShelvesInTheLibrary(id,1);

8
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/BillDataMapper.java

@ -6,14 +6,16 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@Mapper
public interface BillDataMapper {
Integer billCount(@Param("warehouseId") Long warehouseId, @Param("timeType") Integer timeType, @Param("date")List<Object> date);
BigDecimal billMoney(@Param("warehouseId") Long warehouseId,@Param("timeType") Integer timeType, @Param("date")List<Object> date);
BigDecimal detailMoney(@Param("warehouseId") Long warehouseId,@Param("detailMoney") Integer timeType, @Param("date")List<Object> date);
Integer billCount(@Param("warehouseId") List<Long> warehouseId, @Param("timeType") String timeType, @Param("date") HashMap<String, Date> date);
BigDecimal billMoney(@Param("warehouseId") List<Long> warehouseId,@Param("timeType") String timeType, @Param("date")HashMap<String,Date> date);
BigDecimal detailMoney(@Param("warehouseId") List<Long> warehouseId,@Param("detailMoney") String timeType, @Param("date")HashMap<String,Date> date);

20
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/BillDataMapper.xml

@ -7,20 +7,22 @@
select count(*) billCount
from
logpm_platform.logpm_warehouse_waybill
where freeze_status = 1
where freeze_status = 0
<where>
<if test="warehouseId!=null">
and
where destination_warehouse_id = #{warehouseId}
</if>
<foreach collection="warehouseId" index="index" item="item">
<if test="item != null">
and destination_warehouse_id = #{item}
</if>
</foreach>
<if test="timeType !=null ">
<choose>
<when test="timeType == 2">
<if test="param.startDate != null and date.startDate != '' ">
and create_time &gt; #{param.startDate}
<if test="date.start_date != null and date.start_date != '' ">
and create_time &gt; #{date.start_date}
</if>
<if test="param.endDate != null and date.endDate != '' ">
and create_time &lt; #{param.endDate}
<if test="date.end_date != null and date.end_date != '' ">
and create_time &lt; #{date.end_date}
</if>
</when>
</choose>

8
blade-service/logpm-report/src/main/java/com/logpm/report/service/BillingService.java

@ -4,6 +4,8 @@ import com.logpm.report.vo.indexCount.BillingDataVo;
import com.logpm.report.vo.indexCount.DetailMoneyVo;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
public interface BillingService {
@ -13,21 +15,21 @@ public interface BillingService {
* @param TType
* @return Integer
*/
Integer BillCount(Integer TType);
Integer BillCount(String TType,HashMap<String,Date> date);
/**
* 获取开单收入
* @param TType
* @return BigDecimal
*/
BigDecimal BillMoney(Integer TType);
BigDecimal BillMoney(String TType, HashMap<String, Date> date);
/**
* 获取开单收入明细
* @param TType
* @return List
*/
List<DetailMoneyVo> DetailType(Integer TType);
List<DetailMoneyVo> DetailType(String TType,HashMap<String,Date> date);
/**

86
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/BillingServiceImpl.java

@ -2,15 +2,19 @@ package com.logpm.report.service.impl;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.report.mapper.BillDataMapper;
import com.logpm.report.service.BillingService;
import com.logpm.report.typepage.TimeType;
import com.logpm.report.vo.indexCount.BillingDataVo;
import com.logpm.report.vo.indexCount.DetailMoneyVo;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
@Service
@AllArgsConstructor
@ -18,35 +22,99 @@ public class BillingServiceImpl implements BillingService {
private IBasicdataWarehouseClient warehouseClient;
private BillDataMapper billDataMapper;
/**
* 获取时间范围内的开单数
* @param TType
* @param date
* @return Integer
*/
@Override
public Integer BillCount(Integer TType) {
return null;
public Integer BillCount(String TType,HashMap<String,Date> date) {
List<Long> warehouse = getWarehouse();
return billDataMapper.billCount(warehouse, TType, date);
}
/**
* 获取时间范围内的收入
* @param TType
* @param date
* @return BigDecimal
*/
@Override
public BigDecimal BillMoney(Integer TType) {
return null;
public BigDecimal BillMoney(String TType, HashMap<String,Date> date) {
List<Long> warehouse = getWarehouse();
return billDataMapper.billMoney(warehouse, TType, date);
}
/**
* 获取时间范围内地的收入明细
* @param TType
* @param date
* @return
*/
@Override
public List<DetailMoneyVo> DetailType(Integer TType) {
public List<DetailMoneyVo> DetailType(String TType,HashMap<String,Date> date) {
return null;
}
/**
* 获取全部开单数据
* @return BillingDataVo
*/
@Override
public BillingDataVo BillData() {
return null;
BillingDataVo billingDataVo = new BillingDataVo();
HashMap<String, Date> time1 = getOtherTime(TimeType.all.getValue());
HashMap<String, Date> time2 = getOtherTime(TimeType.moon.getValue());
HashMap<String, Date> time3 = getOtherTime(TimeType.day.getValue());
Integer all = BillCount(TimeType.all.getValue(), time1);
Integer moon = BillCount(TimeType.moon.getValue(), time2);
Integer day = BillCount(TimeType.day.getValue(), time3);
billingDataVo.setAllCount(all);
billingDataVo.setMoonCount(moon);
billingDataVo.setDayCount(day);
return billingDataVo;
}
/**
* 获取当月/当天时间
* @param type 23天
* @return
*/
public HashMap<String,Date> getOtherTime(String type){
HashMap<String, Date> hashMap = new HashMap<>();
Calendar instance = Calendar.getInstance();
Date endTime = new Date();
int typeI = Integer.parseInt(type);
if (typeI ==2){
instance.set(Calendar.DAY_OF_MONTH,1);
Date time = instance.getTime();
hashMap.put("stare_time",time);
hashMap.put("end_time",endTime);
}else if (typeI ==3) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date time = calendar.getTime();
hashMap.put("stare_time",time);
hashMap.put("end_time",endTime);
}
return hashMap;
}
/**
* 获取用户仓库id
* @return
*/
private List<Long> getWarehouse(){
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// BasicdataWarehouseEntity myCurrentWarehouse = new BasicdataWarehouseEntity();
List<Long> ls = new ArrayList<>();
if (myCurrentWarehouse !=null){
ls.add(myCurrentWarehouse.getId());

7
blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/BillingDataVo.java

@ -1,11 +1,16 @@
package com.logpm.report.vo.indexCount;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
public class BillingDataVo {
@Data
@ApiModel("首页开单数据")
public class BillingDataVo implements Serializable {
@ApiModelProperty("开单总数")
private Integer allCount;

4
blade-service/logpm-report/src/main/resources/application-dev.yml

@ -33,7 +33,7 @@ spring:
url: ${blade.datasource.report.master.url}
username: ${blade.datasource.report.master.username}
# password: ${blade.datasource.report.master.password}
password: Hwy@1234
password: 12345678
slave:
druid:
#独立校验配置
@ -43,5 +43,5 @@ spring:
url: ${blade.datasource.report.slave.url}
username: ${blade.datasource.report.slave.username}
# password: ${blade.datasource.report.slave.password}
password: Hwy@1234
password: 12345678

Loading…
Cancel
Save