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
c226bdb5
Commit
c226bdb5
authored
Sep 11, 2024
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
委外相关调整
parent
5226cd48
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
331 additions
and
10 deletions
+331
-10
IMdWorkunitService.java
...ain/java/com/ximai/mes/md/service/IMdWorkunitService.java
+3
-0
ProTaskWorkunitController.java
...ai/mes/pro/controller/task/ProTaskWorkunitController.java
+38
-0
ProWorkOrderProcess.java
...imai/mes/pro/domain/proWorkOrder/ProWorkOrderProcess.java
+2
-1
ProTaskWorkunit.java
...n/java/com/ximai/mes/pro/domain/task/ProTaskWorkunit.java
+12
-0
ProWorkOrderProcessVo.java
...va/com/ximai/mes/pro/domain/vo/ProWorkOrderProcessVo.java
+4
-0
ProTaskWorkunitQuery.java
...om/ximai/mes/pro/domain/vo/task/ProTaskWorkunitQuery.java
+5
-4
TaskWorkunitOutsourceSplitParam.java
...s/pro/domain/vo/task/TaskWorkunitOutsourceSplitParam.java
+49
-0
TaskWorkunitToOutsourceParam.java
.../mes/pro/domain/vo/task/TaskWorkunitToOutsourceParam.java
+45
-0
TaskWorkunitToSelfMadeParam.java
...i/mes/pro/domain/vo/task/TaskWorkunitToSelfMadeParam.java
+46
-0
GreedyAlg.java
mes/src/main/java/com/ximai/mes/pro/schedule/GreedyAlg.java
+3
-1
AlgorithmDataSourceImpl.java
.../ximai/mes/pro/schedule/impl/AlgorithmDataSourceImpl.java
+1
-1
ProTaskWorkunitServiceImpl.java
...mes/pro/service/impl/task/ProTaskWorkunitServiceImpl.java
+71
-3
IProTaskWorkunitService.java
...m/ximai/mes/pro/service/task/IProTaskWorkunitService.java
+30
-0
ProWorkOrderProcessMapper.xml
...ces/mapper/pro/proWorkOrder/ProWorkOrderProcessMapper.xml
+5
-0
ProProductionSolutionMapper.xml
...er/pro/productionSolution/ProProductionSolutionMapper.xml
+1
-0
ProTaskWorkunitMapper.xml
.../main/resources/mapper/pro/task/ProTaskWorkunitMapper.xml
+16
-0
No files found.
mes/src/main/java/com/ximai/mes/md/service/IMdWorkunitService.java
View file @
c226bdb5
...
@@ -14,6 +14,9 @@ import java.util.List;
...
@@ -14,6 +14,9 @@ import java.util.List;
* @date 2024-01-18
* @date 2024-01-18
*/
*/
public
interface
IMdWorkunitService
{
public
interface
IMdWorkunitService
{
public
static
Long
OUTSOURCE_WORKUNIT_ID
=
1
l
;
public
static
String
OUTSOURCE_WORKUNIT_CODE
=
"XMSWWDY"
;
/**
/**
* 查询工作单元
* 查询工作单元
*
*
...
...
mes/src/main/java/com/ximai/mes/pro/controller/task/ProTaskWorkunitController.java
View file @
c226bdb5
...
@@ -5,10 +5,16 @@ import com.ximai.common.core.controller.BaseController;
...
@@ -5,10 +5,16 @@ import com.ximai.common.core.controller.BaseController;
import
com.ximai.common.core.domain.AjaxResult
;
import
com.ximai.common.core.domain.AjaxResult
;
import
com.ximai.common.core.page.TableDataInfo
;
import
com.ximai.common.core.page.TableDataInfo
;
import
com.ximai.common.enums.BusinessType
;
import
com.ximai.common.enums.BusinessType
;
import
com.ximai.common.utils.data.ExceptionUtil
;
import
com.ximai.common.utils.data.StringUtils
;
import
com.ximai.common.utils.poi.ExcelUtil
;
import
com.ximai.common.utils.poi.ExcelUtil
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
com.ximai.mes.pro.domain.vo.ProTaskVo
;
import
com.ximai.mes.pro.domain.vo.task.ProTaskWorkunitQuery
;
import
com.ximai.mes.pro.domain.vo.task.ProTaskWorkunitQuery
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitOutsourceSplitParam
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitToOutsourceParam
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitToSelfMadeParam
;
import
com.ximai.mes.pro.service.task.IProTaskWorkunitService
;
import
com.ximai.mes.pro.service.task.IProTaskWorkunitService
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -17,7 +23,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
...
@@ -17,7 +23,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
/**
/**
* 任务工作单元Controller
* 任务工作单元Controller
...
@@ -120,5 +128,35 @@ public class ProTaskWorkunitController extends BaseController {
...
@@ -120,5 +128,35 @@ public class ProTaskWorkunitController extends BaseController {
proTaskWorkunitService
.
makeProduction
(
taskWorkunitIds
);
proTaskWorkunitService
.
makeProduction
(
taskWorkunitIds
);
return
AjaxResult
.
success
();
return
AjaxResult
.
success
();
}
}
@ApiOperation
(
"转外委"
)
@Log
(
title
=
"转外委"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"/toOutsource"
)
public
AjaxResult
toOutsource
(
@RequestBody
List
<
TaskWorkunitToOutsourceParam
>
taskWorkunitToOutsourceParam
)
{
proTaskWorkunitService
.
toOutsource
(
taskWorkunitToOutsourceParam
);
return
AjaxResult
.
success
();
}
@ApiOperation
(
"转自制"
)
@Log
(
title
=
"转自制"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"/toSelfMade"
)
public
AjaxResult
toSelfMade
(
@RequestBody
List
<
TaskWorkunitToSelfMadeParam
>
taskWorkunitToSelfMadeParam
)
{
proTaskWorkunitService
.
toSelfMade
(
taskWorkunitToSelfMadeParam
);
return
AjaxResult
.
success
();
}
@ApiOperation
(
"外委拆分"
)
@Log
(
title
=
"外委拆分"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"/outsourceSplit"
)
public
AjaxResult
outsourceSplit
(
@RequestBody
List
<
TaskWorkunitOutsourceSplitParam
>
taskWorkunitOutsourceSplitParam
)
{
proTaskWorkunitService
.
outsourceSplit
(
taskWorkunitOutsourceSplitParam
);
return
AjaxResult
.
success
();
}
@ApiOperation
(
"外委确认"
)
@Log
(
title
=
"外委确认"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"/outsourceConfirm"
)
public
AjaxResult
outsourceConfirm
(
@RequestBody
List
<
Long
>
taskWorkunitIds
)
{
proTaskWorkunitService
.
outsourceConfirm
(
taskWorkunitIds
);
return
AjaxResult
.
success
();
}
}
}
mes/src/main/java/com/ximai/mes/pro/domain/proWorkOrder/ProWorkOrderProcess.java
View file @
c226bdb5
...
@@ -92,7 +92,6 @@ public class ProWorkOrderProcess extends BaseEntity {
...
@@ -92,7 +92,6 @@ public class ProWorkOrderProcess extends BaseEntity {
*/
*/
private
String
stdWorkingTimeUom
;
private
String
stdWorkingTimeUom
;
/**
/**
* 加工方式
* 加工方式
*/
*/
...
@@ -126,6 +125,8 @@ public class ProWorkOrderProcess extends BaseEntity {
...
@@ -126,6 +125,8 @@ public class ProWorkOrderProcess extends BaseEntity {
@ApiModelProperty
(
"序号"
)
@ApiModelProperty
(
"序号"
)
private
String
idx
;
private
String
idx
;
@ApiModelProperty
(
"是否外协"
)
private
String
outsourced
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"工作中心名称"
)
@ApiModelProperty
(
"工作中心名称"
)
...
...
mes/src/main/java/com/ximai/mes/pro/domain/task/ProTaskWorkunit.java
View file @
c226bdb5
...
@@ -170,6 +170,18 @@ public class ProTaskWorkunit extends BaseEntity {
...
@@ -170,6 +170,18 @@ public class ProTaskWorkunit extends BaseEntity {
@Excel
(
name
=
"工作中心ID"
)
@Excel
(
name
=
"工作中心ID"
)
private
String
workstationCode
;
private
String
workstationCode
;
@ApiModelProperty
(
"外包单价"
)
private
BigDecimal
outsourceUnitPrice
;
@ApiModelProperty
(
"是否委外,1:是,0:否"
)
private
Integer
outsourced
;
@ApiModelProperty
(
"供应商ID"
)
private
Long
vendorId
;
@ApiModelProperty
(
"供应商名称"
)
private
String
vendorName
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"编排单号"
)
@ApiModelProperty
(
"编排单号"
)
private
String
arrangeCode
;
private
String
arrangeCode
;
...
...
mes/src/main/java/com/ximai/mes/pro/domain/vo/ProWorkOrderProcessVo.java
View file @
c226bdb5
...
@@ -170,6 +170,10 @@ public class ProWorkOrderProcessVo extends BaseEntity {
...
@@ -170,6 +170,10 @@ public class ProWorkOrderProcessVo extends BaseEntity {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
endTime
;
private
Date
endTime
;
@ApiModelProperty
(
"是否外协"
)
private
String
outsourced
;
/**
/**
* 工序物料
* 工序物料
*/
*/
...
...
mes/src/main/java/com/ximai/mes/pro/domain/vo/task/ProTaskWorkunitQuery.java
View file @
c226bdb5
...
@@ -66,11 +66,14 @@ public class ProTaskWorkunitQuery extends BaseEntity {
...
@@ -66,11 +66,14 @@ public class ProTaskWorkunitQuery extends BaseEntity {
@ApiModelProperty
(
"工作中心Id"
)
@ApiModelProperty
(
"工作中心Id"
)
private
Long
workCenterId
;
private
Long
workCenterId
;
@ApiModelProperty
(
"工厂Id"
)
private
Long
workshopId
;
@ApiModelProperty
(
"工作单元Id"
)
@ApiModelProperty
(
"工作单元Id"
)
private
Long
workunitId
;
private
Long
workunitId
;
@ApiModelProperty
(
"工
厂Id
"
)
@ApiModelProperty
(
"工
作单元Id不等于
"
)
private
Long
workshop
Id
;
private
Long
neWorkunit
Id
;
@ApiModelProperty
(
"工作单元编码"
)
@ApiModelProperty
(
"工作单元编码"
)
private
String
workunitCode
;
private
String
workunitCode
;
...
@@ -78,8 +81,6 @@ public class ProTaskWorkunitQuery extends BaseEntity {
...
@@ -78,8 +81,6 @@ public class ProTaskWorkunitQuery extends BaseEntity {
@ApiModelProperty
(
"工作单元名称"
)
@ApiModelProperty
(
"工作单元名称"
)
private
String
workunitName
;
private
String
workunitName
;
private
String
workorderCode
;
private
String
workorderCode
;
private
String
arrangeUsername
;
}
}
mes/src/main/java/com/ximai/mes/pro/domain/vo/task/TaskWorkunitOutsourceSplitParam.java
0 → 100644
View file @
c226bdb5
package
com
.
ximai
.
mes
.
pro
.
domain
.
vo
.
task
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ximai.common.annotation.Excel
;
import
com.ximai.common.core.domain.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 外协拆分参数
*
* @author chicheng.li
* @date 2024-09-10
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
TaskWorkunitOutsourceSplitParam
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"派工任务ID"
)
private
Long
taskWorkunitId
;
@ApiModelProperty
(
"拆分数量"
)
private
BigDecimal
splitQuantity
;
@ApiModelProperty
(
"外委单价"
)
private
BigDecimal
outsourceUnitPrice
;
@ApiModelProperty
(
"计划结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
scheduleStartDate
;
@ApiModelProperty
(
"计划结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
scheduleEndDate
;
@ApiModelProperty
(
"供应商ID"
)
private
Long
vendorId
;
@ApiModelProperty
(
"供应商名称"
)
private
String
vendorName
;
}
mes/src/main/java/com/ximai/mes/pro/domain/vo/task/TaskWorkunitToOutsourceParam.java
0 → 100644
View file @
c226bdb5
package
com
.
ximai
.
mes
.
pro
.
domain
.
vo
.
task
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ximai.common.annotation.Excel
;
import
com.ximai.common.core.domain.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 派工任务转外协参数
*
* @author chiheng.li
* @date 2024-09-10
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
TaskWorkunitToOutsourceParam
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"派工任务ID"
)
private
Long
taskWorkunitId
;
@ApiModelProperty
(
"转外协数量"
)
private
BigDecimal
toOutsourceQuantity
;
@ApiModelProperty
(
"计划结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
scheduleStartDate
;
@ApiModelProperty
(
"计划结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
scheduleEndDate
;
@ApiModelProperty
(
"供应商ID"
)
private
Long
vendorId
;
@ApiModelProperty
(
"供应商名称"
)
private
String
vendorName
;
}
mes/src/main/java/com/ximai/mes/pro/domain/vo/task/TaskWorkunitToSelfMadeParam.java
0 → 100644
View file @
c226bdb5
package
com
.
ximai
.
mes
.
pro
.
domain
.
vo
.
task
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ximai.common.annotation.Excel
;
import
com.ximai.common.core.domain.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 派工任务转自制参数
*
* @author chicheng.li
* @date 2024-09-10
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
TaskWorkunitToSelfMadeParam
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"派工任务ID"
)
private
Long
taskWorkunitId
;
@ApiModelProperty
(
"转自制数量"
)
private
BigDecimal
toSelfMadeQuantity
;
@ApiModelProperty
(
"计划结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
scheduleStartDate
;
@ApiModelProperty
(
"计划结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
scheduleEndDate
;
@ApiModelProperty
(
"工作单元Id"
)
private
Long
workunitId
;
@ApiModelProperty
(
"工作单元编码"
)
private
String
workunitCode
;
}
mes/src/main/java/com/ximai/mes/pro/schedule/GreedyAlg.java
View file @
c226bdb5
package
com
.
ximai
.
mes
.
pro
.
schedule
;
package
com
.
ximai
.
mes
.
pro
.
schedule
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.ximai.mes.md.service.IMdWorkunitService
;
import
com.ximai.mes.pro.schedule.strategy.EquipmentSelectionResult
;
import
com.ximai.mes.pro.schedule.strategy.EquipmentSelectionResult
;
import
com.ximai.mes.pro.schedule.strategy.EquipmentSelectionStrategy
;
import
com.ximai.mes.pro.schedule.strategy.EquipmentSelectionStrategy
;
import
com.ximai.mes.pro.service.task.IProTaskWorkunitService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -123,7 +125,7 @@ public class GreedyAlg implements IAlgorithm{
...
@@ -123,7 +125,7 @@ public class GreedyAlg implements IAlgorithm{
List
<
EvaluateOptionalEquipmentResult
>
evaluateResultList
=
selectionResult
.
getSelectList
();
List
<
EvaluateOptionalEquipmentResult
>
evaluateResultList
=
selectionResult
.
getSelectList
();
if
(
task
.
isOutsourced
()){
if
(
task
.
isOutsourced
()){
//查询外委作业单元
//查询外委作业单元
Optional
<
Resource
>
equipmentResource
=
this
.
resources
.
stream
().
filter
(
s
->
"GZBSWWDY"
.
equals
(((
Equipment
)
s
).
getWorkUnitCode
())).
findFirst
();
Optional
<
Resource
>
equipmentResource
=
this
.
resources
.
stream
().
filter
(
s
->
IMdWorkunitService
.
OUTSOURCE_WORKUNIT_CODE
.
equals
(((
Equipment
)
s
).
getWorkUnitCode
())).
findFirst
();
if
(!
equipmentResource
.
isPresent
()){
if
(!
equipmentResource
.
isPresent
()){
task
.
setScheduleStatus
(
ScheduleStatus
.
InadequateTime
);
task
.
setScheduleStatus
(
ScheduleStatus
.
InadequateTime
);
task
.
getJob
().
setScheduleStatus
(
ScheduleStatus
.
InadequateTime
);
task
.
getJob
().
setScheduleStatus
(
ScheduleStatus
.
InadequateTime
);
...
...
mes/src/main/java/com/ximai/mes/pro/schedule/impl/AlgorithmDataSourceImpl.java
View file @
c226bdb5
...
@@ -155,7 +155,7 @@ public class AlgorithmDataSourceImpl implements AlgorithmDataSource {
...
@@ -155,7 +155,7 @@ public class AlgorithmDataSourceImpl implements AlgorithmDataSource {
task
.
setOrderQuantity
(
scheduleJobGroup
.
getQuantity
());
task
.
setOrderQuantity
(
scheduleJobGroup
.
getQuantity
());
task
.
setWorkCenterId
(
routingItem
.
getWorkstationId
());
task
.
setWorkCenterId
(
routingItem
.
getWorkstationId
());
task
.
setWorkCenterName
(
routingItem
.
getWorkstationName
());
task
.
setWorkCenterName
(
routingItem
.
getWorkstationName
());
if
(
ProcessControlCodeEnum
.
PP02
.
getValue
().
equalsIgnoreCase
(
routingItem
.
getControlCode
())){
if
(
"Y"
.
equalsIgnoreCase
(
routingItem
.
getOutsourced
())){
task
.
setOutsourced
(
true
);
task
.
setOutsourced
(
true
);
}
}
//HOUR\SECOND\MINUTE
//HOUR\SECOND\MINUTE
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskWorkunitServiceImpl.java
View file @
c226bdb5
...
@@ -6,9 +6,13 @@ import cn.hutool.core.collection.CollectionUtil;
...
@@ -6,9 +6,13 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.ximai.common.core.domain.BaseEntity
;
import
com.ximai.common.core.domain.BaseEntity
;
import
com.ximai.common.core.domain.entity.SysUser
;
import
com.ximai.common.core.domain.entity.SysUser
;
import
com.ximai.common.utils.data.DataUtil
;
import
com.ximai.common.utils.data.ExceptionUtil
;
import
com.ximai.common.utils.data.ExceptionUtil
;
import
com.ximai.common.utils.data.StringUtils
;
import
com.ximai.common.utils.data.StringUtils
;
import
com.ximai.mes.constant.*
;
import
com.ximai.mes.constant.*
;
import
com.ximai.mes.md.domain.MdWorkunit
;
import
com.ximai.mes.md.mapper.MdWorkunitMapper
;
import
com.ximai.mes.md.service.IMdWorkunitService
;
import
com.ximai.mes.pro.domain.ProArrange
;
import
com.ximai.mes.pro.domain.ProArrange
;
import
com.ximai.mes.pro.domain.ProFeedback
;
import
com.ximai.mes.pro.domain.ProFeedback
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
...
@@ -16,7 +20,11 @@ import com.ximai.mes.pro.domain.task.ProTask;
...
@@ -16,7 +20,11 @@ import com.ximai.mes.pro.domain.task.ProTask;
import
com.ximai.mes.pro.domain.task.ProTaskWorkorder
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkorder
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunitOpRecord
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunitOpRecord
;
import
com.ximai.mes.pro.domain.vo.ProTaskVo
;
import
com.ximai.mes.pro.domain.vo.task.ProTaskWorkunitQuery
;
import
com.ximai.mes.pro.domain.vo.task.ProTaskWorkunitQuery
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitOutsourceSplitParam
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitToOutsourceParam
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitToSelfMadeParam
;
import
com.ximai.mes.pro.mapper.ProArrangeMapper
;
import
com.ximai.mes.pro.mapper.ProArrangeMapper
;
import
com.ximai.mes.pro.mapper.ProFeedbackMapper
;
import
com.ximai.mes.pro.mapper.ProFeedbackMapper
;
import
com.ximai.mes.pro.mapper.task.ProTaskWorkunitMapper
;
import
com.ximai.mes.pro.mapper.task.ProTaskWorkunitMapper
;
...
@@ -37,10 +45,12 @@ import com.ximai.mes.tm.service.ITmToolRequestService;
...
@@ -37,10 +45,12 @@ import com.ximai.mes.tm.service.ITmToolRequestService;
import
com.ximai.system.mapper.SysUserMapper
;
import
com.ximai.system.mapper.SysUserMapper
;
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
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
ximai
.
mes
.
constant
.
WorkorderStatusEnum
.
CLOSE
;
import
static
com
.
ximai
.
mes
.
constant
.
WorkorderStatusEnum
.
CLOSE
;
...
@@ -83,11 +93,10 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
...
@@ -83,11 +93,10 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
@Autowired
@Autowired
private
ITmToolRequestService
tmToolRequestService
;
private
ITmToolRequestService
tmToolRequestService
;
@Autowired
@Autowired
private
IProMaterialRequestService
proMaterialRequestService
;
private
IProMaterialRequestService
proMaterialRequestService
;
@Autowired
private
MdWorkunitMapper
mdWorkunitMapper
;
@Autowired
@Autowired
private
IProAllocationMaterialService
proAllocationMaterialService
;
private
IProAllocationMaterialService
proAllocationMaterialService
;
...
@@ -166,6 +175,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
...
@@ -166,6 +175,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
@Override
@Override
public
int
insertProTaskWorkunit
(
ProTaskWorkunit
proTaskWorkunit
)
{
public
int
insertProTaskWorkunit
(
ProTaskWorkunit
proTaskWorkunit
)
{
proTaskWorkunit
.
createAction
();
proTaskWorkunit
.
createAction
();
proTaskWorkunit
.
setOutsourced
(
0
);
return
proTaskWorkunitMapper
.
insertProTaskWorkunit
(
proTaskWorkunit
);
return
proTaskWorkunitMapper
.
insertProTaskWorkunit
(
proTaskWorkunit
);
}
}
...
@@ -390,6 +400,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
...
@@ -390,6 +400,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
query
.
notIn
(
CollectionUtil
.
isNotEmpty
(
list1
),
"ptw.status"
,
Collections
.
singletonList
(
CLOSE
.
getValue
()));
query
.
notIn
(
CollectionUtil
.
isNotEmpty
(
list1
),
"ptw.status"
,
Collections
.
singletonList
(
CLOSE
.
getValue
()));
query
.
eq
(
proTaskWorkunit
.
getWorkCenterId
()
!=
null
,
"ws.workstation_id"
,
proTaskWorkunit
.
getWorkCenterId
());
query
.
eq
(
proTaskWorkunit
.
getWorkCenterId
()
!=
null
,
"ws.workstation_id"
,
proTaskWorkunit
.
getWorkCenterId
());
query
.
eq
(
proTaskWorkunit
.
getWorkunitId
()
!=
null
,
"mw.workunit_id"
,
proTaskWorkunit
.
getWorkunitId
());
query
.
eq
(
proTaskWorkunit
.
getWorkunitId
()
!=
null
,
"mw.workunit_id"
,
proTaskWorkunit
.
getWorkunitId
());
query
.
ne
(
proTaskWorkunit
.
getNeWorkunitId
()
!=
null
,
"mw.workunit_id"
,
proTaskWorkunit
.
getNeWorkunitId
());
query
.
eq
(
proTaskWorkunit
.
getWorkshopId
()
!=
null
,
"ws.workshop_id"
,
proTaskWorkunit
.
getWorkshopId
());
query
.
eq
(
proTaskWorkunit
.
getWorkshopId
()
!=
null
,
"ws.workshop_id"
,
proTaskWorkunit
.
getWorkshopId
());
query
.
like
(
StringUtils
.
isNotEmpty
(
proTaskWorkunit
.
getWorkorderCode
()),
"wo.workorder_code"
,
proTaskWorkunit
.
getWorkorderCode
());
query
.
like
(
StringUtils
.
isNotEmpty
(
proTaskWorkunit
.
getWorkorderCode
()),
"wo.workorder_code"
,
proTaskWorkunit
.
getWorkorderCode
());
query
.
like
(
StringUtils
.
isNotEmpty
(
proTaskWorkunit
.
getTaskCode
()),
"t.task_code"
,
proTaskWorkunit
.
getTaskCode
());
query
.
like
(
StringUtils
.
isNotEmpty
(
proTaskWorkunit
.
getTaskCode
()),
"t.task_code"
,
proTaskWorkunit
.
getTaskCode
());
...
@@ -405,4 +416,61 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
...
@@ -405,4 +416,61 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
List
<
ProTaskWorkunit
>
list
=
proTaskWorkunitService
.
selectTaskWorkUnitJoinTask
(
query
);
List
<
ProTaskWorkunit
>
list
=
proTaskWorkunitService
.
selectTaskWorkUnitJoinTask
(
query
);
return
list
;
return
list
;
}
}
@Override
@Transactional
public
void
toSelfMade
(
List
<
TaskWorkunitToSelfMadeParam
>
toSelfMadeParamList
)
{
toSelfMadeParamList
.
forEach
(
toSelfMadeParam
->{
ProTaskWorkunit
taskWorkunit
=
this
.
selectProTaskWorkunitByTaskWorkunitId
(
toSelfMadeParam
.
getTaskWorkunitId
());
ProTaskWorkunit
newTaskWorkunit
=
BeanUtil
.
copyProperties
(
taskWorkunit
,
ProTaskWorkunit
.
class
);
newTaskWorkunit
.
setQuantity
(
toSelfMadeParam
.
getToSelfMadeQuantity
());
BeanUtil
.
copyProperties
(
toSelfMadeParam
,
newTaskWorkunit
);
this
.
insertProTaskWorkunit
(
newTaskWorkunit
);
//原数量扣减
taskWorkunit
.
setQuantity
(
taskWorkunit
.
getQuantity
().
subtract
(
toSelfMadeParam
.
getToSelfMadeQuantity
()));
this
.
updateProTaskWorkunit
(
taskWorkunit
);
});
}
@Override
@Transactional
public
void
outsourceSplit
(
List
<
TaskWorkunitOutsourceSplitParam
>
outsourceSplitParamList
)
{
outsourceSplitParamList
.
forEach
(
outsourceSplitParam
->{
ProTaskWorkunit
taskWorkunit
=
this
.
selectProTaskWorkunitByTaskWorkunitId
(
outsourceSplitParam
.
getTaskWorkunitId
());
ProTaskWorkunit
newTaskWorkunit
=
BeanUtil
.
copyProperties
(
taskWorkunit
,
ProTaskWorkunit
.
class
);
newTaskWorkunit
.
setQuantity
(
outsourceSplitParam
.
getSplitQuantity
());
BeanUtil
.
copyProperties
(
outsourceSplitParam
,
newTaskWorkunit
);
this
.
insertProTaskWorkunit
(
newTaskWorkunit
);
//原数量扣减
taskWorkunit
.
setQuantity
(
taskWorkunit
.
getQuantity
().
subtract
(
outsourceSplitParam
.
getSplitQuantity
()));
this
.
updateProTaskWorkunit
(
taskWorkunit
);
});
}
@Override
@Transactional
public
void
toOutsource
(
List
<
TaskWorkunitToOutsourceParam
>
toOutsourceParamList
)
{
toOutsourceParamList
.
forEach
(
toOutsourceParam
->{
ProTaskWorkunit
taskWorkunit
=
this
.
selectProTaskWorkunitByTaskWorkunitId
(
toOutsourceParam
.
getTaskWorkunitId
());
ProTaskWorkunit
newTaskWorkunit
=
BeanUtil
.
copyProperties
(
taskWorkunit
,
ProTaskWorkunit
.
class
);
newTaskWorkunit
.
setWorkunitId
(
IMdWorkunitService
.
OUTSOURCE_WORKUNIT_ID
);
newTaskWorkunit
.
setQuantity
(
toOutsourceParam
.
getToOutsourceQuantity
());
BeanUtil
.
copyProperties
(
toOutsourceParam
,
newTaskWorkunit
);
this
.
insertProTaskWorkunit
(
newTaskWorkunit
);
//原数量扣减
taskWorkunit
.
setQuantity
(
taskWorkunit
.
getQuantity
().
subtract
(
toOutsourceParam
.
getToOutsourceQuantity
()));
this
.
updateProTaskWorkunit
(
taskWorkunit
);
});
}
@Override
@Transactional
public
void
outsourceConfirm
(
List
<
Long
>
taskWorkunitIds
)
{
taskWorkunitIds
.
forEach
(
id
->{
ProTaskWorkunit
taskWorkunit
=
this
.
selectProTaskWorkunitByTaskWorkunitId
(
id
);
taskWorkunit
.
setOutsourced
(
1
);
this
.
updateProTaskWorkunit
(
taskWorkunit
);
});
}
}
}
mes/src/main/java/com/ximai/mes/pro/service/task/IProTaskWorkunitService.java
View file @
c226bdb5
...
@@ -4,8 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -4,8 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.ximai.mes.pro.domain.ProFeedback
;
import
com.ximai.mes.pro.domain.ProFeedback
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
com.ximai.mes.pro.domain.task.ProTaskWorkunit
;
import
com.ximai.mes.pro.domain.vo.ProTaskVo
;
import
com.ximai.mes.pro.domain.vo.task.ProTaskWorkunitQuery
;
import
com.ximai.mes.pro.domain.vo.task.ProTaskWorkunitQuery
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitOutsourceSplitParam
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitToOutsourceParam
;
import
com.ximai.mes.pro.domain.vo.task.TaskWorkunitToSelfMadeParam
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.List
;
...
@@ -124,4 +129,29 @@ public interface IProTaskWorkunitService {
...
@@ -124,4 +129,29 @@ public interface IProTaskWorkunitService {
List
<
ProTaskWorkunit
>
schedulingList
(
ProTaskWorkunitQuery
proTaskWorkunit
);
List
<
ProTaskWorkunit
>
schedulingList
(
ProTaskWorkunitQuery
proTaskWorkunit
);
void
closeObj
(
List
<
ProTaskWorkunit
>
proTaskWorkunits
);
void
closeObj
(
List
<
ProTaskWorkunit
>
proTaskWorkunits
);
/**
* 转自制
* @param toSelfMadeParamList
*/
void
toSelfMade
(
List
<
TaskWorkunitToSelfMadeParam
>
toSelfMadeParamList
);
/**
* 外协拆分
* @param outsourceSplitParamList
*/
void
outsourceSplit
(
List
<
TaskWorkunitOutsourceSplitParam
>
outsourceSplitParamList
);
/**
* 转外协
* @param toOutsourceParamList
*/
void
toOutsource
(
List
<
TaskWorkunitToOutsourceParam
>
toOutsourceParamList
);
/**
* 委外确认
* @param taskWorkunitIds
*/
void
outsourceConfirm
(
List
<
Long
>
taskWorkunitIds
);
}
}
mes/src/main/resources/mapper/pro/proWorkOrder/ProWorkOrderProcessMapper.xml
View file @
c226bdb5
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
<result
property=
"processRef"
column=
"process_ref"
/>
<result
property=
"processRef"
column=
"process_ref"
/>
<result
property=
"enCode"
column=
"en_code"
/>
<result
property=
"enCode"
column=
"en_code"
/>
<result
property=
"controlCode"
column=
"control_code"
/>
<result
property=
"controlCode"
column=
"control_code"
/>
<result
property=
"outsourced"
column=
"outsourced"
/>
<result
property=
"x"
column=
"x"
/>
<result
property=
"x"
column=
"x"
/>
<result
property=
"processName"
column=
"process_name"
/>
<result
property=
"processName"
column=
"process_name"
/>
<result
property=
"quantity"
column=
"quantity"
/>
<result
property=
"quantity"
column=
"quantity"
/>
...
@@ -51,6 +52,7 @@
...
@@ -51,6 +52,7 @@
pwop.default_pre_time,
pwop.default_pre_time,
pwop.default_suf_time,
pwop.default_suf_time,
pwop.idx,
pwop.idx,
pwop.outsourced,
pp.process_code,
pp.process_code,
pp.process_name,
pp.process_name,
mw.workstation_name,
mw.workstation_name,
...
@@ -114,6 +116,7 @@
...
@@ -114,6 +116,7 @@
<if
test=
"processRef != null"
>
process_ref,
</if>
<if
test=
"processRef != null"
>
process_ref,
</if>
<if
test=
"enCode != null"
>
en_code,
</if>
<if
test=
"enCode != null"
>
en_code,
</if>
<if
test=
"controlCode != null"
>
control_code,
</if>
<if
test=
"controlCode != null"
>
control_code,
</if>
<if
test=
"outsourced != null"
>
outsourced,
</if>
<if
test=
"x != null"
>
x,
</if>
<if
test=
"x != null"
>
x,
</if>
<if
test=
"processName != null"
>
process_name,
</if>
<if
test=
"processName != null"
>
process_name,
</if>
<if
test=
"quantity != null"
>
quantity,
</if>
<if
test=
"quantity != null"
>
quantity,
</if>
...
@@ -137,6 +140,7 @@
...
@@ -137,6 +140,7 @@
<if
test=
"processRef != null"
>
#{processRef},
</if>
<if
test=
"processRef != null"
>
#{processRef},
</if>
<if
test=
"enCode != null"
>
#{enCode},
</if>
<if
test=
"enCode != null"
>
#{enCode},
</if>
<if
test=
"controlCode != null"
>
#{controlCode},
</if>
<if
test=
"controlCode != null"
>
#{controlCode},
</if>
<if
test=
"outsourced != null"
>
#{outsourced},
</if>
<if
test=
"x != null"
>
#{x},
</if>
<if
test=
"x != null"
>
#{x},
</if>
<if
test=
"processName != null"
>
#{processName},
</if>
<if
test=
"processName != null"
>
#{processName},
</if>
<if
test=
"quantity != null"
>
#{quantity},
</if>
<if
test=
"quantity != null"
>
#{quantity},
</if>
...
@@ -163,6 +167,7 @@
...
@@ -163,6 +167,7 @@
<if
test=
"processRef != null"
>
process_ref = #{processRef},
</if>
<if
test=
"processRef != null"
>
process_ref = #{processRef},
</if>
<if
test=
"enCode != null"
>
en_code = #{enCode},
</if>
<if
test=
"enCode != null"
>
en_code = #{enCode},
</if>
<if
test=
"controlCode != null"
>
control_code = #{controlCode},
</if>
<if
test=
"controlCode != null"
>
control_code = #{controlCode},
</if>
<if
test=
"outsourced != null"
>
outsourced = #{outsourced},
</if>
<if
test=
"x != null"
>
x = #{x},
</if>
<if
test=
"x != null"
>
x = #{x},
</if>
<if
test=
"processName != null"
>
process_name = #{processName},
</if>
<if
test=
"processName != null"
>
process_name = #{processName},
</if>
<if
test=
"stdWorkingTimeUom != null"
>
std_working_time_uom = #{stdWorkingTimeUom},
</if>
<if
test=
"stdWorkingTimeUom != null"
>
std_working_time_uom = #{stdWorkingTimeUom},
</if>
...
...
mes/src/main/resources/mapper/pro/productionSolution/ProProductionSolutionMapper.xml
View file @
c226bdb5
...
@@ -91,6 +91,7 @@
...
@@ -91,6 +91,7 @@
<if
test=
"itemId != null "
>
and pps.item_id = #{itemId}
</if>
<if
test=
"itemId != null "
>
and pps.item_id = #{itemId}
</if>
<if
test=
"sapItemCode != null and sapItemCode != ''"
>
and pps.sap_item_code like concat('%', #{sapItemCode}, '%')
</if>
<if
test=
"sapItemCode != null and sapItemCode != ''"
>
and pps.sap_item_code like concat('%', #{sapItemCode}, '%')
</if>
<if
test=
"itemName != null and itemName != ''"
>
and mi.item_name like concat('%', #{itemName}, '%')
</if>
<if
test=
"itemName != null and itemName != ''"
>
and mi.item_name like concat('%', #{itemName}, '%')
</if>
<if
test=
"itemCode != null and itemCode != ''"
>
and mi.item_code like concat('%', #{itemCode}, '%')
</if>
<if
test=
"sapPrototypeMakeCode != null and sapPrototypeMakeCode != ''"
>
and pps.sap_prototype_make_code
<if
test=
"sapPrototypeMakeCode != null and sapPrototypeMakeCode != ''"
>
and pps.sap_prototype_make_code
like concat('%', #{sapPrototypeMakeCode}, '%')
like concat('%', #{sapPrototypeMakeCode}, '%')
</if>
</if>
...
...
mes/src/main/resources/mapper/pro/task/ProTaskWorkunitMapper.xml
View file @
c226bdb5
...
@@ -22,6 +22,10 @@
...
@@ -22,6 +22,10 @@
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"outsourceUnitPrice"
column=
"outsource_unit_price"
/>
<result
property=
"vendorId"
column=
"vendor_id"
/>
<result
property=
"vendorName"
column=
"vendor_name"
/>
<result
property=
"outsourced"
column=
"outsourced"
/>
</resultMap>
</resultMap>
<sql
id=
"selectProTaskWorkunitVo"
>
<sql
id=
"selectProTaskWorkunitVo"
>
...
@@ -104,6 +108,10 @@
...
@@ -104,6 +108,10 @@
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"outsourceUnitPrice != null"
>
outsource_unit_price,
</if>
<if
test=
"vendorId != null"
>
vendor_id,
</if>
<if
test=
"vendorName != null"
>
vendor_name,
</if>
<if
test=
"outsourced != null"
>
outsourced,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"taskId != null"
>
#{taskId},
</if>
<if
test=
"taskId != null"
>
#{taskId},
</if>
...
@@ -121,6 +129,10 @@
...
@@ -121,6 +129,10 @@
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"outsourceUnitPrice != null"
>
#{outsourceUnitPrice},
</if>
<if
test=
"vendorId != null"
>
#{vendorId},
</if>
<if
test=
"vendorName != null"
>
#{vendorName},
</if>
<if
test=
"outsourced != null"
>
#{outsourced},
</if>
</trim>
</trim>
</insert>
</insert>
...
@@ -143,6 +155,10 @@
...
@@ -143,6 +155,10 @@
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"outsourceUnitPrice != null"
>
outsource_unit_price = #{outsourceUnitPrice},
</if>
<if
test=
"vendorId != null"
>
vendor_id = #{vendorId},
</if>
<if
test=
"vendorName != null"
>
vendor_name = #{vendorName},
</if>
<if
test=
"outsourced != null"
>
outsourced = #{outsourced},
</if>
</trim>
</trim>
where task_workunit_id = #{taskWorkunitId}
where task_workunit_id = #{taskWorkunitId}
</update>
</update>
...
...
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