Commit c7b3407ff1de5308ec0332584fab3ba3649c7dda
1 parent
45794e51
fix:业务研发净利润四张表添加状态筛选,对于通过订单在导出时添加通过标识。
Showing
6 changed files
with
183 additions
and
10 deletions
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoQueryVO.java
... | ... | @@ -211,5 +211,26 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable { |
211 | 211 | * checkNo checkNo状态。 |
212 | 212 | */ |
213 | 213 | private Long checkNoStatus; |
214 | + | |
215 | + /** | |
216 | + * 业务研发净利润分析表状态 | |
217 | + * */ | |
218 | + private Integer developmentStatus; | |
219 | + /** | |
220 | + * 包装费用明细表状态 | |
221 | + * */ | |
222 | + private Integer packStatus; | |
223 | + /** | |
224 | + * 内部生产净利润分析表状态 | |
225 | + * */ | |
226 | + private Integer innerProductionStatus; | |
227 | + /** | |
228 | + * 内部生产明细表状态 | |
229 | + * */ | |
230 | + private Integer innerProduceStatus; | |
231 | + /** | |
232 | + * 业务研发以及内部生产表中的前缀项目号 | |
233 | + * */ | |
234 | + private Set<String> projectNoPrefixSet; | |
214 | 235 | } |
215 | 236 | ... | ... |
src/main/java/com/order/erp/mapper/order/ProjectBaseInfoMapper.java
... | ... | @@ -24,5 +24,7 @@ public interface ProjectBaseInfoMapper extends BaseMapper<ProjectBaseInfoDO> { |
24 | 24 | |
25 | 25 | List<String> selectDistinctProjectNos( @Param("queryVO")OrderBaseInfoQueryVO queryVO); |
26 | 26 | |
27 | + IPage<OrderBaseInfoDO> pageProjectNos(@Param("page") Page<OrderBaseInfoDO> page, @Param("queryVO")OrderBaseInfoQueryVO queryVO); | |
28 | + | |
27 | 29 | |
28 | 30 | } | ... | ... |
src/main/java/com/order/erp/service/order/impl/OrderCostInfoServiceImpl.java
... | ... | @@ -195,6 +195,21 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
195 | 195 | |
196 | 196 | @Override |
197 | 197 | public ServerResult<Page<InnerProfitDetailVO>> listInnerProfitDetailByPage(OrderBaseInfoQueryVO queryVO) { |
198 | + Set<Long> orderIds = null; | |
199 | + if(Objects.nonNull(queryVO.getInnerProduceStatus())){ | |
200 | + List<OrderCostInfoDO> list = list(new LambdaQueryWrapper<OrderCostInfoDO>() | |
201 | + .select(OrderCostInfoDO::getOrderId).eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
202 | + .eq(OrderCostInfoDO::getInnerProduceStatus, queryVO.getInnerProduceStatus())); | |
203 | + orderIds = CollectionUtils.isEmpty(list) | |
204 | + ? new HashSet<>() | |
205 | + : list.stream() | |
206 | + .map(OrderCostInfoDO::getOrderId) | |
207 | + .filter(Objects::nonNull) | |
208 | + .collect(Collectors.toSet()); | |
209 | + } | |
210 | + if(CollectionUtils.isNotEmpty(orderIds)){ | |
211 | + queryVO.setOrderIds(orderIds); | |
212 | + } | |
198 | 213 | ServerResult serverResult = orderBaseInfoService.listByPage(queryVO); |
199 | 214 | Page<OrderInfoResultVO> page = (Page<OrderInfoResultVO>) serverResult.getData(); |
200 | 215 | List<OrderInfoResultVO> records = page.getRecords(); |
... | ... | @@ -302,6 +317,21 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
302 | 317 | |
303 | 318 | @Override |
304 | 319 | public ServerResult<Page<BusinessProfitDetailVO>> listBusinessProfitDetailByPage(OrderBaseInfoQueryVO queryVO) { |
320 | + Set<Long> orderIds=null; | |
321 | + if(Objects.nonNull(queryVO.getPackStatus())){ | |
322 | + List<OrderCostInfoDO> list = list(new LambdaQueryWrapper<OrderCostInfoDO>().select(OrderCostInfoDO::getOrderId) | |
323 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
324 | + .eq(OrderCostInfoDO::getPackStatus, queryVO.getPackStatus())); | |
325 | + orderIds = CollectionUtils.isEmpty(list) | |
326 | + ? new HashSet<>() | |
327 | + : list.stream() | |
328 | + .map(OrderCostInfoDO::getOrderId) | |
329 | + .filter(Objects::nonNull) | |
330 | + .collect(Collectors.toSet()); | |
331 | + } | |
332 | + if(CollectionUtils.isNotEmpty(orderIds)){ | |
333 | + queryVO.setOrderIds(orderIds); | |
334 | + } | |
305 | 335 | ServerResult serverResult = orderBaseInfoService.listByPage(queryVO); |
306 | 336 | Page<OrderInfoResultVO> page = (Page<OrderInfoResultVO>) serverResult.getData(); |
307 | 337 | List<OrderInfoResultVO> records = page.getRecords(); | ... | ... |
src/main/java/com/order/erp/service/order/impl/ProjectBaseInfoServiceImpl.java
... | ... | @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; |
8 | 8 | import com.alibaba.fastjson.TypeReference; |
9 | 9 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
10 | 10 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
11 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
11 | 12 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
12 | 13 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
13 | 14 | import com.fasterxml.jackson.core.JsonProcessingException; |
... | ... | @@ -49,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional; |
49 | 50 | import javax.annotation.Resource; |
50 | 51 | import javax.servlet.http.HttpServletResponse; |
51 | 52 | import java.io.IOException; |
53 | +import java.io.InputStream; | |
52 | 54 | import java.io.OutputStream; |
53 | 55 | import java.math.BigDecimal; |
54 | 56 | import java.math.RoundingMode; |
... | ... | @@ -285,7 +287,25 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
285 | 287 | |
286 | 288 | @Override |
287 | 289 | public ServerResult<Page<InnerProfitInfoVO>> listInnerProfitInfoByPage(OrderBaseInfoQueryVO queryVO) { |
288 | - Page<OrderBaseInfoDO> page = pageProjectNo(queryVO); | |
290 | + Set<String> projectNoPrefix = null; | |
291 | + //如果有状态则先查询有状态的数据。 | |
292 | + if(Objects.nonNull(queryVO.getInnerProductionStatus())){ | |
293 | + List<ProjectBaseInfoDO> list = list(new LambdaQueryWrapper<ProjectBaseInfoDO>() | |
294 | + .select(ProjectBaseInfoDO::getProjectNoPrefix) | |
295 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
296 | + .eq(ProjectBaseInfoDO::getInnerProductionStatus, queryVO.getInnerProductionStatus())); | |
297 | + projectNoPrefix = CollectionUtils.isEmpty(list) | |
298 | + ? new HashSet<>() | |
299 | + : list.stream() | |
300 | + .map(ProjectBaseInfoDO::getProjectNoPrefix) | |
301 | + .filter(Objects::nonNull) | |
302 | + .collect(Collectors.toSet()); | |
303 | + } | |
304 | + if(CollectionUtils.isNotEmpty(projectNoPrefix)){ | |
305 | + queryVO.setProjectNoPrefixSet(projectNoPrefix); | |
306 | + } | |
307 | + Page<OrderBaseInfoDO> page = (Page<OrderBaseInfoDO>) baseMapper.pageProjectNos(new Page<>(queryVO.getPage(), queryVO.getPageSize()), queryVO); | |
308 | +// Page<OrderBaseInfoDO> page=pageProjectNo(queryVO); | |
289 | 309 | List<OrderInfoResultVO> orderInfoResultVOS = getOrderInfoResultVOS(page, queryVO); |
290 | 310 | List<InnerProfitInfoVO> innerProfitInfoVOs = buildInnerProfitInfos(orderInfoResultVOS); |
291 | 311 | return buildPageResult(page, innerProfitInfoVOs); |
... | ... | @@ -293,6 +313,23 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
293 | 313 | |
294 | 314 | @Override |
295 | 315 | public ServerResult<Page<BusinessProfitInfoVO>> listBusinessProfitInfoByPage(OrderBaseInfoQueryVO queryVO) { |
316 | + Set<String> projectNoPrefix = null; | |
317 | + //如果有状态则先查询有状态的数据。 | |
318 | + if(Objects.nonNull(queryVO.getDevelopmentStatus())){ | |
319 | + List<ProjectBaseInfoDO> list = list(new LambdaQueryWrapper<ProjectBaseInfoDO>() | |
320 | + .select(ProjectBaseInfoDO::getProjectNoPrefix) | |
321 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
322 | + .eq(ProjectBaseInfoDO::getDevelopmentStatus, queryVO.getDevelopmentStatus())); | |
323 | + projectNoPrefix = CollectionUtils.isEmpty(list) | |
324 | + ? new HashSet<>() | |
325 | + : list.stream() | |
326 | + .map(ProjectBaseInfoDO::getProjectNoPrefix) | |
327 | + .filter(Objects::nonNull) | |
328 | + .collect(Collectors.toSet()); | |
329 | + } | |
330 | + if(CollectionUtils.isNotEmpty(projectNoPrefix)){ | |
331 | + queryVO.setProjectNoPrefixSet(projectNoPrefix); | |
332 | + } | |
296 | 333 | Integer page = queryVO.getPage(); |
297 | 334 | Integer size = queryVO.getPageSize(); |
298 | 335 | // 之前是查询项目号前八位,但是遇到A06-PS-2503-1,就会出问题,所以这里根据第二段截取,判断是否包含中文或者英文,如果包含中文或者英文时就截取前三段,如果不包含,则区前八位。 |
... | ... | @@ -323,7 +360,7 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
323 | 360 | /** |
324 | 361 | * 分页查询项目号前8位 |
325 | 362 | */ |
326 | - private Page<OrderBaseInfoDO> pageProjectNo(OrderBaseInfoQueryVO queryVO) { | |
363 | +/* private Page<OrderBaseInfoDO> pageProjectNo(OrderBaseInfoQueryVO queryVO) { | |
327 | 364 | LambdaQueryWrapper<OrderBaseInfoDO> orderBaseInfoDOLambdaQueryWrapper = orderBaseInfoService.buildQueryByParam(queryVO).select(OrderBaseInfoDO::getId); |
328 | 365 | return orderBaseInfoService.page(new Page<>(queryVO.getPage(), queryVO.getPageSize()), |
329 | 366 | new LambdaQueryWrapper<OrderBaseInfoDO>() |
... | ... | @@ -338,7 +375,7 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
338 | 375 | } |
339 | 376 | }) |
340 | 377 | .groupBy(OrderBaseInfoDO::getProjectNo)); |
341 | - } | |
378 | + }*/ | |
342 | 379 | |
343 | 380 | /** |
344 | 381 | * 分页查询项目号前8位 |
... | ... | @@ -1086,7 +1123,27 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
1086 | 1123 | createMergedRow(sheet, cellStyle, 34, 35, 0, 4, "研发贸易净利润率"); |
1087 | 1124 | createMergedRow(sheet, cellStyle, 34, 35, 5, 6, Optional.ofNullable(businessProfitInfoVO.getDevelopmentProfitRate()).map(rate -> rate.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%").orElse("-")); |
1088 | 1125 | createMergedRow(sheet, cellStyle, 34, 35, 7, 9, ""); |
1089 | - createMergedRow(sheet, cellStyle, 36, 37, 0, 4, "包装费用合计金额"); | |
1126 | + if(ProfitStatusEnum.APPROVED.getStatus() .equals(Optional.ofNullable(businessProfitInfoVO.getDevelopmentStatus()).orElse(null))) { | |
1127 | + // 插入图片到总经理审核下面的单元格 | |
1128 | + InputStream is = getClass().getClassLoader().getResourceAsStream("images/know.png"); // 假设图片在 resources/static 目录下 | |
1129 | + //采用btyes部署到服务器上报错,所以不使用bytes。 | |
1130 | +// byte[] bytes = IOUtils.toByteArray(is); | |
1131 | + | |
1132 | + int pictureIdx = workbook.addPicture(is, Workbook.PICTURE_TYPE_PNG); | |
1133 | + is.close(); | |
1134 | + | |
1135 | + Drawing<?> drawing = sheet.createDrawingPatriarch(); | |
1136 | + ClientAnchor anchor = workbook.getCreationHelper().createClientAnchor(); | |
1137 | +// 设置图片位置和大小(行列号对应“总经理审核”下的单元格范围) | |
1138 | + anchor.setCol1(7); // 起始列:总经理审核格子开始列 | |
1139 | + anchor.setRow1(26); // 起始行:总经理审核格子开始行 | |
1140 | + anchor.setCol2(10); // 结束列:总经理审核格子结束列 | |
1141 | + anchor.setRow2(35); // 结束行:总经理审核格子结束行 | |
1142 | + Picture picture = drawing.createPicture(anchor, pictureIdx); | |
1143 | +// 如果图片仍然过大,调整缩放比例 | |
1144 | + picture.resize(1.1); // 调整为 80% 的大小 | |
1145 | + } | |
1146 | + /* createMergedRow(sheet, cellStyle, 36, 37, 0, 4, "包装费用合计金额"); | |
1090 | 1147 | createMergedRow(sheet, cellStyle, 36, 37, 5, 6, Optional.ofNullable(businessProfitInfoVO.getPacketRmbTotalPrice()).map(price -> "¥" + price).orElse("-")); |
1091 | 1148 | createMergedRow(sheet, cellStyle, 36, 37, 7, 9, ""); |
1092 | 1149 | createMergedRow(sheet, cellStyle, 38, 39, 0, 4, "包装费用实际金额"); |
... | ... | @@ -1120,7 +1177,7 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
1120 | 1177 | // createMergedRow(sheet, cellStyle, 52, 53, 7, 9, ""); |
1121 | 1178 | createMergedRow(sheet, cellStyle, 50, 51, 0, 4, "综合收益"); |
1122 | 1179 | createMergedRow(sheet, cellStyle, 50, 51, 5, 6, Optional.ofNullable(businessProfitInfoVO.getComprehensiveProfit()).map(price -> "¥" + price).orElse("-")); |
1123 | - createMergedRow(sheet, cellStyle, 50, 51, 7, 9, ""); | |
1180 | + createMergedRow(sheet, cellStyle, 50, 51, 7, 9, "");*/ | |
1124 | 1181 | |
1125 | 1182 | // 设置响应头 |
1126 | 1183 | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
... | ... | @@ -1134,7 +1191,7 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
1134 | 1191 | |
1135 | 1192 | @Override |
1136 | 1193 | public void exportInnerProfitInfo(HttpServletResponse response, String projectNoPrefix) throws Exception { |
1137 | - ServerResult serverResult = listInnerProfitInfoByPage(OrderBaseInfoQueryVO.builder().page(1).pageSize(1).productionDepartment(Collections.singletonList("内部")).projectNoLikeRight(projectNoPrefix).build()); | |
1194 | + ServerResult serverResult = listInnerProfitInfoByPage(OrderBaseInfoQueryVO.builder().page(1).pageSize(1).productionDepartment(Collections.singletonList("内部")).projectNoLikeRight(projectNoPrefix+"%").build()); | |
1138 | 1195 | Page<InnerProfitInfoVO> page = (Page<InnerProfitInfoVO>) serverResult.getData(); |
1139 | 1196 | List<InnerProfitInfoVO> profitInfoVOS = page.getRecords(); |
1140 | 1197 | InnerProfitInfoVO ProfitInfoVO = profitInfoVOS.get(0); |
... | ... | @@ -1278,7 +1335,7 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
1278 | 1335 | projectBaseInfoDO.setInnerProductionStatus(ProfitStatusEnum.APPROVED.getStatus()); |
1279 | 1336 | //把审核通过时的计算数据时的系统配置保存到永久配置中。防止后续更改系统配置后,正确的数据会被更新掉。 |
1280 | 1337 | //获取当前的系统配置。 |
1281 | - String projectNoSuffixYear = vo.getProjectNo().substring(vo.getProjectNo().lastIndexOf("-")+1).substring(0, 2); | |
1338 | + String projectNoSuffixYear = vo.getProjectNo().substring(ProjectNoUtils.extractProjectNoPrefix(vo.getProjectNo()).lastIndexOf("-") + 1).substring(0, 2); | |
1282 | 1339 | ProjectBaseAfterReviewSettingDO projectBaseAfterReviewSettingDO = projectBaseAfterReviewSettingService.getOne(new LambdaQueryWrapper<ProjectBaseAfterReviewSettingDO>() |
1283 | 1340 | .eq(ProjectBaseAfterReviewSettingDO::getProjectNoPrefix, vo.getProjectNo()) |
1284 | 1341 | // .eq(ProjectBaseAfterReviewSettingDO::getYear,"20"+vo.getProjectNo().substring(4, 6)) |
... | ... | @@ -1413,6 +1470,26 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
1413 | 1470 | createMergedRow(sheet, cellStyle, 22, 23, 4, 5, "¥" + Optional.ofNullable(vo.getInnerProductionProfit()).orElse(BigDecimal.ZERO)); |
1414 | 1471 | createMergedRow(sheet, cellStyle, 22, 23, 6, 7, Optional.ofNullable(vo.getInnerProductionProfitRate()).map(r -> r.multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%").orElse("-")); |
1415 | 1472 | createMergedRow(sheet, cellStyle, 22, 23, 8, 9, ""); |
1473 | + if(ProfitStatusEnum.APPROVED.getStatus() .equals(Optional.ofNullable(vo.getInnerProductionStatus()).orElse(null))) { | |
1474 | + // 插入图片到总经理审核下面的单元格 | |
1475 | + InputStream is = getClass().getClassLoader().getResourceAsStream("images/know.png"); // 假设图片在 resources/static 目录下 | |
1476 | + //采用btyes部署到服务器上报错,所以不使用bytes。 | |
1477 | +// byte[] bytes = IOUtils.toByteArray(is); | |
1478 | + | |
1479 | + int pictureIdx = workbook.addPicture(is, Workbook.PICTURE_TYPE_PNG); | |
1480 | + is.close(); | |
1481 | + | |
1482 | + Drawing<?> drawing = sheet.createDrawingPatriarch(); | |
1483 | + ClientAnchor anchor = workbook.getCreationHelper().createClientAnchor(); | |
1484 | +// 设置图片位置和大小(行列号对应“总经理审核”下的单元格范围) | |
1485 | + anchor.setCol1(7); // 起始列:总经理审核格子开始列 | |
1486 | + anchor.setRow1(17); // 起始行:总经理审核格子开始行 | |
1487 | + anchor.setCol2(10); // 结束列:总经理审核格子结束列 | |
1488 | + anchor.setRow2(27); // 结束行:总经理审核格子结束行 | |
1489 | + Picture picture = drawing.createPicture(anchor, pictureIdx); | |
1490 | +// 如果图片仍然过大,调整缩放比例 | |
1491 | + picture.resize(1.1); // 调整为 80% 的大小 | |
1492 | + } | |
1416 | 1493 | |
1417 | 1494 | // 设置响应头 |
1418 | 1495 | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
... | ... | @@ -1509,13 +1586,13 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
1509 | 1586 | ? vo.getDevelopmentProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" |
1510 | 1587 | : "" |
1511 | 1588 | ); |
1512 | - hashMap.put("包装费用合计¥",Objects.nonNull(vo.getPacketRmbTotalPrice()) ? String.format("%.2f",vo.getPacketRmbTotalPrice()) : ""); | |
1589 | + /* hashMap.put("包装费用合计¥",Objects.nonNull(vo.getPacketRmbTotalPrice()) ? String.format("%.2f",vo.getPacketRmbTotalPrice()) : ""); | |
1513 | 1590 | hashMap.put("包装费用实际金额¥",Objects.nonNull(vo.getPacketActualRmbPrice()) ? vo.getPacketActualRmbPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); |
1514 | 1591 | hashMap.put("订单总数量",Objects.nonNull(vo.getOrderCount()) ? vo.getOrderCount() : ""); |
1515 | 1592 | hashMap.put("实际跟单单价¥",Objects.nonNull(vo.getActualOrderRmbPrice()) ? vo.getActualOrderRmbPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); |
1516 | 1593 | hashMap.put("实际跟单单价$",Objects.nonNull(vo.getActualOrderPrice()) ? vo.getActualOrderPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); |
1517 | 1594 | hashMap.put("包装费用收益¥",Objects.nonNull(vo.getPacketProfitRmbPrice()) ? vo.getPacketProfitRmbPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); |
1518 | - hashMap.put("综合收益¥",Objects.nonNull(vo.getComprehensiveProfit()) ? vo.getComprehensiveProfit().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | |
1595 | + hashMap.put("综合收益¥",Objects.nonNull(vo.getComprehensiveProfit()) ? vo.getComprehensiveProfit().setScale(2, RoundingMode.HALF_UP).toPlainString() : "");*/ | |
1519 | 1596 | // if(StringUtils.isNotBlank(queryVO.getProjectExportSelect().getSpainPaidRmbCommission()) && |
1520 | 1597 | // OrderLockFieldEnum.SELECTED.name().equals(queryVO.getProjectExportSelect().getSpainPaidRmbCommission())){ |
1521 | 1598 | // } | ... | ... |
src/main/resources/images/know.png
0 → 100644
79.6 KB
src/main/resources/mapper/ProjectBaseInfoMapper.xml
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | SELECT DISTINCT project_no |
8 | 8 | FROM order_base_info |
9 | 9 | <where> |
10 | + enable_flag = 10 | |
10 | 11 | <if test="queryVO.customerCode != null and queryVO.customerCode.size() > 0"> |
11 | 12 | AND customer_code IN |
12 | 13 | <foreach collection="queryVO.customerCode" item="code" open="(" separator="," close=")"> |
... | ... | @@ -19,9 +20,51 @@ |
19 | 20 | #{proj} |
20 | 21 | </foreach> |
21 | 22 | </if> |
23 | + <if test="queryVO.projectNoPrefixSet != null and queryVO.projectNoPrefixSet.size() > 0"> | |
24 | + AND ( | |
25 | + <foreach collection="queryVO.projectNoPrefixSet" item="proj" separator="OR"> | |
26 | + project_no LIKE CONCAT(#{proj}, '%') | |
27 | + </foreach> | |
28 | + ) | |
29 | + </if> | |
22 | 30 | </where> |
23 | 31 | </select> |
24 | 32 | |
33 | + <select id="pageProjectNos" resultType="com.order.erp.domain.dto.order.OrderBaseInfoDO"> | |
34 | + SELECT project_no | |
35 | + FROM order_base_info | |
36 | + <where> | |
37 | + enable_flag = 10 | |
38 | + <if test="queryVO.customerCode != null and queryVO.customerCode.size() > 0"> | |
39 | + AND customer_code IN | |
40 | + <foreach collection="queryVO.customerCode" item="code" open="(" separator="," close=")"> | |
41 | + #{code} | |
42 | + </foreach> | |
43 | + </if> | |
44 | + <if test="queryVO.projectNo != null and queryVO.projectNo.size() > 0"> | |
45 | + AND project_no IN | |
46 | + <foreach collection="queryVO.projectNo" item="proj" open="(" separator="," close=")"> | |
47 | + #{proj} | |
48 | + </foreach> | |
49 | + </if> | |
50 | + <if test="queryVO.projectNoPrefixSet != null and queryVO.projectNoPrefixSet.size() > 0"> | |
51 | + AND project_no IN | |
52 | + <foreach collection="queryVO.projectNoPrefixSet" item="proj" open="(" separator="," close=")"> | |
53 | + #{proj} | |
54 | + </foreach> | |
25 | 55 | |
26 | - | |
56 | + </if> | |
57 | + <if test="queryVO.ProductionDepartment !=null and queryVO.ProductionDepartment.size() > 0"> | |
58 | + AND production_department | |
59 | + IN | |
60 | + <foreach collection="queryVO.ProductionDepartment" item="department" open="(" separator="," close=")"> | |
61 | + #{department} | |
62 | + </foreach> | |
63 | + </if> | |
64 | + <if test="queryVO.projectNoLikeRight != null and queryVO.projectNoLikeRight != ''"> | |
65 | + AND project_no LIKE #{queryVO.projectNoLikeRight} | |
66 | + </if> | |
67 | + </where> | |
68 | + GROUP BY project_no | |
69 | + </select> | |
27 | 70 | </mapper> | ... | ... |