添加controller
This commit is contained in:
parent
c72df130a1
commit
12ea3d9293
@ -0,0 +1,53 @@
|
||||
package com.xkrs.newpro.controller;
|
||||
|
||||
import com.xkrs.newpro.model.qo.QcItemQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoInsert;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoUpdate;
|
||||
import com.xkrs.newpro.service.QcItemService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
public class QcItemController {
|
||||
|
||||
@Resource
|
||||
private QcItemService qcItemService;
|
||||
|
||||
/**
|
||||
* 添加检验项目
|
||||
*/
|
||||
@PostMapping("/insertQcItem")
|
||||
public String insertQcItem(QcItemQoInsert insertQo) {
|
||||
return qcItemService.insertQcItem(insertQo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检验项目
|
||||
*/
|
||||
@PostMapping("/deleteQcItem")
|
||||
public String deleteQcItem(QcItemQoDelete deleteQo) {
|
||||
return qcItemService.deleteQcItem(deleteQo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新检验项目名称
|
||||
*/
|
||||
@PostMapping("/updateQcItem")
|
||||
public String updateQcItem(QcItemQoUpdate updateQo) {
|
||||
return qcItemService.updateQcItem(updateQo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检验项目
|
||||
*/
|
||||
@GetMapping("/queryQcItem")
|
||||
public String queryQcItem(@RequestParam(value = "no") String no, @RequestParam(value = "name") String name) {
|
||||
return qcItemService.queryQcItem(no, name);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.xkrs.newpro.controller;
|
||||
|
||||
import com.xkrs.newpro.model.qo.QcSourceQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcSourceQoInsert;
|
||||
import com.xkrs.newpro.service.QcSourceService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
public class QcSourceController {
|
||||
|
||||
@Resource
|
||||
private QcSourceService qcSourceService;
|
||||
|
||||
/**
|
||||
* 添加检验数据
|
||||
*/
|
||||
@PostMapping("/insertQcSource")
|
||||
public String insertQcSource(QcSourceQoInsert insertQo) {
|
||||
return qcSourceService.insertQcSource(insertQo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检验数据
|
||||
*/
|
||||
@PostMapping("/deleteQcSource")
|
||||
public String deleteQcSource(QcSourceQoDelete deleteQo) {
|
||||
return qcSourceService.deleteQcSource(deleteQo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检验数据
|
||||
*/
|
||||
@GetMapping("/queryQcSource")
|
||||
public String queryQcSource(@RequestParam(value = "batchNo") String batchNo, @RequestParam(value = "machineNo") String machineNo, @RequestParam(value = "materialNo") String materialNo, @RequestParam(value = "mouldNo") String mouldNo, @RequestParam(value = "varietyNo") String varietyNo) {
|
||||
return qcSourceService.queryQcSource(batchNo, machineNo, materialNo, mouldNo, varietyNo);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.xkrs.newpro.controller;
|
||||
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoInsert;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoUpdate;
|
||||
import com.xkrs.newpro.service.QcSpecService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
public class QcSpecController {
|
||||
|
||||
@Resource
|
||||
private QcSpecService qcSpecService;
|
||||
|
||||
/**
|
||||
* 添加检验规格
|
||||
*/
|
||||
@PostMapping("/insertQcSpec")
|
||||
public String insertQcSpec(QcSpecQoInsert insertQo) {
|
||||
return qcSpecService.insertQcSpec(insertQo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检验规格
|
||||
*/
|
||||
@PostMapping("/deleteQcSpec")
|
||||
public String deleteQcSpec(QcSpecQoDelete deleteQo) {
|
||||
return qcSpecService.deleteQcSpec(deleteQo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新检验规格
|
||||
*/
|
||||
@PostMapping("/updateQcSpec")
|
||||
public String updateQcSpec(QcSpecQoUpdate updateQo) {
|
||||
return qcSpecService.updateQcSpec(updateQo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检验规格
|
||||
*/
|
||||
@GetMapping("/queryQcSpec")
|
||||
public String queryQcSpec(@RequestParam(value = "varietyNo") String varietyNo, @RequestParam(value = "qcItemNo") String qcItemNo) {
|
||||
return qcSpecService.queryQcSpec(varietyNo, qcItemNo);
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package com.xkrs.newpro.model.qo;
|
||||
|
||||
/**
|
||||
* 查询检验项目接收类
|
||||
*/
|
||||
public class QcItemQoQuery {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
public QcItemQoQuery() {
|
||||
}
|
||||
|
||||
public String getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
public void setNo(String no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QcItemQoQuery{" + "no='" + no + '\'' + ", name='" + name + '\'' + '}';
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package com.xkrs.newpro.model.qo;
|
||||
|
||||
/**
|
||||
* 查询检验数据接收类
|
||||
*/
|
||||
public class QcSourceQoQuery {
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 机器号
|
||||
*/
|
||||
private String machineNo;
|
||||
|
||||
/**
|
||||
* 物料号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 模具号
|
||||
*/
|
||||
private String mouldNo;
|
||||
|
||||
/**
|
||||
* 机种号
|
||||
*/
|
||||
private String varietyNo;
|
||||
|
||||
public QcSourceQoQuery() {
|
||||
}
|
||||
|
||||
public String getBatchNo() {
|
||||
return batchNo;
|
||||
}
|
||||
|
||||
public void setBatchNo(String batchNo) {
|
||||
this.batchNo = batchNo;
|
||||
}
|
||||
|
||||
public String getMachineNo() {
|
||||
return machineNo;
|
||||
}
|
||||
|
||||
public void setMachineNo(String machineNo) {
|
||||
this.machineNo = machineNo;
|
||||
}
|
||||
|
||||
public String getMaterialNo() {
|
||||
return materialNo;
|
||||
}
|
||||
|
||||
public void setMaterialNo(String materialNo) {
|
||||
this.materialNo = materialNo;
|
||||
}
|
||||
|
||||
public String getMouldNo() {
|
||||
return mouldNo;
|
||||
}
|
||||
|
||||
public void setMouldNo(String mouldNo) {
|
||||
this.mouldNo = mouldNo;
|
||||
}
|
||||
|
||||
public String getVarietyNo() {
|
||||
return varietyNo;
|
||||
}
|
||||
|
||||
public void setVarietyNo(String varietyNo) {
|
||||
this.varietyNo = varietyNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QcSourceQoQuery{" + "batchNo='" + batchNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", mouldNo='" + mouldNo + '\'' + ", varietyNo='" + varietyNo + '\'' + '}';
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package com.xkrs.newpro.model.qo;
|
||||
|
||||
/**
|
||||
* 查询检验规格接收类
|
||||
*/
|
||||
public class QcSpecQoQuery {
|
||||
|
||||
/**
|
||||
* 机种号
|
||||
*/
|
||||
private String varietyNo;
|
||||
|
||||
/**
|
||||
* 检验项目编号
|
||||
*/
|
||||
private String qcItemNo;
|
||||
|
||||
public QcSpecQoQuery() {
|
||||
}
|
||||
|
||||
public String getVarietyNo() {
|
||||
return varietyNo;
|
||||
}
|
||||
|
||||
public void setVarietyNo(String varietyNo) {
|
||||
this.varietyNo = varietyNo;
|
||||
}
|
||||
|
||||
public String getQcItemNo() {
|
||||
return qcItemNo;
|
||||
}
|
||||
|
||||
public void setQcItemNo(String qcItemNo) {
|
||||
this.qcItemNo = qcItemNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QcSpecQoQuery{" + "varietyNo='" + varietyNo + '\'' + ", qcItemNo='" + qcItemNo + '\'' + '}';
|
||||
}
|
||||
}
|
@ -2,7 +2,6 @@ package com.xkrs.newpro.service;
|
||||
|
||||
import com.xkrs.newpro.model.qo.QcItemQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoInsert;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoQuery;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoUpdate;
|
||||
|
||||
public interface QcItemService {
|
||||
@ -25,6 +24,6 @@ public interface QcItemService {
|
||||
/**
|
||||
* 查询检验项目
|
||||
*/
|
||||
String queryQcItem(QcItemQoQuery queryQo);
|
||||
String queryQcItem(String no, String name);
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package com.xkrs.newpro.service;
|
||||
|
||||
import com.xkrs.newpro.model.qo.QcSourceQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcSourceQoInsert;
|
||||
import com.xkrs.newpro.model.qo.QcSourceQoQuery;
|
||||
|
||||
public interface QcSourceService {
|
||||
|
||||
@ -19,6 +18,6 @@ public interface QcSourceService {
|
||||
/**
|
||||
* 查询检验数据
|
||||
*/
|
||||
String queryQcSource(QcSourceQoQuery queryQo);
|
||||
String queryQcSource(String batchNo, String machineNo, String materialNo, String mouldNo, String varietyNo);
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package com.xkrs.newpro.service;
|
||||
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoInsert;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoQuery;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoUpdate;
|
||||
|
||||
public interface QcSpecService {
|
||||
@ -25,6 +24,6 @@ public interface QcSpecService {
|
||||
/**
|
||||
* 查询检验规格
|
||||
*/
|
||||
String queryQcSpec(QcSpecQoQuery queryQo);
|
||||
String queryQcSpec(String varietyNo, String qcItemNo);
|
||||
|
||||
}
|
||||
|
@ -5,12 +5,12 @@ import com.xkrs.newpro.dao.QcItemDao;
|
||||
import com.xkrs.newpro.model.entity.QcItemEntity;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoInsert;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoQuery;
|
||||
import com.xkrs.newpro.model.qo.QcItemQoUpdate;
|
||||
import com.xkrs.newpro.service.QcItemService;
|
||||
import com.xkrs.newpro.utils.LocalDateUtils;
|
||||
import com.xkrs.newpro.utils.LocalStringUtils;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
@ -21,6 +21,7 @@ import java.util.Optional;
|
||||
|
||||
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
|
||||
|
||||
@Service
|
||||
public class QcItemServiceImpl implements QcItemService {
|
||||
|
||||
private Locale locale = LocaleContextHolder.getLocale();
|
||||
@ -84,9 +85,7 @@ public class QcItemServiceImpl implements QcItemService {
|
||||
* 查询检验项目
|
||||
*/
|
||||
@Override
|
||||
public String queryQcItem(QcItemQoQuery queryQo) {
|
||||
String no = queryQo.getNo();
|
||||
String name = queryQo.getName();
|
||||
public String queryQcItem(String no, String name) {
|
||||
List<Map<String, Object>> resultList = qcItemDao.queryQcItem(LocalStringUtils.formatEmptyValue(no), LocalStringUtils.formatEmptyValue(name));
|
||||
if (resultList == null || resultList.isEmpty()) {
|
||||
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该检验项目的信息!", locale);
|
||||
|
@ -5,11 +5,11 @@ import com.xkrs.newpro.dao.QcSourceDao;
|
||||
import com.xkrs.newpro.model.entity.QcSourceEntity;
|
||||
import com.xkrs.newpro.model.qo.QcSourceQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcSourceQoInsert;
|
||||
import com.xkrs.newpro.model.qo.QcSourceQoQuery;
|
||||
import com.xkrs.newpro.service.QcSourceService;
|
||||
import com.xkrs.newpro.utils.LocalDateUtils;
|
||||
import com.xkrs.newpro.utils.LocalStringUtils;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@ -19,6 +19,7 @@ import java.util.Optional;
|
||||
|
||||
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
|
||||
|
||||
@Service
|
||||
public class QcSourceServiceImpl implements QcSourceService {
|
||||
|
||||
private Locale locale = LocaleContextHolder.getLocale();
|
||||
@ -72,13 +73,7 @@ public class QcSourceServiceImpl implements QcSourceService {
|
||||
* 查询检验数据
|
||||
*/
|
||||
@Override
|
||||
public String queryQcSource(QcSourceQoQuery queryQo) {
|
||||
|
||||
String batchNo = queryQo.getBatchNo();
|
||||
String machineNo = queryQo.getMachineNo();
|
||||
String materialNo = queryQo.getMaterialNo();
|
||||
String mouldNo = queryQo.getMouldNo();
|
||||
String varietyNo = queryQo.getVarietyNo();
|
||||
public String queryQcSource(String batchNo, String machineNo, String materialNo, String mouldNo, String varietyNo) {
|
||||
List<Map<String, Object>> resultList = qcSourceDao.queryQcSource(LocalStringUtils.formatEmptyValue(batchNo), LocalStringUtils.formatEmptyValue(machineNo), LocalStringUtils.formatEmptyValue(materialNo), LocalStringUtils.formatEmptyValue(mouldNo), LocalStringUtils.formatEmptyValue(varietyNo));
|
||||
if (resultList == null || resultList.isEmpty()) {
|
||||
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该检验数据的信息!", locale);
|
||||
|
@ -7,12 +7,12 @@ import com.xkrs.newpro.model.entity.QcItemEntity;
|
||||
import com.xkrs.newpro.model.entity.QcSpecEntity;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoDelete;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoInsert;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoQuery;
|
||||
import com.xkrs.newpro.model.qo.QcSpecQoUpdate;
|
||||
import com.xkrs.newpro.service.QcSpecService;
|
||||
import com.xkrs.newpro.utils.LocalDateUtils;
|
||||
import com.xkrs.newpro.utils.LocalStringUtils;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@ -22,6 +22,7 @@ import java.util.Optional;
|
||||
|
||||
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
|
||||
|
||||
@Service
|
||||
public class QcSpecServiceImpl implements QcSpecService {
|
||||
|
||||
private Locale locale = LocaleContextHolder.getLocale();
|
||||
@ -117,10 +118,7 @@ public class QcSpecServiceImpl implements QcSpecService {
|
||||
* 查询检验规格
|
||||
*/
|
||||
@Override
|
||||
public String queryQcSpec(QcSpecQoQuery queryQo) {
|
||||
|
||||
String varietyNo = queryQo.getVarietyNo();
|
||||
String qcItemNo = queryQo.getQcItemNo();
|
||||
public String queryQcSpec(String varietyNo, String qcItemNo) {
|
||||
List<Map<String, Object>> resultList = qcSpecDao.queryQcSpec(LocalStringUtils.formatEmptyValue(varietyNo), LocalStringUtils.formatEmptyValue(qcItemNo));
|
||||
if (resultList == null || resultList.isEmpty()) {
|
||||
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该检验规格的信息!", locale);
|
||||
|
Loading…
Reference in New Issue
Block a user