mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
报表基础模块:新增支持生产单报表 (板材明细-按房间/板材)导出
This commit is contained in:
+86
-10
@@ -7,6 +7,7 @@ import com.cf.imes.module.executor.api.datasource.OrderDatasourceApi;
|
||||
import com.cf.imes.module.executor.api.datasource.OrderPlateDatasourceApi;
|
||||
import com.cf.imes.module.executor.api.datasource.dto.OrderDTO;
|
||||
import com.cf.imes.module.executor.api.datasource.dto.PlateGoodsRespDTO;
|
||||
import com.cf.imes.module.executor.enums.OrderPlateOpenDoorTypeEnum;
|
||||
import com.cf.imes.module.report.framework.ureport.annotation.CfReportSpringbeanDatasource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -76,15 +77,15 @@ public class OrderSummaryBeanDatasource {
|
||||
}
|
||||
|
||||
/**
|
||||
* 板材汇总-按板材
|
||||
* 板材汇总
|
||||
*
|
||||
* @param dsName
|
||||
* @param datasetName
|
||||
* @param parameters
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> orderPlateSummaryByPlate(String dsName, String datasetName, Map<String, Object> parameters) {
|
||||
log.info("报表数据源[OrderSummaryBeanDatasource][orderPlateSummaryByPlate][{}][{}]调用开始", dsName, datasetName);
|
||||
public List<Map<String, Object>> orderPlateGoodsSummary(String dsName, String datasetName, Map<String, Object> parameters) {
|
||||
log.info("报表数据源[OrderSummaryBeanDatasource][orderPlateGoodsSummary][{}][{}]调用开始", dsName, datasetName);
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
|
||||
Object orderId = parameters.get(ORDER_ID_FIELD_NAME);
|
||||
@@ -100,19 +101,94 @@ public class OrderSummaryBeanDatasource {
|
||||
// 构造报表所需结构
|
||||
resultMap.put("roomName", p.getRoomName());
|
||||
resultMap.put("bodyName", p.getBodyName());
|
||||
resultMap.put("thickness", p.getThickness());
|
||||
resultMap.put("thickness", stripTrailingZeros(p.getThickness()));
|
||||
resultMap.put("name", p.getName());
|
||||
resultMap.put("height", p.getHeight());
|
||||
resultMap.put("width", p.getWidth());
|
||||
resultMap.put("height", stripTrailingZeros(p.getHeight()));
|
||||
resultMap.put("width", stripTrailingZeros(p.getWidth()));
|
||||
resultMap.put("count", count);
|
||||
resultMap.put("area", area);
|
||||
resultMap.put("openDoorType", p.getOpenDoorType());
|
||||
resultMap.put("area", stripTrailingZeros(area));
|
||||
resultMap.put("openDoorType", OrderPlateOpenDoorTypeEnum.getDescFromCode(p.getOpenDoorType()));
|
||||
resultMap.put("material", p.getMaterial());
|
||||
resultMap.put("color", p.getColor());
|
||||
resultMap.put("remark", p.getRemark());
|
||||
resultMap.put("areaAll", area.multiply(BigDecimal.valueOf(count)));
|
||||
resultMap.put("areaAll", stripTrailingZeros(area.multiply(BigDecimal.valueOf(count))));
|
||||
resultList.add(resultMap);
|
||||
});
|
||||
}
|
||||
log.info("报表数据源[OrderSummaryBeanDatasource][orderPlateSummaryByPlate][{}][{}]调用结束", dsName, datasetName);
|
||||
log.info("报表数据源[OrderSummaryBeanDatasource][orderPlateGoodsSummary][{}][{}]调用结束", dsName, datasetName);
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 板材明细
|
||||
*
|
||||
* @param dsName
|
||||
* @param datasetName
|
||||
* @param parameters
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> orderPlateGoodsList(String dsName, String datasetName, Map<String, Object> parameters) {
|
||||
log.info("报表数据源[OrderSummaryBeanDatasource][orderPlateGoodsList][{}][{}]调用开始", dsName, datasetName);
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
|
||||
Object orderId = parameters.get(ORDER_ID_FIELD_NAME);
|
||||
// 查询统计信息
|
||||
CommonResult<List<PlateGoodsRespDTO>> commonResult = orderPlateDatasourceApi.selectPlateGoodsList(Long.parseLong(orderId.toString()));
|
||||
List<PlateGoodsRespDTO> plateGoodsRespDTOS = commonResult.getData();
|
||||
|
||||
if (CollUtil.isNotEmpty(plateGoodsRespDTOS)) {
|
||||
plateGoodsRespDTOS.forEach(p -> {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
BigDecimal area = p.getArea();
|
||||
Integer count = p.getCount();
|
||||
// 构造报表所需结构
|
||||
resultMap.put("goodsName", p.getGoodsName());
|
||||
resultMap.put("name", p.getName());
|
||||
resultMap.put("material", p.getMaterial());
|
||||
resultMap.put("color", p.getColor());
|
||||
resultMap.put("goodsThickness", p.getGoodsThickness());
|
||||
resultMap.put("count", p.getCount());
|
||||
resultMap.put("roomName", p.getRoomName());
|
||||
resultMap.put("bodyName", p.getBodyName());
|
||||
resultMap.put("plateNo", p.getPlateNo());
|
||||
resultMap.put("height", stripTrailingZeros(p.getHeight()));
|
||||
resultMap.put("width", stripTrailingZeros(p.getWidth()));
|
||||
resultMap.put("thickness", stripTrailingZeros(p.getThickness()));
|
||||
resultMap.put("area", stripTrailingZeros(area));
|
||||
resultMap.put("remark", p.getRemark());
|
||||
resultMap.put("isSpecialShaped", getBooleanString(p.getIsSpecialShaped()));
|
||||
resultMap.put("isSculpt", getBooleanString(p.getIsSculpt()));
|
||||
resultMap.put("openDoorType", OrderPlateOpenDoorTypeEnum.getDescFromCode(p.getOpenDoorType()));
|
||||
resultMap.put("seal", String.join(",", stripTrailingZeros(p.getSealLeft()), stripTrailingZeros(p.getSealRight()), stripTrailingZeros(p.getSealUp()), stripTrailingZeros(p.getSealDown())));
|
||||
resultMap.put("areaAll", stripTrailingZeros(area.multiply(BigDecimal.valueOf(count))));
|
||||
resultList.add(resultMap);
|
||||
});
|
||||
}
|
||||
log.info("报表数据源[OrderSummaryBeanDatasource][orderPlateGoodsList][{}][{}]调用结束", dsName, datasetName);
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除尾数的0,600.000 -> 600
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
private String stripTrailingZeros(BigDecimal data) {
|
||||
if (ObjectUtil.isNotNull(data)) {
|
||||
return data.stripTrailingZeros().toPlainString();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 布尔值转是否
|
||||
*
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
private String getBooleanString(Boolean b) {
|
||||
return b ? "是" : "否";
|
||||
}
|
||||
}
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user