|
@@ -5,17 +5,14 @@ import java.io.InputStream;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
-import cn.hutool.core.date.DateTime;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.Month;
|
|
import cn.hutool.core.date.Month;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
-import cn.hutool.json.JSONUtil;
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
import com.alibaba.excel.EasyExcel;
|
|
import com.alibaba.excel.ExcelWriter;
|
|
import com.alibaba.excel.ExcelWriter;
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
|
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.pj.api.wx.bo.PriceBO;
|
|
import com.pj.api.wx.bo.PriceBO;
|
|
@@ -33,17 +30,14 @@ import com.pj.project.tb_fee_details.TbFeeDetails;
|
|
import com.pj.project.tb_fee_details.TbFeeDetailsService;
|
|
import com.pj.project.tb_fee_details.TbFeeDetailsService;
|
|
import com.pj.project.tb_goods.TbGoods;
|
|
import com.pj.project.tb_goods.TbGoods;
|
|
import com.pj.project.tb_goods.TbGoodsService;
|
|
import com.pj.project.tb_goods.TbGoodsService;
|
|
-import com.pj.project.tb_item_type.TbItemType;
|
|
|
|
import com.pj.project.tb_item_type.TbItemTypeService;
|
|
import com.pj.project.tb_item_type.TbItemTypeService;
|
|
import com.pj.project4sp.uploadfile.UploadUtil;
|
|
import com.pj.project4sp.uploadfile.UploadUtil;
|
|
import com.pj.utils.so.SoMap;
|
|
import com.pj.utils.so.SoMap;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.core.io.ClassPathResource;
|
|
import org.springframework.core.io.ClassPathResource;
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import com.pj.utils.sg.*;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -412,4 +406,71 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
|
|
}
|
|
}
|
|
this.updateBatchById(list);
|
|
this.updateBatchById(list);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public PrintDayStatsDTO prePrint(SoMap so) {
|
|
|
|
+ so.clearNull();
|
|
|
|
+
|
|
|
|
+ String beginTimeStr = "";
|
|
|
|
+ String endTimeStr = "";
|
|
|
|
+ String isMonth = so.getString("isMonth");
|
|
|
|
+ String isYear = so.getString("isYear");
|
|
|
|
+ beginTimeStr = so.getString("beginDay");
|
|
|
|
+ endTimeStr = so.getString("endDay");
|
|
|
|
+ if(StrUtil.isNotEmpty(isMonth)){
|
|
|
|
+ beginTimeStr = so.getString("beginMonth");
|
|
|
|
+ endTimeStr = so.getString("endMonth");
|
|
|
|
+ }
|
|
|
|
+ String time = "所有时间";
|
|
|
|
+ if(StrUtil.isNotEmpty(beginTimeStr) && StrUtil.isNotEmpty(endTimeStr)){
|
|
|
|
+ time = beginTimeStr + "至" + endTimeStr;
|
|
|
|
+ }else if(StrUtil.isNotEmpty(isYear)){
|
|
|
|
+ time = so.getString("year");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ BigDecimal totalFee = new BigDecimal(0);
|
|
|
|
+ BigDecimal totalTaxes = new BigDecimal(0);
|
|
|
|
+ BigDecimal totalNoTaxFee = new BigDecimal(0);
|
|
|
|
+ BigDecimal totalWxPrice = new BigDecimal(0);
|
|
|
|
+
|
|
|
|
+ List<TbFeeStatistics> statsList = this.getList(so);
|
|
|
|
+ if(StrUtil.isNotEmpty(isMonth)){
|
|
|
|
+ statsList = this.getMonth(so);
|
|
|
|
+ }
|
|
|
|
+ if(StrUtil.isNotEmpty(isYear)){
|
|
|
|
+ statsList = this.getYear(so);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<ExportDayStatsDTO> printList = new ArrayList<>();
|
|
|
|
+ for (TbFeeStatistics stats : statsList) {
|
|
|
|
+ String feeType = TbFeeDetails.fee.getDesc(stats.getFeeType());
|
|
|
|
+ ExportDayStatsDTO dayStatsDTO = new ExportDayStatsDTO();
|
|
|
|
+ dayStatsDTO.setDayTime(stats.getDay())
|
|
|
|
+ .setFeeType(feeType).setNum(stats.getNum())
|
|
|
|
+ .setTaxMoney(stats.getTaxMoney())
|
|
|
|
+ .setTaxRate(stats.getTaxRate())
|
|
|
|
+ .setTaxes(stats.getTaxes())
|
|
|
|
+ .setNoTaxMoney(stats.getNoTaxMoney())
|
|
|
|
+ .setWxPrice(stats.getTaxMoney());
|
|
|
|
+ if(StrUtil.isNotEmpty(isMonth)){
|
|
|
|
+ dayStatsDTO.setDayTime(stats.getMonth());
|
|
|
|
+ }
|
|
|
|
+ if(StrUtil.isNotEmpty(isYear)){
|
|
|
|
+ dayStatsDTO.setDayTime(stats.getYear());
|
|
|
|
+ }
|
|
|
|
+ printList.add(dayStatsDTO);
|
|
|
|
+ totalFee = totalFee.add(stats.getTaxMoney());
|
|
|
|
+ totalTaxes = totalTaxes.add(stats.getTaxes());
|
|
|
|
+ totalNoTaxFee = totalNoTaxFee.add(stats.getNoTaxMoney());
|
|
|
|
+ totalWxPrice = totalWxPrice.add(stats.getTaxMoney());
|
|
|
|
+ }
|
|
|
|
+ PrintDayStatsDTO printData = new PrintDayStatsDTO();
|
|
|
|
+ printData.setList(printList)
|
|
|
|
+ .setTime(time)
|
|
|
|
+ .setTotalMoney(totalFee).setTotalTaxes(totalTaxes).setTotalNoTaxMoney(totalNoTaxFee)
|
|
|
|
+ .setTotalWxPrice(totalWxPrice);
|
|
|
|
+
|
|
|
|
+ return printData;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|