触控屏端生产报工
This commit is contained in:
parent
5f8c246bf2
commit
b0b7c8b645
@ -242,3 +242,35 @@ create table pro_task (
|
||||
) engine=innodb auto_increment=200 comment = '生产任务表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、生产报工记录表
|
||||
-- ----------------------------
|
||||
drop table if exists pro_feedback;
|
||||
create table pro_feedback (
|
||||
record_id bigint(20) not null auto_increment comment '记录ID',
|
||||
workstation_id bigint(20) not null comment '工作站ID',
|
||||
workstation_code varchar(64) comment '工作站编号',
|
||||
workstation_name varchar(255) comment '工作站名称',
|
||||
workorder_id bigint(20) not null comment '生产工单ID',
|
||||
workorder_code varchar(64) comment '生产工单编号',
|
||||
workorder_name varchar(255) comment '生产工单名称',
|
||||
task_id bigint(20) comment '生产任务ID',
|
||||
task_code varchar(64) comment '生产任务编号',
|
||||
quantity double(14,2) comment '排产数量',
|
||||
quantity_feedback double(14,2) comment '本次报工数量',
|
||||
quantity_qualified double(14,2) comment '合格品数量',
|
||||
quantity_unquanlified double(14,2) comment '不良品数量',
|
||||
user_name varchar(64) comment '报工用户名',
|
||||
nick_name varchar(64) comment '昵称',
|
||||
feedback_time 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 = '生产报工记录表';
|
Binary file not shown.
@ -0,0 +1,105 @@
|
||||
package com.ktg.mes.pro.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.mes.pro.domain.ProFeedback;
|
||||
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.service.IProFeedbackService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产报工记录Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/pro/feedback")
|
||||
public class ProFeedbackController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProFeedbackService proFeedbackService;
|
||||
|
||||
/**
|
||||
* 查询生产报工记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProFeedback proFeedback)
|
||||
{
|
||||
startPage();
|
||||
List<ProFeedback> list = proFeedbackService.selectProFeedbackList(proFeedback);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产报工记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:export')")
|
||||
@Log(title = "生产报工记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProFeedback proFeedback)
|
||||
{
|
||||
List<ProFeedback> list = proFeedbackService.selectProFeedbackList(proFeedback);
|
||||
ExcelUtil<ProFeedback> util = new ExcelUtil<ProFeedback>(ProFeedback.class);
|
||||
util.exportExcel(response, list, "生产报工记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产报工记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(proFeedbackService.selectProFeedbackByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产报工记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:add')")
|
||||
@Log(title = "生产报工记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProFeedback proFeedback)
|
||||
{
|
||||
return toAjax(proFeedbackService.insertProFeedback(proFeedback));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产报工记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:edit')")
|
||||
@Log(title = "生产报工记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProFeedback proFeedback)
|
||||
{
|
||||
return toAjax(proFeedbackService.updateProFeedback(proFeedback));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产报工记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:remove')")
|
||||
@Log(title = "生产报工记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(proFeedbackService.deleteProFeedbackByRecordIds(recordIds));
|
||||
}
|
||||
}
|
@ -4,12 +4,17 @@ 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.md.domain.MdWorkstation;
|
||||
import com.ktg.mes.md.service.IMdWorkstationService;
|
||||
import com.ktg.mes.pro.domain.ProFeedback;
|
||||
import com.ktg.mes.pro.domain.ProTask;
|
||||
import com.ktg.mes.pro.service.IProFeedbackService;
|
||||
import com.ktg.mes.pro.service.IProTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@ -19,6 +24,12 @@ public class ProTaskMobController extends BaseController {
|
||||
@Autowired
|
||||
private IProTaskService proTaskService;
|
||||
|
||||
@Autowired
|
||||
private IProFeedbackService proFeedbackService;
|
||||
|
||||
@Autowired
|
||||
private IMdWorkstationService mdWorkstationService;
|
||||
|
||||
/**
|
||||
* 查询工作站的生产任务
|
||||
*/
|
||||
@ -44,14 +55,30 @@ public class ProTaskMobController extends BaseController {
|
||||
/**
|
||||
* 修改生产任务状态
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:protask:edit')")
|
||||
@Log(title = "生产任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping
|
||||
@PostMapping("/change")
|
||||
@ResponseBody
|
||||
public AjaxResult edit(@RequestBody ProTask proTask)
|
||||
public AjaxResult changeStatus(ProTask proTask)
|
||||
{
|
||||
return toAjax(proTaskService.updateProTask(proTask));
|
||||
}
|
||||
|
||||
@Log(title = "生产报工", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/feedBack")
|
||||
@ResponseBody
|
||||
public AjaxResult feedBack( ProFeedback feedback){
|
||||
MdWorkstation workstation = mdWorkstationService.selectMdWorkstationByWorkstationId(feedback.getWorkstationId());
|
||||
feedback.setWorkstationCode(workstation.getWorkstationCode());
|
||||
feedback.setWorkstationName(workstation.getWorkstationName());
|
||||
|
||||
ProTask task = proTaskService.selectProTaskByTaskId(feedback.getTaskId());
|
||||
feedback.setTaskCode(task.getTaskCode());
|
||||
feedback.setWorkorderId(task.getWorkorderId());
|
||||
feedback.setWorkorderCode(task.getWorkorderCode());
|
||||
feedback.setWorkorderName(task.getWorkorderName());
|
||||
feedback.setQuantity(task.getQuantity());
|
||||
feedback.setFeedbackTime(new Date());
|
||||
return toAjax(proFeedbackService.insertProFeedback(feedback));
|
||||
}
|
||||
|
||||
}
|
||||
|
322
ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProFeedback.java
Normal file
322
ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProFeedback.java
Normal file
@ -0,0 +1,322 @@
|
||||
package com.ktg.mes.pro.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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_feedback
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-10
|
||||
*/
|
||||
public class ProFeedback extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 工作站ID */
|
||||
@Excel(name = "工作站ID")
|
||||
private Long workstationId;
|
||||
|
||||
/** 工作站编号 */
|
||||
@Excel(name = "工作站编号")
|
||||
private String workstationCode;
|
||||
|
||||
/** 工作站名称 */
|
||||
@Excel(name = "工作站名称")
|
||||
private String workstationName;
|
||||
|
||||
/** 生产工单ID */
|
||||
@Excel(name = "生产工单ID")
|
||||
private Long workorderId;
|
||||
|
||||
/** 生产工单编号 */
|
||||
@Excel(name = "生产工单编号")
|
||||
private String workorderCode;
|
||||
|
||||
/** 生产工单名称 */
|
||||
@Excel(name = "生产工单名称")
|
||||
private String workorderName;
|
||||
|
||||
/** 生产任务ID */
|
||||
@Excel(name = "生产任务ID")
|
||||
private Long taskId;
|
||||
|
||||
/** 生产任务编号 */
|
||||
@Excel(name = "生产任务编号")
|
||||
private String taskCode;
|
||||
|
||||
/** 排产数量 */
|
||||
@Excel(name = "排产数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 本次报工数量 */
|
||||
@Excel(name = "本次报工数量")
|
||||
private BigDecimal quantityFeedback;
|
||||
|
||||
/** 合格品数量 */
|
||||
@Excel(name = "合格品数量")
|
||||
private BigDecimal quantityQualified;
|
||||
|
||||
/** 不良品数量 */
|
||||
@Excel(name = "不良品数量")
|
||||
private BigDecimal quantityUnquanlified;
|
||||
|
||||
/** 报工用户名 */
|
||||
@Excel(name = "报工用户名")
|
||||
private String userName;
|
||||
|
||||
/** 昵称 */
|
||||
@Excel(name = "昵称")
|
||||
private String nickName;
|
||||
|
||||
/** 报工途径 */
|
||||
@Excel(name = "报工途径")
|
||||
private String feedbackChannel;
|
||||
|
||||
/** 报工时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "报工时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date feedbackTime;
|
||||
|
||||
/** 预留字段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 setWorkstationId(Long workstationId)
|
||||
{
|
||||
this.workstationId = workstationId;
|
||||
}
|
||||
|
||||
public Long getWorkstationId()
|
||||
{
|
||||
return workstationId;
|
||||
}
|
||||
public void setWorkstationCode(String workstationCode)
|
||||
{
|
||||
this.workstationCode = workstationCode;
|
||||
}
|
||||
|
||||
public String getWorkstationCode()
|
||||
{
|
||||
return workstationCode;
|
||||
}
|
||||
public void setWorkstationName(String workstationName)
|
||||
{
|
||||
this.workstationName = workstationName;
|
||||
}
|
||||
|
||||
public String getWorkstationName()
|
||||
{
|
||||
return workstationName;
|
||||
}
|
||||
public void setWorkorderId(Long workorderId)
|
||||
{
|
||||
this.workorderId = workorderId;
|
||||
}
|
||||
|
||||
public Long getWorkorderId()
|
||||
{
|
||||
return workorderId;
|
||||
}
|
||||
public void setWorkorderCode(String workorderCode)
|
||||
{
|
||||
this.workorderCode = workorderCode;
|
||||
}
|
||||
|
||||
public String getWorkorderCode()
|
||||
{
|
||||
return workorderCode;
|
||||
}
|
||||
public void setWorkorderName(String workorderName)
|
||||
{
|
||||
this.workorderName = workorderName;
|
||||
}
|
||||
|
||||
public String getWorkorderName()
|
||||
{
|
||||
return workorderName;
|
||||
}
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setTaskCode(String taskCode)
|
||||
{
|
||||
this.taskCode = taskCode;
|
||||
}
|
||||
|
||||
public String getTaskCode()
|
||||
{
|
||||
return taskCode;
|
||||
}
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
public void setQuantityFeedback(BigDecimal quantityFeedback)
|
||||
{
|
||||
this.quantityFeedback = quantityFeedback;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantityFeedback()
|
||||
{
|
||||
return quantityFeedback;
|
||||
}
|
||||
public void setQuantityQualified(BigDecimal quantityQualified)
|
||||
{
|
||||
this.quantityQualified = quantityQualified;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantityQualified()
|
||||
{
|
||||
return quantityQualified;
|
||||
}
|
||||
public void setQuantityUnquanlified(BigDecimal quantityUnquanlified)
|
||||
{
|
||||
this.quantityUnquanlified = quantityUnquanlified;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantityUnquanlified()
|
||||
{
|
||||
return quantityUnquanlified;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setFeedbackChannel(String feedbackChannel)
|
||||
{
|
||||
this.feedbackChannel = feedbackChannel;
|
||||
}
|
||||
|
||||
public String getFeedbackChannel()
|
||||
{
|
||||
return feedbackChannel;
|
||||
}
|
||||
public void setFeedbackTime(Date feedbackTime)
|
||||
{
|
||||
this.feedbackTime = feedbackTime;
|
||||
}
|
||||
|
||||
public Date getFeedbackTime()
|
||||
{
|
||||
return feedbackTime;
|
||||
}
|
||||
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("workstationId", getWorkstationId())
|
||||
.append("workstationCode", getWorkstationCode())
|
||||
.append("workstationName", getWorkstationName())
|
||||
.append("workorderId", getWorkorderId())
|
||||
.append("workorderCode", getWorkorderCode())
|
||||
.append("workorderName", getWorkorderName())
|
||||
.append("taskId", getTaskId())
|
||||
.append("taskCode", getTaskCode())
|
||||
.append("quantity", getQuantity())
|
||||
.append("quantityFeedback", getQuantityFeedback())
|
||||
.append("quantityQualified", getQuantityQualified())
|
||||
.append("quantityUnquanlified", getQuantityUnquanlified())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("feedbackChannel", getFeedbackChannel())
|
||||
.append("feedbackTime", getFeedbackTime())
|
||||
.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.ProFeedback;
|
||||
|
||||
/**
|
||||
* 生产报工记录Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-10
|
||||
*/
|
||||
public interface ProFeedbackMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产报工记录
|
||||
*
|
||||
* @param recordId 生产报工记录主键
|
||||
* @return 生产报工记录
|
||||
*/
|
||||
public ProFeedback selectProFeedbackByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询生产报工记录列表
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 生产报工记录集合
|
||||
*/
|
||||
public List<ProFeedback> selectProFeedbackList(ProFeedback proFeedback);
|
||||
|
||||
/**
|
||||
* 新增生产报工记录
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProFeedback(ProFeedback proFeedback);
|
||||
|
||||
/**
|
||||
* 修改生产报工记录
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProFeedback(ProFeedback proFeedback);
|
||||
|
||||
/**
|
||||
* 删除生产报工记录
|
||||
*
|
||||
* @param recordId 生产报工记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProFeedbackByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除生产报工记录
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProFeedbackByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.pro.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.pro.domain.ProFeedback;
|
||||
|
||||
/**
|
||||
* 生产报工记录Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-10
|
||||
*/
|
||||
public interface IProFeedbackService
|
||||
{
|
||||
/**
|
||||
* 查询生产报工记录
|
||||
*
|
||||
* @param recordId 生产报工记录主键
|
||||
* @return 生产报工记录
|
||||
*/
|
||||
public ProFeedback selectProFeedbackByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询生产报工记录列表
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 生产报工记录集合
|
||||
*/
|
||||
public List<ProFeedback> selectProFeedbackList(ProFeedback proFeedback);
|
||||
|
||||
/**
|
||||
* 新增生产报工记录
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProFeedback(ProFeedback proFeedback);
|
||||
|
||||
/**
|
||||
* 修改生产报工记录
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProFeedback(ProFeedback proFeedback);
|
||||
|
||||
/**
|
||||
* 批量删除生产报工记录
|
||||
*
|
||||
* @param recordIds 需要删除的生产报工记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProFeedbackByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除生产报工记录信息
|
||||
*
|
||||
* @param recordId 生产报工记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProFeedbackByRecordId(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.ProFeedbackMapper;
|
||||
import com.ktg.mes.pro.domain.ProFeedback;
|
||||
import com.ktg.mes.pro.service.IProFeedbackService;
|
||||
|
||||
/**
|
||||
* 生产报工记录Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-07-10
|
||||
*/
|
||||
@Service
|
||||
public class ProFeedbackServiceImpl implements IProFeedbackService
|
||||
{
|
||||
@Autowired
|
||||
private ProFeedbackMapper proFeedbackMapper;
|
||||
|
||||
/**
|
||||
* 查询生产报工记录
|
||||
*
|
||||
* @param recordId 生产报工记录主键
|
||||
* @return 生产报工记录
|
||||
*/
|
||||
@Override
|
||||
public ProFeedback selectProFeedbackByRecordId(Long recordId)
|
||||
{
|
||||
return proFeedbackMapper.selectProFeedbackByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产报工记录列表
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 生产报工记录
|
||||
*/
|
||||
@Override
|
||||
public List<ProFeedback> selectProFeedbackList(ProFeedback proFeedback)
|
||||
{
|
||||
return proFeedbackMapper.selectProFeedbackList(proFeedback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产报工记录
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProFeedback(ProFeedback proFeedback)
|
||||
{
|
||||
proFeedback.setCreateTime(DateUtils.getNowDate());
|
||||
return proFeedbackMapper.insertProFeedback(proFeedback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产报工记录
|
||||
*
|
||||
* @param proFeedback 生产报工记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProFeedback(ProFeedback proFeedback)
|
||||
{
|
||||
proFeedback.setUpdateTime(DateUtils.getNowDate());
|
||||
return proFeedbackMapper.updateProFeedback(proFeedback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产报工记录
|
||||
*
|
||||
* @param recordIds 需要删除的生产报工记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProFeedbackByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return proFeedbackMapper.deleteProFeedbackByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产报工记录信息
|
||||
*
|
||||
* @param recordId 生产报工记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProFeedbackByRecordId(Long recordId)
|
||||
{
|
||||
return proFeedbackMapper.deleteProFeedbackByRecordId(recordId);
|
||||
}
|
||||
}
|
167
ktg-mes/src/main/resources/mapper/pro/ProFeedbackMapper.xml
Normal file
167
ktg-mes/src/main/resources/mapper/pro/ProFeedbackMapper.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.ProFeedbackMapper">
|
||||
|
||||
<resultMap type="ProFeedback" id="ProFeedbackResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="workstationId" column="workstation_id" />
|
||||
<result property="workstationCode" column="workstation_code" />
|
||||
<result property="workstationName" column="workstation_name" />
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="workorderCode" column="workorder_code" />
|
||||
<result property="workorderName" column="workorder_name" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="taskCode" column="task_code" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="quantityFeedback" column="quantity_feedback" />
|
||||
<result property="quantityQualified" column="quantity_qualified" />
|
||||
<result property="quantityUnquanlified" column="quantity_unquanlified" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="feedbackChannel" column="feedback_channel" />
|
||||
<result property="feedbackTime" column="feedback_time" />
|
||||
<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="selectProFeedbackVo">
|
||||
select record_id, workstation_id, workstation_code, workstation_name, workorder_id, workorder_code, workorder_name, task_id, task_code, quantity, quantity_feedback, quantity_qualified, quantity_unquanlified, user_name, nick_name, feedback_channel, feedback_time, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_feedback
|
||||
</sql>
|
||||
|
||||
<select id="selectProFeedbackList" parameterType="ProFeedback" resultMap="ProFeedbackResult">
|
||||
<include refid="selectProFeedbackVo"/>
|
||||
<where>
|
||||
<if test="workstationId != null "> and workstation_id = #{workstationId}</if>
|
||||
<if test="workstationCode != null and workstationCode != ''"> and workstation_code = #{workstationCode}</if>
|
||||
<if test="workstationName != null and workstationName != ''"> and workstation_name like concat('%', #{workstationName}, '%')</if>
|
||||
<if test="workorderId != null "> and workorder_id = #{workorderId}</if>
|
||||
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
|
||||
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
|
||||
<if test="taskId != null "> and task_id = #{taskId}</if>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="quantityFeedback != null "> and quantity_feedback = #{quantityFeedback}</if>
|
||||
<if test="quantityQualified != null "> and quantity_qualified = #{quantityQualified}</if>
|
||||
<if test="quantityUnquanlified != null "> and quantity_unquanlified = #{quantityUnquanlified}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="feedbackChannel != null and feedbackChannel != ''"> and feedback_channel = #{feedbackChannel}</if>
|
||||
<if test="feedbackTime != null "> and feedback_time = #{feedbackTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProFeedbackByRecordId" parameterType="Long" resultMap="ProFeedbackResult">
|
||||
<include refid="selectProFeedbackVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProFeedback" parameterType="ProFeedback" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into pro_feedback
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workstationId != null">workstation_id,</if>
|
||||
<if test="workstationCode != null">workstation_code,</if>
|
||||
<if test="workstationName != null">workstation_name,</if>
|
||||
<if test="workorderId != null">workorder_id,</if>
|
||||
<if test="workorderCode != null">workorder_code,</if>
|
||||
<if test="workorderName != null">workorder_name,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="taskCode != null">task_code,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="quantityFeedback != null">quantity_feedback,</if>
|
||||
<if test="quantityQualified != null">quantity_qualified,</if>
|
||||
<if test="quantityUnquanlified != null">quantity_unquanlified,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="feedbackChannel != null">feedback_channel,</if>
|
||||
<if test="feedbackTime != null">feedback_time,</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="workstationId != null">#{workstationId},</if>
|
||||
<if test="workstationCode != null">#{workstationCode},</if>
|
||||
<if test="workstationName != null">#{workstationName},</if>
|
||||
<if test="workorderId != null">#{workorderId},</if>
|
||||
<if test="workorderCode != null">#{workorderCode},</if>
|
||||
<if test="workorderName != null">#{workorderName},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="taskCode != null">#{taskCode},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="quantityFeedback != null">#{quantityFeedback},</if>
|
||||
<if test="quantityQualified != null">#{quantityQualified},</if>
|
||||
<if test="quantityUnquanlified != null">#{quantityUnquanlified},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="feedbackChannel != null">#{feedbackChannel},</if>
|
||||
<if test="feedbackTime != null">#{feedbackTime},</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="updateProFeedback" parameterType="ProFeedback">
|
||||
update pro_feedback
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workstationId != null">workstation_id = #{workstationId},</if>
|
||||
<if test="workstationCode != null">workstation_code = #{workstationCode},</if>
|
||||
<if test="workstationName != null">workstation_name = #{workstationName},</if>
|
||||
<if test="workorderId != null">workorder_id = #{workorderId},</if>
|
||||
<if test="workorderCode != null">workorder_code = #{workorderCode},</if>
|
||||
<if test="workorderName != null">workorder_name = #{workorderName},</if>
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="taskCode != null">task_code = #{taskCode},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="quantityFeedback != null">quantity_feedback = #{quantityFeedback},</if>
|
||||
<if test="quantityQualified != null">quantity_qualified = #{quantityQualified},</if>
|
||||
<if test="quantityUnquanlified != null">quantity_unquanlified = #{quantityUnquanlified},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="feedbackChannel != null">feedback_channel = #{feedbackChannel},</if>
|
||||
<if test="feedbackTime != null">feedback_time = #{feedbackTime},</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="deleteProFeedbackByRecordId" parameterType="Long">
|
||||
delete from pro_feedback where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProFeedbackByRecordIds" parameterType="String">
|
||||
delete from pro_feedback where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user