Commit 2ced8971dd6d703db3272e57dcf349da18e11145

Authored by qdlgxiemaosheng
1 parent 3ff114fd

fixbug

src/main/java/com/order/erp/domain/vo/admin/AdminUserResultVO.java
... ... @@ -92,4 +92,9 @@ public class AdminUserResultVO implements Serializable {
92 92 */
93 93 private String roleName;
94 94  
  95 + /**
  96 + * 备注
  97 + */
  98 + private String remark;
  99 +
95 100 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderAuditLogResultVO.java
... ... @@ -4,6 +4,7 @@ import lombok.*;
4 4 import lombok.experimental.SuperBuilder;
5 5  
6 6 import java.io.Serializable;
  7 +import java.time.LocalDateTime;
7 8  
8 9 /**
9 10 * 订单操作信息表实体类
... ... @@ -59,4 +60,6 @@ public class OrderAuditLogResultVO implements Serializable {
59 60 */
60 61 private String fields;
61 62  
  63 + private LocalDateTime createTime;
  64 +
62 65 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderInfoResultVO.java
... ... @@ -44,4 +44,9 @@ public class OrderInfoResultVO extends OrderBaseInfoVO implements Serializable {
44 44 */
45 45 private OrderLockFieldVO lockFields;
46 46  
  47 + /**
  48 + * 进度条
  49 + */
  50 + private Double schedule;
  51 +
47 52 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderOptLogResultVO.java
... ... @@ -4,6 +4,7 @@ import lombok.*;
4 4 import lombok.experimental.SuperBuilder;
5 5  
6 6 import java.io.Serializable;
  7 +import java.time.LocalDateTime;
7 8  
8 9 /**
9 10 * 订单操作信息表实体类
... ... @@ -41,4 +42,6 @@ public class OrderOptLogResultVO implements Serializable {
41 42 */
42 43 private String fields;
43 44  
  45 + private LocalDateTime createTime;
  46 +
44 47 }
... ...
src/main/java/com/order/erp/service/admin/impl/AdminUserServiceImpl.java
... ... @@ -164,6 +164,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
164 164 return new LambdaQueryWrapper<AdminUserDO>()
165 165 .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
166 166 .eq(StringUtils.isNotBlank(queryVO.getUserName()), AdminUserDO::getUserName, queryVO.getUserName())
  167 + .eq(StringUtils.isNotBlank(queryVO.getNickName()), AdminUserDO::getNickName, queryVO.getNickName())
167 168 .eq(StringUtils.isNotBlank(queryVO.getPhone()), AdminUserDO::getPhone, queryVO.getPhone())
168 169 .eq(StringUtils.isNotBlank(queryVO.getEmail()), AdminUserDO::getEmail, queryVO.getEmail());
169 170 }
... ... @@ -179,9 +180,19 @@ public class AdminUserServiceImpl extends ServiceImpl&lt;AdminUserMapper, AdminUser
179 180 if (Objects.nonNull(adminUserVO.getId())) {
180 181 adminUserVO.setId(null);
181 182 }
  183 + List<AdminUserDO> userDOS = list(new LambdaQueryWrapper<AdminUserDO>().eq(BaseDO::getEnableFlag,Constant.ENABLE_TEN)
  184 + .eq(AdminUserDO::getPhone,adminUserVO.getPhone()));
  185 + if (CollectionUtils.isNotEmpty(userDOS)) {
  186 + throw new BusinessException("手机号已被注册");
  187 + }
182 188 AdminUserDO adminUserDo = BeanUtil.copyProperties(adminUserVO, AdminUserDO.class);
183   - adminUserDo.setUserName(adminUserVO.getNickName());
184   - adminUserDo.setGender(adminUserVO.getNickName());
  189 + if (StringUtils.isNotBlank(adminUserVO.getUserName())) {
  190 + adminUserDo.setNickName(adminUserVO.getUserName());
  191 + }
  192 + if (StringUtils.isNotBlank(adminUserVO.getNickName())) {
  193 + adminUserDo.setNickName(adminUserVO.getNickName());
  194 + }
  195 + adminUserDo.setGender("男");
