From 3ccb79a31dfc7295184ebbfaa5aec91cc507b418 Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Tue, 17 Jun 2025 11:20:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(project):=20=E6=B7=BB=E5=8A=A0=20POC=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BF=A1=E6=81=AF=E7=9B=B8=E5=85=B3=E9=80=BB?= =?UTF-8?q?=E8=BE=91-=20=E5=9C=A8=E9=A1=B9=E7=9B=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=20POC=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=92=8C=E7=9B=B8=E5=85=B3=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=20-=20=E5=AE=9E=E7=8E=B0=20POC=20=E6=B5=8B=E8=AF=95=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E7=9A=84=E5=8A=A8=E6=80=81=E6=98=BE=E7=A4=BA=E5=92=8C?= =?UTF-8?q?=E9=9A=90=E8=97=8F=20-=20=E6=B7=BB=E5=8A=A0=20POC=20=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E7=9A=84=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91-=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=92=8C=E7=BB=9F=E8=AE=A1=20-=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=A1=B9=E7=9B=AE=E9=AB=98=E4=BA=AE=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8=E6=9C=80=E5=90=8E=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=20-=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/manage/service/service.html | 14 ++--- .../resources/templates/project/info/add.html | 20 ++++++-- .../templates/project/info/common/pocLog.html | 51 ++++++++++++------- .../templates/project/info/edit.html | 41 +++++++++------ .../templates/project/info/project.html | 10 ++-- .../com/ruoyi/sip/domain/ProjectInfo.java | 9 ++-- .../service/impl/DeliveryListServiceImpl.java | 5 +- .../service/impl/OrderInfoServiceImpl.java | 2 +- .../service/impl/ProjectInfoServiceImpl.java | 31 +++++------ .../impl/ProjectOrderInfoServiceImpl.java | 2 +- .../impl/ProjectProductInfoServiceImpl.java | 15 +++++- .../mapper/sip/ProjectInfoMapper.xml | 20 +++++++- 12 files changed, 144 insertions(+), 76 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/manage/service/service.html b/ruoyi-admin/src/main/resources/templates/manage/service/service.html index 1ef9c328..6c81a4a7 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/service/service.html +++ b/ruoyi-admin/src/main/resources/templates/manage/service/service.html @@ -50,14 +50,14 @@ width:100px; padding:0; height: 30px; - background-color: #e74c3c; + background-color: #1c84c6; color: white; border: none; border-radius: 4px; cursor: pointer; } button:hover { - background-color: #c0392b; + border-color: #1a7bb9; } .topBox{ display: flex; @@ -107,7 +107,7 @@
查询结果
-
产品信息
+
产品信息
@@ -123,7 +123,7 @@
- 相关合同 + 相关合同 标准保修
@@ -174,7 +174,7 @@ res.data.forEach((ele)=>{ str+=` - + @@ -222,7 +222,7 @@ } function changeTab(show) { if(!show){ - $('#tab1').css({'background': '#dd242a','color':'#fff'}) + $('#tab1').css({'background': '#1c84c6','color':'#fff'}) $('#tab2').css({'background': '#fff','color':'#333'}) $('#tableBOx2').show() @@ -230,7 +230,7 @@ }else{ $('#tableBOx3').show() $('#tableBOx2').hide() - $('#tab2').css({'background': '#dd242a','color':'#fff'}) + $('#tab2').css({'background': '#1c84c6','color':'#fff'}) $('#tab1').css({'background': '#fff','color':'#333'}) } diff --git a/ruoyi-admin/src/main/resources/templates/project/info/add.html b/ruoyi-admin/src/main/resources/templates/project/info/add.html index abeebeb2..3a643de0 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/add.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/add.html @@ -223,10 +223,9 @@ > @@ -279,7 +278,7 @@
@@ -351,8 +350,21 @@ displayInput.value = Number(rawValue).toLocaleString('en-US'); } } + function changePoc() { + let val = $('#poc').val(); + if (val==='0'){ + $('#pocLogTab').attr('style','display:none') + }else{ + $('#pocLogTab').attr('style','display:inline') + } + } function submitHandler() { + let activeTabIndex=$('.layui-tab-title .layui-this').index(); + if (activeTabIndex!==1 && $('#poc').val() ==='1' && validatePoc()){ + $.modal.alertWarning("请完善POC记录信息"); + return ; + } if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-product-add').serialize()); } else { diff --git a/ruoyi-admin/src/main/resources/templates/project/info/common/pocLog.html b/ruoyi-admin/src/main/resources/templates/project/info/common/pocLog.html index 9f1a58bc..5137247a 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/common/pocLog.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/common/pocLog.html @@ -31,87 +31,87 @@ -
-
+
+
${ele.serialNumber}${ele.model}${ele.productCode} ${ele.description} ${ele.productName} CN POC测试 - +
- - - - - - - - - - - - - - @@ -137,8 +137,8 @@
服务器配置*
云桌面版本* 配置终端* 操作系统*
H3C接口人* H3C TEL*
汇智接口人* 汇智 TEL*
研发接口人* 研发 TEL*
现场接口人* 现场 TEL*
启动时间* 预计完成时间* 实际完成时间*
- + @@ -150,7 +150,7 @@ ${length + 1} - + `) @@ -211,6 +211,19 @@ } }); + function validatePoc() { + let result = false; + const pocDiv = $('#poc-info-component') + pocDiv.find('input').each(function () { + if ($(this).attr('required')) { + if (!$(this).val().trim()) { + result = true; + return false + } + } + }) + return result + } /*]]>*/ diff --git a/ruoyi-admin/src/main/resources/templates/project/info/edit.html b/ruoyi-admin/src/main/resources/templates/project/info/edit.html index 91b140be..6e8ea65a 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/edit.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/edit.html @@ -242,10 +242,9 @@ th:value="${#dates.format(projectInfo.estimatedOrderTime, 'yyyy-MM-dd')}"> POC测试 - + @@ -299,7 +298,7 @@
@@ -403,7 +402,23 @@ displayInput.value = ""; } } + + function changePoc() { + let val = $('#poc').val(); + console.log('----------------------------------') + console.log(val) + if (val==='0'){ + $('#pocLogTab').attr('style','display:none') + }else{ + $('#pocLogTab').attr('style','display:inline') + } + } function submitHandler() { + let activeTabIndex=$('.layui-tab-title .layui-this').index(); + if (activeTabIndex!==1 && $('#poc').val() ==='1' && validatePoc()){ + $.modal.alertWarning("请完善POC记录信息"); + return ; + } if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-product-add').serialize()); } else { @@ -411,11 +426,17 @@ } } + + $(function () { let amount = [[${projectInfo.estimatedAmount}]] || '' if (amount) { document.getElementById('displayEstimatedAmount').value=amount.toLocaleString('en-US'); } + let pocVal = [[${projectInfo.poc}]]; + if (pocVal==='0'){ + $('#pocLogTab').attr('style','display:none') + } initProductList() $("input[name='estimatedOrderTime']").datetimepicker({ format: "yyyy-mm-dd", @@ -573,19 +594,7 @@ } - function addLog(data) { - let length = $('#workLog tbody').find('tr').length - let tr = $(` - -${length + 1} - - - - -`) - $('#workLog tbody').append(tr) - } function showDetailValue(ele, canUpdate) { diff --git a/ruoyi-admin/src/main/resources/templates/project/info/project.html b/ruoyi-admin/src/main/resources/templates/project/info/project.html index 27de8c00..7e2383e7 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/project.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/project.html @@ -291,7 +291,7 @@ width: 140 }, { - field: 'updateTime', + field: 'lastWorkUpdateTime', title: '更新时间', class: 'time3', width: 160, @@ -380,7 +380,7 @@ function changeSort(ele, index) { - let arr = ['estimated_orderTime', 'estimated_deliverTime', 'update_time'] + let arr = ['estimated_orderTime', 'estimated_deliverTime', 'last_work_update_time'] $('.sortBox').find('.timeAction').removeClass('timeAction') $(ele).addClass('timeAction') $('input[name="orderByColumn"]').val(arr[index]) @@ -397,8 +397,10 @@ $('#laydate-startTime').attr('name', 'estimatedDeliverTimeStart') $('#laydate-endTime').attr('name', 'estimatedDeliverTimeEnd') } else if (timeType == 2) { - $('#laydate-startTime').attr('name', 'updateTimeStart') - $('#laydate-endTime').attr('name', 'updateTimeEnd') + // $('#laydate-startTime').attr('name', 'updateTimeStart') + // $('#laydate-endTime').attr('name', 'updateTimeEnd') + $('#laydate-startTime').attr('name', 'lastWorkUpdateTimeStart') + $('#laydate-endTime').attr('name', 'lastWorkUpdateTimeEnd') } } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectInfo.java index c42dbca4..d3f99359 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectInfo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectInfo.java @@ -108,6 +108,7 @@ public class ProjectInfo extends BaseEntity private Date estimatedOrderTimeStart; private Date estimatedOrderTimeEnd; + @Excel(name = "POC测试") private String poc; private String contactEmail; @@ -158,11 +159,13 @@ public class ProjectInfo extends BaseEntity private Date estimatedDeliverTimeEnd; private Date updateTimeStart; private Date updateTimeEnd; + + private Date updateTime; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") - private Date updateTime; - - + private Date lastWorkUpdateTime; + private Date lastWorkUpdateTimeStart; + private Date lastWorkUpdateTimeEnd; diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/DeliveryListServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/DeliveryListServiceImpl.java index f3711c40..45ca5f75 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/DeliveryListServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/DeliveryListServiceImpl.java @@ -210,8 +210,8 @@ public class DeliveryListServiceImpl implements IDeliveryListService { private void updateDeliveryInfoVo(DeliveryInfoVo deliveryInfoVo, Map> maintenanceTypeMap, List productInfos) { List productInfoList = maintenanceTypeMap.get(deliveryInfoVo.getOrderId()); List serviceInfoList = new ArrayList<>(); + Date startTime = deliveryInfoVo.getServiceStartTime(); if (CollUtil.isNotEmpty(productInfoList)) { - Date startTime = deliveryInfoVo.getServiceStartTime(); if (ProductInfo.ProductTypeEnum.SOFTWARE.getType().equals(deliveryInfoVo.getProductType())) { for (ProductInfo productInfo : productInfoList) { if (ProductInfo.ProductTypeEnum.SOFTWARE_MAINTENANCE.getType().equals(productInfo.getType()) && StringUtils.isNotEmpty(productInfo.getValue())) { @@ -228,6 +228,7 @@ public class DeliveryListServiceImpl implements IDeliveryListService { } } } + } if (CollUtil.isEmpty(serviceInfoList) && ProductInfo.ProductTypeEnum.HARDWARE.getType().equals(deliveryInfoVo.getProductType()) && CollUtil.isNotEmpty(productInfos)) { @@ -238,7 +239,7 @@ public class DeliveryListServiceImpl implements IDeliveryListService { } deliveryInfoVo.setServiceInfo(serviceInfoList); - } + } private static Date updateStartTimeAndAddList(DeliveryInfoVo deliveryInfoVo, ProductInfo productInfo, Date startTime, List serviceInfoList) { diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java index 37abd601..a2e9287b 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java @@ -349,7 +349,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService if (orderList.getDiscount() == null) { throw new ServiceException("折扣不能为空"); } - if (orderList.getDiscount().compareTo(BigDecimal.ONE) > 0 || orderList.getDiscount().compareTo(BigDecimal.ZERO) <= 0) { + if (orderList.getDiscount().compareTo(BigDecimal.ONE) > 0 || orderList.getDiscount().compareTo(BigDecimal.ZERO) < 0) { throw new ServiceException("折扣区间需在0-1之间"); } if (orderList.getPrice() == null) { diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java index 22b2b27b..72aabd8c 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java @@ -18,6 +18,8 @@ import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.sip.domain.*; +import com.ruoyi.sip.dto.HomepageQueryDto; +import com.ruoyi.sip.dto.StatisticsDto; import com.ruoyi.sip.mapper.ProjectInfoMapper; import com.ruoyi.sip.service.*; import lombok.extern.slf4j.Slf4j; @@ -129,10 +131,16 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { Map orderInfoMap = projectOrderInfos.stream().collect(Collectors.toMap(ProjectOrderInfo::getProjectId, Function.identity(), (v1, v2) -> v1)); LocalDate now = LocalDate.now(); for (ProjectInfo info : projectInfos) { - LocalDate localDate = info.getUpdateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - Period between = Period.between(localDate, now); - info.setHighlight(between.getMonths() >= 2); info.setCanGenerate(orderInfoMap.get(info.getId()) == null); + if (info.getLastWorkUpdateTime() != null) { + LocalDate localDate = info.getLastWorkUpdateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + Period between = Period.between(localDate, now); + info.setHighlight(between.getMonths() >= 2); + } else { + info.setHighlight(false); + } + + } return projectInfos; } @@ -153,9 +161,6 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { if (CollUtil.isNotEmpty(projectInfo.getCompetitorList())) { projectInfo.setCompetitor(projectInfo.getCompetitorList().stream().filter(StringUtils::isNotEmpty).collect(Collectors.joining(","))); } - if (projectInfo.getProjectPocInfo()!=null && CollUtil.isNotEmpty(projectInfo.getProjectPocInfo().getProjectPocInfoDetailList())){ - projectInfo.setPoc("1"); - } int i = projectInfoMapper.insertProjectInfo(projectInfo); saveOtherInfo(projectInfo); return i; @@ -229,18 +234,9 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { //如果没有 变更编码 是否考虑高并发加锁 setProjectCode(projectInfo); } - - - int newWorkSize = projectInfo.getProjectWorkProgressList() == null ? 0 : projectInfo.getProjectWorkProgressList().size(); - int existWorkSize = oldProjectInfo.getProjectWorkProgressList() == null ? 0 : oldProjectInfo.getProjectWorkProgressList().size(); - boolean changeWork = newWorkSize > existWorkSize; // 更新项目信息 - if (changeWork) { - projectInfo.setUpdateTime(DateUtils.getNowDate()); - } - if (projectInfo.getProjectPocInfo()!=null && CollUtil.isNotEmpty(projectInfo.getProjectPocInfo().getProjectPocInfoDetailList())){ - projectInfo.setPoc("1"); - } + projectInfo.setUpdateTime(DateUtils.getNowDate()); + projectInfo.setUpdateBy(ShiroUtils.getUserId().toString()); int result = projectInfoMapper.updateProjectInfo(projectInfo); //变更其它信息 saveOtherInfo(projectInfo); @@ -284,6 +280,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { formatterDate(projectInfo.getEstimatedOrderTime())); // logIndex = compareField(logContent, logIndex, "预计发货时间", formatterDate(oldProjectInfo.getEstimatedDeliverTime()), formatterDate(projectInfo.getEstimatedDeliverTime())); logIndex = compareField(logContent, logIndex, "竞争对手", oldProjectInfo.getCompetitor(), projectInfo.getCompetitor()); + logIndex = compareField(logContent, logIndex, "poc记录", oldProjectInfo.getPoc(), projectInfo.getPoc()); logIndex = compareField(logContent, logIndex, "关键技术问题", oldProjectInfo.getKeyProblem(), projectInfo.getKeyProblem()); logIndex = compareField(logContent, logIndex, "项目简述", oldProjectInfo.getProjectDesc(), projectInfo.getProjectDesc()); if (logIndex > 1) { diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java index 1f5c1e1b..77470677 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java @@ -327,7 +327,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService { Sheet sheet = writeSheetHolder.getSheet(); // 基础列范围(前 25 列) - if (columnIndex >= 0 && columnIndex <= 25) { + if (columnIndex >= 0 && columnIndex <= 26) { // 自适应列宽逻辑 sheet.setColumnWidth(columnIndex, 256 * 30); // 设置固定宽度为 20 个字符 } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java index f65bb6a3..dccafb9f 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java @@ -1,5 +1,7 @@ package com.ruoyi.sip.service.impl; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.Collections; import java.util.List; import java.util.Set; @@ -117,7 +119,18 @@ public class ProjectProductInfoServiceImpl implements IProjectProductInfoService if (stringJoiner.length() > 0) { throw new ServiceException(StringUtils.format("产品编码[{}]在产品库中未找到,请确认后重试", stringJoiner.toString())); } - + for (ProjectProductInfo info : list) { + //计算价格 防止前端价格计算错误 + if (info.getGuidanceDiscount() != null && info.getDiscount() == null) { + info.setDiscount(info.getGuidanceDiscount()); + } + if (info.getCataloguePrice() != null && info.getDiscount() != null) { + info.setPrice(info.getCataloguePrice().multiply(info.getDiscount()).setScale(2, RoundingMode.HALF_UP)); + } + if (info.getPrice() != null && info.getQuantity() != null) { + info.setAllPrice(info.getPrice().multiply(new BigDecimal(info.getQuantity())).setScale(2, RoundingMode.HALF_UP)); + } + } List projectProductInfos = projectProductInfoMapper.selectProjectProductInfoListByProjectId(Collections.singletonList(list.get(0).getProjectId())); Set idSet = list.stream().map(ProjectProductInfo::getId).collect(Collectors.toSet()); diff --git a/ruoyi-sip/src/main/resources/mapper/sip/ProjectInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/sip/ProjectInfoMapper.xml index 9172c52e..a4edd75b 100644 --- a/ruoyi-sip/src/main/resources/mapper/sip/ProjectInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/sip/ProjectInfoMapper.xml @@ -70,10 +70,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t1.update_time, t1.customer_user_name,t1.customer_phone,t1.partner_email,t1.partner_user_name,t1.h3c_person,t1.poc,t1.h3c_phone, t2.agent_name,t2.contact_email,t2.contact_phone,t2.contact_person, - t3.user_name as hz_support_user_name + t3.user_name as hz_support_user_name, + t4.work_time as last_work_update_time from project_info t1 left join agent_info t2 on t1.agent_code = t2.agent_code left join sys_user t3 on t1.hz_support_user=t3.user_id + left join (select max(work_time) work_time,project_id from project_work_progress group by project_id) t4 ON t1.id=t4.project_id +