移动端质量检验接口

This commit is contained in:
JinLu.Yin 2022-09-10 08:35:18 +08:00
parent ff006c3d87
commit f4a8acb4a8
2 changed files with 160 additions and 0 deletions

View File

@ -0,0 +1,46 @@
package com.ktg.mes.qc.controller;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.qc.domain.QcMobParam;
import com.ktg.mes.qc.domain.QcTemplate;
import com.ktg.mes.qc.domain.QcTemplateIndex;
import com.ktg.mes.qc.service.IQcTemplateIndexService;
import com.ktg.mes.qc.service.IQcTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/mobile/qc/templateindex")
public class QcTemplateIndexMobController {
@Autowired
private IQcTemplateService qcTemplateService;
@Autowired
private IQcTemplateIndexService qcTemplateIndexService;
/**
* 根据物料产品和质检类型查询对应的质检模板行信息
*/
@GetMapping("/getLines")
public AjaxResult getLines(QcMobParam param){
//根据物料和质检类型查询模板
QcTemplate template = qcTemplateService.findTemplateByProductIdAndQcType(param);
if(StringUtils.isNull(template)){
return AjaxResult.error("当前生产的产品未配置此类型的检验模板,请联系质量管理人员!");
}
//根据模板查询模板行
QcTemplateIndex p = new QcTemplateIndex();
p.setTemplateId(template.getTemplateId());
List<QcTemplateIndex> indexList = qcTemplateIndexService.selectQcTemplateIndexList(p);
return AjaxResult.success(indexList);
}
}

View File

@ -0,0 +1,114 @@
package com.ktg.mes.qc.domain;
import com.ktg.common.core.domain.BaseEntity;
/**
* 专门用于移动端质量管理各种数据查询的参数传递
*/
public class QcMobParam extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 检验单的ID可以是IQC检验单PQC过程检验单OQC出货检验单
*/
private Long qcId;
/**
* 对应的物料/产品ID
*/
private Long itemId;
/**
* 对应的物料/产品编码
*/
private String itemCode;
/**
* 对应的物料/产品名称
*/
private String itemName;
/**
* 检验类型IQCFIRSTFINALPATROLCHECKSELFFQCOQC
*/
private String qcType;
/**
* 检验模板ID
*/
private String templateId;
/**
* 检验单行ID
*/
private Long lineId;
public Long getQcId() {
return qcId;
}
public void setQcId(Long qcId) {
this.qcId = qcId;
}
public Long getItemId() {
return itemId;
}
public void setItemId(Long itemId) {
this.itemId = itemId;
}
public String getItemCode() {
return itemCode;
}
public void setItemCode(String itemCode) {
this.itemCode = itemCode;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getQcType() {
return qcType;
}
public void setQcType(String qcType) {
this.qcType = qcType;
}
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public Long getLineId() {
return lineId;
}
public void setLineId(Long lineId) {
this.lineId = lineId;
}
@Override
public String toString() {
return "QcMobParam{" +
"qcId=" + qcId +
", itemId=" + itemId +
", itemCode='" + itemCode + '\'' +
", itemName='" + itemName + '\'' +
", qcType='" + qcType + '\'' +
", templateId='" + templateId + '\'' +
", lineId=" + lineId +
'}';
}
}