查询质检项

This commit is contained in:
liuchengqian 2022-03-11 10:28:36 +08:00
parent 9dd6f697a6
commit 1fa0f9cffb
14 changed files with 209 additions and 2 deletions

View File

@ -7,6 +7,8 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
@Component @Component
@ -18,7 +20,12 @@ public interface QcItemDao extends JpaRepository<QcItemEntity, Integer>, JpaSpec
* 更新质检项名称 * 更新质检项名称
*/ */
@Modifying(clearAutomatically = true) @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); 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<Map<String, Object>> queryQcItem(String no, String name);
} }

View File

@ -18,7 +18,7 @@ public interface QcSpecDao extends JpaRepository<QcSpecEntity, Integer>, JpaSpec
* 更新质检规格 * 更新质检规格
*/ */
@Modifying(clearAutomatically = true) @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); void updateQcSpecById(Integer id, String updateTime, String max, String mean, String min, String unit, String method, String standard, String remark);
} }

View File

@ -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 + '\'' +
'}';
}
}

View File

@ -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 + '\'' +
'}';
}
}

View File

@ -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 + '\'' +
'}';
}
}

View File

@ -0,0 +1,4 @@
package com.xkrs.newpro.model.va;
public interface QcItemQoQueryVa {
}

View File

@ -0,0 +1,4 @@
package com.xkrs.newpro.model.va;
public interface QcSourceQoQueryVa {
}

View File

@ -0,0 +1,4 @@
package com.xkrs.newpro.model.va;
public interface QcSpecQoQueryVa {
}

View File

@ -1,6 +1,7 @@
package com.xkrs.newpro.service; package com.xkrs.newpro.service;
import com.xkrs.newpro.model.qo.QcItemQoInsert; 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.model.qo.QcItemQoUpdate;
public interface QcItemService { public interface QcItemService {
@ -15,4 +16,9 @@ public interface QcItemService {
*/ */
String updateQcItem(QcItemQoUpdate updateQo); String updateQcItem(QcItemQoUpdate updateQo);
/**
* 查询质检项
*/
String queryQcItem(QcItemQoQuery queryQo);
} }

View File

@ -1,6 +1,7 @@
package com.xkrs.newpro.service; package com.xkrs.newpro.service;
import com.xkrs.newpro.model.qo.QcSourceQoInsert; import com.xkrs.newpro.model.qo.QcSourceQoInsert;
import com.xkrs.newpro.model.qo.QcSourceQoQuery;
public interface QcSourceService { public interface QcSourceService {
@ -9,4 +10,9 @@ public interface QcSourceService {
*/ */
String insertQcSource(QcSourceQoInsert insertQo); String insertQcSource(QcSourceQoInsert insertQo);
/**
* 查询质检数据
*/
String queryQcSource(QcSourceQoQuery queryQo);
} }

View File

@ -1,6 +1,7 @@
package com.xkrs.newpro.service; package com.xkrs.newpro.service;
import com.xkrs.newpro.model.qo.QcSpecQoInsert; 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.model.qo.QcSpecQoUpdate;
public interface QcSpecService { public interface QcSpecService {
@ -15,4 +16,9 @@ public interface QcSpecService {
*/ */
String updateQcSpec(QcSpecQoUpdate updateQo); String updateQcSpec(QcSpecQoUpdate updateQo);
/**
* 查询质检规格
*/
String queryQcSpec(QcSpecQoQuery queryQo);
} }

View File

@ -4,13 +4,17 @@ import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.newpro.dao.QcItemDao; import com.xkrs.newpro.dao.QcItemDao;
import com.xkrs.newpro.model.entity.QcItemEntity; import com.xkrs.newpro.model.entity.QcItemEntity;
import com.xkrs.newpro.model.qo.QcItemQoInsert; 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.model.qo.QcItemQoUpdate;
import com.xkrs.newpro.service.QcItemService; import com.xkrs.newpro.service.QcItemService;
import com.xkrs.newpro.utils.LocalDateUtils; import com.xkrs.newpro.utils.LocalDateUtils;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject; import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@ -51,6 +55,7 @@ public class QcItemServiceImpl implements QcItemService {
/** /**
* 更新质检项名称 * 更新质检项名称
*/ */
@Transactional(rollbackOn = Exception.class)
@Override @Override
public String updateQcItem(QcItemQoUpdate updateQo) { public String updateQcItem(QcItemQoUpdate updateQo) {
@ -66,4 +71,19 @@ public class QcItemServiceImpl implements QcItemService {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale);
} }
/**
* 查询质检项
*/
@Override
public String queryQcItem(QcItemQoQuery queryQo) {
String no = queryQo.getNo();
String name = queryQo.getName();
List<Map<String, Object>> resultList = qcItemDao.queryQcItem(no, name);
if (resultList == null || resultList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该质检项的信息!", locale);
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, resultList, locale);
}
} }

View File

@ -4,6 +4,7 @@ import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.newpro.dao.QcSourceDao; import com.xkrs.newpro.dao.QcSourceDao;
import com.xkrs.newpro.model.entity.QcSourceEntity; import com.xkrs.newpro.model.entity.QcSourceEntity;
import com.xkrs.newpro.model.qo.QcSourceQoInsert; import com.xkrs.newpro.model.qo.QcSourceQoInsert;
import com.xkrs.newpro.model.qo.QcSourceQoQuery;
import com.xkrs.newpro.service.QcSourceService; import com.xkrs.newpro.service.QcSourceService;
import com.xkrs.newpro.utils.LocalDateUtils; import com.xkrs.newpro.utils.LocalDateUtils;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
@ -47,4 +48,12 @@ public class QcSourceServiceImpl implements QcSourceService {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
} }
/**
* 查询质检数据
*/
@Override
public String queryQcSource(QcSourceQoQuery queryQo) {
return null;
}
} }

View File

@ -6,6 +6,7 @@ import com.xkrs.newpro.dao.QcSpecDao;
import com.xkrs.newpro.model.entity.QcItemEntity; import com.xkrs.newpro.model.entity.QcItemEntity;
import com.xkrs.newpro.model.entity.QcSpecEntity; import com.xkrs.newpro.model.entity.QcSpecEntity;
import com.xkrs.newpro.model.qo.QcSpecQoInsert; 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.model.qo.QcSpecQoUpdate;
import com.xkrs.newpro.service.QcSpecService; import com.xkrs.newpro.service.QcSpecService;
import com.xkrs.newpro.utils.LocalDateUtils; import com.xkrs.newpro.utils.LocalDateUtils;
@ -102,4 +103,12 @@ public class QcSpecServiceImpl implements QcSpecService {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale);
} }
/**
* 查询质检规格
*/
@Override
public String queryQcSpec(QcSpecQoQuery queryQo) {
return null;
}
} }