优化注释

This commit is contained in:
liuchengqian 2022-03-11 15:37:06 +08:00
parent 34d9d84456
commit c72df130a1
25 changed files with 240 additions and 110 deletions

View File

@ -11,6 +11,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
/**
* 检验项目Dao
*/
@Component @Component
public interface QcItemDao extends JpaRepository<QcItemEntity, Integer>, JpaSpecificationExecutor<QcItemEntity> { public interface QcItemDao extends JpaRepository<QcItemEntity, Integer>, JpaSpecificationExecutor<QcItemEntity> {

View File

@ -9,6 +9,9 @@ import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/**
* 检验数据Dao
*/
@Component @Component
public interface QcSourceDao extends JpaRepository<QcSourceEntity, Integer>, JpaSpecificationExecutor<QcSourceEntity> { public interface QcSourceDao extends JpaRepository<QcSourceEntity, Integer>, JpaSpecificationExecutor<QcSourceEntity> {

View File

@ -17,14 +17,14 @@ public interface QcSpecDao extends JpaRepository<QcSpecEntity, Integer>, JpaSpec
Optional<QcSpecEntity> findByVarietyNoAndQcItemNo(String varietyNo, String qcItemNo); Optional<QcSpecEntity> findByVarietyNoAndQcItemNo(String varietyNo, String qcItemNo);
/** /**
* 更新检规格 * 更新规格
*/ */
@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);
/** /**
* 查询检规格 * 查询规格
*/ */
@Query(value = "SELECT id, variety_no AS varietyNo, qc_item_no AS qcItemNo, max, mean, min, unit, method, standard, remark FROM qc_spec WHERE variety_no LIKE %?1% AND qc_item_no LIKE %?2% ORDER BY create_time ASC", nativeQuery = true) @Query(value = "SELECT id, variety_no AS varietyNo, qc_item_no AS qcItemNo, max, mean, min, unit, method, standard, remark FROM qc_spec WHERE variety_no LIKE %?1% AND qc_item_no LIKE %?2% ORDER BY create_time ASC", nativeQuery = true)
List<Map<String, Object>> queryQcSpec(String varietyNo, String qcItemNo); List<Map<String, Object>> queryQcSpec(String varietyNo, String qcItemNo);

View File

@ -3,7 +3,7 @@ package com.xkrs.newpro.model.entity;
import javax.persistence.*; import javax.persistence.*;
/** /**
* 检数据 * 数据
*/ */
@Entity @Entity
@Table(name = "qc_source") @Table(name = "qc_source")
@ -142,16 +142,6 @@ public class QcSourceEntity {
@Override @Override
public String toString() { public String toString() {
return "QcSourceEntity{" + return "QcSourceEntity{" + "id=" + id + ", createTime='" + createTime + '\'' + ", batchNo='" + batchNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", mouldNo='" + mouldNo + '\'' + ", varietyNo='" + varietyNo + '\'' + ", qcItemNo='" + qcItemNo + '\'' + ", qcValue='" + qcValue + '\'' + '}';
"id=" + id +
", createTime='" + createTime + '\'' +
", batchNo='" + batchNo + '\'' +
", machineNo='" + machineNo + '\'' +
", materialNo='" + materialNo + '\'' +
", mouldNo='" + mouldNo + '\'' +
", varietyNo='" + varietyNo + '\'' +
", qcItemNo='" + qcItemNo + '\'' +
", qcValue='" + qcValue + '\'' +
'}';
} }
} }

View File

@ -3,7 +3,7 @@ package com.xkrs.newpro.model.entity;
import javax.persistence.*; import javax.persistence.*;
/** /**
* 检规格 * 规格
*/ */
@Entity @Entity
@Table(name = "qc_spec") @Table(name = "qc_spec")
@ -184,19 +184,6 @@ public class QcSpecEntity {
@Override @Override
public String toString() { public String toString() {
return "QcSpecEntity{" + return "QcSpecEntity{" + "id=" + id + ", createTime='" + createTime + '\'' + ", updateTime='" + updateTime + '\'' + ", varietyNo='" + varietyNo + '\'' + ", qcItemNo='" + qcItemNo + '\'' + ", max='" + max + '\'' + ", mean='" + mean + '\'' + ", min='" + min + '\'' + ", unit='" + unit + '\'' + ", method='" + method + '\'' + ", standard='" + standard + '\'' + ", remark='" + remark + '\'' + '}';
"id=" + id +
", createTime='" + createTime + '\'' +
", updateTime='" + updateTime + '\'' +
", varietyNo='" + varietyNo + '\'' +
", qcItemNo='" + qcItemNo + '\'' +
", max='" + max + '\'' +
", mean='" + mean + '\'' +
", min='" + min + '\'' +
", unit='" + unit + '\'' +
", method='" + method + '\'' +
", standard='" + standard + '\'' +
", remark='" + remark + '\'' +
'}';
} }
} }

View File

@ -0,0 +1,28 @@
package com.xkrs.newpro.model.qo;
/**
* 删除检验项目接收类
*/
public class QcItemQoDelete {
/**
* 主键id
*/
private Integer id;
public QcItemQoDelete() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Override
public String toString() {
return "QcItemQoDelete{" + "id=" + id + '}';
}
}

View File

@ -1,7 +1,7 @@
package com.xkrs.newpro.model.qo; package com.xkrs.newpro.model.qo;
/** /**
* 新增检验项目接收类编号名称类型 * 新增检验项目接收类
*/ */
public class QcItemQoInsert { public class QcItemQoInsert {
@ -49,10 +49,6 @@ public class QcItemQoInsert {
@Override @Override
public String toString() { public String toString() {
return "QcItemQoInsert{" + return "QcItemQoInsert{" + "no='" + no + '\'' + ", name='" + name + '\'' + ", type='" + type + '\'' + '}';
"no='" + no + '\'' +
", name='" + name + '\'' +
", type='" + type + '\'' +
'}';
} }
} }

View File

@ -1,8 +1,18 @@
package com.xkrs.newpro.model.qo; package com.xkrs.newpro.model.qo;
/**
* 查询检验项目接收类
*/
public class QcItemQoQuery { public class QcItemQoQuery {
/**
* 编号
*/
private String no; private String no;
/**
* 名称
*/
private String name; private String name;
public QcItemQoQuery() { public QcItemQoQuery() {
@ -26,9 +36,6 @@ public class QcItemQoQuery {
@Override @Override
public String toString() { public String toString() {
return "QcItemQoQuery{" + return "QcItemQoQuery{" + "no='" + no + '\'' + ", name='" + name + '\'' + '}';
"no='" + no + '\'' +
", name='" + name + '\'' +
'}';
} }
} }

View File

@ -1,7 +1,7 @@
package com.xkrs.newpro.model.qo; package com.xkrs.newpro.model.qo;
/** /**
* 更新检验项目接收类根据id更新名称 * 更新检验项目接收类
*/ */
public class QcItemQoUpdate { public class QcItemQoUpdate {
@ -36,9 +36,6 @@ public class QcItemQoUpdate {
@Override @Override
public String toString() { public String toString() {
return "QcItemQoUpdate{" + return "QcItemQoUpdate{" + "id=" + id + ", name='" + name + '\'' + '}';
"id=" + id +
", name='" + name + '\'' +
'}';
} }
} }

View File

@ -0,0 +1,28 @@
package com.xkrs.newpro.model.qo;
/**
* 删除检验数据接收类
*/
public class QcSourceQoDelete {
/**
* 主键id
*/
private Integer id;
public QcSourceQoDelete() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Override
public String toString() {
return "QcSourceQoDelete{" + "id=" + id + '}';
}
}

View File

@ -1,7 +1,7 @@
package com.xkrs.newpro.model.qo; package com.xkrs.newpro.model.qo;
/** /**
* 新增检数据接收类 * 新增数据接收类
*/ */
public class QcSourceQoInsert { public class QcSourceQoInsert {
@ -101,14 +101,6 @@ public class QcSourceQoInsert {
@Override @Override
public String toString() { public String toString() {
return "QcSourceQoInsert{" + return "QcSourceQoInsert{" + "batchNo='" + batchNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", mouldNo='" + mouldNo + '\'' + ", varietyNo='" + varietyNo + '\'' + ", qcItemNo='" + qcItemNo + '\'' + ", qcValue='" + qcValue + '\'' + '}';
"batchNo='" + batchNo + '\'' +
", machineNo='" + machineNo + '\'' +
", materialNo='" + materialNo + '\'' +
", mouldNo='" + mouldNo + '\'' +
", varietyNo='" + varietyNo + '\'' +
", qcItemNo='" + qcItemNo + '\'' +
", qcValue='" + qcValue + '\'' +
'}';
} }
} }

View File

@ -1,11 +1,33 @@
package com.xkrs.newpro.model.qo; package com.xkrs.newpro.model.qo;
/**
* 查询检验数据接收类
*/
public class QcSourceQoQuery { public class QcSourceQoQuery {
/**
* 批次号
*/
private String batchNo; private String batchNo;
/**
* 机器号
*/
private String machineNo; private String machineNo;
/**
* 物料号
*/
private String materialNo; private String materialNo;
/**
* 模具号
*/
private String mouldNo; private String mouldNo;
/**
* 机种号
*/
private String varietyNo; private String varietyNo;
public QcSourceQoQuery() { public QcSourceQoQuery() {
@ -53,12 +75,6 @@ public class QcSourceQoQuery {
@Override @Override
public String toString() { public String toString() {
return "QcSourceQoQuery{" + return "QcSourceQoQuery{" + "batchNo='" + batchNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", mouldNo='" + mouldNo + '\'' + ", varietyNo='" + varietyNo + '\'' + '}';
"batchNo='" + batchNo + '\'' +
", machineNo='" + machineNo + '\'' +
", materialNo='" + materialNo + '\'' +
", mouldNo='" + mouldNo + '\'' +
", varietyNo='" + varietyNo + '\'' +
'}';
} }
} }

View File

@ -0,0 +1,28 @@
package com.xkrs.newpro.model.qo;
/**
* 删除检验规格接收类
*/
public class QcSpecQoDelete {
/**
* 主键id
*/
private Integer id;
public QcSpecQoDelete() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Override
public String toString() {
return "QcSpecQoDelete{" + "id=" + id + '}';
}
}

View File

@ -1,7 +1,7 @@
package com.xkrs.newpro.model.qo; package com.xkrs.newpro.model.qo;
/** /**
* 新增检规格接收类 * 新增规格接收类
*/ */
public class QcSpecQoInsert { public class QcSpecQoInsert {
@ -127,16 +127,6 @@ public class QcSpecQoInsert {
@Override @Override
public String toString() { public String toString() {
return "QcSpecQoInsert{" + return "QcSpecQoInsert{" + "varietyNo='" + varietyNo + '\'' + ", qcItemNo='" + qcItemNo + '\'' + ", max='" + max + '\'' + ", mean='" + mean + '\'' + ", min='" + min + '\'' + ", unit='" + unit + '\'' + ", method='" + method + '\'' + ", standard='" + standard + '\'' + ", remark='" + remark + '\'' + '}';
"varietyNo='" + varietyNo + '\'' +
", qcItemNo='" + qcItemNo + '\'' +
", max='" + max + '\'' +
", mean='" + mean + '\'' +
", min='" + min + '\'' +
", unit='" + unit + '\'' +
", method='" + method + '\'' +
", standard='" + standard + '\'' +
", remark='" + remark + '\'' +
'}';
} }
} }

View File

@ -1,8 +1,18 @@
package com.xkrs.newpro.model.qo; package com.xkrs.newpro.model.qo;
/**
* 查询检验规格接收类
*/
public class QcSpecQoQuery { public class QcSpecQoQuery {
/**
* 机种号
*/
private String varietyNo; private String varietyNo;
/**
* 检验项目编号
*/
private String qcItemNo; private String qcItemNo;
public QcSpecQoQuery() { public QcSpecQoQuery() {
@ -26,9 +36,6 @@ public class QcSpecQoQuery {
@Override @Override
public String toString() { public String toString() {
return "QcSpecQoQuery{" + return "QcSpecQoQuery{" + "varietyNo='" + varietyNo + '\'' + ", qcItemNo='" + qcItemNo + '\'' + '}';
"varietyNo='" + varietyNo + '\'' +
", qcItemNo='" + qcItemNo + '\'' +
'}';
} }
} }

View File

@ -1,7 +1,7 @@
package com.xkrs.newpro.model.qo; package com.xkrs.newpro.model.qo;
/** /**
* 更新检规格接收类 * 更新规格接收类
*/ */
public class QcSpecQoUpdate { public class QcSpecQoUpdate {
@ -114,15 +114,6 @@ public class QcSpecQoUpdate {
@Override @Override
public String toString() { public String toString() {
return "QcSpecQoUpdate{" + return "QcSpecQoUpdate{" + "id=" + id + ", max='" + max + '\'' + ", mean='" + mean + '\'' + ", min='" + min + '\'' + ", unit='" + unit + '\'' + ", method='" + method + '\'' + ", standard='" + standard + '\'' + ", remark='" + remark + '\'' + '}';
"id=" + id +
", max='" + max + '\'' +
", mean='" + mean + '\'' +
", min='" + min + '\'' +
", unit='" + unit + '\'' +
", method='" + method + '\'' +
", standard='" + standard + '\'' +
", remark='" + remark + '\'' +
'}';
} }
} }

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
package com.xkrs.newpro.service; 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.QcItemQoInsert;
import com.xkrs.newpro.model.qo.QcItemQoQuery; import com.xkrs.newpro.model.qo.QcItemQoQuery;
import com.xkrs.newpro.model.qo.QcItemQoUpdate; import com.xkrs.newpro.model.qo.QcItemQoUpdate;
@ -11,6 +12,11 @@ public interface QcItemService {
*/ */
String insertQcItem(QcItemQoInsert insertQo); String insertQcItem(QcItemQoInsert insertQo);
/**
* 删除检验项目
*/
String deleteQcItem(QcItemQoDelete deleteQo);
/** /**
* 更新检验项目名称 * 更新检验项目名称
*/ */

View File

@ -1,17 +1,23 @@
package com.xkrs.newpro.service; 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.QcSourceQoInsert;
import com.xkrs.newpro.model.qo.QcSourceQoQuery; import com.xkrs.newpro.model.qo.QcSourceQoQuery;
public interface QcSourceService { public interface QcSourceService {
/** /**
* 添加检数据 * 添加数据
*/ */
String insertQcSource(QcSourceQoInsert insertQo); String insertQcSource(QcSourceQoInsert insertQo);
/** /**
* 查询质检数据 * 删除检验数据
*/
String deleteQcSource(QcSourceQoDelete deleteQo);
/**
* 查询检验数据
*/ */
String queryQcSource(QcSourceQoQuery queryQo); String queryQcSource(QcSourceQoQuery queryQo);

View File

@ -1,5 +1,6 @@
package com.xkrs.newpro.service; 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.QcSpecQoInsert;
import com.xkrs.newpro.model.qo.QcSpecQoQuery; import com.xkrs.newpro.model.qo.QcSpecQoQuery;
import com.xkrs.newpro.model.qo.QcSpecQoUpdate; import com.xkrs.newpro.model.qo.QcSpecQoUpdate;
@ -7,17 +8,22 @@ import com.xkrs.newpro.model.qo.QcSpecQoUpdate;
public interface QcSpecService { public interface QcSpecService {
/** /**
* 添加检规格 * 添加规格
*/ */
String insertQcSpec(QcSpecQoInsert insertQo); String insertQcSpec(QcSpecQoInsert insertQo);
/** /**
* 更新质检规格 * 删除检验规格
*/
String deleteQcSpec(QcSpecQoDelete deleteQo);
/**
* 更新检验规格
*/ */
String updateQcSpec(QcSpecQoUpdate updateQo); String updateQcSpec(QcSpecQoUpdate updateQo);
/** /**
* 查询质检规格 * 查询规格
*/ */
String queryQcSpec(QcSpecQoQuery queryQo); String queryQcSpec(QcSpecQoQuery queryQo);

View File

@ -3,6 +3,7 @@ package com.xkrs.newpro.service.impl;
import com.xkrs.encapsulation.PromptMessageEnum; 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.QcItemQoDelete;
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.QcItemQoQuery;
import com.xkrs.newpro.model.qo.QcItemQoUpdate; import com.xkrs.newpro.model.qo.QcItemQoUpdate;
@ -32,16 +33,13 @@ public class QcItemServiceImpl implements QcItemService {
*/ */
@Override @Override
public String insertQcItem(QcItemQoInsert insertQo) { public String insertQcItem(QcItemQoInsert insertQo) {
String no = insertQo.getNo(); String no = insertQo.getNo();
String name = insertQo.getName(); String name = insertQo.getName();
String type = insertQo.getType(); String type = insertQo.getType();
Optional<QcItemEntity> entityByNo = qcItemDao.findByNo(no); Optional<QcItemEntity> entityByNo = qcItemDao.findByNo(no);
if (entityByNo.isPresent()) { if (entityByNo.isPresent()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "该检验项目已存在,请勿重复添加!", locale); return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "该检验项目已存在,请勿重复添加!", locale);
} }
QcItemEntity entity = new QcItemEntity(); QcItemEntity entity = new QcItemEntity();
entity.setCreateTime(LocalDateUtils.getCurrentSecond()); entity.setCreateTime(LocalDateUtils.getCurrentSecond());
entity.setUpdateTime(""); entity.setUpdateTime("");
@ -49,28 +47,37 @@ public class QcItemServiceImpl implements QcItemService {
entity.setName(LocalStringUtils.formatEmptyValue(name)); entity.setName(LocalStringUtils.formatEmptyValue(name));
entity.setType(LocalStringUtils.formatEmptyValue(type)); entity.setType(LocalStringUtils.formatEmptyValue(type));
qcItemDao.save(entity); qcItemDao.save(entity);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
} }
/**
* 删除检验项目
*/
@Override
public String deleteQcItem(QcItemQoDelete deleteQo) {
Integer id = deleteQo.getId();
Optional<QcItemEntity> entityById = qcItemDao.findById(id);
if (entityById.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验项目,请先添加检验项目!", locale);
}
qcItemDao.deleteById(id);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "删除成功!", locale);
}
/** /**
* 更新检验项目名称 * 更新检验项目名称
*/ */
@Transactional(rollbackOn = Exception.class) @Transactional(rollbackOn = Exception.class)
@Override @Override
public String updateQcItem(QcItemQoUpdate updateQo) { public String updateQcItem(QcItemQoUpdate updateQo) {
Integer id = updateQo.getId(); Integer id = updateQo.getId();
String name = updateQo.getName(); String name = updateQo.getName();
Optional<QcItemEntity> entityById = qcItemDao.findById(id); Optional<QcItemEntity> entityById = qcItemDao.findById(id);
if (entityById.isEmpty()) { if (entityById.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验项目,请先添加检验项目!", locale); return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验项目,请先添加检验项目!", locale);
} }
qcItemDao.updateNameById(id, LocalDateUtils.getCurrentSecond(), LocalStringUtils.formatEmptyValue(name)); qcItemDao.updateNameById(id, LocalDateUtils.getCurrentSecond(), LocalStringUtils.formatEmptyValue(name));
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "更新成功!", locale);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale);
} }
/** /**
@ -78,7 +85,6 @@ public class QcItemServiceImpl implements QcItemService {
*/ */
@Override @Override
public String queryQcItem(QcItemQoQuery queryQo) { public String queryQcItem(QcItemQoQuery queryQo) {
String no = queryQo.getNo(); String no = queryQo.getNo();
String name = queryQo.getName(); String name = queryQo.getName();
List<Map<String, Object>> resultList = qcItemDao.queryQcItem(LocalStringUtils.formatEmptyValue(no), LocalStringUtils.formatEmptyValue(name)); List<Map<String, Object>> resultList = qcItemDao.queryQcItem(LocalStringUtils.formatEmptyValue(no), LocalStringUtils.formatEmptyValue(name));

View File

@ -3,6 +3,7 @@ package com.xkrs.newpro.service.impl;
import com.xkrs.encapsulation.PromptMessageEnum; 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.QcSourceQoDelete;
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.model.qo.QcSourceQoQuery;
import com.xkrs.newpro.service.QcSourceService; import com.xkrs.newpro.service.QcSourceService;
@ -14,6 +15,7 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject; import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@ -25,7 +27,7 @@ public class QcSourceServiceImpl implements QcSourceService {
private QcSourceDao qcSourceDao; private QcSourceDao qcSourceDao;
/** /**
* 添加检数据 * 添加数据
*/ */
@Override @Override
public String insertQcSource(QcSourceQoInsert insertQo) { public String insertQcSource(QcSourceQoInsert insertQo) {
@ -53,7 +55,21 @@ public class QcSourceServiceImpl implements QcSourceService {
} }
/** /**
* 查询质检数据 * 删除检验数据
*/
@Override
public String deleteQcSource(QcSourceQoDelete deleteQo) {
Integer id = deleteQo.getId();
Optional<QcSourceEntity> entityById = qcSourceDao.findById(id);
if (entityById.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验数据,请先添加检验数据!", locale);
}
qcSourceDao.deleteById(id);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "删除成功!", locale);
}
/**
* 查询检验数据
*/ */
@Override @Override
public String queryQcSource(QcSourceQoQuery queryQo) { public String queryQcSource(QcSourceQoQuery queryQo) {
@ -65,7 +81,7 @@ public class QcSourceServiceImpl implements QcSourceService {
String varietyNo = queryQo.getVarietyNo(); String varietyNo = queryQo.getVarietyNo();
List<Map<String, Object>> resultList = qcSourceDao.queryQcSource(LocalStringUtils.formatEmptyValue(batchNo), LocalStringUtils.formatEmptyValue(machineNo), LocalStringUtils.formatEmptyValue(materialNo), LocalStringUtils.formatEmptyValue(mouldNo), LocalStringUtils.formatEmptyValue(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()) { if (resultList == null || resultList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该检验项目的信息!", locale); return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该检验数据的信息!", locale);
} }
return null; return null;

View File

@ -5,6 +5,7 @@ import com.xkrs.newpro.dao.QcItemDao;
import com.xkrs.newpro.dao.QcSpecDao; 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.QcSpecQoDelete;
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.QcSpecQoQuery;
import com.xkrs.newpro.model.qo.QcSpecQoUpdate; import com.xkrs.newpro.model.qo.QcSpecQoUpdate;
@ -32,7 +33,7 @@ public class QcSpecServiceImpl implements QcSpecService {
private QcSpecDao qcSpecDao; private QcSpecDao qcSpecDao;
/** /**
* 添加检规格 * 添加规格
*/ */
@Override @Override
public String insertQcSpec(QcSpecQoInsert insertQo) { public String insertQcSpec(QcSpecQoInsert insertQo) {
@ -49,7 +50,7 @@ public class QcSpecServiceImpl implements QcSpecService {
Optional<QcItemEntity> entityByNo = qcItemDao.findByNo(qcItemNo); Optional<QcItemEntity> entityByNo = qcItemDao.findByNo(qcItemNo);
if (entityByNo.isEmpty()) { if (entityByNo.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验项目,请先添加检验项目", locale); return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验规格,请先添加检验规格", locale);
} }
Optional<QcSpecEntity> entityByVarietyNoAndQcItemNo = qcSpecDao.findByVarietyNoAndQcItemNo(varietyNo, qcItemNo); Optional<QcSpecEntity> entityByVarietyNoAndQcItemNo = qcSpecDao.findByVarietyNoAndQcItemNo(varietyNo, qcItemNo);
@ -74,7 +75,21 @@ public class QcSpecServiceImpl implements QcSpecService {
} }
/** /**
* 更新质检规格 * 删除检验规格
*/
@Override
public String deleteQcSpec(QcSpecQoDelete deleteQo) {
Integer id = deleteQo.getId();
Optional<QcSpecEntity> entityById = qcSpecDao.findById(id);
if (entityById.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验规格,请先添加检验规格!", locale);
}
qcSpecDao.deleteById(id);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "删除成功!", locale);
}
/**
* 更新检验规格
*/ */
@Override @Override
public String updateQcSpec(QcSpecQoUpdate updateQo) { public String updateQcSpec(QcSpecQoUpdate updateQo) {
@ -99,7 +114,7 @@ public class QcSpecServiceImpl implements QcSpecService {
} }
/** /**
* 查询检规格 * 查询规格
*/ */
@Override @Override
public String queryQcSpec(QcSpecQoQuery queryQo) { public String queryQcSpec(QcSpecQoQuery queryQo) {