Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes
Project
Project
Details
Activity
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
ximai
mes
Commits
f4a5606a
Commit
f4a5606a
authored
Sep 06, 2024
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产版本相关引用调整、排产调整
parent
821302bc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
294 additions
and
1546 deletions
+294
-1546
RuoYiApplication.java
admin/src/main/java/com/ximai/RuoYiApplication.java
+2
-0
Knife4jConfiguration.java
.../java/com/ximai/web/core/config/Knife4jConfiguration.java
+0
-34
logback.xml
admin/src/main/resources/logback.xml
+19
-0
PageParams.java
...rc/main/java/com/ximai/common/core/domain/PageParams.java
+41
-9
ProWorkorder.java
...a/com/ximai/mes/pro/domain/proWorkOrder/ProWorkorder.java
+12
-10
ProWorkorderVo.java
...main/java/com/ximai/mes/pro/domain/vo/ProWorkorderVo.java
+9
-10
ProProductQrcodeRecordCreate.java
...a/com/ximai/mes/pro/dto/ProProductQrcodeRecordCreate.java
+11
-1
AlgorithmDataSourceImpl.java
.../ximai/mes/pro/schedule/impl/AlgorithmDataSourceImpl.java
+2
-1
AlgorithmResultProcessImpl.java
...mai/mes/pro/schedule/impl/AlgorithmResultProcessImpl.java
+14
-17
JobResult.java
.../java/com/ximai/mes/pro/schedule/impl/busi/JobResult.java
+18
-0
MaterialRequestBuild.java
...imai/mes/pro/schedule/impl/busi/MaterialRequestBuild.java
+6
-4
ProductQrcodeBuild.java
.../ximai/mes/pro/schedule/impl/busi/ProductQrcodeBuild.java
+46
-0
ScheduleBusiProcess.java
...ximai/mes/pro/schedule/impl/busi/ScheduleBusiProcess.java
+1
-1
TaskResult.java
...java/com/ximai/mes/pro/schedule/impl/busi/TaskResult.java
+14
-0
ToolRequestBuild.java
...om/ximai/mes/pro/schedule/impl/busi/ToolRequestBuild.java
+5
-3
WorkorderUpdate.java
...com/ximai/mes/pro/schedule/impl/busi/WorkorderUpdate.java
+41
-0
EvaluateEquipmentChangeOver.java
...es/pro/schedule/strategy/EvaluateEquipmentChangeOver.java
+0
-95
EvaluateEquipmentFunction.java
.../mes/pro/schedule/strategy/EvaluateEquipmentFunction.java
+0
-63
IProProductQrcodeRuleService.java
...m/ximai/mes/pro/service/IProProductQrcodeRuleService.java
+10
-1
ProProductQrcodeRecordServiceImpl.java
...s/pro/service/impl/ProProductQrcodeRecordServiceImpl.java
+1
-1
ProProductQrcodeRuleServiceImpl.java
...mes/pro/service/impl/ProProductQrcodeRuleServiceImpl.java
+15
-9
ProScheduleSetupRuleValServiceImpl.java
.../pro/service/impl/ProScheduleSetupRuleValServiceImpl.java
+2
-1
ProWorkOrderArrangeRuleValServiceImpl.java
...l/proWorkOrder/ProWorkOrderArrangeRuleValServiceImpl.java
+2
-1
ProWorkorderServiceImpl.java
...ro/service/impl/proWorkOrder/ProWorkorderServiceImpl.java
+7
-682
ProTaskServiceImpl.java
...m/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
+0
-6
IProWorkorderService.java
...ai/mes/pro/service/proWorkOrder/IProWorkorderService.java
+0
-17
WorkorderRestController.java
...n/java/com/ximai/mes/restful/WorkorderRestController.java
+0
-110
ProWorkorderMapper.xml
.../resources/mapper/pro/proWorkOrder/ProWorkorderMapper.xml
+16
-9
EquipmentSelectionStrategyImplTest.java
...schedule/strategy/EquipmentSelectionStrategyImplTest.java
+0
-344
EvaluateEquipmentChangeOverTest.java
...es/schedule/strategy/EvaluateEquipmentChangeOverTest.java
+0
-62
EvaluateEquipmentFunctionTest.java
.../mes/schedule/strategy/EvaluateEquipmentFunctionTest.java
+0
-55
No files found.
admin/src/main/java/com/ximai/RuoYiApplication.java
View file @
f4a5606a
...
@@ -10,6 +10,7 @@ import org.springframework.context.annotation.Bean;
...
@@ -10,6 +10,7 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.ImportResource
;
import
org.springframework.context.annotation.ImportResource
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
springfox.documentation.oas.annotations.EnableOpenApi
;
/**
/**
* 启动程序
* 启动程序
...
@@ -19,6 +20,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
...
@@ -19,6 +20,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
})
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
})
@EnableFeignClients
(
basePackages
=
{
"com.ximai"
})
@EnableFeignClients
(
basePackages
=
{
"com.ximai"
})
@EnableScheduling
@EnableScheduling
@EnableOpenApi
public
class
RuoYiApplication
{
public
class
RuoYiApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
// System.setProperty("spring.devtools.restart.enabled", "false");
...
...
admin/src/main/java/com/ximai/web/core/config/Knife4jConfiguration.java
deleted
100644 → 0
View file @
821302bc
//package com.ximai.web.core.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
//
//@Configuration
//@EnableSwagger2WebMvc
//public class Knife4jConfiguration {
// @Bean(value = "dockerBean")
// public Docket dockerBean() {
// //指定使用Swagger2规范
// Docket docket=new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(new ApiInfoBuilder()
// //描述字段支持Markdown语法
// .description("# Knife4j RESTful APIs")
// .termsOfServiceUrl("https://doc.xiaominfo.com/")
// .version("1.0")
// .build())
// //分组名称
// .groupName("用户服务")
// .select()
// //这里指定Controller扫描包路径
// .apis(RequestHandlerSelectors.basePackage("com.github.xiaoymin.knife4j.controller"))
// .paths(PathSelectors.any())
// .build();
// return docket;
// }
//}
admin/src/main/resources/logback.xml
View file @
f4a5606a
...
@@ -71,6 +71,20 @@
...
@@ -71,6 +71,20 @@
</encoder>
</encoder>
</appender>
</appender>
<!-- 排产相关日志输出 -->
<appender
name=
"sys-schedule"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${log.path}/sys-schedule.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 按天回滚 daily -->
<fileNamePattern>
${log.path}/sys-schedule.%d{yyyy-MM-dd}.log
</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>
60
</maxHistory>
</rollingPolicy>
<encoder>
<pattern>
${log.pattern}
</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<!-- 系统模块日志级别控制 -->
<logger
name=
"com.ximai"
level=
"info"
/>
<logger
name=
"com.ximai"
level=
"info"
/>
<!-- Spring日志级别控制 -->
<!-- Spring日志级别控制 -->
...
@@ -90,4 +104,9 @@
...
@@ -90,4 +104,9 @@
<logger
name=
"sys-user"
level=
"info"
>
<logger
name=
"sys-user"
level=
"info"
>
<appender-ref
ref=
"sys-user"
/>
<appender-ref
ref=
"sys-user"
/>
</logger>
</logger>
<!--排产操作日志-->
<logger
name=
"com.bsn.mes.pro.schedule"
level=
"info"
>
<appender-ref
ref=
"sys-schedule"
/>
</logger>
</configuration>
</configuration>
common/src/main/java/com/ximai/common/core/domain/PageParams.java
View file @
f4a5606a
package
com
.
ximai
.
common
.
core
.
domain
;
package
com
.
ximai
.
common
.
core
.
domain
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
PageParams
{
public
class
PageParams
{
/**
/**
* 当前记录起始索引
* 当前记录起始索引
*/
*/
@ApiModelProperty
(
"页数"
)
public
static
Integer
pageNum
;
public
Integer
pageNum
;
/**
/**
* 每页显示记录数
* 每页显示记录数
*/
*/
@ApiModelProperty
(
"分页SIZE"
)
public
Integer
pageSize
;
public
Integer
pageSize
;
/**
/**
* 排序列
* 排序列
*/
*/
@ApiModelProperty
(
"排序列"
)
public
String
orderByColumn
;
public
String
orderByColumn
;
/**
/**
* 排序的方向 "desc" 或者 "asc".
* 排序的方向 "desc" 或者 "asc".
*/
*/
@ApiModelProperty
(
"排序方向"
)
public
String
isAsc
;
public
String
isAsc
;
/**
/**
* 分页参数合理化
* 分页参数合理化
*/
*/
public
Boolean
reasonable
;
public
Boolean
reasonable
;
public
static
Integer
getPageNum
()
{
return
pageNum
;
}
public
static
void
setPageNum
(
Integer
pageNum
)
{
PageParams
.
pageNum
=
pageNum
;
}
public
Integer
getPageSize
()
{
return
pageSize
;
}
public
void
setPageSize
(
Integer
pageSize
)
{
this
.
pageSize
=
pageSize
;
}
public
String
getOrderByColumn
()
{
return
orderByColumn
;
}
public
void
setOrderByColumn
(
String
orderByColumn
)
{
this
.
orderByColumn
=
orderByColumn
;
}
public
String
getIsAsc
()
{
return
isAsc
;
}
public
void
setIsAsc
(
String
isAsc
)
{
this
.
isAsc
=
isAsc
;
}
public
Boolean
getReasonable
()
{
return
reasonable
;
}
public
void
setReasonable
(
Boolean
reasonable
)
{
this
.
reasonable
=
reasonable
;
}
}
}
mes/src/main/java/com/ximai/mes/pro/domain/proWorkOrder/ProWorkorder.java
View file @
f4a5606a
package
com
.
ximai
.
mes
.
pro
.
domain
.
proWorkOrder
;
package
com
.
ximai
.
mes
.
pro
.
domain
.
proWorkOrder
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.ximai.common.annotation.Excel
;
import
com.ximai.common.annotation.Excel
;
...
@@ -222,16 +223,15 @@ public class ProWorkorder extends TreeEntity {
...
@@ -222,16 +223,15 @@ public class ProWorkorder extends TreeEntity {
*/
*/
@Excel
(
name
=
"单据状态"
)
@Excel
(
name
=
"单据状态"
)
private
String
status
;
private
String
status
;
/**
* 任务清单组键值
@ApiModelProperty
(
"生产版本ID"
)
*/
private
Long
productionSolutionId
;
@Excel
(
name
=
"任务清单组键值"
)
private
String
groupKey
;
@ApiModelProperty
(
"生产版本编码"
)
/**
private
String
productionSolutionCode
;
* 组计数器
*/
@ApiModelProperty
(
"生产版本名称"
)
@Excel
(
name
=
"组计数器"
)
private
String
productionSolutionName
;
private
String
groupCounter
;
/**
/**
* 工厂编码
* 工厂编码
...
@@ -299,6 +299,8 @@ public class ProWorkorder extends TreeEntity {
...
@@ -299,6 +299,8 @@ public class ProWorkorder extends TreeEntity {
*/
*/
private
String
sapItemCode
;
private
String
sapItemCode
;
@ApiModelProperty
(
"批次序列号"
)
private
Integer
batchSerial
;
/**
/**
* ep物料号
* ep物料号
...
...
mes/src/main/java/com/ximai/mes/pro/domain/vo/ProWorkorderVo.java
View file @
f4a5606a
...
@@ -33,15 +33,6 @@ public class ProWorkorderVo extends BaseEntity {
...
@@ -33,15 +33,6 @@ public class ProWorkorderVo extends BaseEntity {
private
Long
[]
workorderIds
;
private
Long
[]
workorderIds
;
/**
* 任务清单组键值
*/
private
String
groupKey
;
/**
* 组计数器
*/
private
String
groupCounter
;
private
Long
parentId
;
private
Long
parentId
;
/**
/**
* 工艺路线ID
* 工艺路线ID
...
@@ -64,7 +55,6 @@ public class ProWorkorderVo extends BaseEntity {
...
@@ -64,7 +55,6 @@ public class ProWorkorderVo extends BaseEntity {
private
String
sapItemCode
;
private
String
sapItemCode
;
private
String
productionSolutionCode
;
/**
/**
* 工单名称
* 工单名称
*/
*/
...
@@ -299,4 +289,13 @@ public class ProWorkorderVo extends BaseEntity {
...
@@ -299,4 +289,13 @@ public class ProWorkorderVo extends BaseEntity {
@Excel
(
name
=
"是否急单"
)
@Excel
(
name
=
"是否急单"
)
private
String
rushOrder
;
private
String
rushOrder
;
@ApiModelProperty
(
"生产版本ID"
)
private
Long
productionSolutionId
;
@ApiModelProperty
(
"生产版本编码"
)
private
String
productionSolutionCode
;
@ApiModelProperty
(
"生产版本名称"
)
private
String
productionSolutionName
;
}
}
mes/src/main/java/com/ximai/mes/pro/dto/ProProductQrcodeRecordCreate.java
View file @
f4a5606a
package
com
.
ximai
.
mes
.
pro
.
dto
;
package
com
.
ximai
.
mes
.
pro
.
dto
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -36,7 +37,7 @@ public class ProProductQrcodeRecordCreate {
...
@@ -36,7 +37,7 @@ public class ProProductQrcodeRecordCreate {
/** 打印次数 */
/** 打印次数 */
@ApiModelProperty
(
"打印次数"
)
@ApiModelProperty
(
"打印次数"
)
private
Long
printTime
;
private
Integer
printTime
;
/** 二维码 */
/** 二维码 */
@ApiModelProperty
(
"二维码"
)
@ApiModelProperty
(
"二维码"
)
...
@@ -54,6 +55,15 @@ public class ProProductQrcodeRecordCreate {
...
@@ -54,6 +55,15 @@ public class ProProductQrcodeRecordCreate {
@ApiModelProperty
(
"产品描述"
)
@ApiModelProperty
(
"产品描述"
)
private
String
itemDesc
;
private
String
itemDesc
;
public
void
initByWorkorder
(
ProWorkorder
workorder
){
this
.
setItemId
(
workorder
.
getProductId
());
this
.
setItemCode
(
workorder
.
getProductCode
());
this
.
setClientCode
(
workorder
.
getClientCode
());
this
.
setClientName
(
workorder
.
getClientName
());
this
.
setWorkOrderId
(
workorder
.
getWorkorderId
());
this
.
setWorkOrderNo
(
workorder
.
getWorkorderCode
());
}
}
}
mes/src/main/java/com/ximai/mes/pro/schedule/impl/AlgorithmDataSourceImpl.java
View file @
f4a5606a
...
@@ -16,6 +16,7 @@ import com.ximai.mes.pro.domain.productionSolution.ProProductionSolutionProcess;
...
@@ -16,6 +16,7 @@ import com.ximai.mes.pro.domain.productionSolution.ProProductionSolutionProcess;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolutionSpecificationSheet
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolutionSpecificationSheet
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
com.ximai.mes.pro.domain.task.WorkorderScheduleParams
;
import
com.ximai.mes.pro.domain.task.WorkorderScheduleParams
;
import
com.ximai.mes.pro.domain.vo.ProProductionSolutionVo
;
import
com.ximai.mes.pro.schedule.*
;
import
com.ximai.mes.pro.schedule.*
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkOrderProcessService
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkOrderProcessService
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkorderService
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkorderService
;
...
@@ -130,7 +131,7 @@ public class AlgorithmDataSourceImpl implements AlgorithmDataSource {
...
@@ -130,7 +131,7 @@ public class AlgorithmDataSourceImpl implements AlgorithmDataSource {
processQuery
.
orderByAsc
(
"t1.idx"
);
processQuery
.
orderByAsc
(
"t1.idx"
);
List
<
ProWorkOrderProcess
>
productionOrderRoutings
=
proWorkOrderProcessService
.
selectListByQw
(
processQuery
);
List
<
ProWorkOrderProcess
>
productionOrderRoutings
=
proWorkOrderProcessService
.
selectListByQw
(
processQuery
);
//生产版本查询
//生产版本查询
ProProductionSolution
productionSolution
=
proProductionSolutionService
.
selectByGroupKeyAndGroupCounterAndSapItemCode
(
firstWorkorder
.
getGroupKey
(),
firstWorkorder
.
getGroupCounter
(),
firstWorkorder
.
getSapItemCode
());
ProProductionSolution
Vo
productionSolution
=
proProductionSolutionService
.
selectProProductionSolutionByProductionSolutionId
(
firstWorkorder
.
getProductionSolutionId
());
if
(
productionSolution
==
null
){
if
(
productionSolution
==
null
){
throw
new
ServiceException
(
String
.
format
(
"生产工单:%s生产版本未找到"
,
firstWorkorder
.
getWorkorderCode
()));
throw
new
ServiceException
(
String
.
format
(
"生产工单:%s生产版本未找到"
,
firstWorkorder
.
getWorkorderCode
()));
}
}
...
...
mes/src/main/java/com/ximai/mes/pro/schedule/impl/AlgorithmResultProcessImpl.java
View file @
f4a5606a
...
@@ -12,7 +12,9 @@ import com.ximai.mes.pro.schedule.AlgorithmResultProcess;
...
@@ -12,7 +12,9 @@ import com.ximai.mes.pro.schedule.AlgorithmResultProcess;
import
com.ximai.mes.pro.schedule.Job
;
import
com.ximai.mes.pro.schedule.Job
;
import
com.ximai.mes.pro.schedule.ScheduleStatus
;
import
com.ximai.mes.pro.schedule.ScheduleStatus
;
import
com.ximai.mes.pro.schedule.Task
;
import
com.ximai.mes.pro.schedule.Task
;
import
com.ximai.mes.pro.schedule.impl.busi.JobResult
;
import
com.ximai.mes.pro.schedule.impl.busi.ScheduleBusiProcess
;
import
com.ximai.mes.pro.schedule.impl.busi.ScheduleBusiProcess
;
import
com.ximai.mes.pro.schedule.impl.busi.TaskResult
;
import
com.ximai.mes.pro.service.IProMaterialRequestService
;
import
com.ximai.mes.pro.service.IProMaterialRequestService
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkorderService
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkorderService
;
import
com.ximai.mes.pro.service.task.IProTaskService
;
import
com.ximai.mes.pro.service.task.IProTaskService
;
...
@@ -20,6 +22,7 @@ import com.ximai.mes.pro.service.task.IProTaskWorkorderService;
...
@@ -20,6 +22,7 @@ import com.ximai.mes.pro.service.task.IProTaskWorkorderService;
import
com.ximai.mes.pro.service.task.IProTaskWorkunitService
;
import
com.ximai.mes.pro.service.task.IProTaskWorkunitService
;
import
com.ximai.mes.tm.service.ITmToolRequestService
;
import
com.ximai.mes.tm.service.ITmToolRequestService
;
import
lombok.Data
;
import
lombok.Data
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -59,8 +62,14 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
...
@@ -59,8 +62,14 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
public
void
execute
(
LocalDateTime
scheduleStartDate
,
List
<
Job
>
jobs
)
{
public
void
execute
(
LocalDateTime
scheduleStartDate
,
List
<
Job
>
jobs
)
{
StopWatch
stopWatch
=
new
StopWatch
();
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
stopWatch
.
start
();
List
<
TaskResult
>
rst
=
new
ArrayList
<>();
List
<
JobResult
>
jobResults
=
new
ArrayList
<>();
for
(
Job
job
:
jobs
)
{
for
(
Job
job
:
jobs
)
{
JobResult
jobResult
=
new
JobResult
();
jobResults
.
add
(
jobResult
);
List
<
TaskResult
>
taskResults
=
new
ArrayList
<>();
jobResult
.
setTaskResultList
(
taskResults
);
jobResult
.
setQuantity
(
job
.
getQuantity
());
jobResult
.
setWorkorderList
(
job
.
getJobExtend
().
getWorkorderList
());
if
(!
ScheduleStatus
.
Success
.
equals
(
job
.
getScheduleStatus
())
&&
if
(!
ScheduleStatus
.
Success
.
equals
(
job
.
getScheduleStatus
())
&&
!
ScheduleStatus
.
Delay
.
equals
(
job
.
getScheduleStatus
()))
{
!
ScheduleStatus
.
Delay
.
equals
(
job
.
getScheduleStatus
()))
{
throw
new
ServiceException
(
String
.
format
(
"排产失败%s,%s,%s"
,
job
.
getScheduleStatus
()
throw
new
ServiceException
(
String
.
format
(
"排产失败%s,%s,%s"
,
job
.
getScheduleStatus
()
...
@@ -71,7 +80,8 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
...
@@ -71,7 +80,8 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
//保存任务表
//保存任务表
ProTask
proTask
=
this
.
convertTask
(
job
,
task
);
ProTask
proTask
=
this
.
convertTask
(
job
,
task
);
proTask
.
setArrangeCode
(
job
.
getId
());
proTask
.
setArrangeCode
(
job
.
getId
());
proTask
.
setTaskBatch
(
proTask
.
getArrangeCode
()+
"-001"
);
proTask
.
setTaskBatch
(
proTask
.
getArrangeCode
()+
"-"
+
StringUtils
.
leftPad
(
job
.
getJobExtend
().
getWorkorderList
().
get
(
0
).
getBatchSerial
()+
""
,
3
,
"0"
));
proTask
.
setOrdinal
(
i
);
proTask
.
setOrdinal
(
i
);
//首工序,待加工数等于排产数
//首工序,待加工数等于排产数
if
(
i
==
1
)
{
if
(
i
==
1
)
{
...
@@ -88,7 +98,7 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
...
@@ -88,7 +98,7 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
proTaskService
.
insertProTask
(
proTask
);
proTaskService
.
insertProTask
(
proTask
);
TaskResult
taskResult
=
new
TaskResult
();
TaskResult
taskResult
=
new
TaskResult
();
taskResult
.
setProTask
(
proTask
);
taskResult
.
setProTask
(
proTask
);
rst
.
add
(
taskResult
);
taskResults
.
add
(
taskResult
);
long
j
=
1
;
long
j
=
1
;
for
(
ProWorkorder
workorder
:
job
.
getJobExtend
().
getWorkorderList
())
{
for
(
ProWorkorder
workorder
:
job
.
getJobExtend
().
getWorkorderList
())
{
ProTaskWorkorder
proTaskWorkorder
=
new
ProTaskWorkorder
();
ProTaskWorkorder
proTaskWorkorder
=
new
ProTaskWorkorder
();
...
@@ -97,13 +107,6 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
...
@@ -97,13 +107,6 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
proTaskWorkorder
.
setWorkorderId
(
workorder
.
getWorkorderId
());
proTaskWorkorder
.
setWorkorderId
(
workorder
.
getWorkorderId
());
// 保存
// 保存
proTaskWorkorderService
.
insertProTaskWorkorder
(
proTaskWorkorder
);
proTaskWorkorderService
.
insertProTaskWorkorder
(
proTaskWorkorder
);
//更新工单状态
ProWorkorder
proWorkorderUpdate
=
new
ProWorkorder
();
proWorkorderUpdate
.
setStatus
(
WorkorderStatusEnum
.
ISSUED
.
getValue
());
proWorkorderUpdate
.
setArrangeCode
(
workorder
.
getArrangeCode
());
proWorkorderUpdate
.
setWorkorderId
(
workorder
.
getWorkorderId
());
proWorkorderUpdate
.
setQuantityScheduled
(
proWorkorderUpdate
.
getQuantityScheduled
().
add
(
task
.
getOrderQuantity
()));
proWorkorderService
.
updateProWorkorder
(
proWorkorderUpdate
);
j
++;
j
++;
}
}
List
<
Long
>
taskWorkunitIds
=
new
ArrayList
<>();
List
<
Long
>
taskWorkunitIds
=
new
ArrayList
<>();
...
@@ -128,7 +131,7 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
...
@@ -128,7 +131,7 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
}
}
}
}
busiProcesseList
.
forEach
(
s
->{
busiProcesseList
.
forEach
(
s
->{
s
.
execute
(
rst
);
s
.
execute
(
jobResults
);
});
});
stopWatch
.
stop
();
stopWatch
.
stop
();
logger
.
info
(
String
.
format
(
"排产结果保存、刀具/物料申请单生成耗时:%s"
,
stopWatch
.
getTotalTimeSeconds
()));
logger
.
info
(
String
.
format
(
"排产结果保存、刀具/物料申请单生成耗时:%s"
,
stopWatch
.
getTotalTimeSeconds
()));
...
@@ -167,10 +170,4 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
...
@@ -167,10 +170,4 @@ public class AlgorithmResultProcessImpl implements AlgorithmResultProcess {
return
taskWorkunit
;
return
taskWorkunit
;
}
}
@Data
public
static
class
TaskResult
{
ProTask
proTask
;
List
<
ProTaskWorkunit
>
proTaskWorkunitList
;
}
}
}
mes/src/main/java/com/ximai/mes/pro/schedule/impl/busi/JobResult.java
0 → 100644
View file @
f4a5606a
package
com
.
ximai
.
mes
.
pro
.
schedule
.
impl
.
busi
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.schedule.Job
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
public
class
JobResult
{
BigDecimal
quantity
;
List
<
TaskResult
>
taskResultList
;
List
<
ProWorkorder
>
workorderList
;
}
mes/src/main/java/com/ximai/mes/pro/schedule/impl/busi/MaterialRequestBuild.java
View file @
f4a5606a
...
@@ -16,11 +16,13 @@ public class MaterialRequestBuild implements ScheduleBusiProcess{
...
@@ -16,11 +16,13 @@ public class MaterialRequestBuild implements ScheduleBusiProcess{
@Autowired
@Autowired
private
IProMaterialRequestService
proMaterialRequestService
;
private
IProMaterialRequestService
proMaterialRequestService
;
@Override
@Override
public
void
execute
(
List
<
AlgorithmResultProcessImpl
.
TaskResult
>
taskList
)
{
public
void
execute
(
List
<
JobResult
>
jobResults
)
{
//生产领料申请单
//生产领料申请单
taskList
.
forEach
(
s
->{
jobResults
.
forEach
(
job
->{
s
.
getProTaskWorkunitList
().
forEach
(
s2
->{
job
.
getTaskResultList
().
forEach
(
task
->{
proMaterialRequestService
.
insertProMaterialRequestIssueItem
(
s2
.
getTaskWorkunitId
(),
s
.
getProTask
());
task
.
getProTaskWorkunitList
().
forEach
(
s2
->{
proMaterialRequestService
.
insertProMaterialRequestIssueItem
(
s2
.
getTaskWorkunitId
(),
task
.
getProTask
());
});
});
});
});
});
}
}
...
...
mes/src/main/java/com/ximai/mes/pro/schedule/impl/busi/ProductQrcodeBuild.java
0 → 100644
View file @
f4a5606a
package
com
.
ximai
.
mes
.
pro
.
schedule
.
impl
.
busi
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.ximai.common.utils.data.StringUtils
;
import
com.ximai.mes.pro.domain.ProProductQrcodeRule
;
import
com.ximai.mes.pro.dto.ProProductQrcodeRecordCreate
;
import
com.ximai.mes.pro.schedule.impl.AlgorithmResultProcessImpl
;
import
com.ximai.mes.pro.service.IProMaterialRequestService
;
import
com.ximai.mes.pro.service.IProProductQrcodeRecordService
;
import
com.ximai.mes.pro.service.IProProductQrcodeRuleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* 产品序列号生成
*/
@Component
public
class
ProductQrcodeBuild
implements
ScheduleBusiProcess
{
@Autowired
private
IProProductQrcodeRecordService
productQrcodeRecordService
;
@Autowired
private
IProProductQrcodeRuleService
productQrcodeRuleService
;
@Override
public
void
execute
(
List
<
JobResult
>
jobResults
)
{
jobResults
.
forEach
(
job
->{
job
.
getWorkorderList
().
forEach
(
workorder
->{
ProProductQrcodeRule
rule
=
productQrcodeRuleService
.
selectProProductQrcodeRuleNewest
(
workorder
.
getProductId
(),
workorder
.
getClientCode
());
if
(
rule
==
null
){
return
;
}
List
<
String
>
qrcodes
=
productQrcodeRuleService
.
buildQrcode
(
rule
,
job
.
getQuantity
().
intValue
());
for
(
String
qrcode
:
qrcodes
){
ProProductQrcodeRecordCreate
create
=
new
ProProductQrcodeRecordCreate
();
create
.
setQrcode
(
qrcode
);
create
.
initByWorkorder
(
workorder
);
create
.
setItemDesc
(
rule
.
getItemDesc
());
productQrcodeRecordService
.
insertProProductQrcodeRecord
(
create
);
}
});
});
}
}
mes/src/main/java/com/ximai/mes/pro/schedule/impl/busi/ScheduleBusiProcess.java
View file @
f4a5606a
...
@@ -9,6 +9,6 @@ import java.util.List;
...
@@ -9,6 +9,6 @@ import java.util.List;
*/
*/
public
interface
ScheduleBusiProcess
{
public
interface
ScheduleBusiProcess
{
public
void
execute
(
List
<
AlgorithmResultProcessImpl
.
TaskResult
>
task
List
);
public
void
execute
(
List
<
JobResult
>
jobResult
List
);
}
}
mes/src/main/java/com/ximai/mes/pro/schedule/impl/busi/TaskResult.java
0 → 100644
View file @
f4a5606a
package
com
.
ximai
.
mes
.
pro
.
schedule
.
impl
.
busi
;
import
com.ximai.mes.pro.domain.task.ProTask
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
TaskResult
{
ProTask
proTask
;
List
<
ProTaskWorkunit
>
proTaskWorkunitList
;
}
mes/src/main/java/com/ximai/mes/pro/schedule/impl/busi/ToolRequestBuild.java
View file @
f4a5606a
...
@@ -16,9 +16,11 @@ public class ToolRequestBuild implements ScheduleBusiProcess{
...
@@ -16,9 +16,11 @@ public class ToolRequestBuild implements ScheduleBusiProcess{
@Autowired
@Autowired
private
ITmToolRequestService
tmToolRequestService
;
private
ITmToolRequestService
tmToolRequestService
;
@Override
@Override
public
void
execute
(
List
<
AlgorithmResultProcessImpl
.
TaskResult
>
taskList
)
{
public
void
execute
(
List
<
JobResult
>
jobResults
)
{
taskList
.
forEach
(
s
->{
jobResults
.
forEach
(
job
->{
tmToolRequestService
.
addedToolRequestAppForm
(
s
.
getProTaskWorkunitList
());
job
.
getTaskResultList
().
forEach
(
task
->{
tmToolRequestService
.
addedToolRequestAppForm
(
task
.
getProTaskWorkunitList
());
});
});
});
}
}
}
}
mes/src/main/java/com/ximai/mes/pro/schedule/impl/busi/WorkorderUpdate.java
0 → 100644
View file @
f4a5606a
package
com
.
ximai
.
mes
.
pro
.
schedule
.
impl
.
busi
;
import
com.ximai.mes.constant.WorkorderStatusEnum
;
import
com.ximai.mes.pro.domain.ProProductQrcodeRule
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.dto.ProProductQrcodeRecordCreate
;
import
com.ximai.mes.pro.service.IProProductQrcodeRecordService
;
import
com.ximai.mes.pro.service.IProProductQrcodeRuleService
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkorderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* 排产完成工单状态数改
*/
@Component
public
class
WorkorderUpdate
implements
ScheduleBusiProcess
{
@Autowired
private
IProWorkorderService
workorderService
;
@Override
public
void
execute
(
List
<
JobResult
>
jobResults
)
{
jobResults
.
forEach
(
job
->{
job
.
getWorkorderList
().
forEach
(
workorder
->{
//更新工单状态
ProWorkorder
proWorkorderUpdate
=
new
ProWorkorder
();
proWorkorderUpdate
.
setStatus
(
WorkorderStatusEnum
.
ISSUED
.
getValue
());
proWorkorderUpdate
.
setArrangeCode
(
workorder
.
getArrangeCode
());
proWorkorderUpdate
.
setWorkorderId
(
workorder
.
getWorkorderId
());
proWorkorderUpdate
.
setQuantityScheduled
(
workorder
.
getQuantityScheduled
().
add
(
job
.
getQuantity
()));
proWorkorderUpdate
.
setBatchSerial
(
workorder
.
getBatchSerial
()+
1
);
workorderService
.
updateProWorkorder
(
proWorkorderUpdate
);
});
});
}
}
mes/src/main/java/com/ximai/mes/pro/schedule/strategy/EvaluateEquipmentChangeOver.java
deleted
100644 → 0
View file @
821302bc
package
com
.
ximai
.
mes
.
pro
.
schedule
.
strategy
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.schedule.IOperationTimeCalculator
;
import
com.ximai.mes.pro.schedule.JobExtent
;
import
com.ximai.mes.pro.schedule.Task
;
import
com.ximai.mes.pro.schedule.TaskSchedulingContext
;
import
org.springframework.stereotype.Component
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
/**
* 产能评估-换型规则
* 根据排产换型规则表的顺序号
* 当前设备任务规则(工序+类别)
* 不存在返回:0
* 存在换型规则
* 当前设备任务工单规则值 匹配 当前设备上个任务工单规则值
* 匹配上的优先级越高、属性越多、打分越高
*/
@Component
public
class
EvaluateEquipmentChangeOver
implements
EvaluateEquipment
{
@Override
public
double
evaluate
(
TaskSchedulingContext
context
,
IOperationTimeCalculator
.
OperationTimePlan
operationTimePlan
,
List
<
TaskSchedulingContext
.
TaskSchedulingResultContext
>
scheduleResult
)
{
//获取交期最晚工单
List
<
ProWorkorder
>
workorderList
=
context
.
getJob
().
getJobExtend
().
getWorkorderList
()
.
stream
().
sorted
(
Comparator
.
comparing
(
ProWorkorder:
:
getRequestDate
)).
collect
(
Collectors
.
toList
());
ProWorkorder
workorder
=
workorderList
.
get
(
workorderList
.
size
()-
1
);
JobExtent
jobExtent
=
context
.
getJob
().
getJobExtend
();
String
processName
=
context
.
getTask
().
getProcessName
();
//根据当前任务工序、产品类别查找换型规则
//当前任务换型规则
Map
<
String
,
Integer
>
setupRuleMap
=
jobExtent
.
getSetupRuleMap
().
get
(
workorder
.
getWorkorderId
()+
processName
);
if
(
setupRuleMap
==
null
){
return
0
;
}
//当前任务工单换型属性值
Map
<
String
,
Object
>
setupRuleValsCur
=
jobExtent
.
getSetupRuleValsCur
().
get
(
workorder
.
getWorkorderId
()+
processName
);
//设备上个任务工单换型属性值
List
<
Task
>
taskList
=
context
.
getEquipment
().
getScheduleTask
().
stream
()
.
sorted
(
Comparator
.
comparing
(
Task:
:
getScheduledEndedTime
)).
collect
(
Collectors
.
toList
());
if
(
taskList
.
isEmpty
()){
return
0
;
}
Task
newestTask
=
taskList
.
get
(
taskList
.
size
()-
1
);
List
<
ProWorkorder
>
preWorkorderList
=
newestTask
.
getJob
().
getJobExtend
().
getWorkorderList
()
.
stream
().
sorted
(
Comparator
.
comparing
(
ProWorkorder:
:
getRequestDate
)).
collect
(
Collectors
.
toList
());
ProWorkorder
preWorkorder
=
preWorkorderList
.
get
(
preWorkorderList
.
size
()-
1
);
Map
<
String
,
Object
>
setupRuleValsPre
=
newestTask
.
getJob
().
getJobExtend
().
getSetupRuleValsCur
().
get
(
preWorkorder
.
getWorkorderId
()+
newestTask
.
getProcessName
());
if
(
setupRuleValsPre
==
null
||
setupRuleValsCur
==
null
){
return
0.0
;
}
return
calculateScore
(
setupRuleMap
,
setupRuleValsCur
,
setupRuleValsPre
);
}
/*
计算得分
*/
private
double
calculateScore
(
Map
<
String
,
Integer
>
setupRuleMap
,
Map
<
String
,
Object
>
setupRuleValsCur
,
Map
<
String
,
Object
>
setupRuleValsPre
){
AtomicReference
<
Integer
>
totalScore
=
new
AtomicReference
<>(
0
);
//总优先数值
//公式=(5-L1)+(5-L2).../5N*10
//L1\L2...
//计算总分
setupRuleMap
.
forEach
((
k
,
v
)->{
totalScore
.
updateAndGet
(
v1
->
v1
+
5
);
});
//总评分
AtomicReference
<
Integer
>
score
=
new
AtomicReference
<>(
0
);
//总优先数值
setupRuleMap
.
forEach
((
k
,
v
)->{
if
(
setupRuleValsCur
.
get
(
k
)==
null
&&
setupRuleValsPre
.
get
(
k
)==
null
){
score
.
updateAndGet
(
v1
->
v1
+
(
5
-
v
));
}
if
(
setupRuleValsCur
.
get
(
k
)!=
null
&&
setupRuleValsPre
.
get
(
k
)!=
null
&&
setupRuleValsCur
.
get
(
k
).
equals
(
setupRuleValsPre
.
get
(
k
))){
score
.
updateAndGet
(
v1
->
v1
+
(
5
-
v
));
}
});
//转换得分范围1-5,最终得分=总得分/总分*10
return
Double
.
valueOf
(
score
.
get
())
/
totalScore
.
get
()
*
10
;
}
@Override
public
int
weight
()
{
return
1
;
}
}
mes/src/main/java/com/ximai/mes/pro/schedule/strategy/EvaluateEquipmentFunction.java
deleted
100644 → 0
View file @
821302bc
package
com
.
ximai
.
mes
.
pro
.
schedule
.
strategy
;
import
cn.hutool.core.util.NumberUtil
;
import
com.ximai.mes.pro.schedule.Equipment
;
import
com.ximai.mes.pro.schedule.IOperationTimeCalculator
;
import
com.ximai.mes.pro.schedule.TaskSchedulingContext
;
import
java.util.List
;
/**
* 根据工序要求设备功能点评估设备,在满足工序功能点基础上,设备功能点越少,越优先匹配
* NumberUtil.max(10-N, 0)
* N=设备已有功能点
*
*/
public
class
EvaluateEquipmentFunction
implements
EvaluateEquipment
{
@Override
public
double
evaluate
(
TaskSchedulingContext
context
,
IOperationTimeCalculator
.
OperationTimePlan
operationTimePlan
,
List
<
TaskSchedulingContext
.
TaskSchedulingResultContext
>
scheduleResult
)
{
int
functionCount
=
0
;
Equipment
.
EquipmentFunction
equipmentFunction
=
context
.
getEquipment
().
getEquipmentFunction
();
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForEdgeOpening
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForPasteComposite
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForThermalComposite
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForLabeling
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForBuckleUp
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForCreasing
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForOrgan
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForThermalCutting
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForThermalSelfFusion
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForMolarTooth
())){
functionCount
++;
}
if
(
"Y"
.
equalsIgnoreCase
(
equipmentFunction
.
getSacmForSlitting
())){
functionCount
++;
}
return
NumberUtil
.
max
(
10
-
functionCount
,
0
);
}
@Override
public
int
weight
()
{
return
1
;
}
}
mes/src/main/java/com/ximai/mes/pro/service/IProProductQrcodeRuleService.java
View file @
f4a5606a
...
@@ -47,6 +47,15 @@ public interface IProProductQrcodeRuleService
...
@@ -47,6 +47,15 @@ public interface IProProductQrcodeRuleService
*/
*/
public
List
<
ProProductQrcodeRule
>
selectProProductQrcodeRuleList
(
QueryWrapper
<
ProProductQrcodeRule
>
proProductQrcodeRuleQuery
);
public
List
<
ProProductQrcodeRule
>
selectProProductQrcodeRuleList
(
QueryWrapper
<
ProProductQrcodeRule
>
proProductQrcodeRuleQuery
);
/**
* 查询产品最新二维码规则列表
*
* @param itemId 产品ID
* @param clientCode 客户编号
* @return 产品二维码规则集合
*/
public
ProProductQrcodeRule
selectProProductQrcodeRuleNewest
(
Long
itemId
,
String
clientCode
);
/**
/**
* 查询产品二维码规则列表
* 查询产品二维码规则列表
*
*
...
@@ -92,5 +101,5 @@ public interface IProProductQrcodeRuleService
...
@@ -92,5 +101,5 @@ public interface IProProductQrcodeRuleService
* @param rule
* @param rule
* @return
* @return
*/
*/
public
String
buildQrcode
(
ProProductQrcodeRule
rule
);
public
List
<
String
>
buildQrcode
(
ProProductQrcodeRule
rule
,
Integer
quantity
);
}
}
mes/src/main/java/com/ximai/mes/pro/service/impl/ProProductQrcodeRecordServiceImpl.java
View file @
f4a5606a
...
@@ -89,7 +89,7 @@ public class ProProductQrcodeRecordServiceImpl implements IProProductQrcodeRecor
...
@@ -89,7 +89,7 @@ public class ProProductQrcodeRecordServiceImpl implements IProProductQrcodeRecor
*/
*/
@Override
@Override
public
int
insertProProductQrcodeRecord
(
ProProductQrcodeRecordCreate
proProductQrcodeRecordCreate
)
{
public
int
insertProProductQrcodeRecord
(
ProProductQrcodeRecordCreate
proProductQrcodeRecordCreate
)
{
proProductQrcodeRecordCreate
.
setPrintTime
(
0
);
ProProductQrcodeRecord
proProductQrcodeRecord
=
new
ProProductQrcodeRecord
();
ProProductQrcodeRecord
proProductQrcodeRecord
=
new
ProProductQrcodeRecord
();
BeanUtil
.
copyProperties
(
proProductQrcodeRecordCreate
,
proProductQrcodeRecord
);
BeanUtil
.
copyProperties
(
proProductQrcodeRecordCreate
,
proProductQrcodeRecord
);
proProductQrcodeRecord
.
setCreateBy
(
SecurityUtils
.
getUsername
());
proProductQrcodeRecord
.
setCreateBy
(
SecurityUtils
.
getUsername
());
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/ProProductQrcodeRuleServiceImpl.java
View file @
f4a5606a
...
@@ -5,6 +5,7 @@ import java.util.List;
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.ximai.common.utils.data.DateUtils
;
import
com.ximai.common.utils.data.DateUtils
;
import
com.ximai.common.utils.SecurityUtils
;
import
com.ximai.common.utils.SecurityUtils
;
import
com.ximai.common.utils.data.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
...
@@ -71,6 +72,19 @@ public class ProProductQrcodeRuleServiceImpl implements IProProductQrcodeRuleSer
...
@@ -71,6 +72,19 @@ public class ProProductQrcodeRuleServiceImpl implements IProProductQrcodeRuleSer
return
proProductQrcodeRuleMapper
.
selectList
(
proProductQrcodeRuleQuery
);
return
proProductQrcodeRuleMapper
.
selectList
(
proProductQrcodeRuleQuery
);
}
}
@Override
public
ProProductQrcodeRule
selectProProductQrcodeRuleNewest
(
Long
itemId
,
String
clientCode
)
{
QueryWrapper
<
ProProductQrcodeRule
>
proProductQrcodeRuleQuery
=
new
QueryWrapper
<>();
proProductQrcodeRuleQuery
.
eq
(
"item_id"
,
itemId
);
proProductQrcodeRuleQuery
.
eq
(
StringUtils
.
isNotEmpty
(
clientCode
),
"client_code"
,
clientCode
);
proProductQrcodeRuleQuery
.
orderByDesc
(
"create_time"
);
List
<
ProProductQrcodeRule
>
list
=
this
.
selectProProductQrcodeRuleList
(
proProductQrcodeRuleQuery
);
if
(
list
.
size
()>
0
){
return
list
.
get
(
0
);
}
return
null
;
}
/**
/**
* 查询产品二维码规则列表
* 查询产品二维码规则列表
*
*
...
@@ -93,6 +107,7 @@ public class ProProductQrcodeRuleServiceImpl implements IProProductQrcodeRuleSer
...
@@ -93,6 +107,7 @@ public class ProProductQrcodeRuleServiceImpl implements IProProductQrcodeRuleSer
ProProductQrcodeRule
proProductQrcodeRule
=
new
ProProductQrcodeRule
();
ProProductQrcodeRule
proProductQrcodeRule
=
new
ProProductQrcodeRule
();
BeanUtil
.
copyProperties
(
proProductQrcodeRuleCreate
,
proProductQrcodeRule
);
BeanUtil
.
copyProperties
(
proProductQrcodeRuleCreate
,
proProductQrcodeRule
);
proProductQrcodeRule
.
setCurrentSerial
(
1
);
proProductQrcodeRule
.
setCreateBy
(
SecurityUtils
.
getUsername
());
proProductQrcodeRule
.
setCreateBy
(
SecurityUtils
.
getUsername
());
proProductQrcodeRule
.
setCreateTime
(
DateUtils
.
getNowDate
());
proProductQrcodeRule
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
proProductQrcodeRuleMapper
.
insertProProductQrcodeRule
(
proProductQrcodeRule
);
return
proProductQrcodeRuleMapper
.
insertProProductQrcodeRule
(
proProductQrcodeRule
);
...
@@ -136,15 +151,6 @@ public class ProProductQrcodeRuleServiceImpl implements IProProductQrcodeRuleSer
...
@@ -136,15 +151,6 @@ public class ProProductQrcodeRuleServiceImpl implements IProProductQrcodeRuleSer
}
}
@Override
@Override
public
String
buildQrcode
(
ProProductQrcodeRule
rule
)
{
String
rst
=
rule
.
buildQrcode
();
//当前流水+1
rule
.
setCurrentSerial
(
rule
.
getCurrentSerial
()+
1
);
proProductQrcodeRuleMapper
.
updateById
(
rule
);
return
rst
;
}
public
List
<
String
>
buildQrcode
(
ProProductQrcodeRule
rule
,
Integer
quantity
)
{
public
List
<
String
>
buildQrcode
(
ProProductQrcodeRule
rule
,
Integer
quantity
)
{
List
<
String
>
rst
=
new
ArrayList
<>();
List
<
String
>
rst
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
quantity
;
i
++){
for
(
int
i
=
0
;
i
<
quantity
;
i
++){
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/ProScheduleSetupRuleValServiceImpl.java
View file @
f4a5606a
...
@@ -13,6 +13,7 @@ import com.ximai.mes.pro.domain.proWorkOrder.ProWorkOrderProcessTool;
...
@@ -13,6 +13,7 @@ import com.ximai.mes.pro.domain.proWorkOrder.ProWorkOrderProcessTool;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolution
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolution
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolutionSpecificationSheet
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolutionSpecificationSheet
;
import
com.ximai.mes.pro.domain.vo.ProProductionSolutionVo
;
import
com.ximai.mes.pro.domain.vo.ProWorkOrderProcessVo
;
import
com.ximai.mes.pro.domain.vo.ProWorkOrderProcessVo
;
import
com.ximai.mes.pro.mapper.ProScheduleSetupRuleValMapper
;
import
com.ximai.mes.pro.mapper.ProScheduleSetupRuleValMapper
;
import
com.ximai.mes.pro.service.IProScheduleSetupRuleValService
;
import
com.ximai.mes.pro.service.IProScheduleSetupRuleValService
;
...
@@ -150,7 +151,7 @@ public class ProScheduleSetupRuleValServiceImpl implements IProScheduleSetupRule
...
@@ -150,7 +151,7 @@ public class ProScheduleSetupRuleValServiceImpl implements IProScheduleSetupRule
proScheduleSetupRuleVal
.
setItemTypeName
(
mdItem
.
getItemTypeName
());
proScheduleSetupRuleVal
.
setItemTypeName
(
mdItem
.
getItemTypeName
());
proScheduleSetupRuleVal
.
setProductStandard
(
mdItem
.
getSpecification
());
proScheduleSetupRuleVal
.
setProductStandard
(
mdItem
.
getSpecification
());
//查询生产规格书
//查询生产规格书
ProProductionSolution
proProductionSolution
=
proProductionSolutionService
.
selectByGroupKeyAndGroupCounterAndSapItemCode
(
proWorkorder
.
getGroupKey
(),
proWorkorder
.
getGroupCounter
(),
proWorkorder
.
getSapItemCode
());
ProProductionSolution
Vo
proProductionSolution
=
proProductionSolutionService
.
selectProProductionSolutionByProductionSolutionId
(
proWorkorder
.
getProductionSolutionId
());
if
(
proProductionSolution
!=
null
)
{
if
(
proProductionSolution
!=
null
)
{
ProProductionSolutionSpecificationSheet
specificationSheet
=
proProductionSolutionSpecificationSheetService
.
selectSpecificationSheetByProductionSolutionId
(
proProductionSolution
.
getProductionSolutionId
());
ProProductionSolutionSpecificationSheet
specificationSheet
=
proProductionSolutionSpecificationSheetService
.
selectSpecificationSheetByProductionSolutionId
(
proProductionSolution
.
getProductionSolutionId
());
if
(
specificationSheet
!=
null
)
{
if
(
specificationSheet
!=
null
)
{
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/proWorkOrder/ProWorkOrderArrangeRuleValServiceImpl.java
View file @
f4a5606a
...
@@ -10,6 +10,7 @@ import com.ximai.mes.md.service.IMdProductPublishedConfService;
...
@@ -10,6 +10,7 @@ import com.ximai.mes.md.service.IMdProductPublishedConfService;
import
com.ximai.mes.pro.domain.proWorkOrder.*
;
import
com.ximai.mes.pro.domain.proWorkOrder.*
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolution
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolution
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolutionSpecificationSheet
;
import
com.ximai.mes.pro.domain.productionSolution.ProProductionSolutionSpecificationSheet
;
import
com.ximai.mes.pro.domain.vo.ProProductionSolutionVo
;
import
com.ximai.mes.pro.domain.vo.ProWorkOrderProcessVo
;
import
com.ximai.mes.pro.domain.vo.ProWorkOrderProcessVo
;
import
com.ximai.mes.pro.mapper.proWorkOrder.ProWorkOrderArrangeRuleValMapper
;
import
com.ximai.mes.pro.mapper.proWorkOrder.ProWorkOrderArrangeRuleValMapper
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkOrderArrangeRuleValService
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkOrderArrangeRuleValService
;
...
@@ -133,7 +134,7 @@ public class ProWorkOrderArrangeRuleValServiceImpl implements IProWorkOrderArran
...
@@ -133,7 +134,7 @@ public class ProWorkOrderArrangeRuleValServiceImpl implements IProWorkOrderArran
workOrderArrangeRuleVal
.
setItemTypeId
(
mdItem
.
getItemTypeId
());
workOrderArrangeRuleVal
.
setItemTypeId
(
mdItem
.
getItemTypeId
());
workOrderArrangeRuleVal
.
setItemTypeName
(
mdItem
.
getItemTypeName
());
workOrderArrangeRuleVal
.
setItemTypeName
(
mdItem
.
getItemTypeName
());
//查询生产规格书
//查询生产规格书
ProProductionSolution
proProductionSolution
=
proProductionSolutionService
.
selectByGroupKeyAndGroupCounterAndSapItemCode
(
proWorkorder
.
getGroupKey
(),
proWorkorder
.
getGroupCounter
(),
proWorkorder
.
getSapItemCode
());
ProProductionSolution
Vo
proProductionSolution
=
proProductionSolutionService
.
selectProProductionSolutionByProductionSolutionId
(
proWorkorder
.
getProductionSolutionId
());
if
(
proProductionSolution
!=
null
)
{
if
(
proProductionSolution
!=
null
)
{
ProProductionSolutionSpecificationSheet
specificationSheet
=
proProductionSolutionSpecificationSheetService
.
selectSpecificationSheetByProductionSolutionId
(
proProductionSolution
.
getProductionSolutionId
());
ProProductionSolutionSpecificationSheet
specificationSheet
=
proProductionSolutionSpecificationSheetService
.
selectSpecificationSheetByProductionSolutionId
(
proProductionSolution
.
getProductionSolutionId
());
if
(
specificationSheet
!=
null
)
{
if
(
specificationSheet
!=
null
)
{
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/proWorkOrder/ProWorkorderServiceImpl.java
View file @
f4a5606a
This diff is collapsed.
Click to expand it.
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskServiceImpl.java
View file @
f4a5606a
...
@@ -52,10 +52,8 @@ import com.ximai.mes.pro.schedule.AlgorithmDataSource;
...
@@ -52,10 +52,8 @@ import com.ximai.mes.pro.schedule.AlgorithmDataSource;
import
com.ximai.mes.pro.schedule.AlgorithmExtendDataSource
;
import
com.ximai.mes.pro.schedule.AlgorithmExtendDataSource
;
import
com.ximai.mes.pro.schedule.AlgorithmResultProcess
;
import
com.ximai.mes.pro.schedule.AlgorithmResultProcess
;
import
com.ximai.mes.pro.schedule.impl.BaoshenScheduleAlgorithmAdapter
;
import
com.ximai.mes.pro.schedule.impl.BaoshenScheduleAlgorithmAdapter
;
import
com.ximai.mes.pro.schedule.impl.ScheduledResult
;
import
com.ximai.mes.pro.schedule.strategy.EquipmentSelectionStrategyImpl
;
import
com.ximai.mes.pro.schedule.strategy.EquipmentSelectionStrategyImpl
;
import
com.ximai.mes.pro.schedule.strategy.EvaluateEquipment
;
import
com.ximai.mes.pro.schedule.strategy.EvaluateEquipment
;
import
com.ximai.mes.pro.schedule.strategy.EvaluateEquipmentFunction
;
import
com.ximai.mes.pro.service.*
;
import
com.ximai.mes.pro.service.*
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkorderService
;
import
com.ximai.mes.pro.service.proWorkOrder.IProWorkorderService
;
import
com.ximai.mes.pro.service.task.IProPackagePrintRecordService
;
import
com.ximai.mes.pro.service.task.IProPackagePrintRecordService
;
...
@@ -164,8 +162,6 @@ public class ProTaskServiceImpl implements IProTaskService {
...
@@ -164,8 +162,6 @@ public class ProTaskServiceImpl implements IProTaskService {
@Autowired
@Autowired
private
AlgorithmExtendDataSource
scheduleSetupRuleAlgorithmData
;
private
AlgorithmExtendDataSource
scheduleSetupRuleAlgorithmData
;
@Autowired
@Autowired
private
EvaluateEquipment
evaluateEquipmentChangeOver
;
@Autowired
private
IProPackagePrintRecordService
proPackagePrintRecordService
;
private
IProPackagePrintRecordService
proPackagePrintRecordService
;
@Autowired
@Autowired
private
IProRecoilMaterialService
proRecoilMaterialService
;
private
IProRecoilMaterialService
proRecoilMaterialService
;
...
@@ -1848,8 +1844,6 @@ public class ProTaskServiceImpl implements IProTaskService {
...
@@ -1848,8 +1844,6 @@ public class ProTaskServiceImpl implements IProTaskService {
baoshenScheduleAlgorithmAdapter
.
setAlgorithmDataSource
(
algorithmDataSource
);
baoshenScheduleAlgorithmAdapter
.
setAlgorithmDataSource
(
algorithmDataSource
);
baoshenScheduleAlgorithmAdapter
.
setAlgorithmResultProcess
(
algorithmResultProcess
);
baoshenScheduleAlgorithmAdapter
.
setAlgorithmResultProcess
(
algorithmResultProcess
);
EquipmentSelectionStrategyImpl
defaultStrategy
=
new
EquipmentSelectionStrategyImpl
();
EquipmentSelectionStrategyImpl
defaultStrategy
=
new
EquipmentSelectionStrategyImpl
();
defaultStrategy
.
addEvaluateEquipment
(
evaluateEquipmentChangeOver
);
defaultStrategy
.
addEvaluateEquipment
(
new
EvaluateEquipmentFunction
());
baoshenScheduleAlgorithmAdapter
.
setEquipmentSelectionStrategy
(
defaultStrategy
);
baoshenScheduleAlgorithmAdapter
.
setEquipmentSelectionStrategy
(
defaultStrategy
);
baoshenScheduleAlgorithmAdapter
.
setAlgorithmExtendDataSources
(
new
ArrayList
<
AlgorithmExtendDataSource
>()
{
baoshenScheduleAlgorithmAdapter
.
setAlgorithmExtendDataSources
(
new
ArrayList
<
AlgorithmExtendDataSource
>()
{
private
static
final
long
serialVersionUID
=
-
4466020352312471396L
;
private
static
final
long
serialVersionUID
=
-
4466020352312471396L
;
...
...
mes/src/main/java/com/ximai/mes/pro/service/proWorkOrder/IProWorkorderService.java
View file @
f4a5606a
...
@@ -153,13 +153,6 @@ public interface IProWorkorderService {
...
@@ -153,13 +153,6 @@ public interface IProWorkorderService {
void
generateBomLine
(
Long
workorderId
);
void
generateBomLine
(
Long
workorderId
);
String
sapCreateObj
(
SAPDtoProWorkOrder
SAPDtoProWorkorder
);
/**
* SAP传入工单--新工单的创建
*/
String
workorderCreate
(
EPDtoProWorkOrder
SAPDtoProWorkOrder
);
Integer
countByParentCode
(
String
workorderCode
);
Integer
countByParentCode
(
String
workorderCode
);
void
addComplements
(
ProWorkorderVo
proWorkorder
);
void
addComplements
(
ProWorkorderVo
proWorkorder
);
...
@@ -192,8 +185,6 @@ public interface IProWorkorderService {
...
@@ -192,8 +185,6 @@ public interface IProWorkorderService {
int
closeObj
(
ProWorkorder
workorderCode
);
int
closeObj
(
ProWorkorder
workorderCode
);
String
sapUpdateObj
(
SAPDtoProWorkOrder
proWorkorder
,
ProWorkorder
workorder
);
List
<
ProWorkorder
>
selectSaleAndWorkorderList
(
ProWorkorder
proWorkorder
);
List
<
ProWorkorder
>
selectSaleAndWorkorderList
(
ProWorkorder
proWorkorder
);
List
<
Map
<
String
,
String
>>
getWorkorderProcessInfo
(
String
workorderCode
);
List
<
Map
<
String
,
String
>>
getWorkorderProcessInfo
(
String
workorderCode
);
...
@@ -213,12 +204,4 @@ public interface IProWorkorderService {
...
@@ -213,12 +204,4 @@ public interface IProWorkorderService {
int
updateObject
(
ProWorkorderVo
proWorkorderVo
);
int
updateObject
(
ProWorkorderVo
proWorkorderVo
);
/**
* 查询SAP平台流水号
*
* @param sapDtoProWorkOrder
* @return
*/
Integer
getAndUpdateSerialByEpService
(
SAPDtoProWorkOrder
sapDtoProWorkOrder
);
}
}
mes/src/main/java/com/ximai/mes/restful/WorkorderRestController.java
View file @
f4a5606a
...
@@ -50,116 +50,6 @@ public class WorkorderRestController extends BaseController {
...
@@ -50,116 +50,6 @@ public class WorkorderRestController extends BaseController {
private
IProWorkOrderChangeRecordService
proWorkOrderChangeRecordService
;
private
IProWorkOrderChangeRecordService
proWorkOrderChangeRecordService
;
/**
* sap ep 工单同步逻辑
*
* @param orderVo
* @return
*/
@ApiOperation
(
value
=
"打样工单创建"
)
@BasicAuth
@RequestMapping
(
value
=
"/workOrderCreate"
,
method
=
RequestMethod
.
POST
)
public
AjaxResult
workorderCreate
(
@RequestBody
String
orderVo
)
{
try
{
EPDtoProWorkOrder
SAPDtoProWorkOrder
=
JSON
.
parseObject
(
orderVo
).
toJavaObject
(
EPDtoProWorkOrder
.
class
);
proWorkorderService
.
workorderCreate
(
SAPDtoProWorkOrder
);
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
e
.
getMessage
());
}
return
AjaxResult
.
success
();
}
/**
* sap 工单同步逻辑 包含增删改
*
* @param orderVo
* @return
*/
@ApiOperation
(
value
=
"sap生产工单操作"
)
@BasicAuth
@RequestMapping
(
value
=
"/sapapi"
,
method
=
RequestMethod
.
POST
)
public
SapAjaxResult
sapapi
(
@RequestBody
String
orderVo
)
{
try
{
SAPDtoProWorkOrder
sapDtoProWorkOrder
=
JSON
.
parseObject
(
orderVo
,
SAPDtoProWorkOrder
.
class
);
ProWorkOrderChangeRecord
proWorkOrderChangeRecord
=
new
ProWorkOrderChangeRecord
();
proWorkOrderChangeRecord
.
setWorkorderCode
(
sapDtoProWorkOrder
.
getWorkorderCode
());
proWorkOrderChangeRecord
.
setRequestBody
(
orderVo
);
proWorkOrderChangeRecord
.
setApiFlag
(
true
);
proWorkOrderChangeRecordService
.
insertProWorkOrderChangeRecord
(
proWorkOrderChangeRecord
);
// 状态ID
//I0001
//I0002
//I0045
//I0076
//I0043
String
status
=
sapDtoProWorkOrder
.
getStatus
();
ExceptionUtil
.
checkTrueThrowException
(
StringUtils
.
isEmpty
(
status
),
"ZSTATUS, 操作类型为空"
);
String
workorderCode
=
sapDtoProWorkOrder
.
getWorkorderCode
();
List
<
ProWorkorder
>
proWorkorders
=
proWorkorderMapper
.
selectListByQw
(
new
QueryWrapper
<
ProWorkorder
>().
eq
(
"workorder_code"
,
workorderCode
));
ProWorkorder
proWorkorder
=
CollectionUtil
.
isNotEmpty
(
proWorkorders
)
?
proWorkorders
.
get
(
0
)
:
null
;
WorkorderSAPStatusEnum
sapStatusEnum
=
WorkorderSAPStatusEnum
.
get
(
status
);
switch
(
sapStatusEnum
)
{
// 新增/变更
case
RELEASED:
if
(
proWorkorder
==
null
)
{
proWorkorderService
.
sapCreateObj
(
sapDtoProWorkOrder
);
ProWorkorder
workorder
=
proWorkorderMapper
.
selectListByQw
(
new
QueryWrapper
<
ProWorkorder
>().
eq
(
"workorder_code"
,
workorderCode
)).
get
(
0
);
proWorkOrderChangeRecord
.
setActionType
(
METHOD_INSERT_TYPE
);
proWorkOrderChangeRecord
.
setWorkorderId
(
workorder
.
getWorkorderId
());
proWorkOrderChangeRecord
.
setWorkorderCode
(
workorder
.
getWorkorderCode
());
proWorkOrderChangeRecord
.
setWorkorderName
(
workorder
.
getWorkorderName
());
}
else
{
proWorkorderService
.
sapUpdateObj
(
sapDtoProWorkOrder
,
proWorkorder
);
proWorkOrderChangeRecord
.
setActionType
(
METHOD_UPDATE_TYPE
);
proWorkOrderChangeRecord
.
setWorkorderId
(
proWorkorder
.
getWorkorderId
());
proWorkOrderChangeRecord
.
setWorkorderCode
(
proWorkorder
.
getWorkorderCode
());
proWorkOrderChangeRecord
.
setWorkorderName
(
proWorkorder
.
getWorkorderName
());
}
break
;
case
COMPLETED:
// 完工
if
(
proWorkorder
!=
null
)
{
proWorkorder
.
setStatus
(
WorkorderStatusEnum
.
FINISHED
.
getValue
());
proWorkorder
.
setApiFlag
(
true
);
proWorkorderService
.
updateProWorkorder
(
proWorkorder
);
proWorkOrderChangeRecord
.
setActionType
(
METHOD_UPDATE_TYPE
);
proWorkOrderChangeRecord
.
setWorkorderId
(
proWorkorder
.
getWorkorderId
());
proWorkOrderChangeRecord
.
setWorkorderCode
(
proWorkorder
.
getWorkorderCode
());
proWorkOrderChangeRecord
.
setWorkorderName
(
proWorkorder
.
getWorkorderName
());
}
break
;
case
CANCAL:
ExceptionUtil
.
checkTrueThrowException
(
proWorkorder
==
null
,
WorkorderConst
.
WorkOrderErrorConst
.
ERROR_8
);
ExceptionUtil
.
checkTrueThrowException
(
Objects
.
equals
(
proWorkorder
.
getStatus
(),
WorkorderStatusEnum
.
FINISHED
.
getValue
())
||
Objects
.
equals
(
proWorkorder
.
getStatus
(),
WorkorderStatusEnum
.
CANCELED
.
getValue
()),
WorkorderConst
.
WorkOrderErrorConst
.
ERROR_10
);
// 标记/工单作废
proWorkorder
.
setApiFlag
(
true
);
proWorkorderService
.
clossAndDeleteObjV2
(
proWorkorder
);
proWorkOrderChangeRecord
.
setActionType
(
METHOD_DELETE_TYPE
);
proWorkOrderChangeRecord
.
setWorkorderId
(
proWorkorder
.
getWorkorderId
());
proWorkOrderChangeRecord
.
setWorkorderCode
(
proWorkorder
.
getWorkorderCode
());
proWorkOrderChangeRecord
.
setWorkorderName
(
proWorkorder
.
getWorkorderName
());
break
;
case
LOCK:
// 锁定
break
;
default
:
break
;
}
proWorkOrderChangeRecordService
.
updateProWorkOrderChangeRecord
(
proWorkOrderChangeRecord
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
SapAjaxResult
.
error
(
e
.
getMessage
());
}
return
SapAjaxResult
.
success
();
}
@ApiOperation
(
value
=
"查询工序任务状态"
)
@ApiOperation
(
value
=
"查询工序任务状态"
)
@BasicAuth
@BasicAuth
@RequestMapping
(
value
=
"/getWorkorderProcessInfo"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/getWorkorderProcessInfo"
,
method
=
RequestMethod
.
POST
)
...
...
mes/src/main/resources/mapper/pro/proWorkOrder/ProWorkorderMapper.xml
View file @
f4a5606a
...
@@ -49,8 +49,6 @@
...
@@ -49,8 +49,6 @@
<result
property=
"rowNum"
column=
"row_num"
/>
<result
property=
"rowNum"
column=
"row_num"
/>
<result
property=
"singleWeight"
column=
"single_weight"
/>
<result
property=
"singleWeight"
column=
"single_weight"
/>
<result
property=
"thickness"
column=
"thickness"
/>
<result
property=
"thickness"
column=
"thickness"
/>
<result
property=
"groupKey"
column=
"group_key"
/>
<result
property=
"groupCounter"
column=
"group_counter"
/>
<result
property=
"materialsGroupBill"
column=
"materials_group_bill"
/>
<result
property=
"materialsGroupBill"
column=
"materials_group_bill"
/>
<result
property=
"alternativeBill"
column=
"alternative_bill"
/>
<result
property=
"alternativeBill"
column=
"alternative_bill"
/>
<result
property=
"packNum"
column=
"pack_num"
/>
<result
property=
"packNum"
column=
"pack_num"
/>
...
@@ -62,6 +60,10 @@
...
@@ -62,6 +60,10 @@
<result
property=
"usageEncasementNum"
column=
"usage_encasement_num"
/>
<result
property=
"usageEncasementNum"
column=
"usage_encasement_num"
/>
<result
property=
"mergePack"
column=
"merge_pack"
/>
<result
property=
"mergePack"
column=
"merge_pack"
/>
<result
property=
"itemTypeName"
column=
"item_type_name"
/>
<result
property=
"itemTypeName"
column=
"item_type_name"
/>
<result
property=
"batchSerial"
column=
"batch_serial"
/>
<result
property=
"productionSolutionId"
column=
"production_solution_id"
/>
<result
property=
"productionSolutionCode"
column=
"production_solution_code"
/>
<result
property=
"productionSolutionName"
column=
"production_solution_name"
/>
</resultMap>
</resultMap>
...
@@ -213,8 +215,6 @@
...
@@ -213,8 +215,6 @@
<if
test=
"rowNum != null"
>
row_num,
</if>
<if
test=
"rowNum != null"
>
row_num,
</if>
<if
test=
"singleWeight != null"
>
single_weight,
</if>
<if
test=
"singleWeight != null"
>
single_weight,
</if>
<if
test=
"thickness != null"
>
thickness,
</if>
<if
test=
"thickness != null"
>
thickness,
</if>
<if
test=
"groupKey != null"
>
group_key,
</if>
<if
test=
"groupCounter != null"
>
group_counter,
</if>
<if
test=
"materialsGroupBill != null"
>
materials_group_bill,
</if>
<if
test=
"materialsGroupBill != null"
>
materials_group_bill,
</if>
<if
test=
"alternativeBill != null"
>
alternative_bill,
</if>
<if
test=
"alternativeBill != null"
>
alternative_bill,
</if>
<if
test=
"packNum != null"
>
pack_num,
</if>
<if
test=
"packNum != null"
>
pack_num,
</if>
...
@@ -232,6 +232,10 @@
...
@@ -232,6 +232,10 @@
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"startSerial != null"
>
start_serial,
</if>
<if
test=
"startSerial != null"
>
start_serial,
</if>
<if
test=
"endSerial != null"
>
end_serial,
</if>
<if
test=
"endSerial != null"
>
end_serial,
</if>
<if
test=
"batchSerial != null"
>
batch_serial,
</if>
<if
test=
"productionSolutionId != null"
>
production_solution_id,
</if>
<if
test=
"productionSolutionCode != null"
>
production_solution_code,
</if>
<if
test=
"productionSolutionName != null"
>
production_solution_name,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"workorderCode != null and workorderCode != ''"
>
#{workorderCode},
</if>
<if
test=
"workorderCode != null and workorderCode != ''"
>
#{workorderCode},
</if>
...
@@ -273,8 +277,6 @@
...
@@ -273,8 +277,6 @@
<if
test=
"rowNum != null"
>
#{rowNum},
</if>
<if
test=
"rowNum != null"
>
#{rowNum},
</if>
<if
test=
"singleWeight != null"
>
#{singleWeight},
</if>
<if
test=
"singleWeight != null"
>
#{singleWeight},
</if>
<if
test=
"thickness != null"
>
#{thickness},
</if>
<if
test=
"thickness != null"
>
#{thickness},
</if>
<if
test=
"groupKey != null"
>
#{groupKey},
</if>
<if
test=
"groupCounter != null"
>
#{groupCounter},
</if>
<if
test=
"materialsGroupBill != null"
>
#{materialsGroupBill},
</if>
<if
test=
"materialsGroupBill != null"
>
#{materialsGroupBill},
</if>
<if
test=
"alternativeBill != null"
>
#{alternativeBill},
</if>
<if
test=
"alternativeBill != null"
>
#{alternativeBill},
</if>
<if
test=
"packNum != null"
>
#{packNum},
</if>
<if
test=
"packNum != null"
>
#{packNum},
</if>
...
@@ -292,6 +294,10 @@
...
@@ -292,6 +294,10 @@
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"startSerial != null"
>
#{startSerial},
</if>
<if
test=
"startSerial != null"
>
#{startSerial},
</if>
<if
test=
"endSerial != null"
>
#{endSerial},
</if>
<if
test=
"endSerial != null"
>
#{endSerial},
</if>
<if
test=
"batchSerial != null"
>
#{batchSerial},
</if>
<if
test=
"productionSolutionId != null"
>
#{productionSolutionId},
</if>
<if
test=
"productionSolutionCode != null"
>
#{productionSolutionCode},
</if>
<if
test=
"productionSolutionName != null"
>
#{productionSolutionName},
</if>
</trim>
</trim>
</insert>
</insert>
...
@@ -356,8 +362,6 @@
...
@@ -356,8 +362,6 @@
<if
test=
"rowNum != null"
>
row_num = #{rowNum},
</if>
<if
test=
"rowNum != null"
>
row_num = #{rowNum},
</if>
<if
test=
"singleWeight != null"
>
single_weight = #{singleWeight},
</if>
<if
test=
"singleWeight != null"
>
single_weight = #{singleWeight},
</if>
<if
test=
"thickness != null"
>
thickness = #{thickness},
</if>
<if
test=
"thickness != null"
>
thickness = #{thickness},
</if>
<if
test=
"groupKey != null"
>
group_key = #{groupKey},
</if>
<if
test=
"groupCounter != null"
>
group_counter = #{groupCounter},
</if>
<if
test=
"materialsGroupBill != null"
>
materials_group_bill = #{materialsGroupBill},
</if>
<if
test=
"materialsGroupBill != null"
>
materials_group_bill = #{materialsGroupBill},
</if>
<if
test=
"alternativeBill != null"
>
alternative_bill = #{alternativeBill},
</if>
<if
test=
"alternativeBill != null"
>
alternative_bill = #{alternativeBill},
</if>
<if
test=
"packNum != null"
>
pack_num = #{packNum},
</if>
<if
test=
"packNum != null"
>
pack_num = #{packNum},
</if>
...
@@ -369,7 +373,10 @@
...
@@ -369,7 +373,10 @@
<if
test=
"mergePack != null"
>
merge_pack=#{mergePack},
</if>
<if
test=
"mergePack != null"
>
merge_pack=#{mergePack},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"batchSerial != null"
>
batch_serial=#{batchSerial},
</if>
<if
test=
"productionSolutionId != null"
>
production_solution_id=#{productionSolutionId},
</if>
<if
test=
"productionSolutionCode != null"
>
production_solution_code = #{productionSolutionCode},
</if>
<if
test=
"productionSolutionName != null"
>
production_solution_name = #{productionSolutionName},
</if>
</trim>
</trim>
where workorder_id = #{workorderId}
where workorder_id = #{workorderId}
</update>
</update>
...
...
mes/src/test/java/com/bs/mes/schedule/strategy/EquipmentSelectionStrategyImplTest.java
deleted
100644 → 0
View file @
821302bc
This diff is collapsed.
Click to expand it.
mes/src/test/java/com/bs/mes/schedule/strategy/EvaluateEquipmentChangeOverTest.java
deleted
100644 → 0
View file @
821302bc
package
com
.
bs
.
mes
.
schedule
.
strategy
;
import
com.ximai.mes.pro.schedule.strategy.EvaluateEquipmentChangeOver
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
java.lang.reflect.Method
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
EvaluateEquipmentChangeOverTest
{
@Test
public
void
calculateScore
()
throws
Exception
{
EvaluateEquipmentChangeOver
evaluateEquipmentChangeOver
=
new
EvaluateEquipmentChangeOver
();
Method
methods
=
EvaluateEquipmentChangeOver
.
class
.
getDeclaredMethod
(
"calculateScore"
,
Map
.
class
,
Map
.
class
,
Map
.
class
);
methods
.
setAccessible
(
true
);
Map
<
String
,
Integer
>
setupRuleMap
=
new
HashMap
<
String
,
Integer
>();
//当前任务换型规则
setupRuleMap
.
put
(
"tool"
,
1
);
setupRuleMap
.
put
(
"sheet_width"
,
2
);
setupRuleMap
.
put
(
"product_standard"
,
3
);
Map
<
String
,
Object
>
setupRuleValsCur
=
new
HashMap
<
String
,
Object
>();
//当前任务工单换型属性值
setupRuleValsCur
.
put
(
"tool"
,
"1"
);
setupRuleValsCur
.
put
(
"sheet_width"
,
"2"
);
setupRuleValsCur
.
put
(
"product_standard"
,
"3"
);
Map
<
String
,
Object
>
setupRuleValsPre
=
new
HashMap
<
String
,
Object
>();
//上个任务工单换型属性值
setupRuleValsPre
.
put
(
"tool"
,
"1.1"
);
setupRuleValsPre
.
put
(
"sheet_width"
,
"2"
);
setupRuleValsPre
.
put
(
"product_standard"
,
"3"
);
double
rst
=
(
double
)
methods
.
invoke
(
evaluateEquipmentChangeOver
,
setupRuleMap
,
setupRuleValsCur
,
setupRuleValsPre
);
Assert
.
assertEquals
(
5.0
/
15
*
10
,
rst
,
0.1
);
//优先级全为1的情况
setupRuleMap
.
clear
();
setupRuleValsCur
.
clear
();
setupRuleValsPre
.
clear
();
setupRuleMap
.
put
(
"tool"
,
1
);
setupRuleMap
.
put
(
"sheet_width"
,
1
);
setupRuleMap
.
put
(
"product_standard"
,
1
);
setupRuleMap
.
put
(
"pro_con_color"
,
1
);
setupRuleMap
.
put
(
"inlay"
,
1
);
setupRuleMap
.
put
(
"product_width"
,
1
);
setupRuleValsCur
.
put
(
"tool"
,
"1"
);
setupRuleValsCur
.
put
(
"sheet_width"
,
"2"
);
setupRuleValsCur
.
put
(
"product_standard"
,
"3"
);
setupRuleValsCur
.
put
(
"pro_con_color"
,
"4"
);
setupRuleValsCur
.
put
(
"inlay"
,
"5.1"
);
setupRuleValsCur
.
put
(
"product_width"
,
"6"
);
setupRuleValsPre
.
put
(
"tool"
,
"1.1"
);
setupRuleValsPre
.
put
(
"sheet_width"
,
"2"
);
setupRuleValsPre
.
put
(
"product_standard"
,
"3"
);
setupRuleValsPre
.
put
(
"pro_con_color"
,
"4"
);
setupRuleValsPre
.
put
(
"inlay"
,
"5.2"
);
setupRuleValsPre
.
put
(
"product_width"
,
"6"
);
rst
=
(
double
)
methods
.
invoke
(
evaluateEquipmentChangeOver
,
setupRuleMap
,
setupRuleValsCur
,
setupRuleValsPre
);
Assert
.
assertEquals
(
16.0
/
30
*
10
,
rst
,
0.1
);
}
}
mes/src/test/java/com/bs/mes/schedule/strategy/EvaluateEquipmentFunctionTest.java
deleted
100644 → 0
View file @
821302bc
package
com
.
bs
.
mes
.
schedule
.
strategy
;
import
com.ximai.mes.pro.schedule.Equipment
;
import
com.ximai.mes.pro.schedule.IOperationTimeCalculator
;
import
com.ximai.mes.pro.schedule.Job
;
import
com.ximai.mes.pro.schedule.TaskSchedulingContext
;
import
com.ximai.mes.pro.schedule.strategy.EvaluateEquipmentFunction
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
java.time.Duration
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
EvaluateEquipmentFunctionTest
{
@Test
public
void
evaluate
(){
EvaluateEquipmentFunction
evaluateEquipmentFunction
=
new
EvaluateEquipmentFunction
();
TaskSchedulingContext
context
=
new
TaskSchedulingContext
();
IOperationTimeCalculator
.
OperationTimePlan
operationTimePlan
=
new
IOperationTimeCalculator
.
OperationTimePlan
();
List
<
IOperationTimeCalculator
.
OperationTimePlanItem
>
operationTimePlanItemList
=
new
ArrayList
<
IOperationTimeCalculator
.
OperationTimePlanItem
>();
operationTimePlan
.
setPlan
(
operationTimePlanItemList
);
operationTimePlan
.
setScheduledSuccess
(
true
);
Job
job
=
new
Job
(
"1"
,
Duration
.
ofMinutes
(
12
));
job
.
setProducedDeliveryTime
(
Duration
.
ofMinutes
(
3000
));
context
.
setJob
(
job
);
operationTimePlanItemList
.
add
(
new
IOperationTimeCalculator
.
OperationTimePlanItem
(){{
setStartedTime
(
Duration
.
ofMinutes
(
2888
));
setEndedTime
(
Duration
.
ofMinutes
(
2898
));
setShiftType
(
"白班"
);
}});
Equipment
equipment
=
new
Equipment
();
context
.
setEquipment
(
equipment
);
Equipment
.
EquipmentFunction
equipmentFunction
=
new
Equipment
.
EquipmentFunction
();
equipmentFunction
.
setSacmForBuckleUp
(
"Y"
);
equipmentFunction
.
setSacmForOrgan
(
"Y"
);
equipmentFunction
.
setSacmForEdgeOpening
(
"N"
);
equipment
.
setEquipmentFunction
(
equipmentFunction
);
double
rst
=
evaluateEquipmentFunction
.
evaluate
(
context
,
operationTimePlan
,
null
);
Assert
.
assertEquals
(
8
,
rst
,
Double
.
valueOf
(
0.001
));
equipmentFunction
.
setSacmForEdgeOpening
(
"Y"
);
equipmentFunction
.
setSacmForSlitting
(
"Y"
);
equipmentFunction
.
setSacmForMolarTooth
(
"Y"
);
equipmentFunction
.
setSacmForThermalComposite
(
"Y"
);
equipmentFunction
.
setSacmForPasteComposite
(
"Y"
);
equipmentFunction
.
setSacmForThermalCutting
(
"Y"
);
equipmentFunction
.
setSacmForThermalSelfFusion
(
"Y"
);
equipmentFunction
.
setSacmForCreasing
(
"Y"
);
equipmentFunction
.
setSacmForLabeling
(
"Y"
);
rst
=
evaluateEquipmentFunction
.
evaluate
(
context
,
operationTimePlan
,
null
);
Assert
.
assertEquals
(
0
,
rst
,
Double
.
valueOf
(
0.001
));
}
}
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