185 196 if (Objects.isNull(adminUserDo.getDeptId())) {
186 197 adminUserDo.setDeptId(1L);
187 198 }
... ...
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... ... @@ -37,6 +37,7 @@ import javax.annotation.Resource;
37 37 import javax.servlet.http.HttpServletResponse;
38 38 import java.io.File;
39 39 import java.io.IOException;
  40 +import java.math.BigDecimal;
40 41 import java.util.List;
41 42 import java.util.Map;
42 43 import java.util.Objects;
... ... @@ -157,6 +158,9 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
157 158 // 填充字段锁定信息
158 159 fillLockFields(resultVOList);
159 160  
  161 + // 填充进度
  162 + fillSchedules(resultVOList);
  163 +
160 164 webVOPage.setRecords(resultVOList);
161 165 }
162 166 BeanUtils.copyProperties(page, webVOPage, "records");
... ... @@ -435,6 +439,246 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
435 439 /**
436 440 * @param orderInfoResultVOList
437 441 */
  442 + private void fillSchedules(List<OrderInfoResultVO> orderInfoResultVOList) {
  443 + if (CollectionUtils.isEmpty(orderInfoResultVOList)) {
  444 + return;
  445 + }
  446 +
  447 + orderInfoResultVOList.forEach(x -> {
  448 + int i = 0;
  449 + if (isFillOrderBaseInfo(x)) {
  450 + i++;
  451 + }
  452 + if (isFillProfitInfo(x.getProfitAnalysisInfo())) {
  453 + i++;
  454 + }
  455 + if (isFillReportInfo(x.getReportInfo())) {
  456 + i++;
  457 + }
  458 + if (isFillTrackInfo(x.getTrackStageInfo())) {
  459 + i++;
  460 + }
  461 + if (isFillInspectionInfo(x.getInspectionStageInfo())) {
  462 + i++;
  463 + }
  464 + x.setSchedule(new BigDecimal(i).divide(new BigDecimal(Constant.FOUR)).doubleValue());
  465 + });
  466 + }
  467 +
  468 + /**
  469 + * @param inspectionStageInfo
  470 + * @return
  471 + */
  472 + private boolean isFillInspectionInfo(OrderInspectionStageVO inspectionStageInfo) {
  473 + if (Objects.isNull(inspectionStageInfo)) {
  474 + return false;
  475 + }
  476 + if (StringUtils.isBlank(inspectionStageInfo.getMidCheckApplyTime())) {
  477 + return false;
  478 + }
  479 + if (StringUtils.isBlank(inspectionStageInfo.getMidCheckComment())) {
  480 + return false;
  481 + }
  482 + if (StringUtils.isBlank(inspectionStageInfo.getMidCheckResult())) {
  483 + return false;
  484 + }
  485 + if (StringUtils.isBlank(inspectionStageInfo.getEndCheckApplyTime())) {
  486 + return false;
  487 + }
  488 + if (StringUtils.isBlank(inspectionStageInfo.getSpecification())) {
  489 + return false;
  490 + }
  491 + if (StringUtils.isBlank(inspectionStageInfo.getFunctionality())) {
  492 + return false;
  493 + }
  494 + if (StringUtils.isBlank(inspectionStageInfo.getElectroplate())) {
  495 + return false;
  496 + }
  497 + if (StringUtils.isBlank(inspectionStageInfo.getBoxPacket())) {
  498 + return false;
  499 + }
  500 + if (StringUtils.isBlank(inspectionStageInfo.getEndCheckResult())) {
  501 + return false;
  502 + } else if ("FAIL".equals(inspectionStageInfo.getEndCheckResult())) {
  503 + return false;
  504 + }
  505 + return true;
  506 + }
  507 +
  508 + /**
  509 + * @param trackStageVO
  510 + * @return
  511 + */
  512 + private boolean isFillTrackInfo(OrderTrackStageVO trackStageVO) {
  513 + if (Objects.isNull(trackStageVO)) {
  514 + return false;
  515 + }
  516 + if (StringUtils.isBlank(trackStageVO.getPpTime())) {
  517 + return false;
  518 + }
  519 + if (StringUtils.isBlank(trackStageVO.getPpConfirmResult())) {
  520 + return false;
  521 + }
  522 + if (StringUtils.isBlank(trackStageVO.getEsoSampleSendTime())) {
  523 + return false;
  524 + }
  525 + if (StringUtils.isBlank(trackStageVO.getShippmentSampleSendTime())) {
  526 + return false;
  527 + }
  528 + if (StringUtils.isBlank(trackStageVO.getShippmentSampleConfirmResult())) {
  529 + return false;
  530 + }
  531 + if (StringUtils.isBlank(trackStageVO.getSelfTestPassTime())) {
  532 + return false;
  533 + }
  534 + if (StringUtils.isBlank(trackStageVO.getAitexTestSendTime())) {
  535 + return false;
  536 + }
  537 + if (StringUtils.isBlank(trackStageVO.getAitexTestFinishResult())) {
  538 + return false;
  539 + }
  540 + if (StringUtils.isBlank(trackStageVO.getSgsTestSendTime())) {
  541 + return false;
  542 + }
  543 + if (StringUtils.isBlank(trackStageVO.getSgsTestFinishResult())) {
  544 + return false;
  545 + }
  546 + if (StringUtils.isBlank(trackStageVO.getBarcodeStickerArrivalTime())) {
  547 + return false;
  548 + }
  549 + if (StringUtils.isBlank(trackStageVO.getLatestArrivalTime())) {
  550 + return false;
  551 + }
  552 + if (StringUtils.isBlank(trackStageVO.getLatestBkTime())) {
  553 + return false;
  554 + }
  555 + return true;
  556 + }
  557 +
  558 +
  559 + /**
  560 + * @param reportInfo
  561 + * @return
  562 + */
  563 + private boolean isFillReportInfo(OrderCompletionReportVO reportInfo) {
  564 + if (Objects.isNull(reportInfo)) {
  565 + return false;
  566 + }
  567 + if (StringUtils.isBlank(reportInfo.getIdeaSource())) {
  568 + return false;
  569 + }
  570 + if (StringUtils.isBlank(reportInfo.getManualPreform())) {
  571 + return false;
  572 + }
  573 + if (Objects.isNull(reportInfo.getIdeaManualRate())) {
  574 + return false;
  575 + }
  576 + return true;
  577 + }
  578 +
  579 + /**
  580 + * @param profitAnalysisInfo
  581 + * @return
  582 + */
  583 + private boolean isFillProfitInfo(OrderProfitAnalysisVO profitAnalysisInfo) {
  584 + if (Objects.isNull(profitAnalysisInfo)) {
  585 + return false;
  586 + }
  587 + if (Objects.isNull(profitAnalysisInfo.getCustomerPrice())) {
  588 + return false;
  589 + }
  590 + if (Objects.isNull(profitAnalysisInfo.getCustomerTotalPrice())) {
  591 + return false;
  592 + }
  593 + if (Objects.isNull(profitAnalysisInfo.getProductionDepartmentPrice())) {
  594 + return false;
  595 + }
  596 + if (Objects.isNull(profitAnalysisInfo.getProductionDepartmentTotalPrice())) {
  597 + return false;
  598 + }
  599 + if (Objects.isNull(profitAnalysisInfo.getPacketPrice())) {
  600 + return false;
  601 + }
  602 + if (Objects.isNull(profitAnalysisInfo.getPacketTotalPrice())) {
  603 + return false;
  604 + }
  605 + if (Objects.isNull(profitAnalysisInfo.getExchangeRate())) {
  606 + return false;
  607 + }
  608 + return true;
  609 + }
  610 +
  611 + /**
  612 + * @param resultVO
  613 + * @return
  614 + */
  615 + private boolean isFillOrderBaseInfo(OrderInfoResultVO resultVO) {
  616 + if (Objects.isNull(resultVO)) {
  617 + return false;
  618 + }
  619 + if (StringUtils.isBlank(resultVO.getCustomerCode())) {
  620 + return false;
  621 + }
  622 + if (StringUtils.isBlank(resultVO.getProjectNo())) {
  623 + return false;
  624 + }
  625 + if (StringUtils.isBlank(resultVO.getProductionDepartment())) {
  626 + return false;
  627 + }
  628 + if (StringUtils.isBlank(resultVO.getInnerNo())) {
  629 + return false;
  630 + }
  631 + if (StringUtils.isBlank(resultVO.getCustomerPo())) {
  632 + return false;
  633 + }
  634 + if (StringUtils.isBlank(resultVO.getCustomerStyle())) {
  635 + return false;
  636 + }
  637 + if (StringUtils.isBlank(resultVO.getModeleLo())) {
  638 + return false;
  639 + }
  640 + if (StringUtils.isBlank(resultVO.getCollection())) {
  641 + return false;
  642 + }
  643 + if (StringUtils.isBlank(resultVO.getPoColor())) {
  644 + return false;
  645 + }
  646 + if (StringUtils.isBlank(resultVO.getCnColor())) {
  647 + return false;
  648 + }
  649 + if (StringUtils.isBlank(resultVO.getPicUrl())) {
  650 + return false;
  651 + }
  652 + if (StringUtils.isBlank(resultVO.getProductionComment())) {
  653 + return false;
  654 + }
  655 + if (Objects.isNull(resultVO.getOrderCount())) {
  656 + return false;
  657 + }
  658 + if (StringUtils.isBlank(resultVO.getOrderComposition())) {
  659 + return false;
  660 + }
  661 + if (StringUtils.isBlank(resultVO.getProductStyle())) {
  662 + return false;
  663 + }
  664 + if (StringUtils.isBlank(resultVO.getProductionDepartmentConsignTime())) {
  665 + return false;
  666 + }
  667 + if (StringUtils.isBlank(resultVO.getOrderHodTime())) {
  668 + return false;
  669 + }
  670 + if (StringUtils.isBlank(resultVO.getOutboundType())) {
  671 + return false;
  672 + }
  673 + if (StringUtils.isBlank(resultVO.getPacketType())) {
  674 + return false;
  675 + }
  676 + return true;
  677 + }
  678 +
  679 + /**
  680 + * @param orderInfoResultVOList
  681 + */
