Commit dbc2957f authored by 郝旭阳's avatar 郝旭阳

结算物料导出

parent 55bd8d70
......@@ -45,93 +45,107 @@ public class ErpMaterialPickingExportVo {
/**
* 序号
*/
@ColumnWidth(15)
@ColumnWidth(20)
@ExcelProperty(index = 0, value = {"title", "序号"})
private String index;
/**
* 分公司
*/
@ColumnWidth(15)
@ColumnWidth(20)
@ExcelProperty(index = 1, value = {"title", "分公司"})
private String branchOffice;
/**
* 车间
*/
@ColumnWidth(15)
@ColumnWidth(20)
@ExcelProperty(index = 2, value = {"title", "车间"})
private String workshopName;
/**
* 仓库
*/
@ColumnWidth(15)
@ColumnWidth(20)
@ExcelProperty(index = 3, value = {"title", "仓库"})
private String warehouseName;
/**
* 到货单号
*/
@ColumnWidth(20)
@ExcelProperty(index = 4, value = {"title", "到货单号"})
private String arrivalNumber;
/**
* 领料人
*/
@ColumnWidth(15)
@ExcelProperty(index = 4, value = {"title", "领料人"})
@ColumnWidth(20)
@ExcelProperty(index = 5, value = {"title", "领料人"})
private String receiveUserName;
/**
* 领料时间
*/
@ColumnWidth(25)
@ExcelProperty(index = 5, value = {"title", "领料时间"})
@ExcelProperty(index = 6, value = {"title", "领料时间"})
private Date receiveTime;
/**
* 材料编码
*/
@ColumnWidth(15)
@ExcelProperty(index = 6, value = {"title", "材料编码"})
@ColumnWidth(20)
@ExcelProperty(index = 7, value = {"title", "材料编码"})
private String materialCode;
/**
* 物资名称
*/
@ColumnWidth(15)
@ExcelProperty(index = 7, value = {"title", "物资名称"})
@ColumnWidth(20)
@ExcelProperty(index = 8, value = {"title", "物资名称"})
private String materialName;
/**
* 规格
*/
@ColumnWidth(15)
@ExcelProperty(index = 8, value = {"title", "规格"})
@ColumnWidth(20)
@ExcelProperty(index = 9, value = {"title", "规格"})
private String materialSpecifications;
/**
* 单位
*/
@ColumnWidth(15)
@ExcelProperty(index = 9, value = {"title", "单位"}, converter = ExcelDictConvert.class)
@ColumnWidth(20)
@ExcelProperty(index = 10, value = {"title", "单位"}, converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "material_unit")
private String materialUnit;
/**
* 入库价格
*/
@ColumnWidth(15)
@ExcelProperty(index = 10, value = {"title", "入库价格"})
@ColumnWidth(20)
@ExcelProperty(index = 11, value = {"title", "入库价格"})
private BigDecimal putawayPrice;
/**
* 数量
*/
@ColumnWidth(15)
@ExcelProperty(index = 11, value = {"title", "数量"})
@ColumnWidth(20)
@ExcelProperty(index = 12, value = {"title", "数量"})
private BigDecimal collectNumber;
/**
* 合计(元)
*/
@ColumnWidth(15)
@ExcelProperty(index = 12, value = {"title", "合计(元)"})
@ColumnWidth(20)
@ExcelProperty(index = 13, value = {"title", "合计(元)"})
private BigDecimal money;
/**
* 供应商名称
*/
@ColumnWidth(30)
@ExcelProperty(index = 14, value = {"title", "供应商名称"})
private String vendorName;
}
......@@ -477,7 +477,7 @@ public class ErpMaterialPickingServiceImpl implements IErpMaterialPickingService
// 双行表头:第 0 行为大标题,第 1 行为列名;合计行 Excel 行号 = list.size() + 1
int totalExcelRowIndex = list.size() + 1;
centerMergedAnchorExcelRowIndex = totalExcelRowIndex;
mergeCellList.add(MergeCellModel.createMergeCellModel(sheetName, totalExcelRowIndex, totalExcelRowIndex, 0, 10));
mergeCellList.add(MergeCellModel.createMergeCellModel(sheetName, totalExcelRowIndex, totalExcelRowIndex, 0, 11));
//计算数量总和
BigDecimal collectNumber = list.stream().map(ErpMaterialPickingExportVo::getCollectNumber).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
erpMaterialPickingExportVo1.setCollectNumber(collectNumber);
......
......@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
ec.branch_office AS branchOffice,
empi.warehouse_name AS warehouseName,
emp.receive_user_name AS receiveUserName,
su.nick_name AS receiveUserName,
emp.receive_time AS receiveTime,
empi.material_code AS materialCode,
empi.material_name AS materialName,
......@@ -61,11 +61,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
empi.material_unit AS materialUnit,
empi.putaway_price AS putawayPrice,
empi.collect_number AS collectNumber,
empi.`money` AS money
empi.`money` AS money,
erf.repairer_dept_name as workshopName,
empi.vendor_name as vendorName,
empp.arrival_number as arrivalNumber
FROM
erp_material_picking_info empi
LEFT JOIN erp_material_picking emp ON empi.picking_id = emp.id
LEFT JOIN erp_car ec ON ec.id = emp.car_id
left join erp_repair_form erf ON erf.id = empi.repair_form_id
left join sys_user su on su.user_name = emp.receive_user_name
left join erp_material_inventory_record emir ON empi.record_id = emir.id
left join erp_material_putaway_info empii ON empii.id = emir.info_id
left join erp_material_putaway empp ON empii.putaway_id = empp.id
<where>
<if test="repairNumber != null">
and emp.repair_number like CONCAT('%',#{repairNumber},'%')
......
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