Merge branch 'main' of ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server

This commit is contained in:
lym
2024-06-22 09:15:13 +08:00
27 changed files with 181 additions and 98 deletions
@@ -17,6 +17,12 @@
</includes>
</fileSet>
<!-- 模板xlsx相关文件 -->
<fileSet>
<directory>${basedir}/src/main/resources/type</directory>
<outputDirectory>execFile</outputDirectory>
</fileSet>
<!-- 依赖库 -->
<fileSet>
<directory>${basedir}/target/lib</directory>
@@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.Operation;
import javax.validation.*;
import javax.servlet.http.*;
import java.io.File;
import java.util.*;
import com.cf.imes.framework.common.pojo.PageResult;
@@ -251,12 +252,12 @@ public class OrderController {
System.err.println(excelReadUtil.isErr());
// 判断是否读取有误
if (excelReadUtil.isErr() == -1) { // 文件为空
ExcelWriterUtil.writeErr(response, "生产单内容为空",orderService.getSavePath()+ "\\"+ "错误文件.xlsx");
ExcelWriterUtil.writeErr(response, "生产单内容为空", orderService.getSavePath() + File.separator + "错误文件.xlsx");
return;
}else if (excelReadUtil.isErr() > 0) {
// 返回文件
System.out.println("(Map<Object, Object>) " + (Map<Object, Object>) map.get("order")+ " , (List<OrderPlateImportExcelVO>)" +(List<OrderPlateImportExcelVO>) map.get("plate"));
ExcelWriterUtil.write(response, (Map<Object, Object>) map.get("order"), (List<OrderPlateImportExcelVO>) map.get("plate"),orderService.getSavePath()+ "\\"+ "生产单Excel导入错误导出模板.xlsx");
ExcelWriterUtil.write(response, (Map<Object, Object>) map.get("order"), (List<OrderPlateImportExcelVO>) map.get("plate"), orderService.getSavePath() + File.separator + "生产单Excel导入错误导出模板.xlsx");
return;
} else {
// 获取数据
@@ -568,7 +568,7 @@ public class OrderServiceImpl implements OrderService {
// 新增字典查询
dictDataApi.addDictData("upload_file_type", label, value);
// 保存文件
File saveFile = new File(getSavePath() + "\\" + fileName);
File saveFile = new File(getSavePath() + File.separator + fileName);
file.transferTo(saveFile);
return value;
} catch (IOException e) {
@@ -581,7 +581,7 @@ public class OrderServiceImpl implements OrderService {
// 根据type获取文件名称
try {
// path是指想要下载的文件的路径
File file = new File(getSavePath() + "\\" + value);
File file = new File(getSavePath() + File.separator + value);
// 获取文件名
String filename = file.getName();
// 获取文件后缀名
@@ -444,8 +444,8 @@ public class PlanServiceImpl implements PlanService {
.betweenIfPresent("a.width", new BigDecimal[]{vo.getWidthMinRang(), vo.getWidthMaxRang()})
.betweenIfPresent("a.height", new BigDecimal[]{vo.getLongMinRang(), vo.getLongMaxRang()})
.inIfPresent("a.filter_type", filterTypes)
.betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()});
.betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()})
.orderByDesc("a.name");
PageDTO<PlateResList> page = new PageDTO<>(vo.getPageNo(), vo.getPageSize());
IPage<PlateResList> pageResult = plateMapper.selectPlateByPlanId(page, queryWrapperX);
Set<Long> bodyIds = pageResult.getRecords().stream().map(PlateResList::getBodyId).collect(Collectors.toSet());
@@ -4,7 +4,6 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.WriteTable;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO;
@@ -13,10 +12,10 @@ import org.springframework.util.ResourceUtils;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
@@ -143,7 +142,7 @@ public class ExcelWriterUtil {
String filePathErr,
String type) throws IOException {
//输入流
InputStream inputStream = ResourceUtils.getURL(filePathErr+ "\\" + type).openStream();
InputStream inputStream = ResourceUtils.getURL(filePathErr+ File.separator + type).openStream();
ServletOutputStream outputStream = response.getOutputStream();
@@ -3,7 +3,7 @@
<mapper namespace="com.cf.imes.module.executor.dal.mysql.order.OrderMapper">
<select id="selectOrderPage" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
select a.id as orderId, a.order_date, a.delivery_date, a.customer, a.address, a.custom_order_no as defineId,
select distinct a.id as orderId, a.order_date, a.delivery_date, a.customer, a.address, a.custom_order_no as defineId,
count(op.id) as num, sum(op.area) as area
from `orders` a
left join order_item oi on a.id = oi.order_id and a.organ_id = oi.organ_id
@@ -171,13 +171,13 @@
from order_item oi
left join order_package op on oi.order_id = op.order_id and oi.organ_id = op.organ_id
where oi.parts_id = '' and oi.organ_id = #{organId}
where oi.parts_id = 0 and oi.organ_id = #{organId}
and oi.order_id in
<foreach item="orderIds" collection="orderIds" open="(" separator="," close=")">
#{orderIds}
</foreach>
group by oi.order_id,oi.plate_id,op.id,op.package_no;
group by oi.order_id,oi.plate_id,op.id,op.package_no,op.status;
@@ -4,7 +4,7 @@
<select id="selectProductList"
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO">
SELECT a.id, a.goods_id, a.name, a.material, a.type, a.model, a.spec, a.brand, a.factory,
SELECT distinct a.id, a.goods_id, a.name, a.material, a.type, a.model, a.spec, a.brand, a.factory,
a.unit, a.price, a.is_composite, a.remark, b.num
FROM order_parts a
LEFT JOIN order_item b ON a.id = b.parts_id and a.organ_id = b.organ_id
@@ -90,7 +90,7 @@
<select id="getOptimizePlanParam" resultMap="optimizeMap">
select op.id as plan_id, op.plan_no, op.type as op_type, op.status as op_status, op.machine_id, op.plan_time, op.produce_time, op.remark as op_remark, op.operator,
select distinct op.id as plan_id, op.plan_no, op.type as op_type, op.status as op_status, op.machine_id, op.plan_time, op.produce_time, op.remark as op_remark, op.operator,
oi.order_id, opl.id as plateId, opl.order_id opl_order_id, opl.name opl_name, opl.plate_no, opl.type as opl_type, opl.goods_id as opl_goods_id, opl.width opl_width,
opl.height opl_height, opl.thickness as opl_thickness, opl.split_width, opl.split_height, opl.split_thickness, opl.seal_left, opl.seal_right,
opl.seal_up, opl.seal_down, opl.area, opl.texture, opl.hole_face, opl.hole_arrange, opl.unregular_point_count, opl.front_hole_count,
@@ -111,7 +111,7 @@
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize"
parameterType="java.lang.Long">
select a.id, a.goods_name, a.material, a.color, a.width, a.height, a.thickness, count(b.id) as plateNum, d.*
select distinct a.id, a.goods_name, a.material, a.color, a.width, a.height, a.thickness, count(b.id) as plateNum, d.*
from order_goods a
left join order_plate b on a.id = b.goods_id and a.organ_id = b.organ_id
left join order_item c on c.order_id = b.order_id and c.organ_id = b.organ_id
@@ -5,7 +5,7 @@
<select id="selectPlatePage" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage">
select a.id as plateId, a.name, a.width, a.height, a.thickness, a.area,
select distinct a.id as plateId, a.name, a.width, a.height, a.thickness, a.area,
b.custom_order_no, b.customer, b.address, b.remark, b.id as orderId,
c.goods_name, c.material, c.color, a.goods_id,oi.num,a.is_special_shaped as specialShaped,a.is_sculpt as profiling
@@ -29,7 +29,7 @@
<select id="selectPlateByPlanId"
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList">
select a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
select distinct a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
from order_plate a
LEFT JOIN order_item b ON a.id = b.plate_id AND a.order_id = b.order_id and a.organ_id = b.organ_id
LEFT JOIN order_goods e ON e.id = a.goods_id AND e.order_id = a.order_id and e.organ_id = a.organ_id
@@ -40,7 +40,7 @@
</select>
<select id="selectPlateList"
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam">
select a.id, a.plate_no, a.height length, a.width, a.texture, a.hole_arrange, a.hole_face, if ( (count(a.unregular_point_count) = 0), 1, 0) as isRect
select distinct a.id, a.plate_no, a.height length, a.width, a.texture, a.hole_arrange, a.hole_face, if ( (count(a.unregular_point_count) = 0), 1, 0) as isRect
from order_plate a
left join order_item b on a.id = b.plate_id
where b.plan_id = #{planId}
@@ -63,7 +63,7 @@
</select>
<select id="selectBatchOrderIdsAndGoodsIds" resultType="java.lang.Long">
select oi.id from order_plate op
select distinct oi.id from order_plate op
join order_item oi on op.id = oi.plate_id and op.order_id = oi.order_id and op.organ_id = oi.organ_id
where op.organ_id = #{organId} and op.order_id in
<foreach collection="itemList" item="item" open="(" close=")" separator=",">
@@ -181,7 +181,8 @@
<select id="selectPlateGoodsList" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
select op.id,
select distinct
op.id,
op.name,
op.goods_id,
ogs.goods_name,
@@ -242,7 +243,7 @@
<select id="selectPlateGoodsListSummary" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
select
select distinct
op.name,
op.open_door_type,
op.height,
@@ -293,15 +294,15 @@
parameterType="java.lang.Long">
select a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
select distinct a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
from order_plan_item p
left join order_item b on p.item_id = b.id and b.organ_id = p.organ_id
left join order_plate a on b.plate_id = a.id and b.order_id = a.order_id and b.organ_id = a.organ_id
left join order_goods e on a.goods_id = e.id and a.order_id = e.order_id and a.organ_id = e.organ_id
where p.plan_id = #{planId} and p.organ_id = #{organId} ;
where p.plan_id = #{planId} and p.organ_id = #{organId}
order by a.order_id,plateName;
</select>