Commit a3f18d143f5f53987ab190a61bb9f817aff16fe1
1 parent
c7b3407f
fix:1.生产指示书对于内部,无法查看生产科单价。
2.业务研发利润表中的包装费用表,添加跟单提成。 3.业务研发底下的四个表添加未完成状态筛选。
Showing
10 changed files
with
180 additions
and
36 deletions
src/main/java/com/order/erp/common/utils/EasyPdfUtils.java
... | ... | @@ -420,8 +420,13 @@ public class EasyPdfUtils { |
420 | 420 | } |
421 | 421 | dataCellList.add(createCell(productionDepartmentConsignTime, 110F)); |
422 | 422 | dataCellList.add(createCell(StringUtils.isNotEmpty(producePdfVO.getPacketType()) ? producePdfVO.getPacketType() : "", 80F)); |
423 | - dataCellList.add(createCell(Objects.nonNull(producePdfVO.getProductionDepartmentPrice()) ? "" + "¥"+producePdfVO.getProductionDepartmentPrice() : "", 110F)); | |
424 | - dataCellList.add(createCell(Objects.nonNull(producePdfVO.getProductionDepartmentTotalPrice()) ? "" + "¥"+producePdfVO.getProductionDepartmentTotalPrice() : "", 110F)); | |
423 | + if(!"内部".equals(producePdfVO.getProductionDepartment())){ | |
424 | + dataCellList.add(createCell(Objects.nonNull(producePdfVO.getProductionDepartmentPrice()) ? "" + "¥"+producePdfVO.getProductionDepartmentPrice() : "", 110F)); | |
425 | + dataCellList.add(createCell(Objects.nonNull(producePdfVO.getProductionDepartmentTotalPrice()) ? "" + "¥"+producePdfVO.getProductionDepartmentTotalPrice() : "", 110F)); | |
426 | + }else{ | |
427 | + dataCellList.add(createCell( "无权限", 110F)); | |
428 | + dataCellList.add(createCell( "无权限", 110F)); | |
429 | + } | |
425 | 430 | rowList.add(XEasyPdfHandler.Table.Row.build(dataCellList)); |
426 | 431 | } |
427 | 432 | |
... | ... | @@ -442,7 +447,11 @@ public class EasyPdfUtils { |
442 | 447 | endCellList.add(createCell("", 110F)); |
443 | 448 | endCellList.add(createCell("", 80F)); |
444 | 449 | endCellList.add(createCell("", 110F)); |
450 | + if("内部".equals(pdfVOList.get(0).getProductionDepartment())){ | |
451 | + endCellList.add(createCell("无权限" , 110F, 16F)); | |
452 | + }else{ | |
445 | 453 | endCellList.add(createCell("¥" + totalPrice, 110F, 16F)); |
454 | + } | |
446 | 455 | rowList.add(XEasyPdfHandler.Table.Row.build(endCellList)); |
447 | 456 | } |
448 | 457 | ... | ... |
src/main/java/com/order/erp/domain/dto/order/OrderCostInfoDO.java
... | ... | @@ -41,6 +41,8 @@ public class OrderCostInfoDO extends BaseDO implements Serializable { |
41 | 41 | private BigDecimal productionDepartmentPredictPrice; |
42 | 42 | |
43 | 43 | private BigDecimal productionActualPrice; |
44 | + //包装费用明细表中的跟单评分。 (1-100分) | |
45 | + private Integer orderScore; | |
44 | 46 | |
45 | 47 | private BigDecimal packetActualRmbTotalPrice; |
46 | 48 | //生产科预算单价 | ... | ... |
src/main/java/com/order/erp/domain/vo/order/BusinessProfitDetailVO.java
... | ... | @@ -87,6 +87,16 @@ public class BusinessProfitDetailVO implements Serializable { |
87 | 87 | */ |
88 | 88 | @ApiModelProperty(value = "包装费用实际金额(人民币)") |
89 | 89 | private BigDecimal packetActualRmbTotalPrice; |
90 | + /** | |
91 | + * 跟单评分 | |
92 | + * */ | |
93 | + @ApiModelProperty(value = "跟单评分") | |
94 | + private Integer orderScore; | |
95 | + /** | |
96 | + * 跟单金额。 | |
97 | + * */ | |
98 | + @ApiModelProperty(value = "跟单提成(人民币)") | |
99 | + private BigDecimal copyCommission; | |
90 | 100 | |
91 | 101 | /** |
92 | 102 | * 实际跟单单价¥ | ... | ... |
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoQueryVO.java
... | ... | @@ -26,6 +26,10 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable { |
26 | 26 | private List<Long> ids; |
27 | 27 | |
28 | 28 | private Set<Long> orderIds; |
29 | + /** | |
30 | + * 查询不通过的订单。 | |
31 | + * */ | |
32 | + private Set<Long> notInOrderIds; | |
29 | 33 | |
30 | 34 | |
31 | 35 | private Long id; |
... | ... | @@ -232,5 +236,10 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable { |
232 | 236 | * 业务研发以及内部生产表中的前缀项目号 |
233 | 237 | * */ |
234 | 238 | private Set<String> projectNoPrefixSet; |
239 | + | |
240 | + /** | |
241 | + * 控制mapper.xml文件中查询分支的判断依据。 | |
242 | + * */ | |
243 | + private Boolean isFinish; | |
235 | 244 | } |
236 | 245 | ... | ... |
src/main/java/com/order/erp/domain/vo/order/OrderCostInfoVO.java
... | ... | @@ -45,7 +45,8 @@ public class OrderCostInfoVO implements Serializable { |
45 | 45 | private Integer orderCount; |
46 | 46 | //单价 之前前端是传递productionDepartmentPredictPrice,现在改为传递单价,所以传递productionDepartmentPredictUnitPrice。 |
47 | 47 | private BigDecimal productionDepartmentPredictUnitPrice; |
48 | - | |
48 | + //包装费用明细表中的跟单评分。 (1-100分) | |
49 | + private Integer orderScore; | |
49 | 50 | //内部生产费用明细表状态。 |
50 | 51 | private Integer innerProduceStatus; |
51 | 52 | //包装费用费用明细表状态。 | ... | ... |
src/main/java/com/order/erp/domain/vo/order/OrderCostInfolockFieldVO.java
... | ... | @@ -41,6 +41,10 @@ public class OrderCostInfolockFieldVO implements Serializable { |
41 | 41 | |
42 | 42 | private String packetActualRmbTotalPrice; |
43 | 43 | /** |
44 | + * 跟单评分 | |
45 | + * */ | |
46 | + private String orderScore; | |
47 | + /** | |
44 | 48 | * 生产科预算单价。 |
45 | 49 | * */ |
46 | 50 | private String productionDepartmentPredictUnitPrice; | ... | ... |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... | ... | @@ -1607,6 +1607,7 @@ end |
1607 | 1607 | .ge(StringUtils.isNotBlank(queryVO.getOrderHodStartTime()), OrderBaseInfoDO::getOrderHodTime, queryVO.getOrderHodStartTime()) |
1608 | 1608 | .le(StringUtils.isNotBlank(queryVO.getOrderHodEndTime()), OrderBaseInfoDO::getOrderHodTime, queryVO.getOrderHodEndTime()) |
1609 | 1609 | .in(CollectionUtils.isNotEmpty(queryVO.getOrderIds()), OrderBaseInfoDO::getId, queryVO.getOrderIds()) |
1610 | + .notIn(CollectionUtils.isNotEmpty(queryVO.getNotInOrderIds()), OrderBaseInfoDO::getId, queryVO.getNotInOrderIds()) | |
1610 | 1611 | .in(CollectionUtils.isNotEmpty(queryVO.getInvoiceNo()),OrderBaseInfoDO::getInvoiceNo,queryVO.getInvoiceNo()) |
1611 | 1612 | .in(CollectionUtils.isNotEmpty(queryVO.getCheckNo()),OrderBaseInfoDO::getCheckNo,queryVO.getCheckNo()) |
1612 | 1613 | .eq(Objects.nonNull(queryVO.getInvoiceStatus()), OrderBaseInfoDO::getInvoiceStatus, queryVO.getInvoiceStatus()) | ... | ... |
src/main/java/com/order/erp/service/order/impl/OrderCostInfoServiceImpl.java
... | ... | @@ -21,6 +21,7 @@ import com.order.erp.common.utils.*; |
21 | 21 | import com.order.erp.config.DataScope; |
22 | 22 | import com.order.erp.domain.*; |
23 | 23 | import com.order.erp.domain.dto.BaseDO; |
24 | +import com.order.erp.domain.dto.SystemSettingDO; | |
24 | 25 | import com.order.erp.domain.dto.order.OrderBaseInfoDO; |
25 | 26 | import com.order.erp.domain.dto.order.OrderCostDetailedOptLogDO; |
26 | 27 | import com.order.erp.domain.dto.order.OrderCostInfoDO; |
... | ... | @@ -115,6 +116,7 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
115 | 116 | OrderCostInfolockFieldVO originOrderCostInfolockFieldVO = JSONObject.parseObject(Optional.ofNullable(orderCostFieldLockRecord.getFields()).orElse("{}"), OrderCostInfolockFieldVO.class); |
116 | 117 | if(Objects.nonNull(vo.getPacketActualRmbTotalPrice())){ |
117 | 118 | originOrderCostInfolockFieldVO.setPacketActualRmbTotalPrice(OrderLockFieldEnum.LOCKED.name()); |
119 | + originOrderCostInfolockFieldVO.setOrderScore(OrderLockFieldEnum.LOCKED.name()); | |
118 | 120 | type=ProjectOptTypeEnum.PACKAGING_COST_TYPE.getType(); |
119 | 121 | operationDesc = isUpdate |
120 | 122 | ? OrderOptTypeEnum.PROJECT_COST_EDIT.getDesc() |
... | ... | @@ -122,7 +124,9 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
122 | 124 | //编辑包装费用实际金额之后状态为待审核 |
123 | 125 | /*需要考虑一个问题,假如状态为已通过,但是没有进行任何的修改而点击了确认,那么它的状态会由已审核变为待审核,所以需要进行判断一下,此次传递来的数据是否与上一次的数据一致,如果不一致则需要进行状态设置*/ |
124 | 126 | if(isUpdate && ProfitStatusEnum.APPROVED.getStatus().equals(oldOrderCostInfoDO.getPackStatus()) |
125 | - && vo.getPacketActualRmbTotalPrice().compareTo(oldOrderCostInfoDO.getPacketActualRmbTotalPrice()) == 0){ | |
127 | + && vo.getPacketActualRmbTotalPrice().compareTo(oldOrderCostInfoDO.getPacketActualRmbTotalPrice()) == 0 | |
128 | + && ( vo.getOrderScore().equals(oldOrderCostInfoDO.getOrderScore())) | |
129 | + ){ | |
126 | 130 | }else{ |
127 | 131 | orderCostInfoDO.setPackStatus(ProfitStatusEnum.PENDING_APPROVAL.getStatus()); |
128 | 132 | } |
... | ... | @@ -167,6 +171,7 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
167 | 171 | } |
168 | 172 | OrderCostInfolockFieldVO lockField = OrderCostInfolockFieldVO.builder() |
169 | 173 | .packetActualRmbTotalPrice(vo.getPacketActualRmbTotalPrice()) |
174 | + .orderScore(vo.getOrderScore()) | |
170 | 175 | .productionActualPrice(vo.getProductionActualPrice()) |
171 | 176 | .productionDepartmentPredictPrice(vo.getProductionDepartmentPredictPrice()) |
172 | 177 | .productionDepartmentPredictUnitPrice(vo.getProductionDepartmentPredictUnitPrice()) |
... | ... | @@ -196,10 +201,18 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
196 | 201 | @Override |
197 | 202 | public ServerResult<Page<InnerProfitDetailVO>> listInnerProfitDetailByPage(OrderBaseInfoQueryVO queryVO) { |
198 | 203 | Set<Long> orderIds = null; |
204 | + Long loginUserId = dataScope.getLoginUserId(); | |
199 | 205 | 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())); | |
206 | + List<OrderCostInfoDO> list; | |
207 | + if(ProfitStatusEnum.Not_COMPLETED.getStatus().equals(queryVO.getInnerProduceStatus())){ | |
208 | + list = list(new LambdaQueryWrapper<OrderCostInfoDO>() | |
209 | + .select(OrderCostInfoDO::getOrderId).eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
210 | + .in(OrderCostInfoDO::getInnerProduceStatus, ProfitStatusEnum.PENDING_APPROVAL.getStatus(), ProfitStatusEnum.APPROVED.getStatus())); | |
211 | + }else{ | |
212 | + list = list(new LambdaQueryWrapper<OrderCostInfoDO>() | |
213 | + .select(OrderCostInfoDO::getOrderId).eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
214 | + .eq(OrderCostInfoDO::getInnerProduceStatus, queryVO.getInnerProduceStatus())); | |
215 | + } | |
203 | 216 | orderIds = CollectionUtils.isEmpty(list) |
204 | 217 | ? new HashSet<>() |
205 | 218 | : list.stream() |
... | ... | @@ -208,7 +221,11 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
208 | 221 | .collect(Collectors.toSet()); |
209 | 222 | } |
210 | 223 | if(CollectionUtils.isNotEmpty(orderIds)){ |
211 | - queryVO.setOrderIds(orderIds); | |
224 | + if(ProfitStatusEnum.Not_COMPLETED.getStatus().equals(queryVO.getInnerProduceStatus())){ | |
225 | + queryVO.setNotInOrderIds(orderIds); | |
226 | + }else{ | |
227 | + queryVO.setOrderIds(orderIds); | |
228 | + } | |
212 | 229 | } |
213 | 230 | ServerResult serverResult = orderBaseInfoService.listByPage(queryVO); |
214 | 231 | Page<OrderInfoResultVO> page = (Page<OrderInfoResultVO>) serverResult.getData(); |
... | ... | @@ -219,7 +236,7 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
219 | 236 | Set<Long> collect = records.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); |
220 | 237 | if (CollUtil.isNotEmpty(collect)) { |
221 | 238 | query.in(OrderCostFieldLockRecord::getOrderId, collect); |
222 | - | |
239 | + query.eq(OrderCostFieldLockRecord::getUserId, loginUserId); | |
223 | 240 | } else { |
224 | 241 | query.apply("1!=1"); |
225 | 242 | } |
... | ... | @@ -232,7 +249,7 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
232 | 249 | } catch (JsonProcessingException e) { |
233 | 250 | throw new RuntimeException(e); |
234 | 251 | } |
235 | - })); | |
252 | + },(v1, v2) -> v2)); | |
236 | 253 | List<InnerProfitDetailVO> innerProfitRatioResultVOs = records.stream().map(record -> { |
237 | 254 | OrderCostInfoVO orderCostInfo = record.getOrderCostInfo(); |
238 | 255 | OrderCostInfolockFieldVO lockFields = Optional.ofNullable(orderId2fieldMapMap.get(record.getId())) |
... | ... | @@ -317,11 +334,19 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
317 | 334 | |
318 | 335 | @Override |
319 | 336 | public ServerResult<Page<BusinessProfitDetailVO>> listBusinessProfitDetailByPage(OrderBaseInfoQueryVO queryVO) { |
337 | + Long loginUserId = dataScope.getLoginUserId(); | |
320 | 338 | Set<Long> orderIds=null; |
321 | 339 | 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())); | |
340 | + List<OrderCostInfoDO> list; | |
341 | + if(ProfitStatusEnum.Not_COMPLETED.getStatus().equals(queryVO.getPackStatus())){ | |
342 | + list = list(new LambdaQueryWrapper<OrderCostInfoDO>().select(OrderCostInfoDO::getOrderId) | |
343 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
344 | + .in(OrderCostInfoDO::getPackStatus, ProfitStatusEnum.PENDING_APPROVAL.getStatus(), ProfitStatusEnum.APPROVED.getStatus())); | |
345 | + }else{ | |
346 | + list = list(new LambdaQueryWrapper<OrderCostInfoDO>().select(OrderCostInfoDO::getOrderId) | |
347 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
348 | + .eq(OrderCostInfoDO::getPackStatus, queryVO.getPackStatus())); | |
349 | + } | |
325 | 350 | orderIds = CollectionUtils.isEmpty(list) |
326 | 351 | ? new HashSet<>() |
327 | 352 | : list.stream() |
... | ... | @@ -330,7 +355,11 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
330 | 355 | .collect(Collectors.toSet()); |
331 | 356 | } |
332 | 357 | if(CollectionUtils.isNotEmpty(orderIds)){ |
333 | - queryVO.setOrderIds(orderIds); | |
358 | + if(ProfitStatusEnum.Not_COMPLETED.getStatus().equals(queryVO.getPackStatus())){ | |
359 | + queryVO.setNotInOrderIds(orderIds); | |
360 | + }else{ | |
361 | + queryVO.setOrderIds(orderIds); | |
362 | + } | |
334 | 363 | } |
335 | 364 | ServerResult serverResult = orderBaseInfoService.listByPage(queryVO); |
336 | 365 | Page<OrderInfoResultVO> page = (Page<OrderInfoResultVO>) serverResult.getData(); |
... | ... | @@ -341,6 +370,7 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
341 | 370 | Set<Long> collect = records.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); |
342 | 371 | if (CollUtil.isNotEmpty(collect)) { |
343 | 372 | query.in(OrderCostFieldLockRecord::getOrderId, collect); |
373 | + query.eq(OrderCostFieldLockRecord::getUserId, loginUserId); | |
344 | 374 | |
345 | 375 | } else { |
346 | 376 | query.apply("1!=1"); |
... | ... | @@ -354,9 +384,13 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
354 | 384 | } catch (JsonProcessingException e) { |
355 | 385 | throw new RuntimeException(e); |
356 | 386 | } |
357 | - })); | |
387 | + },(v1, v2) -> v2)); | |
358 | 388 | BigDecimal exchangeRate = systemSettingService.getExchangeRate(); |
359 | - | |
389 | + //获取所有的客户提成提成配置。 | |
390 | + List<SystemSettingDO> systemSettingDOS = systemSettingService.list(new LambdaQueryWrapper<SystemSettingDO>() | |
391 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
392 | + .eq(SystemSettingDO::getRelationCode, "costSettingItem")); | |
393 | + Map<String, List<SystemSettingDO>> systemSettingDOSMap = systemSettingDOS.stream().collect(Collectors.groupingBy(SystemSettingDO::getSettingValue)); | |
360 | 394 | List<BusinessProfitDetailVO> innerProfitRatioResultVOs = records.stream().map(record -> { |
361 | 395 | OrderCostInfoVO orderCostInfo = record.getOrderCostInfo(); |
362 | 396 | OrderCostInfolockFieldVO lockFields = Optional.ofNullable(orderId2fieldMapMap.get(record.getId())).orElse( |
... | ... | @@ -366,6 +400,11 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
366 | 400 | if(Objects.isNull(lockFields.getPacketActualRmbTotalPrice())){ |
367 | 401 | lockFields.setPacketActualRmbTotalPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getPacketActualRmbTotalPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); |
368 | 402 | } |
403 | + //跟单评分。 | |
404 | + if(Objects.isNull(lockFields.getOrderScore())){ | |
405 | + lockFields.setOrderScore(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getOrderScore()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | |
406 | + | |
407 | + } | |
369 | 408 | if(Objects.isNull(lockFields.getProductionActualPrice())){ |
370 | 409 | lockFields.setProductionActualPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getProductionActualPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); |
371 | 410 | } |
... | ... | @@ -376,6 +415,7 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
376 | 415 | lockFields.setPacketActualRmbTotalPrice(OrderLockFieldEnum.UN_LOCKED.name()); |
377 | 416 | lockFields.setProductionActualPrice(OrderLockFieldEnum.UN_LOCKED.name()); |
378 | 417 | lockFields.setProductionDepartmentPredictPrice(OrderLockFieldEnum.UN_LOCKED.name()); |
418 | + lockFields.setOrderScore(OrderLockFieldEnum.UN_LOCKED.name()); | |
379 | 419 | } |
380 | 420 | BusinessProfitDetailVO vo = BusinessProfitDetailVO.builder() |
381 | 421 | .orderId(record.getId()) |
... | ... | @@ -409,6 +449,35 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
409 | 449 | //包装费用净利润率 = 包装费用收益/包装费用合计 |
410 | 450 | vo.setPacketProfitRate(vo.getPacketProfitRmbPrice().divide(BigDecimal.valueOf(vo.getPacketRmbTotalPrice()), 4, RoundingMode.HALF_UP)); |
411 | 451 | } |
452 | + if(Objects.nonNull(orderCostInfo) && Objects.nonNull(orderCostInfo.getOrderScore())){ | |
453 | + vo.setOrderScore(orderCostInfo.getOrderScore()); | |
454 | + String projectFix = ProjectNoUtils.extractProjectNoPrefix(record.getProjectNo()); | |
455 | + String substring = projectFix.substring(projectFix.lastIndexOf("-") + 1).substring(0, 2); | |
456 | + Optional<SystemSettingDO> optionalSetting = systemSettingDOSMap.values().stream() | |
457 | + .flatMap(List::stream) | |
458 | + .filter(setting -> setting.getSettingValue().equals(record.getCustomerCode())) | |
459 | + .filter(setting -> setting.getRelationName().substring(2, 4).equals(substring)) | |
460 | + .findFirst(); | |
461 | + if(optionalSetting.isPresent()){ | |
462 | + SystemSettingDO systemSettingDO = optionalSetting.get(); | |
463 | + List<Map<String,String>> relations=null; | |
464 | + try { | |
465 | + relations= objectMapper.readValue(systemSettingDO.getRelationValue(),objectMapper.getTypeFactory().constructType(List.class, Map.class)); | |
466 | + } catch (JsonProcessingException e) { | |
467 | + throw new RuntimeException(e); | |
468 | + } | |
469 | + String copyCommission= null; | |
470 | + for(Map<String,String> relation:relations){ | |
471 | + if("copyCommission".equals(relation.get("relationCode"))){ | |
472 | + copyCommission = relation.get("relationValue"); | |
473 | + } | |
474 | + } | |
475 | + if(StringUtils.isNotBlank(copyCommission)){ | |
476 | + //提成金额 = 跟单评分 * 跟单提成计算。 | |
477 | + vo.setCopyCommission(new BigDecimal(copyCommission) .multiply(BigDecimal.valueOf(orderCostInfo.getOrderScore()).divide(BigDecimal.valueOf(100))).setScale(2, RoundingMode.HALF_UP)); | |
478 | + } | |
479 | + } | |
480 | + } | |
412 | 481 | return vo; |
413 | 482 | }).collect(Collectors.toList()); |
414 | 483 | Page<BusinessProfitDetailVO> webVOPage = new Page<>(); |
... | ... | @@ -611,6 +680,8 @@ public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, O |
611 | 680 | map.put("实际跟单单价¥",Objects.nonNull(vo.getPacketActualRmbPrice()) ? vo.getPacketActualRmbPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); |
612 | 681 | map.put("实际跟单单价$",Objects.nonNull(vo.getPacketActualPrice()) ? vo.getPacketActualPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); |
613 | 682 | map.put("包装费用净利润率",Objects.nonNull(vo.getPacketProfitRate()) ? vo.getPacketProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); |
683 | + map.put("跟单评分",Objects.nonNull(vo.getOrderScore()) ? vo.getOrderScore() : ""); | |
684 | + map.put("跟单提成¥",Objects.nonNull(vo.getCopyCommission()) ? vo.getCopyCommission().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | |
614 | 685 | // if(StringUtils.isNotBlank(queryVO.getBusinessCostExportSelect().getPacketPrice()) && |
615 | 686 | // OrderLockFieldEnum.SELECTED.name().equals(queryVO.getBusinessCostExportSelect().getPacketPrice())){ |
616 | 687 | // | ... | ... |
src/main/java/com/order/erp/service/order/impl/ProjectBaseInfoServiceImpl.java
... | ... | @@ -290,10 +290,20 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
290 | 290 | Set<String> projectNoPrefix = null; |
291 | 291 | //如果有状态则先查询有状态的数据。 |
292 | 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())); | |
293 | + List<ProjectBaseInfoDO> list; | |
294 | + if(ProfitStatusEnum.Not_COMPLETED.getStatus().equals(queryVO.getInnerProductionStatus())){ | |
295 | + list = list(new LambdaQueryWrapper<ProjectBaseInfoDO>() | |
296 | + .select(ProjectBaseInfoDO::getProjectNoPrefix) | |
297 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
298 | + .in(ProjectBaseInfoDO::getInnerProductionStatus, ProfitStatusEnum.APPROVED.getStatus(),ProfitStatusEnum.PENDING_APPROVAL.getStatus())); | |
299 | + queryVO.setIsFinish(false); | |
300 | + }else{ | |
301 | + list = list(new LambdaQueryWrapper<ProjectBaseInfoDO>() | |
302 | + .select(ProjectBaseInfoDO::getProjectNoPrefix) | |
303 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
304 | + .eq(ProjectBaseInfoDO::getInnerProductionStatus, queryVO.getInnerProductionStatus())); | |
305 | + queryVO.setIsFinish(true); | |
306 | + } | |
297 | 307 | projectNoPrefix = CollectionUtils.isEmpty(list) |
298 | 308 | ? new HashSet<>() |
299 | 309 | : list.stream() |
... | ... | @@ -316,10 +326,22 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
316 | 326 | Set<String> projectNoPrefix = null; |
317 | 327 | //如果有状态则先查询有状态的数据。 |
318 | 328 | 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())); | |
329 | + List<ProjectBaseInfoDO> list; | |
330 | + if(ProfitStatusEnum.Not_COMPLETED.getStatus().equals(queryVO.getDevelopmentStatus())){ | |
331 | + //查询业务研发未创建的单子 | |
332 | + list = list(new LambdaQueryWrapper<ProjectBaseInfoDO>() | |
333 | + .select(ProjectBaseInfoDO::getProjectNoPrefix) | |
334 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
335 | + .in(ProjectBaseInfoDO::getDevelopmentStatus, ProfitStatusEnum.PENDING_APPROVAL.getStatus(), ProfitStatusEnum.APPROVED.getStatus())); | |
336 | + queryVO.setIsFinish(false); | |
337 | + }else{ | |
338 | + //查询业务研发待审核和审核通过的单子。 | |
339 | + list = list(new LambdaQueryWrapper<ProjectBaseInfoDO>() | |
340 | + .select(ProjectBaseInfoDO::getProjectNoPrefix) | |
341 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
342 | + .eq(ProjectBaseInfoDO::getDevelopmentStatus, queryVO.getDevelopmentStatus())); | |
343 | + queryVO.setIsFinish(true); | |
344 | + } | |
323 | 345 | projectNoPrefix = CollectionUtils.isEmpty(list) |
324 | 346 | ? new HashSet<>() |
325 | 347 | : list.stream() |
... | ... | @@ -504,7 +526,7 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
504 | 526 | } catch (JsonProcessingException e) { |
505 | 527 | throw new RuntimeException(e); |
506 | 528 | } |
507 | - })); | |
529 | + },(v1, v2) -> v2)); | |
508 | 530 | //查询永久已保存的配置。 |
509 | 531 | List<ProjectBaseAfterReviewSettingDO> projectBaseAfterReviewSettingDOS = projectBaseAfterReviewSettingService.list(new LambdaQueryWrapper<ProjectBaseAfterReviewSettingDO>() |
510 | 532 | .eq(ProjectBaseAfterReviewSettingDO::getType, ProjectBaseSettingTypeEnum.FIXED_COST_OF_PRODUCTION_DEPARTMENT.getType()) |
... | ... | @@ -770,7 +792,7 @@ public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMappe |
770 | 792 | } catch (JsonProcessingException e) { |
771 | 793 | throw new RuntimeException(e); |
772 | 794 | } |
773 | - })); | |
795 | + },(v1 ,v2) -> v2)); | |
774 | 796 | BigDecimal exchangeRate = systemSettingService.getExchangeRate(); |
775 | 797 | //查询永久已保存的配置。 如果永久保存配置没有,就去查询系统配置进行显示。 |
776 | 798 | List<ProjectBaseAfterReviewSettingDO> projectBaseAfterReviewSettingDOS = projectBaseAfterReviewSettingService.list(new LambdaQueryWrapper<ProjectBaseAfterReviewSettingDO>() | ... | ... |
src/main/resources/mapper/ProjectBaseInfoMapper.xml
... | ... | @@ -22,9 +22,16 @@ |
22 | 22 | </if> |
23 | 23 | <if test="queryVO.projectNoPrefixSet != null and queryVO.projectNoPrefixSet.size() > 0"> |
24 | 24 | AND ( |
25 | - <foreach collection="queryVO.projectNoPrefixSet" item="proj" separator="OR"> | |
26 | - project_no LIKE CONCAT(#{proj}, '%') | |
27 | - </foreach> | |
25 | + <if test="queryVO.isFinish"> | |
26 | + <foreach collection="queryVO.projectNoPrefixSet" item="proj" separator="OR"> | |
27 | + project_no LIKE CONCAT(#{proj}, '%') | |
28 | + </foreach> | |
29 | + </if> | |
30 | + <if test="!queryVO.isFinish"> | |
31 | + <foreach collection="queryVO.projectNoPrefixSet" item="proj" separator="AND"> | |
32 | + project_no NOT LIKE CONCAT(#{proj}, '%') | |
33 | + </foreach> | |
34 | + </if> | |
28 | 35 | ) |
29 | 36 | </if> |
30 | 37 | </where> |
... | ... | @@ -47,13 +54,6 @@ |
47 | 54 | #{proj} |
48 | 55 | </foreach> |
49 | 56 | </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> | |
55 | - | |
56 | - </if> | |
57 | 57 | <if test="queryVO.ProductionDepartment !=null and queryVO.ProductionDepartment.size() > 0"> |
58 | 58 | AND production_department |
59 | 59 | IN |
... | ... | @@ -61,6 +61,21 @@ |
61 | 61 | #{department} |
62 | 62 | </foreach> |
63 | 63 | </if> |
64 | + <if test="queryVO.projectNoPrefixSet != null and queryVO.projectNoPrefixSet.size() > 0"> | |
65 | + <if test="queryVO.isFinish"> | |
66 | + AND project_no IN | |
67 | + <foreach collection="queryVO.projectNoPrefixSet" item="proj" open="(" separator="," close=")"> | |
68 | + #{proj} | |
69 | + </foreach> | |
70 | + </if> | |
71 | + <if test="!queryVO.isFinish"> | |
72 | + AND project_no NOT IN | |
73 | + <foreach collection="queryVO.projectNoPrefixSet" item="proj" open="(" separator="," close=")"> | |
74 | + #{proj} | |
75 | + </foreach> | |
76 | + </if> | |
77 | + </if> | |
78 | + | |
64 | 79 | <if test="queryVO.projectNoLikeRight != null and queryVO.projectNoLikeRight != ''"> |
65 | 80 | AND project_no LIKE #{queryVO.projectNoLikeRight} |
66 | 81 | </if> | ... | ... |