提交 ed388552 authored 作者: Wangjiajie's avatar Wangjiajie

更改收费单和汇总单的打印功能

上级 c1c9aed8
......@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.modules.iost.basedata.entity.IostReceivinglist;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
......@@ -95,6 +96,9 @@ public class IostReceivingNoteController {
IPage<IostReceivingNote> pageList = iostReceivingNoteService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
......@@ -285,7 +289,6 @@ public class IostReceivingNoteController {
* 增加单据体信息
* @param document
* @param iostReceivingNoteLists
* @param keyFont
* @param textFont
* @throws DocumentException
*/
......@@ -513,6 +516,47 @@ public class IostReceivingNoteController {
List<IostReceivingNoteList> iostReceivingNoteListList = iostReceivingNoteListService.selectByMainId(id);
return Result.OK(iostReceivingNoteListList);
}
/**
* 打印收费单
*
* @param id
* @return
*/
@AutoLog(value = "打印收费单")
@ApiOperation(value="打印收费单", notes="收费明细-打印收费单")
@GetMapping(value = "/queryIostReceivingNotIostReceivingNotListByMainId")
public Result<?> queryIostReceivingNoteListListMainId(@RequestParam(name="id",required=true) String id) {
List<IostReceivingNoteList> iostReceivingNoteListList = iostReceivingNoteListService.selectByMainId(id);
addSumRow(iostReceivingNoteListList);
return Result.OK(iostReceivingNoteListList);
}
/***
* 增加统计行
* @param iostIostReceivingNoteList
*/
private void addSumRow(List<IostReceivingNoteList> iostIostReceivingNoteList)
{
double totlevolume = 0;//体积总
double totleWeightTotal = 0;//重量总
int totlePackagesTotal = 0;//箱数总
double totlePrice = 0;//价格总
for(IostReceivingNoteList iostReceivingNoteList: iostIostReceivingNoteList)
{
totlevolume = totlevolume + iostReceivingNoteList.getVolume();
totlePackagesTotal = totlePackagesTotal + iostReceivingNoteList.getPackages();
totleWeightTotal = totleWeightTotal + iostReceivingNoteList.getWeight();
totlePrice = totlePrice + iostReceivingNoteList.getPrice();
}
IostReceivingNoteList curIostReceivingNotlist = new IostReceivingNoteList();
curIostReceivingNotlist.setNameChs("总和");
curIostReceivingNotlist.setVolume(totlevolume);
curIostReceivingNotlist.setWeight(totleWeightTotal);
curIostReceivingNotlist.setPackages(totlePackagesTotal);
curIostReceivingNotlist.setPrice(totlePrice);
iostIostReceivingNoteList.add(curIostReceivingNotlist);
}
/**
* 导出excel
......
......@@ -3,6 +3,7 @@ package org.jeecg.modules.iost.basedata.controller;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.net.URLDecoder;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
......@@ -524,6 +525,48 @@ public class IostSummarySheetController {
return Result.OK(iostSummarySheetListList);
}
/**
* 打印收费单
*
* @param id
* @return
*/
@AutoLog(value = "打印收费单")
@ApiOperation(value="打印收费单", notes="汇总明细-打印收费单")
@GetMapping(value = "/queryIostSummarySheetListByMainIdiostListByMainId")
public Result<?> queryIostReceivingNoteListListMainId(@RequestParam(name="id",required=true) String id) {
List<IostSummarySheetList> iostReceivingNoteListList = iostSummarySheetListService.selectByMainId(id);
addSumRow(iostReceivingNoteListList);
return Result.OK(iostReceivingNoteListList);
}
/***
* 增加统计行
* @param iostSummarySheetLists
*/
private void addSumRow(List<IostSummarySheetList> iostSummarySheetLists)
{
double totlevolume = 0;//体积总
double totleWeightTotal = 0;//重量总
int totlePackagesTotal = 0;//箱数总
double totleMoney = 0;//金额总
for(IostSummarySheetList iostSummarySheetList: iostSummarySheetLists)
{
totlevolume = totlevolume + iostSummarySheetList.getVolume();
totlePackagesTotal = totlePackagesTotal + iostSummarySheetList.getPackages();
totleWeightTotal = totleWeightTotal + iostSummarySheetList.getWeight();
totleMoney = totleMoney + iostSummarySheetList.getMoney();
}
IostSummarySheetList iostSummarySheetList = new IostSummarySheetList();
iostSummarySheetList.setCustomerName("总和");
iostSummarySheetList.setVolume((double)Math.round(totlevolume*100)/100);
iostSummarySheetList.setWeight(totleWeightTotal);
iostSummarySheetList.setPackages(totlePackagesTotal);
iostSummarySheetList.setMoney(totleMoney);
iostSummarySheetLists.add(iostSummarySheetList);
}
/**
* 导出excel
*
......
......@@ -3,8 +3,10 @@ package org.jeecg.modules.iost.basedata.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.iost.basedata.entity.IostReceiving;
import org.jeecg.modules.iost.basedata.entity.IostReceivingNote;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.iost.basedata.entity.IostReceivinglist;
/**
* @Description: 收费单
......@@ -13,5 +15,4 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @Version: V1.0
*/
public interface IostReceivingNoteMapper extends BaseMapper<IostReceivingNote> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.iost.basedata.mapper.IostReceivingNoteMapper">
</mapper>
\ No newline at end of file
......@@ -3,6 +3,8 @@ package org.jeecg.modules.iost.basedata.service;
import org.jeecg.modules.iost.basedata.entity.IostReceivingNoteList;
import org.jeecg.modules.iost.basedata.entity.IostReceivingNote;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.iost.basedata.entity.IostReceivinglist;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
......
......@@ -73,5 +73,6 @@ public class IostReceivingNoteServiceImpl extends ServiceImpl<IostReceivingNoteM
iostReceivingNoteMapper.deleteById(id);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.iost.basedata.mapper.IostReceivingNoteMapper">
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论