438 682 private void fillLockFields(List<OrderInfoResultVO> orderInfoResultVOList) {
439 683 if (CollectionUtils.isEmpty(orderInfoResultVOList)) {
440 684 return;
... ... @@ -593,7 +837,6 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
593 837 }
594 838  
595 839 /**
596   - *
597 840 * @param orderId
598 841 * @param userId
599 842 * @param optType
... ... @@ -605,10 +848,9 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
605 848 }
606 849  
607 850 /**
608   - *
609 851 * @param updateVO
610 852 */
611   - private void initOrderId(OrderUpdateVO updateVO){
  853 + private void initOrderId(OrderUpdateVO updateVO) {
612 854 if (Objects.nonNull(updateVO.getBaseInfo())) {
613 855 updateVO.getBaseInfo().setId(updateVO.getOrderId());
614 856 }
... ...
src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java
... ... @@ -117,7 +117,19 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp
117 117 BeanUtils.copyProperties(x, resultVO);
118 118 String fields = x.getFields();
119 119 if (StringUtils.isNotBlank(fields)) {
120   - resultVO.setFieldInfos(JSONObject.parseObject(fields, OrderLockFieldVO.class));
  120 + if (ApplyTypeEnum.FIELD_EDIT_APPLY.getType() == x.getType()) {
  121 + resultVO.setFieldInfos(JSONObject.parseObject(fields, OrderLockFieldVO.class));
  122 + }
  123 + if (ApplyTypeEnum.ORDER_REPORT_APPLY.getType() == x.getType()) {
  124 + OrderLockFieldVO fieldVO = new OrderLockFieldVO();
  125 + fieldVO.setReportFields(JSONObject.parseObject(fields, OrderCompletionReportFieldVO.class));
  126 + resultVO.setFieldInfos(fieldVO);
  127 + }
  128 + if (ApplyTypeEnum.ORDER_PROFIT_APPLY.getType() == x.getType()) {
  129 + OrderLockFieldVO fieldVO = new OrderLockFieldVO();
  130 + fieldVO.setProfitAnalysisFields(JSONObject.parseObject(fields, OrderProfitAnalysisFieldVO.class));
  131 + resultVO.setFieldInfos(fieldVO);
  132 + }
121 133 }
122 134 return resultVO;
123 135 }).collect(Collectors.toList());
... ...