更新项目工作流
This commit is contained in:
parent
644f29c959
commit
a5d604988a
@ -49,8 +49,8 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://localhost:3306/item_retrieval-evo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://192.168.5.121:3306/item_retrieval-evo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://localhost:3306/item_retrieval-evo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
url: jdbc:mysql://192.168.5.121:3306/item_retrieval-evo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
@ -58,8 +58,8 @@ spring:
|
||||
lazy: true
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/item_retrieval_salve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://192.168.5.121:3306/item_retrieval_salve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://localhost:3306/item_retrieval_salve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
url: jdbc:mysql://192.168.5.121:3306/item_retrieval_salve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
sqlserver:
|
||||
|
||||
@ -52,8 +52,8 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://localhost:3306/item_retrieval-evo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
# url: jdbc:mysql://192.168.5.121:3306/item_retrieval-evo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://localhost:3306/item_retrieval-evo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
url: jdbc:mysql://192.168.5.121:3306/item_retrieval-evo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
@ -61,8 +61,8 @@ spring:
|
||||
lazy: true
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/item_retrieval_salve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://192.168.5.121:3306/item_retrieval_salve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
#url: jdbc:mysql://localhost:3306/item_retrieval_salve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
url: jdbc:mysql://192.168.5.121:3306/item_retrieval_salve?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
sqlserver:
|
||||
|
||||
@ -155,6 +155,7 @@ security:
|
||||
- /system/material/getObtainPartData2
|
||||
- /system/operationPlanningMain/sync
|
||||
- /system/operationPlanningMain/cascadeList
|
||||
- /system/operationPlanningMain/queryFromK3
|
||||
|
||||
# MyBatisPlus配置
|
||||
# https://baomidou.com/config/
|
||||
|
||||
@ -28,8 +28,6 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.ruoyi.system.domain.dto.OperationPlanResultDTO;
|
||||
import com.ruoyi.system.domain.dto.OperationPlanningUpdateOperatorsReq;
|
||||
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
/**
|
||||
* 工序计划主
|
||||
@ -56,6 +54,15 @@ public class SfcOperationPlanningMainController extends BaseController {
|
||||
return toAjax(iSfcOperationPlanningMainService.syncOperationPlanning());
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接从K3查询工序计划数据(不入库测试)
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/queryFromK3")
|
||||
public R<List<OperationPlanResultDTO>> queryFromK3() {
|
||||
return R.ok(iSfcOperationPlanningMainService.queryFromK3Directly());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询工序计划主及明细级联数据
|
||||
*/
|
||||
|
||||
@ -59,6 +59,36 @@ public class OperationPlanResultDTO {
|
||||
@JsonIgnore
|
||||
private Date rawPlanStartTime;
|
||||
|
||||
/**
|
||||
* 工段信息摘要(如:委外中心/电钳工段)
|
||||
*/
|
||||
private String workCenter;
|
||||
|
||||
/**
|
||||
* 总体计划数量
|
||||
*/
|
||||
private Double overallPlanQty;
|
||||
|
||||
/**
|
||||
* 总体合格数量
|
||||
*/
|
||||
private Double overallOkQty;
|
||||
|
||||
/**
|
||||
* 总体进度(0-100)
|
||||
*/
|
||||
private Double overallProgress;
|
||||
|
||||
/**
|
||||
* 总体状态(如:未开工/生产中/已完工)
|
||||
*/
|
||||
private String overallStatus;
|
||||
|
||||
/**
|
||||
* 轻量级的工序摘要(用于列表页进度图标渲染,限制数量)
|
||||
*/
|
||||
private List<ProcessSummaryDTO> processSummary;
|
||||
|
||||
/**
|
||||
* 工序列表
|
||||
*/
|
||||
|
||||
@ -59,5 +59,10 @@ public interface ISfcOperationPlanningMainService {
|
||||
*/
|
||||
TableDataInfo<OperationPlanResultDTO> queryCascadePageList(SfcOperationPlanningMainBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 直接从K3查询工序计划数据(不入库测试)
|
||||
*/
|
||||
List<OperationPlanResultDTO> queryFromK3Directly();
|
||||
|
||||
Boolean updateOperators(OperationPlanningUpdateOperatorsReq req);
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.system.domain.bo.SfcOperationPlanningMainBo;
|
||||
@ -50,6 +51,7 @@ import java.util.LinkedHashMap;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SfcOperationPlanningMainServiceImpl implements ISfcOperationPlanningMainService {
|
||||
|
||||
private final SfcOperationPlanningMainMapper baseMapper;
|
||||
@ -303,6 +305,64 @@ public class SfcOperationPlanningMainServiceImpl implements ISfcOperationPlannin
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接从K3查询工序计划数据(不入库测试)
|
||||
*/
|
||||
@Override
|
||||
public List<OperationPlanResultDTO> queryFromK3Directly() {
|
||||
long start = System.currentTimeMillis();
|
||||
// 1. 调用JdUtil直接从K3获取层级组装好的数据
|
||||
List<OperationPlanResultDTO> structuredList = JdUtil.getStructuredOperationPlanningList();
|
||||
long endK3 = System.currentTimeMillis();
|
||||
|
||||
// 2. 计算进度、状态等总体数据(如果需要在前端呈现的话)
|
||||
if (structuredList != null && !structuredList.isEmpty()) {
|
||||
for (OperationPlanResultDTO resultDTO : structuredList) {
|
||||
double totalPlanQty = 0.0;
|
||||
double totalOkQty = 0.0;
|
||||
int finishedCount = 0;
|
||||
String mainWorkCenter = "";
|
||||
|
||||
List<ProcessDetailDTO> relatedDetails = resultDTO.getProcessList();
|
||||
if (relatedDetails != null && !relatedDetails.isEmpty()) {
|
||||
mainWorkCenter = relatedDetails.get(0).getWorkCenter();
|
||||
for (ProcessDetailDTO detail : relatedDetails) {
|
||||
if (detail.getPlanQty() != null) totalPlanQty += detail.getPlanQty();
|
||||
if (detail.getOkQty() != null) totalOkQty += detail.getOkQty();
|
||||
if ("4".equals(detail.getStatus()) || "已完工".equals(detail.getStatus())) {
|
||||
finishedCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resultDTO.setWorkCenter(mainWorkCenter);
|
||||
resultDTO.setOverallPlanQty(totalPlanQty);
|
||||
resultDTO.setOverallOkQty(totalOkQty);
|
||||
|
||||
double progress = 0.0;
|
||||
if (totalPlanQty > 0) {
|
||||
progress = (totalOkQty / totalPlanQty) * 100;
|
||||
}
|
||||
resultDTO.setOverallProgress(Math.min(100.0, Math.max(0.0, progress)));
|
||||
|
||||
// 计算总体状态
|
||||
if (relatedDetails == null || relatedDetails.isEmpty() || (finishedCount == 0 && totalOkQty == 0)) {
|
||||
resultDTO.setOverallStatus("未开工");
|
||||
} else if (finishedCount == relatedDetails.size()) {
|
||||
resultDTO.setOverallStatus("已完工");
|
||||
} else {
|
||||
resultDTO.setOverallStatus("生产中");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
long endProcess = System.currentTimeMillis();
|
||||
log.info("K3直查测试 - 请求与解析耗时: {}ms, 内存组装进度耗时: {}ms, 总耗时: {}ms, 总条数: {}",
|
||||
(endK3 - start), (endProcess - endK3), (endProcess - start), structuredList == null ? 0 : structuredList.size());
|
||||
|
||||
return structuredList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询工序计划主及明细级联数据
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user