生产任务投料后台代码
This commit is contained in:
parent
028345df14
commit
b0eaafc215
@ -276,4 +276,124 @@ create table pro_feedback (
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (record_id)
|
||||
) engine=innodb auto_increment=200 comment = '生产报工记录表';
|
||||
) engine=innodb auto_increment=200 comment = '生产报工记录表';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、生产任务投料表
|
||||
-- ----------------------------
|
||||
drop table if exists pro_task_issue;
|
||||
create table pro_task_issue (
|
||||
record_id bigint(20) not null auto_increment comment '记录ID',
|
||||
task_id bigint(20) not null comment '生产任务ID',
|
||||
workorder_id bigint(20) comment '生产工单ID',
|
||||
workstation_id bigint(20) comment '工作站ID',
|
||||
source_doc_id bigint(20) not null comment '单据ID',
|
||||
source_doc_code varchar(64) comment '单据编号',
|
||||
batch_code varchar(64) comment '投料批次',
|
||||
source_line_id bigint(20) comment '行ID',
|
||||
item_id bigint(20) comment '产品物料ID',
|
||||
item_code varchar(64) not null comment '产品物料编码',
|
||||
item_name varchar(255) not null comment '产品物料名称',
|
||||
specification varchar(500) default null comment '规格型号',
|
||||
unit_of_measure varchar(64) not null comment '单位',
|
||||
quantity_issued double(12,2) comment '总的投料数量',
|
||||
quantity_available double(12,2) comment '当前可用数量',
|
||||
quantity_used double(12,2) comment '当前使用数量',
|
||||
remark varchar(500) default '' comment '备注',
|
||||
attr1 varchar(64) default null comment '预留字段1',
|
||||
attr2 varchar(255) default null comment '预留字段2',
|
||||
attr3 int(11) default 0 comment '预留字段3',
|
||||
attr4 int(11) default 0 comment '预留字段4',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (record_id)
|
||||
) engine=innodb auto_increment=200 comment = '生产任务投料表';
|
||||
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、流转单表
|
||||
-- ----------------------------
|
||||
drop table if exists pro_trans_order;
|
||||
create table pro_trans_order (
|
||||
trans_order_id bigint(20) not null auto_increment comment '流转单ID',
|
||||
trans_order_code varchar(64) comment '流转单编号',
|
||||
task_id bigint(20) not null comment '生产任务ID',
|
||||
task_code varchar(64) comment '生产任务编号',
|
||||
workstation_id bigint(20) not null comment '工作站ID',
|
||||
workstation_code varchar(64) comment '工作站编号',
|
||||
workstation_name varchar(255) comment '工作站名称',
|
||||
process_id bigint(20) comment '工序ID',
|
||||
process_code varchar(64) comment '工序编号',
|
||||
process_name varchar(255) comment '工序名称',
|
||||
workorder_id bigint(20) comment '生产工单ID',
|
||||
workorder_code varchar(64) comment '生产工单编号',
|
||||
workorder_name varchar(255) comment '生产工单名称',
|
||||
batch_code varchar(64) comment '批次号',
|
||||
item_id bigint(20) comment '产品物料ID',
|
||||
item_code varchar(64) not null comment '产品物料编码',
|
||||
item_name varchar(255) not null comment '产品物料名称',
|
||||
specification varchar(500) default null comment '规格型号',
|
||||
unit_of_measure varchar(64) not null comment '单位',
|
||||
quantity_transfered double(12,2) comment '流转数量',
|
||||
produce_date datetime comment '生产日期',
|
||||
remark varchar(500) default '' comment '备注',
|
||||
attr1 varchar(64) default null comment '预留字段1',
|
||||
attr2 varchar(255) default null comment '预留字段2',
|
||||
attr3 int(11) default 0 comment '预留字段3',
|
||||
attr4 int(11) default 0 comment '预留字段4',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (record_id)
|
||||
) engine=innodb auto_increment=200 comment = '流转单表';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、物料消耗记录表
|
||||
-- ----------------------------
|
||||
drop table if exists pro_trans_consume;
|
||||
create table pro_trans_consume (
|
||||
record_id bigint(20) not null auto_increment comment '记录ID',
|
||||
trans_order_id bigint(20) comment '流转单ID',
|
||||
trans_order_code varchar(64) comment '流转单编号',
|
||||
task_id bigint(20) not null comment '生产任务ID',
|
||||
workstation_id bigint(20) not null comment '工作站ID',
|
||||
process_id bigint(20) comment '工序ID',
|
||||
workorder_id bigint(20) comment '生产工单ID',
|
||||
batch_code varchar(64) comment '批次号',
|
||||
source_doc_id bigint(20) comment '被消耗单据ID',
|
||||
source_doc_code varchar(64) comment '被消耗单据编号',
|
||||
source_doc_type varchar(64) comment '被消耗单据类型',
|
||||
source_line_id bigint(20) comment '被消耗单据行ID',
|
||||
batch_code varchar(64) comment '被消耗物料批次号',
|
||||
item_id bigint(20) comment '被消耗产品物料ID',
|
||||
item_code varchar(64) not null comment '被消耗产品物料编码',
|
||||
item_name varchar(255) not null comment '被消耗产品物料名称',
|
||||
specification varchar(500) default null comment '规格型号',
|
||||
unit_of_measure varchar(64) not null comment '单位',
|
||||
quantity_consumed double(12,2) comment '消耗数量',
|
||||
consume_date datetime comment '消耗时间',
|
||||
remark varchar(500) default '' comment '备注',
|
||||
attr1 varchar(64) default null comment '预留字段1',
|
||||
attr2 varchar(255) default null comment '预留字段2',
|
||||
attr3 int(11) default 0 comment '预留字段3',
|
||||
attr4 int(11) default 0 comment '预留字段4',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (record_id)
|
||||
) engine=innodb auto_increment=200 comment = '物料消耗记录表';
|
||||
|
||||
|
@ -0,0 +1,104 @@
|
||||
package com.ktg.mes.pro.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.pro.domain.ProTaskIssue;
|
||||
import com.ktg.mes.pro.service.IProTaskIssueService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产任务投料Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/pro/taskissue")
|
||||
public class ProTaskIssueController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProTaskIssueService proTaskIssueService;
|
||||
|
||||
/**
|
||||
* 查询生产任务投料列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:taskissue:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProTaskIssue proTaskIssue)
|
||||
{
|
||||
startPage();
|
||||
List<ProTaskIssue> list = proTaskIssueService.selectProTaskIssueList(proTaskIssue);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产任务投料列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:taskissue:export')")
|
||||
@Log(title = "生产任务投料", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProTaskIssue proTaskIssue)
|
||||
{
|
||||
List<ProTaskIssue> list = proTaskIssueService.selectProTaskIssueList(proTaskIssue);
|
||||
ExcelUtil<ProTaskIssue> util = new ExcelUtil<ProTaskIssue>(ProTaskIssue.class);
|
||||
util.exportExcel(response, list, "生产任务投料数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产任务投料详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:taskissue:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(proTaskIssueService.selectProTaskIssueByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产任务投料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:taskissue:add')")
|
||||
@Log(title = "生产任务投料", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProTaskIssue proTaskIssue)
|
||||
{
|
||||
return toAjax(proTaskIssueService.insertProTaskIssue(proTaskIssue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产任务投料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:taskissue:edit')")
|
||||
@Log(title = "生产任务投料", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProTaskIssue proTaskIssue)
|
||||
{
|
||||
return toAjax(proTaskIssueService.updateProTaskIssue(proTaskIssue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产任务投料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:taskissue:remove')")
|
||||
@Log(title = "生产任务投料", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(proTaskIssueService.deleteProTaskIssueByRecordIds(recordIds));
|
||||
}
|
||||
}
|
319
ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProTaskIssue.java
Normal file
319
ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProTaskIssue.java
Normal file
@ -0,0 +1,319 @@
|
||||
package com.ktg.mes.pro.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产任务投料对象 pro_task_issue
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-22
|
||||
*/
|
||||
public class ProTaskIssue extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 生产任务ID */
|
||||
@Excel(name = "生产任务ID")
|
||||
private Long taskId;
|
||||
|
||||
/** 生产工单ID */
|
||||
@Excel(name = "生产工单ID")
|
||||
private Long workorderId;
|
||||
|
||||
/** 工作站ID */
|
||||
@Excel(name = "工作站ID")
|
||||
private Long workstationId;
|
||||
|
||||
/** 单据ID */
|
||||
@Excel(name = "单据ID")
|
||||
private Long sourceDocId;
|
||||
|
||||
/** 单据编号 */
|
||||
@Excel(name = "单据编号")
|
||||
private String sourceDocCode;
|
||||
|
||||
/** 单据类型 */
|
||||
@Excel(name = "单据类型")
|
||||
private String sourceDocType;
|
||||
|
||||
/** 投料批次 */
|
||||
@Excel(name = "投料批次")
|
||||
private String batchCode;
|
||||
|
||||
/** 行ID */
|
||||
@Excel(name = "行ID")
|
||||
private Long sourceLineId;
|
||||
|
||||
/** 产品物料ID */
|
||||
@Excel(name = "产品物料ID")
|
||||
private Long itemId;
|
||||
|
||||
/** 产品物料编码 */
|
||||
@Excel(name = "产品物料编码")
|
||||
private String itemCode;
|
||||
|
||||
/** 产品物料名称 */
|
||||
@Excel(name = "产品物料名称")
|
||||
private String itemName;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 总的投料数量 */
|
||||
@Excel(name = "总的投料数量")
|
||||
private BigDecimal quantityIssued;
|
||||
|
||||
/** 当前可用数量 */
|
||||
@Excel(name = "当前可用数量")
|
||||
private BigDecimal quantityAvailable;
|
||||
|
||||
/** 当前使用数量 */
|
||||
@Excel(name = "当前使用数量")
|
||||
private BigDecimal quantityUsed;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setWorkorderId(Long workorderId)
|
||||
{
|
||||
this.workorderId = workorderId;
|
||||
}
|
||||
|
||||
public Long getWorkorderId()
|
||||
{
|
||||
return workorderId;
|
||||
}
|
||||
public void setWorkstationId(Long workstationId)
|
||||
{
|
||||
this.workstationId = workstationId;
|
||||
}
|
||||
|
||||
public Long getWorkstationId()
|
||||
{
|
||||
return workstationId;
|
||||
}
|
||||
public void setSourceDocId(Long sourceDocId)
|
||||
{
|
||||
this.sourceDocId = sourceDocId;
|
||||
}
|
||||
|
||||
public Long getSourceDocId()
|
||||
{
|
||||
return sourceDocId;
|
||||
}
|
||||
public void setSourceDocCode(String sourceDocCode)
|
||||
{
|
||||
this.sourceDocCode = sourceDocCode;
|
||||
}
|
||||
|
||||
public String getSourceDocCode()
|
||||
{
|
||||
return sourceDocCode;
|
||||
}
|
||||
public void setSourceDocType(String sourceDocType)
|
||||
{
|
||||
this.sourceDocType = sourceDocType;
|
||||
}
|
||||
|
||||
public String getSourceDocType()
|
||||
{
|
||||
return sourceDocType;
|
||||
}
|
||||
public void setBatchCode(String batchCode)
|
||||
{
|
||||
this.batchCode = batchCode;
|
||||
}
|
||||
|
||||
public String getBatchCode()
|
||||
{
|
||||
return batchCode;
|
||||
}
|
||||
public void setSourceLineId(Long sourceLineId)
|
||||
{
|
||||
this.sourceLineId = sourceLineId;
|
||||
}
|
||||
|
||||
public Long getSourceLineId()
|
||||
{
|
||||
return sourceLineId;
|
||||
}
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
public void setItemCode(String itemCode)
|
||||
{
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemCode()
|
||||
{
|
||||
return itemCode;
|
||||
}
|
||||
public void setItemName(String itemName)
|
||||
{
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemName()
|
||||
{
|
||||
return itemName;
|
||||
}
|
||||
public void setSpecification(String specification)
|
||||
{
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getSpecification()
|
||||
{
|
||||
return specification;
|
||||
}
|
||||
public void setUnitOfMeasure(String unitOfMeasure)
|
||||
{
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure()
|
||||
{
|
||||
return unitOfMeasure;
|
||||
}
|
||||
public void setQuantityIssued(BigDecimal quantityIssued)
|
||||
{
|
||||
this.quantityIssued = quantityIssued;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantityIssued()
|
||||
{
|
||||
return quantityIssued;
|
||||
}
|
||||
public void setQuantityAvailable(BigDecimal quantityAvailable)
|
||||
{
|
||||
this.quantityAvailable = quantityAvailable;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantityAvailable()
|
||||
{
|
||||
return quantityAvailable;
|
||||
}
|
||||
public void setQuantityUsed(BigDecimal quantityUsed)
|
||||
{
|
||||
this.quantityUsed = quantityUsed;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantityUsed()
|
||||
{
|
||||
return quantityUsed;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("recordId", getRecordId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("workorderId", getWorkorderId())
|
||||
.append("workstationId", getWorkstationId())
|
||||
.append("sourceDocId", getSourceDocId())
|
||||
.append("sourceDocCode", getSourceDocCode())
|
||||
.append("sourceDocType", getSourceDocType())
|
||||
.append("batchCode", getBatchCode())
|
||||
.append("sourceLineId", getSourceLineId())
|
||||
.append("itemId", getItemId())
|
||||
.append("itemCode", getItemCode())
|
||||
.append("itemName", getItemName())
|
||||
.append("specification", getSpecification())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("quantityIssued", getQuantityIssued())
|
||||
.append("quantityAvailable", getQuantityAvailable())
|
||||
.append("quantityUsed", getQuantityUsed())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.pro.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProTaskIssue;
|
||||
|
||||
/**
|
||||
* 生产任务投料Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-22
|
||||
*/
|
||||
public interface ProTaskIssueMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产任务投料
|
||||
*
|
||||
* @param recordId 生产任务投料主键
|
||||
* @return 生产任务投料
|
||||
*/
|
||||
public ProTaskIssue selectProTaskIssueByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询生产任务投料列表
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 生产任务投料集合
|
||||
*/
|
||||
public List<ProTaskIssue> selectProTaskIssueList(ProTaskIssue proTaskIssue);
|
||||
|
||||
/**
|
||||
* 新增生产任务投料
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProTaskIssue(ProTaskIssue proTaskIssue);
|
||||
|
||||
/**
|
||||
* 修改生产任务投料
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProTaskIssue(ProTaskIssue proTaskIssue);
|
||||
|
||||
/**
|
||||
* 删除生产任务投料
|
||||
*
|
||||
* @param recordId 生产任务投料主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProTaskIssueByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除生产任务投料
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProTaskIssueByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.pro.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProTaskIssue;
|
||||
|
||||
/**
|
||||
* 生产任务投料Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-22
|
||||
*/
|
||||
public interface IProTaskIssueService
|
||||
{
|
||||
/**
|
||||
* 查询生产任务投料
|
||||
*
|
||||
* @param recordId 生产任务投料主键
|
||||
* @return 生产任务投料
|
||||
*/
|
||||
public ProTaskIssue selectProTaskIssueByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询生产任务投料列表
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 生产任务投料集合
|
||||
*/
|
||||
public List<ProTaskIssue> selectProTaskIssueList(ProTaskIssue proTaskIssue);
|
||||
|
||||
/**
|
||||
* 新增生产任务投料
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProTaskIssue(ProTaskIssue proTaskIssue);
|
||||
|
||||
/**
|
||||
* 修改生产任务投料
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProTaskIssue(ProTaskIssue proTaskIssue);
|
||||
|
||||
/**
|
||||
* 批量删除生产任务投料
|
||||
*
|
||||
* @param recordIds 需要删除的生产任务投料主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProTaskIssueByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除生产任务投料信息
|
||||
*
|
||||
* @param recordId 生产任务投料主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProTaskIssueByRecordId(Long recordId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.pro.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.pro.mapper.ProTaskIssueMapper;
|
||||
import com.ktg.mes.pro.domain.ProTaskIssue;
|
||||
import com.ktg.mes.pro.service.IProTaskIssueService;
|
||||
|
||||
/**
|
||||
* 生产任务投料Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-22
|
||||
*/
|
||||
@Service
|
||||
public class ProTaskIssueServiceImpl implements IProTaskIssueService
|
||||
{
|
||||
@Autowired
|
||||
private ProTaskIssueMapper proTaskIssueMapper;
|
||||
|
||||
/**
|
||||
* 查询生产任务投料
|
||||
*
|
||||
* @param recordId 生产任务投料主键
|
||||
* @return 生产任务投料
|
||||
*/
|
||||
@Override
|
||||
public ProTaskIssue selectProTaskIssueByRecordId(Long recordId)
|
||||
{
|
||||
return proTaskIssueMapper.selectProTaskIssueByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产任务投料列表
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 生产任务投料
|
||||
*/
|
||||
@Override
|
||||
public List<ProTaskIssue> selectProTaskIssueList(ProTaskIssue proTaskIssue)
|
||||
{
|
||||
return proTaskIssueMapper.selectProTaskIssueList(proTaskIssue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产任务投料
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProTaskIssue(ProTaskIssue proTaskIssue)
|
||||
{
|
||||
proTaskIssue.setCreateTime(DateUtils.getNowDate());
|
||||
return proTaskIssueMapper.insertProTaskIssue(proTaskIssue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产任务投料
|
||||
*
|
||||
* @param proTaskIssue 生产任务投料
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProTaskIssue(ProTaskIssue proTaskIssue)
|
||||
{
|
||||
proTaskIssue.setUpdateTime(DateUtils.getNowDate());
|
||||
return proTaskIssueMapper.updateProTaskIssue(proTaskIssue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产任务投料
|
||||
*
|
||||
* @param recordIds 需要删除的生产任务投料主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProTaskIssueByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return proTaskIssueMapper.deleteProTaskIssueByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产任务投料信息
|
||||
*
|
||||
* @param recordId 生产任务投料主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProTaskIssueByRecordId(Long recordId)
|
||||
{
|
||||
return proTaskIssueMapper.deleteProTaskIssueByRecordId(recordId);
|
||||
}
|
||||
}
|
167
ktg-mes/src/main/resources/mapper/pro/ProTaskIssueMapper.xml
Normal file
167
ktg-mes/src/main/resources/mapper/pro/ProTaskIssueMapper.xml
Normal file
@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ktg.mes.pro.mapper.ProTaskIssueMapper">
|
||||
|
||||
<resultMap type="ProTaskIssue" id="ProTaskIssueResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="workstationId" column="workstation_id" />
|
||||
<result property="sourceDocId" column="source_doc_id" />
|
||||
<result property="sourceDocCode" column="source_doc_code" />
|
||||
<result property="sourceDocType" column="source_doc_type" />
|
||||
<result property="batchCode" column="batch_code" />
|
||||
<result property="sourceLineId" column="source_line_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="specification" column="specification" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="quantityIssued" column="quantity_issued" />
|
||||
<result property="quantityAvailable" column="quantity_available" />
|
||||
<result property="quantityUsed" column="quantity_used" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProTaskIssueVo">
|
||||
select record_id, task_id, workorder_id, workstation_id, source_doc_id, source_doc_code, source_doc_type, batch_code, source_line_id, item_id, item_code, item_name, specification, unit_of_measure, quantity_issued, quantity_available, quantity_used, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_task_issue
|
||||
</sql>
|
||||
|
||||
<select id="selectProTaskIssueList" parameterType="ProTaskIssue" resultMap="ProTaskIssueResult">
|
||||
<include refid="selectProTaskIssueVo"/>
|
||||
<where>
|
||||
<if test="taskId != null "> and task_id = #{taskId}</if>
|
||||
<if test="workorderId != null "> and workorder_id = #{workorderId}</if>
|
||||
<if test="workstationId != null "> and workstation_id = #{workstationId}</if>
|
||||
<if test="sourceDocId != null "> and source_doc_id = #{sourceDocId}</if>
|
||||
<if test="sourceDocCode != null and sourceDocCode != ''"> and source_doc_code = #{sourceDocCode}</if>
|
||||
<if test="sourceDocType != null and sourceDocType != ''"> and source_doc_type = #{sourceDocType}</if>
|
||||
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
|
||||
<if test="sourceLineId != null "> and source_line_id = #{sourceLineId}</if>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
|
||||
<if test="quantityIssued != null "> and quantity_issued = #{quantityIssued}</if>
|
||||
<if test="quantityAvailable != null "> and quantity_available = #{quantityAvailable}</if>
|
||||
<if test="quantityUsed != null "> and quantity_used = #{quantityUsed}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProTaskIssueByRecordId" parameterType="Long" resultMap="ProTaskIssueResult">
|
||||
<include refid="selectProTaskIssueVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProTaskIssue" parameterType="ProTaskIssue" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into pro_task_issue
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="workorderId != null">workorder_id,</if>
|
||||
<if test="workstationId != null">workstation_id,</if>
|
||||
<if test="sourceDocId != null">source_doc_id,</if>
|
||||
<if test="sourceDocCode != null">source_doc_code,</if>
|
||||
<if test="sourceDocType != null">source_doc_type,</if>
|
||||
<if test="batchCode != null">batch_code,</if>
|
||||
<if test="sourceLineId != null">source_line_id,</if>
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code,</if>
|
||||
<if test="itemName != null and itemName != ''">item_name,</if>
|
||||
<if test="specification != null">specification,</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure,</if>
|
||||
<if test="quantityIssued != null">quantity_issued,</if>
|
||||
<if test="quantityAvailable != null">quantity_available,</if>
|
||||
<if test="quantityUsed != null">quantity_used,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="workorderId != null">#{workorderId},</if>
|
||||
<if test="workstationId != null">#{workstationId},</if>
|
||||
<if test="sourceDocId != null">#{sourceDocId},</if>
|
||||
<if test="sourceDocCode != null">#{sourceDocCode},</if>
|
||||
<if test="sourceDocType != null">#{sourceDocType},</if>
|
||||
<if test="batchCode != null">#{batchCode},</if>
|
||||
<if test="sourceLineId != null">#{sourceLineId},</if>
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">#{itemCode},</if>
|
||||
<if test="itemName != null and itemName != ''">#{itemName},</if>
|
||||
<if test="specification != null">#{specification},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">#{unitOfMeasure},</if>
|
||||
<if test="quantityIssued != null">#{quantityIssued},</if>
|
||||
<if test="quantityAvailable != null">#{quantityAvailable},</if>
|
||||
<if test="quantityUsed != null">#{quantityUsed},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProTaskIssue" parameterType="ProTaskIssue">
|
||||
update pro_task_issue
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="workorderId != null">workorder_id = #{workorderId},</if>
|
||||
<if test="workstationId != null">workstation_id = #{workstationId},</if>
|
||||
<if test="sourceDocId != null">source_doc_id = #{sourceDocId},</if>
|
||||
<if test="sourceDocCode != null">source_doc_code = #{sourceDocCode},</if>
|
||||
<if test="sourceDocType != null">source_doc_type = #{sourceDocType},</if>
|
||||
<if test="batchCode != null">batch_code = #{batchCode},</if>
|
||||
<if test="sourceLineId != null">source_line_id = #{sourceLineId},</if>
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
|
||||
<if test="specification != null">specification = #{specification},</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="quantityIssued != null">quantity_issued = #{quantityIssued},</if>
|
||||
<if test="quantityAvailable != null">quantity_available = #{quantityAvailable},</if>
|
||||
<if test="quantityUsed != null">quantity_used = #{quantityUsed},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProTaskIssueByRecordId" parameterType="Long">
|
||||
delete from pro_task_issue where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProTaskIssueByRecordIds" parameterType="String">
|
||||
delete from pro_task_issue where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user