diff --git a/src/main/java/com/xkrs/newpro/dao/QcItemDao.java b/src/main/java/com/xkrs/newpro/dao/QcItemDao.java index 93fed9d..5f6fef7 100644 --- a/src/main/java/com/xkrs/newpro/dao/QcItemDao.java +++ b/src/main/java/com/xkrs/newpro/dao/QcItemDao.java @@ -7,6 +7,8 @@ import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Component; +import java.util.List; +import java.util.Map; import java.util.Optional; @Component @@ -18,7 +20,12 @@ public interface QcItemDao extends JpaRepository, JpaSpec * 更新质检项名称 */ @Modifying(clearAutomatically = true) - @Query(value = "UPDATE qc_item SET update_time = ?2,name = ?3 WHERE id = ?1", nativeQuery = true) + @Query(value = "UPDATE qc_item SET update_time = ?2, name = ?3 WHERE id = ?1", nativeQuery = true) void updateNameById(Integer id, String updateTime, String name); + /** + * 查询质检项 + */ + @Query(value = "SELECT id, no, name, type FROM qc_item ORDER BY create_time ASC", nativeQuery = true) + List> queryQcItem(String no, String name); } diff --git a/src/main/java/com/xkrs/newpro/dao/QcSpecDao.java b/src/main/java/com/xkrs/newpro/dao/QcSpecDao.java index 41496ae..c857685 100644 --- a/src/main/java/com/xkrs/newpro/dao/QcSpecDao.java +++ b/src/main/java/com/xkrs/newpro/dao/QcSpecDao.java @@ -18,7 +18,7 @@ public interface QcSpecDao extends JpaRepository, JpaSpec * 更新质检规格 */ @Modifying(clearAutomatically = true) - @Query(value = "UPDATE qc_spec SET update_time = ?2,max = ?3,mean = ?4,min = ?5,unit = ?6,method = ?7,standard = ?8,remark = ?9 WHERE id = ?1", nativeQuery = true) + @Query(value = "UPDATE qc_spec SET update_time = ?2, max = ?3, mean = ?4, min = ?5, unit = ?6, method = ?7, standard = ?8, remark = ?9 WHERE id = ?1", nativeQuery = true) void updateQcSpecById(Integer id, String updateTime, String max, String mean, String min, String unit, String method, String standard, String remark); } \ No newline at end of file diff --git a/src/main/java/com/xkrs/newpro/model/qo/QcItemQoQuery.java b/src/main/java/com/xkrs/newpro/model/qo/QcItemQoQuery.java new file mode 100644 index 0000000..a41668c --- /dev/null +++ b/src/main/java/com/xkrs/newpro/model/qo/QcItemQoQuery.java @@ -0,0 +1,34 @@ +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 + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/newpro/model/qo/QcSourceQoQuery.java b/src/main/java/com/xkrs/newpro/model/qo/QcSourceQoQuery.java new file mode 100644 index 0000000..bac36b9 --- /dev/null +++ b/src/main/java/com/xkrs/newpro/model/qo/QcSourceQoQuery.java @@ -0,0 +1,64 @@ +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 + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/newpro/model/qo/QcSpecQoQuery.java b/src/main/java/com/xkrs/newpro/model/qo/QcSpecQoQuery.java new file mode 100644 index 0000000..7f3fd9d --- /dev/null +++ b/src/main/java/com/xkrs/newpro/model/qo/QcSpecQoQuery.java @@ -0,0 +1,34 @@ +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 + '\'' + + '}'; + } +} diff --git a/src/main/java/com/xkrs/newpro/model/va/QcItemQoQueryVa.java b/src/main/java/com/xkrs/newpro/model/va/QcItemQoQueryVa.java new file mode 100644 index 0000000..b915805 --- /dev/null +++ b/src/main/java/com/xkrs/newpro/model/va/QcItemQoQueryVa.java @@ -0,0 +1,4 @@ +package com.xkrs.newpro.model.va; + +public interface QcItemQoQueryVa { +} diff --git a/src/main/java/com/xkrs/newpro/model/va/QcSourceQoQueryVa.java b/src/main/java/com/xkrs/newpro/model/va/QcSourceQoQueryVa.java new file mode 100644 index 0000000..3f3e86d --- /dev/null +++ b/src/main/java/com/xkrs/newpro/model/va/QcSourceQoQueryVa.java @@ -0,0 +1,4 @@ +package com.xkrs.newpro.model.va; + +public interface QcSourceQoQueryVa { +} diff --git a/src/main/java/com/xkrs/newpro/model/va/QcSpecQoQueryVa.java b/src/main/java/com/xkrs/newpro/model/va/QcSpecQoQueryVa.java new file mode 100644 index 0000000..f5e11a8 --- /dev/null +++ b/src/main/java/com/xkrs/newpro/model/va/QcSpecQoQueryVa.java @@ -0,0 +1,4 @@ +package com.xkrs.newpro.model.va; + +public interface QcSpecQoQueryVa { +} diff --git a/src/main/java/com/xkrs/newpro/service/QcItemService.java b/src/main/java/com/xkrs/newpro/service/QcItemService.java index d8aea29..02fa2ce 100644 --- a/src/main/java/com/xkrs/newpro/service/QcItemService.java +++ b/src/main/java/com/xkrs/newpro/service/QcItemService.java @@ -1,6 +1,7 @@ package com.xkrs.newpro.service; import com.xkrs.newpro.model.qo.QcItemQoInsert; +import com.xkrs.newpro.model.qo.QcItemQoQuery; import com.xkrs.newpro.model.qo.QcItemQoUpdate; public interface QcItemService { @@ -15,4 +16,9 @@ public interface QcItemService { */ String updateQcItem(QcItemQoUpdate updateQo); + /** + * 查询质检项 + */ + String queryQcItem(QcItemQoQuery queryQo); + } diff --git a/src/main/java/com/xkrs/newpro/service/QcSourceService.java b/src/main/java/com/xkrs/newpro/service/QcSourceService.java index 4f20edc..9894321 100644 --- a/src/main/java/com/xkrs/newpro/service/QcSourceService.java +++ b/src/main/java/com/xkrs/newpro/service/QcSourceService.java @@ -1,6 +1,7 @@ package com.xkrs.newpro.service; import com.xkrs.newpro.model.qo.QcSourceQoInsert; +import com.xkrs.newpro.model.qo.QcSourceQoQuery; public interface QcSourceService { @@ -9,4 +10,9 @@ public interface QcSourceService { */ String insertQcSource(QcSourceQoInsert insertQo); + /** + * 查询质检数据 + */ + String queryQcSource(QcSourceQoQuery queryQo); + } diff --git a/src/main/java/com/xkrs/newpro/service/QcSpecService.java b/src/main/java/com/xkrs/newpro/service/QcSpecService.java index d3fa01c..5d68e8d 100644 --- a/src/main/java/com/xkrs/newpro/service/QcSpecService.java +++ b/src/main/java/com/xkrs/newpro/service/QcSpecService.java @@ -1,6 +1,7 @@ package com.xkrs.newpro.service; import com.xkrs.newpro.model.qo.QcSpecQoInsert; +import com.xkrs.newpro.model.qo.QcSpecQoQuery; import com.xkrs.newpro.model.qo.QcSpecQoUpdate; public interface QcSpecService { @@ -15,4 +16,9 @@ public interface QcSpecService { */ String updateQcSpec(QcSpecQoUpdate updateQo); + /** + * 查询质检规格 + */ + String queryQcSpec(QcSpecQoQuery queryQo); + } diff --git a/src/main/java/com/xkrs/newpro/service/impl/QcItemServiceImpl.java b/src/main/java/com/xkrs/newpro/service/impl/QcItemServiceImpl.java index c09cdcc..0081337 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcItemServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcItemServiceImpl.java @@ -4,13 +4,17 @@ import com.xkrs.encapsulation.PromptMessageEnum; import com.xkrs.newpro.dao.QcItemDao; import com.xkrs.newpro.model.entity.QcItemEntity; 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 org.springframework.context.i18n.LocaleContextHolder; import javax.annotation.Resource; +import javax.transaction.Transactional; +import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Optional; import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject; @@ -51,6 +55,7 @@ public class QcItemServiceImpl implements QcItemService { /** * 更新质检项名称 */ + @Transactional(rollbackOn = Exception.class) @Override public String updateQcItem(QcItemQoUpdate updateQo) { @@ -66,4 +71,19 @@ public class QcItemServiceImpl implements QcItemService { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale); } + + /** + * 查询质检项 + */ + @Override + public String queryQcItem(QcItemQoQuery queryQo) { + + String no = queryQo.getNo(); + String name = queryQo.getName(); + List> resultList = qcItemDao.queryQcItem(no, name); + if (resultList == null || resultList.isEmpty()) { + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该质检项的信息!", locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, resultList, locale); + } } diff --git a/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java b/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java index b530790..45964f4 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java @@ -4,6 +4,7 @@ import com.xkrs.encapsulation.PromptMessageEnum; import com.xkrs.newpro.dao.QcSourceDao; import com.xkrs.newpro.model.entity.QcSourceEntity; 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 org.springframework.context.i18n.LocaleContextHolder; @@ -47,4 +48,12 @@ public class QcSourceServiceImpl implements QcSourceService { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); } + + /** + * 查询质检数据 + */ + @Override + public String queryQcSource(QcSourceQoQuery queryQo) { + return null; + } } diff --git a/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java b/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java index 6e560a0..90c17c4 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java @@ -6,6 +6,7 @@ import com.xkrs.newpro.dao.QcSpecDao; import com.xkrs.newpro.model.entity.QcItemEntity; import com.xkrs.newpro.model.entity.QcSpecEntity; 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; @@ -102,4 +103,12 @@ public class QcSpecServiceImpl implements QcSpecService { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale); } + + /** + * 查询质检规格 + */ + @Override + public String queryQcSpec(QcSpecQoQuery queryQo) { + return null; + } }