Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HYH.APSJ
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
佟礼
HYH.APSJ
Commits
be91d0a7
Commit
be91d0a7
authored
Feb 04, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下发修改
parent
c5ab1f7a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
932 additions
and
730 deletions
+932
-730
ChromosomeDataController.java
...a/com/aps/controller/common/ChromosomeDataController.java
+25
-122
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+1
-1
ChromosomeDataService.java
...in/java/com/aps/service/common/ChromosomeDataService.java
+775
-587
DatabaseQueryService.java
...ain/java/com/aps/service/common/DatabaseQueryService.java
+131
-20
No files found.
src/main/java/com/aps/controller/common/ChromosomeDataController.java
View file @
be91d0a7
...
...
@@ -23,6 +23,8 @@ import java.util.Collections;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
aps
.
common
.
util
.
R
.
ok
;
@RestController
@RequestMapping
(
"/queryChromosome"
)
@Tag
(
name
=
"甘特图数据查询"
,
description
=
"甘特图数据查询"
)
...
...
@@ -52,7 +54,6 @@ public class ChromosomeDataController {
@PathVariable
String
entityName
,
@RequestBody
Paged
paged
)
{
// 获取sceneId(文件实体需要,数据库实体可选)
String
sceneId
=
paged
.
getCondition
(
"sceneId"
)
!=
null
?
paged
.
getCondition
(
"sceneId"
).
getFieldValue
()
:
null
;
...
...
@@ -64,7 +65,7 @@ public class ChromosomeDataController {
Map
<
String
,
Object
>
result
=
chromosomeDataService
.
queryChromosomeDataWithConditions
(
sceneId
,
entityName
,
paged
);
return
R
.
ok
(
result
);
return
ok
(
result
);
}
...
...
@@ -85,7 +86,6 @@ public class ChromosomeDataController {
@PathVariable
String
entityName
,
@RequestBody
Paged
paged
)
{
// 获取sceneId(文件实体需要,数据库实体可选)
String
sceneId
=
paged
.
getCondition
(
"sceneId"
)
!=
null
?
paged
.
getCondition
(
"sceneId"
).
getFieldValue
()
:
null
;
...
...
@@ -98,12 +98,11 @@ public class ChromosomeDataController {
// 直接调用服务层的list查询方法
List
<
Object
>
result
=
chromosomeDataService
.
queryChromosomeDataList
(
sceneId
,
entityName
,
paged
);
if
(
result
==
null
)
{
return
R
.
ok
(
Collections
.
emptyList
(),
"查询成功,但未找到匹配的数据"
);
return
ok
(
Collections
.
emptyList
(),
"查询成功,但未找到匹配的数据"
);
}
return
R
.
ok
(
result
);
return
ok
(
result
);
}
...
...
@@ -124,17 +123,18 @@ public class ChromosomeDataController {
@PathVariable
String
entityName
,
@RequestParam
String
id
)
{
// 参数校验
if
(
id
==
null
||
id
.
isEmpty
())
{
return
R
.
ok
(
null
);
}
// 文件实体必须要有sceneId
if
(
isFileEntity
(
entityName
)
&&
(
sceneId
==
null
||
sceneId
.
isEmpty
()))
{
return
R
.
failed
(
"文件实体查询时sceneId不能为空"
);
return
R
.
ok
(
null
);
}
Object
result
=
chromosomeDataService
.
queryChromosomeDataById
(
sceneId
,
entityName
,
id
);
return
R
.
ok
(
result
);
return
ok
(
result
);
}
...
...
@@ -164,20 +164,25 @@ public class ChromosomeDataController {
@Parameter
(
description
=
"要更新的数据 (必须包含id字段)"
,
required
=
true
)
@RequestBody
Map
<
String
,
Object
>
data
)
{
// 参数校验
if
(
data
==
null
||
data
.
isEmpty
())
{
throw
new
RuntimeException
(
"更新数据不能为空"
);
}
if
(
data
.
get
(
"id"
)
==
null
)
{
throw
new
RuntimeException
(
"更新数据必须包含id字段"
);
}
// 文件实体必须要有sceneId
if
(
isFileEntity
(
entityName
)
&&
(
sceneId
==
null
||
sceneId
.
isEmpty
()))
{
throw
new
RuntimeException
(
"文件实体更新时sceneId不能为空"
);
}
if
(
entityName
.
equalsIgnoreCase
(
"machine"
)){
if
(
entityName
.
equalsIgnoreCase
(
"machine"
))
{
return
chromosomeDataService
.
updateMachineOption
(
sceneId
,
taskId
,
data
);
}
boolean
success
=
chromosomeDataService
.
updateChromosomeData
(
sceneId
,
entityName
,
data
);
return
R
.
ok
(
"更新成功"
);
return
ok
(
"更新成功"
);
}
...
...
@@ -196,112 +201,10 @@ public class ChromosomeDataController {
public
R
<
List
<
FieldInfo
>>
getEntityInfo
(
@Parameter
(
description
=
"实体名称"
,
required
=
true
)
@PathVariable
String
entityName
)
{
System
.
out
.
println
(
"getEntityInfo"
);
List
<
FieldInfo
>
fieldInfos
=
chromosomeDataService
.
getEntityInfo
(
entityName
);
return
R
.
ok
(
fieldInfos
);
return
ok
(
fieldInfos
);
}
//
// // 处理setupTime字段
// if (data.containsKey("setupTime")) {
// Object setupTimeObj = data.get("setupTime");
// if (setupTimeObj instanceof Integer) {
// machineOption.setSetupTime((Integer) setupTimeObj);
// } else if (setupTimeObj instanceof Long) {
// machineOption.setSetupTime(((Long) setupTimeObj).intValue());
// } else if (setupTimeObj instanceof String) {
// machineOption.setSetupTime(Integer.parseInt((String) setupTimeObj));
// }
// }
//
// // 处理teardownTime字段
// if (data.containsKey("teardownTime")) {
// Object teardownTimeObj = data.get("teardownTime");
// if (teardownTimeObj instanceof Integer) {
// machineOption.setTeardownTime((Integer) teardownTimeObj);
// } else if (teardownTimeObj instanceof Long) {
// machineOption.setTeardownTime(((Long) teardownTimeObj).intValue());
// } else if (teardownTimeObj instanceof String) {
// machineOption.setTeardownTime(Integer.parseInt((String) teardownTimeObj));
// }
// }
//
// // 处理contantTime字段
// if (data.containsKey("contantTime")) {
// Object contantTimeObj = data.get("contantTime");
// if (contantTimeObj instanceof Integer) {
// machineOption.setContantTime((Integer) contantTimeObj);
// } else if (contantTimeObj instanceof Long) {
// machineOption.setContantTime(((Long) contantTimeObj).intValue());
// } else if (contantTimeObj instanceof String) {
// machineOption.setContantTime(Integer.parseInt((String) contantTimeObj));
// }
// }
// // 处理equipCode字段
// if (data.containsKey("equipCode")) {
// machineOption.setEquipCode(String.valueOf(data.get("equipCode")));
// }
//
// // 处理resourceCode字段
// if (data.containsKey("resourceCode")) {
// machineOption.setResourceCode(String.valueOf(data.get("resourceCode")));
// }
// 忽略id等未知字段
private
boolean
updateMachineOptionsForEntry
(
Entry
targetEntry
,
List
<?>
machineOptions
,
ObjectMapper
objectMapper
)
{
boolean
allSuccess
=
true
;
for
(
Object
optionObj
:
machineOptions
)
{
if
(!(
optionObj
instanceof
Map
))
{
allSuccess
=
false
;
continue
;
}
Map
<?,
?>
optionMap
=
(
Map
<?,
?>)
optionObj
;
// 获取machineId
Object
machineIdObj
=
optionMap
.
get
(
"machineId"
);
if
(
machineIdObj
==
null
)
{
allSuccess
=
false
;
continue
;
}
String
machineOptionId
=
String
.
valueOf
(
machineIdObj
);
// 在entry的machineOptions列表中找到对应的machineOption
MachineOption
targetMachineOption
=
null
;
for
(
MachineOption
machineOption
:
targetEntry
.
getMachineOptions
())
{
if
(
String
.
valueOf
(
machineOption
.
getMachineId
()).
equals
(
machineOptionId
))
{
targetMachineOption
=
machineOption
;
break
;
}
}
if
(
targetMachineOption
==
null
)
{
allSuccess
=
false
;
continue
;
}
// 更新machineOption的字段
MachineOption
updatedMachineOption
=
objectMapper
.
convertValue
(
optionMap
,
MachineOption
.
class
);
// 替换原来的machineOption
int
index
=
targetEntry
.
getMachineOptions
().
indexOf
(
targetMachineOption
);
targetEntry
.
getMachineOptions
().
set
(
index
,
updatedMachineOption
);
}
return
allSuccess
;
}
/**
* 判断是否为文件实体
*/
...
...
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
be91d0a7
...
...
@@ -280,7 +280,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
public
void
decode
(
Chromosome
chromosome
)
{
List
<
OrderMaterialRequirement
>
orderMaterials
=
materialRequirementService
.
buildMultiLevelRequirementNetwork
(
chromosome
,
sceneId
,
baseTime
,
_globalParam
);
//
List<OrderMaterialRequirement> orderMaterials = materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam);
if
(
_globalParam
.
isIsCheckSf
())
{
int
isnew
=
generateGlobalOpList
(
chromosome
);
...
...
src/main/java/com/aps/service/common/ChromosomeDataService.java
View file @
be91d0a7
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/service/common/DatabaseQueryService.java
View file @
be91d0a7
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment