Compare commits

...

6 Commits

Author SHA1 Message Date
9c77ac0ccf 完善输入参数是否可空 2022-03-12 15:34:26 +08:00
a995d08f6f 格式化代码 2022-03-12 15:07:20 +08:00
7690f14c0d 为测量数据添加高低指标后缀 2022-03-12 14:43:52 +08:00
f11ae30b77 完善查询测量数据 2022-03-12 13:52:15 +08:00
b757013382 重构 2022-03-11 17:33:03 +08:00
1ddf362e05 重构 2022-03-11 17:30:56 +08:00
83 changed files with 270 additions and 2317 deletions

View File

@ -1,95 +0,0 @@
package com.xkrs.controller;
import com.xkrs.dao.DataDictDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.DataDict;
import com.xkrs.model.qo.DataDictQo;
import com.xkrs.model.qo.DataDictUpdateQo;
import com.xkrs.service.DataDictService;
import com.xkrs.util.DataDictQuery;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 10:54
*/
@RestController
public class DataDictController {
@Resource
private DataDictService dataDictService;
@Resource
private DataDictDao dataDictDao;
@Resource
private DataDictQuery dataDictQuery;
/**
* 添加字典变量数据
*
* @param dataDictQo
* @return
*/
@PostMapping("/insertDataDict")
public String insertDataDict(@RequestBody DataDictQo dataDictQo) {
return dataDictService.insertDataDict(dataDictQo);
}
/**
* 动态多条件查询字典信息
*
* @param inspectionItemName
* @param inspectionItemCode
* @return
*/
@GetMapping("/selectDataDict")
public String selectDataDict(@RequestParam("inspectionItemName") String inspectionItemName,
@RequestParam("inspectionItemCode") String inspectionItemCode) {
Locale locale = LocaleContextHolder.getLocale();
List<DataDict> dataDict = dataDictQuery.selectDataDict(inspectionItemName, inspectionItemCode);
if (dataDict == null || dataDict.size() == 0) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时还没有该型号类型的字典信息!", locale);
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, dataDict, locale);
}
/**
* 根据id查询字典信息用于数据回显方便进行修改操作
*
* @param id
* @return
*/
@GetMapping("/selectDataDictById")
public String selectDataDictById(@RequestParam("id") Integer id) {
Locale locale = LocaleContextHolder.getLocale();
Optional<DataDict> byId = dataDictDao.findById(id);
if (byId.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时还没有该型号类型的字典信息!", locale);
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, byId.get(), locale);
}
/**
* 根据id修改字典信息
*
* @param dataDictUpdateQo
* @return
*/
@PostMapping("/updateDict")
@Transactional(rollbackOn = Exception.class)
public String updateDict(@RequestBody DataDictUpdateQo dataDictUpdateQo) {
Locale locale = LocaleContextHolder.getLocale();
dataDictDao.updateDict(dataDictUpdateQo.getId(), dataDictUpdateQo.getInspectionItemName());
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale);
}
}

View File

@ -1,118 +0,0 @@
package com.xkrs.controller;
import com.xkrs.dao.DataSourceDao;
import com.xkrs.dao.PictureDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.DataSource;
import com.xkrs.model.qo.DataSourceQo;
import com.xkrs.service.DataSourceService;
import com.xkrs.util.DataSourceQuery;
import org.apache.http.util.TextUtils;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 17:05
*/
@RestController
public class DataSourceController {
@Resource
private DataSourceService dataSourceService;
@Resource
private DataSourceQuery dataSourceQuery;
@Resource
private DataSourceDao dataSourceDao;
@Resource
private PictureDao pictureDao;
/**
* 添加测量数据
*
* @param dataSourceQo
* @return
*/
@PostMapping("/insertDataSource")
public String insertDataSource(@RequestBody DataSourceQo dataSourceQo) {
return dataSourceService.insertDataSource(dataSourceQo);
}
/**
* 查询某一产品的测量信息
*
* @param lotNo 批次号
* @param machineNo 机器号
* @param materialNo 物料号
* @param modelNo 模具号
* @param machineTypeNo 机种号
* @param craftItemName 工艺项目名称
* @return
*/
@GetMapping("/selectDataSource")
public String selectDataSource(@RequestParam(required = false, value = "lotNo") String lotNo, @RequestParam(required = false, value = "machineNo") String machineNo, @RequestParam(required = false, value = "materialNo") String materialNo, @RequestParam(required = false, value = "modelNo") String modelNo, @RequestParam(required = false, value = "machineTypeNo") String machineTypeNo, @RequestParam(required = false, value = "craftItemName") String craftItemName) {
Locale locale = LocaleContextHolder.getLocale();
List<Map<String, String>> groupList = dataSourceDao.selectAllDataSourceGroup();
if (groupList == null || groupList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的测量信息!", locale);
}
List<List<DataSource>> dataSourceListList = new ArrayList<>();
for (Map<String, String> group : groupList) {
String groupNameLotNo = group.get("lotNo");
String groupNameMachineNo = group.get("machineNo");
String groupNameMaterialNo = group.get("materialNo");
String groupNameModelNo = group.get("modelNo");
String groupNameMachineTypeNo = group.get("machineTypeNo");
String groupNameCraftItemName = group.get("craftItemName");
if (!TextUtils.isEmpty(lotNo) && !lotNo.equals(groupNameLotNo)) {
continue;
}
if (!TextUtils.isEmpty(machineNo) && !machineNo.equals(groupNameMachineNo)) {
continue;
}
if (!TextUtils.isEmpty(materialNo) && !materialNo.equals(groupNameMaterialNo)) {
continue;
}
if (!TextUtils.isEmpty(modelNo) && !modelNo.equals(groupNameModelNo)) {
continue;
}
if (!TextUtils.isEmpty(machineTypeNo) && !machineTypeNo.equals(groupNameMachineTypeNo)) {
continue;
}
if (!TextUtils.isEmpty(craftItemName) && !craftItemName.equals(groupNameCraftItemName)) {
continue;
}
List<DataSource> dataSourceList = dataSourceDao.selectDataSource(groupNameLotNo, groupNameMachineNo, groupNameMaterialNo, groupNameModelNo, groupNameMachineTypeNo, groupNameCraftItemName);
if (dataSourceList != null && dataSourceList.size() > 0) {
dataSourceListList.add(dataSourceList);
}
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, dataSourceListList, locale);
}
/**
* 查询全部的测量信息
*
* @return
*/
@GetMapping("/selectAllSource")
public String selectAllSource() {
Locale locale = LocaleContextHolder.getLocale();
List<DataSource> dataSources = dataSourceDao.findAll();
if (dataSources.size() == 0) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的测量信息!", locale);
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, dataSources, locale);
}
}

View File

@ -1,61 +0,0 @@
package com.xkrs.controller;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.PictureEntity;
import com.xkrs.model.qo.DeletePictureQo;
import com.xkrs.model.qo.PictureQo;
import com.xkrs.service.PictureService;
import com.xkrs.util.PictureQuery;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 16:01
*/
@RestController
public class PictureController {
@Resource
private PictureService pictureService;
@Resource
private PictureQuery pictureQuery;
/**
* 上传图片
*/
@PostMapping("/insertPicture")
public String insertPicture(PictureQo pictureQo, @RequestParam("filePicture") MultipartFile filePicture) throws IOException {
return pictureService.insertPicture(pictureQo, filePicture);
}
// /**
// * 删除图片
// */
// @PostMapping("/deletePicture")
// public String deletePicture(@RequestBody DeletePictureQo deletePictureQo) {
// return pictureService.deletePicture(deletePictureQo.getPicturePath());
// }
// /**
// * 查询图片
// */
// @GetMapping("/selectPicture")
// public String selectPicture(@RequestParam(required = false, value = "lotNo") String lotNo, @RequestParam(required = false, value = "machineNo") String machineNo, @RequestParam(required = false, value = "materialNo") String materialNo, @RequestParam(required = false, value = "modelNo") String modelNo, @RequestParam(required = false, value = "machineTypeNo") String machineTypeNo, @RequestParam(required = false, value = "craftItemName") String craftItemName) {
// Locale locale = LocaleContextHolder.getLocale();
// List<PictureEntity> pictureEntities = pictureQuery.selectPicture(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName);
// if (pictureEntities.isEmpty()) {
// return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该图片!", locale);
// }
// return outputEncapsulationObject(PromptMessageEnum.SUCCESS, pictureEntities, locale);
// }
}

View File

@ -1,9 +1,9 @@
package com.xkrs.newpro.controller;
package com.xkrs.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 com.xkrs.model.qo.QcItemQoDelete;
import com.xkrs.model.qo.QcItemQoInsert;
import com.xkrs.model.qo.QcItemQoUpdate;
import com.xkrs.service.QcItemService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -1,8 +1,8 @@
package com.xkrs.newpro.controller;
package com.xkrs.controller;
import com.xkrs.newpro.model.qo.QcSourceQoDelete;
import com.xkrs.newpro.model.qo.QcSourceQoInsert;
import com.xkrs.newpro.service.QcSourceService;
import com.xkrs.model.qo.QcSourceQoDelete;
import com.xkrs.model.qo.QcSourceQoInsert;
import com.xkrs.service.QcSourceService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

View File

@ -1,9 +1,9 @@
package com.xkrs.newpro.controller;
package com.xkrs.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 com.xkrs.model.qo.QcSpecQoDelete;
import com.xkrs.model.qo.QcSpecQoInsert;
import com.xkrs.model.qo.QcSpecQoUpdate;
import com.xkrs.service.QcSpecService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -1,55 +0,0 @@
package com.xkrs.controller;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.SpecEntity;
import com.xkrs.model.qo.SpecQo;
import com.xkrs.service.SpecService;
import com.xkrs.util.SpecQuery;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Locale;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 16:01
*/
@RestController
public class SpecController {
@Resource
private SpecService specService;
@Resource
private SpecQuery specQuery;
/**
* 添加规格数据
*
* @param specQo
*/
@PostMapping("/insertSpec")
public String insertSpec(@RequestBody SpecQo specQo) {
return specService.insertSpec(specQo);
}
/**
* 查询规格信息
*/
@GetMapping("/selectSpec")
public String selectSpec(@RequestParam(required = false, value = "machineTypeNo") String machineTypeNo,
@RequestParam(required = false, value = "inspectionItemCode") String inspectionItemCode,
@RequestParam(required = false, value = "craftItemName") String craftItemName) {
Locale locale = LocaleContextHolder.getLocale();
List<SpecEntity> specEntities = specQuery.selectSpec(machineTypeNo, inspectionItemCode, craftItemName);
if (specEntities.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该规格信息!", locale);
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, specEntities, locale);
}
}

View File

@ -1,42 +0,0 @@
package com.xkrs.dao;
import com.xkrs.model.entity.DataDict;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
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.Optional;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 10:03
*/
@Component
public interface DataDictDao extends JpaRepository<DataDict,Long>, JpaSpecificationExecutor<DataDict> {
/**
* 通过质检项代码查询字典表的数据
* @param inspectionItemCode
* @return
*/
Optional<DataDict> findByInspectionItemCode(String inspectionItemCode);
/**
* 根据id查询字典信息
* @param id
* @return
*/
Optional<DataDict> findById(Integer id);
/**
* 根据id修改字典的信息
* @param id
* @param inspectionItemName
*/
@Modifying(clearAutomatically=true)
@Query(value = "UPDATE qc_inspection_item_dict SET inspection_item_name = ?2 where id = ?1",nativeQuery = true)
void updateDict(Integer id, String inspectionItemName);
}

View File

@ -1,25 +0,0 @@
package com.xkrs.dao;
import com.xkrs.model.entity.DataSource;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
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;
@Component
public interface DataSourceDao extends JpaRepository<DataSource, Long>, JpaSpecificationExecutor<DataSource> {
@Query(value = "SELECT lot_no AS lotNo, machine_no AS machineNo, material_no AS materialNo, model_no AS modelNo, machine_type_no AS machineTypeNo, craft_item_name AS craftItemName FROM qc_inspection_data_source GROUP BY lot_no, machine_no, material_no, model_no, machine_type_no, craft_item_name", nativeQuery = true)
List<Map<String, String>> selectAllDataSourceGroup();
@Query(value = "SELECT * FROM qc_inspection_data_source WHERE (lot_no IS NULL OR lot_no = ?1) AND (machine_no IS NULL OR machine_no = ?2) AND (material_no IS NULL OR material_no = ?3) AND (model_no IS NULL OR model_no = ?4) AND (machine_type_no IS NULL OR machine_type_no = ?5) AND (craft_item_name IS NULL OR craft_item_name = ?6)", nativeQuery = true)
List<DataSource> selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName);
@Modifying(clearAutomatically = true)
@Query(value = "UPDATE qc_inspection_data_source SET picture_path = ?7 WHERE lot_no = ?1 AND machine_no = ?2 AND material_no = ?3 AND model_no = ?4 AND machine_type_no = ?5 AND craft_item_name = ?6", nativeQuery = true)
void updatePicturePath(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName, String filePath);
}

View File

@ -1,33 +0,0 @@
package com.xkrs.dao;
import com.xkrs.model.entity.PictureEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Optional;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 16:41
*/
@Component
public interface PictureDao extends JpaRepository<PictureEntity, Long>, JpaSpecificationExecutor<PictureEntity> {
/**
* 查询图片信息
*
* @param lotNo 批次号
* @param machineNo 机器号
* @param materialNo 物料号
* @param modelNo 模具号
* @param machineTypeNo 机种号
* @param craftItemName 工艺项目名称
* @return
*/
@Query(value = "SELECT * FROM qc_inspection_picture WHERE (lot_no IS NULL OR lot_no = ?1) AND (machine_no IS NULL OR machine_no = ?2) AND (material_no IS NULL OR material_no = ?3) AND (model_no IS NULL OR model_no = ?4) AND (machine_type_no IS NULL OR machine_type_no = ?5) AND (craft_item_name IS NULL OR craft_item_name = ?6)", nativeQuery = true)
List<PictureEntity> selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName);
}

View File

@ -1,6 +1,6 @@
package com.xkrs.newpro.dao;
package com.xkrs.dao;
import com.xkrs.newpro.model.entity.QcItemEntity;
import com.xkrs.model.entity.QcItemEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;

View File

@ -1,6 +1,6 @@
package com.xkrs.newpro.dao;
package com.xkrs.dao;
import com.xkrs.newpro.model.entity.QcSourceEntity;
import com.xkrs.model.entity.QcSourceEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

View File

@ -1,6 +1,6 @@
package com.xkrs.newpro.dao;
package com.xkrs.dao;
import com.xkrs.newpro.model.entity.QcSpecEntity;
import com.xkrs.model.entity.QcSpecEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;

View File

@ -1,18 +0,0 @@
package com.xkrs.dao;
import com.xkrs.model.entity.SpecEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Optional;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 16:41
*/
@Component
public interface SpecDao extends JpaRepository<SpecEntity, Long>, JpaSpecificationExecutor<SpecEntity> {
}

View File

@ -4,8 +4,9 @@ import java.io.Serializable;
/**
* 输出信息对象
* @author tajochen
*
* @param <T>
* @author tajochen
*/
public class EncapsulationObejct<T> implements Serializable {
@ -50,10 +51,6 @@ public class EncapsulationObejct<T> implements Serializable {
@Override
public String toString() {
return "EncapsulationObejct{" +
"status=" + status +
", msg='" + msg + '\'' +
", data=" + data +
'}';
return "EncapsulationObejct{" + "status=" + status + ", msg='" + msg + '\'' + ", data=" + data + '}';
}
}

View File

@ -21,6 +21,7 @@ import java.util.Properties;
/**
* 输出信息封装
*
* @author tajochen
*/
@Component
@ -30,6 +31,7 @@ public class OutputEncapsulation {
/**
* 读取多国语言文件
*
* @return
*/
public static MessageSource messageSource() {
@ -50,6 +52,7 @@ public class OutputEncapsulation {
/**
* 封装输出数据
*
* @param promptMessageEnum
* @param obj
* @return
@ -58,12 +61,12 @@ public class OutputEncapsulation {
EncapsulationObejct encapsulationObejct = new EncapsulationObejct();
encapsulationObejct.setStatus(promptMessageEnum.getCode());
encapsulationObejct.setMsg(messageSource().getMessage(promptMessageEnum.getText(),null,locale));
encapsulationObejct.setMsg(messageSource().getMessage(promptMessageEnum.getText(), null, locale));
encapsulationObejct.setData(obj);
ObjectMapper objectMapper = new ObjectMapper();
// 忽略无法转换的对象
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS,false);
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
// 忽略json字符串中不识别的属性
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
// 解决jackson无法反序列化LocalDateTime的问题,引入jsr310标准
@ -82,15 +85,16 @@ public class OutputEncapsulation {
/**
* 输出请求值检验错误信息
*
* @param fieldErrors
* @return
*/
public static String outputEncapsulationErrorList(List<FieldError> fieldErrors, Locale locale){
public static String outputEncapsulationErrorList(List<FieldError> fieldErrors, Locale locale) {
List<String> errorMsg = new ArrayList<>();
for (FieldError fieldError : fieldErrors) {
String errMessage = fieldError.getDefaultMessage().subSequence(1,fieldError.getDefaultMessage().length()-1).toString();
errorMsg.add(messageSource().getMessage(errMessage,null,locale));
String errMessage = fieldError.getDefaultMessage().subSequence(1, fieldError.getDefaultMessage().length() - 1).toString();
errorMsg.add(messageSource().getMessage(errMessage, null, locale));
}
return outputEncapsulationObject(PromptMessageEnum.PARAM_ILLEGAL,errorMsg,locale);
return outputEncapsulationObject(PromptMessageEnum.PARAM_ILLEGAL, errorMsg, locale);
}
}

View File

@ -1,68 +0,0 @@
package com.xkrs.model.entity;
import javax.persistence.*;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 9:26
*/
@Entity
@Table(name = "qc_inspection_item_dict")
public class DataDict {
/**
* 索引
*/
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "qc_inspection_item_dict_seq_gen")
@SequenceGenerator(name = "qc_inspection_item_dict_seq_gen", sequenceName = "qc_inspection_item_dict_id_seq", allocationSize = 1)
private Integer id;
/**
* 质检项代码
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String inspectionItemCode;
/**
* 质检项名称
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String inspectionItemName;
public DataDict() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getInspectionItemCode() {
return inspectionItemCode;
}
public void setInspectionItemCode(String inspectionItemCode) {
this.inspectionItemCode = inspectionItemCode;
}
public String getInspectionItemName() {
return inspectionItemName;
}
public void setInspectionItemName(String inspectionItemName) {
this.inspectionItemName = inspectionItemName;
}
@Override
public String toString() {
return "DataDict{" +
"id=" + id +
", inspectionItemCode='" + inspectionItemCode + '\'' +
", inspectionItemName='" + inspectionItemName + '\'' +
'}';
}
}

View File

@ -1,173 +0,0 @@
package com.xkrs.model.entity;
import javax.persistence.*;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 14:08
*/
@Entity
@Table(name = "qc_inspection_data_source")
public class DataSource {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "qc_inspection_data_source_seq_gen")
@SequenceGenerator(name = "qc_inspection_data_source_seq_gen", sequenceName = "qc_inspection_data_source_id_seq", allocationSize = 1)
private Integer id;
/**
* 批次号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String lotNo;
/**
* 机器号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String machineNo;
/**
* 物料号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String materialNo;
/**
* 模具号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String modelNo;
/**
* 机种号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String machineTypeNo;
/**
* 检验项代码
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String inspectionItemCode;
/**
* 工艺项目名称
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String craftItemName;
/**
* 检验数值
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String inspectValue;
/**
* 图片
*/
@Column(length = 10240, columnDefinition = "varchar(10240)")
private String picturePath;
public DataSource() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getLotNo() {
return lotNo;
}
public void setLotNo(String lotNo) {
this.lotNo = lotNo;
}
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 getModelNo() {
return modelNo;
}
public void setModelNo(String modelNo) {
this.modelNo = modelNo;
}
public String getMachineTypeNo() {
return machineTypeNo;
}
public void setMachineTypeNo(String machineTypeNo) {
this.machineTypeNo = machineTypeNo;
}
public String getInspectionItemCode() {
return inspectionItemCode;
}
public void setInspectionItemCode(String inspectionItemCode) {
this.inspectionItemCode = inspectionItemCode;
}
public String getCraftItemName() {
return craftItemName;
}
public void setCraftItemName(String craftItemName) {
this.craftItemName = craftItemName;
}
public String getInspectValue() {
return inspectValue;
}
public void setInspectValue(String inspectValue) {
this.inspectValue = inspectValue;
}
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
@Override
public String toString() {
return "DataSource{" +
"id=" + id +
", lotNo='" + lotNo + '\'' +
", machineNo='" + machineNo + '\'' +
", materialNo='" + materialNo + '\'' +
", modelNo='" + modelNo + '\'' +
", machineTypeNo='" + machineTypeNo + '\'' +
", inspectionItemCode='" + inspectionItemCode + '\'' +
", craftItemName='" + craftItemName + '\'' +
", inspectValue='" + inspectValue + '\'' +
", picturePath='" + picturePath + '\'' +
'}';
}
}

View File

@ -143,16 +143,6 @@ public class FileEntity {
@Override
public String toString() {
return "FileEntity{" +
"id=" + id +
", lotNo='" + lotNo + '\'' +
", machineNo='" + machineNo + '\'' +
", materialNo='" + materialNo + '\'' +
", modelNo='" + modelNo + '\'' +
", machineTypeNo='" + machineTypeNo + '\'' +
", craftItemName='" + craftItemName + '\'' +
", fileUploadPath='" + fileUploadPath + '\'' +
", fileDownloadPath='" + fileDownloadPath + '\'' +
'}';
return "FileEntity{" + "id=" + id + ", lotNo='" + lotNo + '\'' + ", machineNo='" + machineNo + '\'' + ", materialNo='" + materialNo + '\'' + ", modelNo='" + modelNo + '\'' + ", machineTypeNo='" + machineTypeNo + '\'' + ", craftItemName='" + craftItemName + '\'' + ", fileUploadPath='" + fileUploadPath + '\'' + ", fileDownloadPath='" + fileDownloadPath + '\'' + '}';
}
}

View File

@ -1,138 +0,0 @@
package com.xkrs.model.entity;
import javax.persistence.*;
@Entity
@Table(name = "qc_inspection_picture")
public class PictureEntity {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "qc_inspection_picture_seq_gen")
@SequenceGenerator(name = "qc_inspection_picture_seq_gen", sequenceName = "qc_inspection_picture_id_seq", allocationSize = 1)
private Integer id;
/**
* 批次号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String lotNo;
/**
* 机器号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String machineNo;
/**
* 物料号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String materialNo;
/**
* 模具号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String modelNo;
/**
* 机种号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String machineTypeNo;
/**
* 工艺项目名称
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String craftItemName;
/**
* 图片路径
*/
@Column(length = 2048, columnDefinition = "varchar(2048)")
private String picturePath;
public PictureEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getLotNo() {
return lotNo;
}
public void setLotNo(String lotNo) {
this.lotNo = lotNo;
}
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 getModelNo() {
return modelNo;
}
public void setModelNo(String modelNo) {
this.modelNo = modelNo;
}
public String getMachineTypeNo() {
return machineTypeNo;
}
public void setMachineTypeNo(String machineTypeNo) {
this.machineTypeNo = machineTypeNo;
}
public String getCraftItemName() {
return craftItemName;
}
public void setCraftItemName(String craftItemName) {
this.craftItemName = craftItemName;
}
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
@Override
public String toString() {
return "PictureEntity{" +
"id=" + id +
", lotNo='" + lotNo + '\'' +
", machineNo='" + machineNo + '\'' +
", materialNo='" + materialNo + '\'' +
", modelNo='" + modelNo + '\'' +
", machineTypeNo='" + machineTypeNo + '\'' +
", craftItemName='" + craftItemName + '\'' +
", picturePath='" + picturePath + '\'' +
'}';
}
}

View File

@ -1,4 +1,4 @@
package com.xkrs.newpro.model.entity;
package com.xkrs.model.entity;
import javax.persistence.*;

View File

@ -1,4 +1,4 @@
package com.xkrs.newpro.model.entity;
package com.xkrs.model.entity;
import javax.persistence.*;

View File

@ -1,4 +1,4 @@
package com.xkrs.newpro.model.entity;
package com.xkrs.model.entity;
import javax.persistence.*;

View File

@ -1,183 +0,0 @@
package com.xkrs.model.entity;
import javax.persistence.*;
@Entity
@Table(name = "qc_inspection_spec")
public class SpecEntity {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "qc_inspection_spec_seq_gen")
@SequenceGenerator(name = "qc_inspection_spec_seq_gen", sequenceName = "qc_inspection_spec_id_seq", allocationSize = 1)
private Integer id;
/**
* 机种号
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String machineTypeNo;
/**
* 检验项代码
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String inspectionItemCode;
/**
* 工艺项目名称
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String craftItemName;
/**
* 最大值
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String max;
/**
* 平均值
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String mean;
/**
* 最小值
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String min;
/**
* 单位
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String unit;
/**
* 检验方法
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String inspectionMethod;
/**
* 检验标准
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String inspectionStandard;
/**
* 备注
*/
@Column(length = 85, columnDefinition = "varchar(85)")
private String remark;
public SpecEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getMachineTypeNo() {
return machineTypeNo;
}
public void setMachineTypeNo(String machineTypeNo) {
this.machineTypeNo = machineTypeNo;
}
public String getInspectionItemCode() {
return inspectionItemCode;
}
public void setInspectionItemCode(String inspectionItemCode) {
this.inspectionItemCode = inspectionItemCode;
}
public String getCraftItemName() {
return craftItemName;
}
public void setCraftItemName(String craftItemName) {
this.craftItemName = craftItemName;
}
public String getMax() {
return max;
}
public void setMax(String max) {
this.max = max;
}
public String getMean() {
return mean;
}
public void setMean(String mean) {
this.mean = mean;
}
public String getMin() {
return min;
}
public void setMin(String min) {
this.min = min;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getInspectionMethod() {
return inspectionMethod;
}
public void setInspectionMethod(String inspectionMethod) {
this.inspectionMethod = inspectionMethod;
}
public String getInspectionStandard() {
return inspectionStandard;
}
public void setInspectionStandard(String inspectionStandard) {
this.inspectionStandard = inspectionStandard;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "SpecEntity{" +
"id=" + id +
", machineTypeNo='" + machineTypeNo + '\'' +
", inspectionItemCode='" + inspectionItemCode + '\'' +
", craftItemName='" + craftItemName + '\'' +
", max='" + max + '\'' +
", mean='" + mean + '\'' +
", min='" + min + '\'' +
", unit='" + unit + '\'' +
", inspectionMethod='" + inspectionMethod + '\'' +
", inspectionStandard='" + inspectionStandard + '\'' +
", remark='" + remark + '\'' +
'}';
}
}

View File

@ -1,43 +0,0 @@
package com.xkrs.model.qo;
import com.xkrs.model.validation.DataDictQoInsert;
import javax.validation.constraints.NotBlank;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 10:14
*/
public class DataDictQo {
/**
* 质检项代码
*/
@NotBlank(message = "{DataDict.inspectionItemCode.blank}", groups = {DataDictQoInsert.class})
private String inspectionItemCode;
/**
* 质检项名称
*/
@NotBlank(message = "{DataDict.inspectionItemName.blank}", groups = {DataDictQoInsert.class})
private String inspectionItemName;
public DataDictQo() {
}
public String getInspectionItemCode() {
return inspectionItemCode;
}
public void setInspectionItemCode(String inspectionItemCode) {
this.inspectionItemCode = inspectionItemCode;
}
public String getInspectionItemName() {
return inspectionItemName;
}
public void setInspectionItemName(String inspectionItemName) {
this.inspectionItemName = inspectionItemName;
}
}

View File

@ -1,40 +0,0 @@
package com.xkrs.model.qo;
import com.xkrs.model.validation.DataDictUpdateQoUpdate;
import javax.validation.constraints.NotBlank;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 11:23
*/
public class DataDictUpdateQo {
@NotBlank(message = "{DataDict.id.blank}", groups = {DataDictUpdateQoUpdate.class})
private Integer id;
/**
* 质检项名称
*/
@NotBlank(message = "{DataDict.inspectionItemName.blank}", groups = {DataDictUpdateQoUpdate.class})
private String inspectionItemName;
public DataDictUpdateQo() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getInspectionItemName() {
return inspectionItemName;
}
public void setInspectionItemName(String inspectionItemName) {
this.inspectionItemName = inspectionItemName;
}
}

View File

@ -1,128 +0,0 @@
package com.xkrs.model.qo;
import com.xkrs.model.validation.DataSourceQoInsert;
import javax.validation.constraints.NotBlank;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 16:37
*/
public class DataSourceQo {
/**
* 批次号
*/
@NotBlank(message = "{DataSource.lotNo.blank}", groups = {DataSourceQoInsert.class})
private String lotNo;
/**
* 机器号
*/
@NotBlank(message = "{DataSource.machineNo.blank}", groups = {DataSourceQoInsert.class})
private String machineNo;
/**
* 物料号
*/
@NotBlank(message = "{DataSource.materialNo.blank}", groups = {DataSourceQoInsert.class})
private String materialNo;
/**
* 模具号
*/
@NotBlank(message = "{DataSource.modelNo.blank}", groups = {DataSourceQoInsert.class})
private String modelNo;
/**
* 机种号
*/
@NotBlank(message = "{DataSource.machineTypeNo.blank}", groups = {DataSourceQoInsert.class})
private String machineTypeNo;
/**
* 检验项代码
*/
@NotBlank(message = "{DataSource.inspectionItemCode.blank}", groups = {DataSourceQoInsert.class})
private String inspectionItemCode;
/**
* 工艺项目名称
*/
@NotBlank(message = "{DataSource.craftItemName.blank}", groups = {DataSourceQoInsert.class})
private String craftItemName;
/**
* 检验数值
*/
@NotBlank(message = "{DataSource.inspectValue.blank}", groups = {DataSourceQoInsert.class})
private String inspectValue;
public DataSourceQo() {
}
public String getLotNo() {
return lotNo;
}
public void setLotNo(String lotNo) {
this.lotNo = lotNo;
}
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 getModelNo() {
return modelNo;
}
public void setModelNo(String modelNo) {
this.modelNo = modelNo;
}
public String getMachineTypeNo() {
return machineTypeNo;
}
public void setMachineTypeNo(String machineTypeNo) {
this.machineTypeNo = machineTypeNo;
}
public String getInspectionItemCode() {
return inspectionItemCode;
}
public void setInspectionItemCode(String inspectionItemCode) {
this.inspectionItemCode = inspectionItemCode;
}
public String getCraftItemName() {
return craftItemName;
}
public void setCraftItemName(String craftItemName) {
this.craftItemName = craftItemName;
}
public String getInspectValue() {
return inspectValue;
}
public void setInspectValue(String inspectValue) {
this.inspectValue = inspectValue;
}
}

View File

@ -1,30 +0,0 @@
package com.xkrs.model.qo;
import com.xkrs.model.validation.DeletePictureQoDelete;
import javax.validation.constraints.NotBlank;
public class DeletePictureQo {
/**
* 图片路径
*/
@NotBlank(message = "{PictureEntity.picturePath.blank}", groups = {DeletePictureQoDelete.class})
private String picturePath;
public DeletePictureQo() {
}
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
@Override
public String toString() {
return "DeletePictureQo{" + "picturePath='" + picturePath + '\'' + '}';
}
}

View File

@ -1,6 +1,6 @@
package com.xkrs.model.qo;
import com.xkrs.model.validation.FileQoInsert;
import com.xkrs.model.va.FileQoInsert;
import javax.validation.constraints.NotBlank;

View File

@ -1,95 +0,0 @@
package com.xkrs.model.qo;
import com.xkrs.model.validation.PictureQoInsert;
import javax.validation.constraints.NotBlank;
public class PictureQo {
/**
* 批次号
*/
@NotBlank(message = "{PictureEntity.lotNo.blank}", groups = {PictureQoInsert.class})
private String lotNo;
/**
* 机器号
*/
@NotBlank(message = "{PictureEntity.machineNo.blank}", groups = {PictureQoInsert.class})
private String machineNo;
/**
* 物料号
*/
@NotBlank(message = "{PictureEntity.materialNo.blank}", groups = {PictureQoInsert.class})
private String materialNo;
/**
* 模具号
*/
@NotBlank(message = "{PictureEntity.modelNo.blank}", groups = {PictureQoInsert.class})
private String modelNo;
/**
* 机种号
*/
@NotBlank(message = "{PictureEntity.machineTypeNo.blank}", groups = {PictureQoInsert.class})
private String machineTypeNo;
/**
* 工艺项目名称
*/
@NotBlank(message = "{PictureEntity.craftItemName.blank}", groups = {PictureQoInsert.class})
private String craftItemName;
public PictureQo() {
}
public String getLotNo() {
return lotNo;
}
public void setLotNo(String lotNo) {
this.lotNo = lotNo;
}
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 getModelNo() {
return modelNo;
}
public void setModelNo(String modelNo) {
this.modelNo = modelNo;
}
public String getMachineTypeNo() {
return machineTypeNo;
}
public void setMachineTypeNo(String machineTypeNo) {
this.machineTypeNo = machineTypeNo;
}
public String getCraftItemName() {
return craftItemName;
}
public void setCraftItemName(String craftItemName) {
this.craftItemName = craftItemName;
}
}

View File

@ -1,4 +1,8 @@
package com.xkrs.newpro.model.qo;
package com.xkrs.model.qo;
import com.xkrs.model.va.QcItemQoDeleteVa;
import javax.validation.constraints.NotBlank;
/**
* 删除检验项目接收类
@ -8,6 +12,7 @@ public class QcItemQoDelete {
/**
* 主键id
*/
@NotBlank(message = "{QcItemEntity.id.blank}", groups = {QcItemQoDeleteVa.class})
private Integer id;
public QcItemQoDelete() {

View File

@ -1,4 +1,8 @@
package com.xkrs.newpro.model.qo;
package com.xkrs.model.qo;
import com.xkrs.model.va.QcItemQoInsertVa;
import javax.validation.constraints.NotBlank;
/**
* 新增检验项目接收类
@ -8,16 +12,19 @@ public class QcItemQoInsert {
/**
* 编号
*/
@NotBlank(message = "{QcItemEntity.no.blank}", groups = {QcItemQoInsertVa.class})
private String no;
/**
* 名称
*/
@NotBlank(message = "{QcItemEntity.name.blank}", groups = {QcItemQoInsertVa.class})
private String name;
/**
* 类型
*/
@NotBlank(message = "{QcItemEntity.type.blank}", groups = {QcItemQoInsertVa.class})
private String type;
public QcItemQoInsert() {

View File

@ -1,4 +1,8 @@
package com.xkrs.newpro.model.qo;
package com.xkrs.model.qo;
import com.xkrs.model.va.QcItemQoUpdateVa;
import javax.validation.constraints.NotBlank;
/**
* 更新检验项目接收类
@ -8,11 +12,13 @@ public class QcItemQoUpdate {
/**
* 主键id
*/
@NotBlank(message = "{QcItemEntity.id.blank}", groups = {QcItemQoUpdateVa.class})
private Integer id;
/**
* 名称
*/
@NotBlank(message = "{QcItemEntity.name.blank}", groups = {QcItemQoUpdateVa.class})
private String name;
public QcItemQoUpdate() {

View File

@ -1,4 +1,8 @@
package com.xkrs.newpro.model.qo;
package com.xkrs.model.qo;
import com.xkrs.model.va.QcSourceQoDeleteVa;
import javax.validation.constraints.NotBlank;
/**
* 删除检验数据接收类
@ -8,6 +12,7 @@ public class QcSourceQoDelete {
/**
* 主键id
*/
@NotBlank(message = "{QcSourceEntity.id.blank}", groups = {QcSourceQoDeleteVa.class})
private Integer id;
public QcSourceQoDelete() {

View File

@ -1,4 +1,8 @@
package com.xkrs.newpro.model.qo;
package com.xkrs.model.qo;
import com.xkrs.model.va.QcSourceQoInsertVa;
import javax.validation.constraints.NotBlank;
/**
* 新增检验数据接收类
@ -8,31 +12,37 @@ public class QcSourceQoInsert {
/**
* 批次号
*/
@NotBlank(message = "{QcSourceEntity.batchNo.blank}", groups = {QcSourceQoInsertVa.class})
private String batchNo;
/**
* 机器号
*/
@NotBlank(message = "{QcSourceEntity.machineNo.blank}", groups = {QcSourceQoInsertVa.class})
private String machineNo;
/**
* 物料号
*/
@NotBlank(message = "{QcSourceEntity.materialNo.blank}", groups = {QcSourceQoInsertVa.class})
private String materialNo;
/**
* 模具号
*/
@NotBlank(message = "{QcSourceEntity.mouldNo.blank}", groups = {QcSourceQoInsertVa.class})
private String mouldNo;
/**
* 机种号
*/
@NotBlank(message = "{QcSourceEntity.varietyNo.blank}", groups = {QcSourceQoInsertVa.class})
private String varietyNo;
/**
* 检验项目编号
*/
@NotBlank(message = "{QcSourceEntity.qcItemNo.blank}", groups = {QcSourceQoInsertVa.class})
private String qcItemNo;
/**

View File

@ -1,4 +1,8 @@
package com.xkrs.newpro.model.qo;
package com.xkrs.model.qo;
import com.xkrs.model.va.QcSpecQoDeleteVa;
import javax.validation.constraints.NotBlank;
/**
* 删除检验规格接收类
@ -8,6 +12,7 @@ public class QcSpecQoDelete {
/**
* 主键id
*/
@NotBlank(message = "{QcSpecEntity.id.blank}", groups = {QcSpecQoDeleteVa.class})
private Integer id;
public QcSpecQoDelete() {

View File

@ -1,4 +1,8 @@
package com.xkrs.newpro.model.qo;
package com.xkrs.model.qo;
import com.xkrs.model.va.QcSpecQoInsertVa;
import javax.validation.constraints.NotBlank;
/**
* 新增检验规格接收类
@ -8,11 +12,13 @@ public class QcSpecQoInsert {
/**
* 机种号
*/
@NotBlank(message = "{QcSpecEntity.varietyNo.blank}", groups = {QcSpecQoInsertVa.class})
private String varietyNo;
/**
* 检验项目编号
*/
@NotBlank(message = "{QcSpecEntity.qcItemNo.blank}", groups = {QcSpecQoInsertVa.class})
private String qcItemNo;
/**

View File

@ -1,4 +1,8 @@
package com.xkrs.newpro.model.qo;
package com.xkrs.model.qo;
import com.xkrs.model.va.QcSpecQoUpdateVa;
import javax.validation.constraints.NotBlank;
/**
* 更新检验规格接收类
@ -8,6 +12,7 @@ public class QcSpecQoUpdate {
/**
* 主键id
*/
@NotBlank(message = "{QcSpecEntity.id.blank}", groups = {QcSpecQoUpdateVa.class})
private Integer id;
/**

View File

@ -1,150 +0,0 @@
package com.xkrs.model.qo;
import com.xkrs.model.validation.SpecQoInsert;
import javax.validation.constraints.NotBlank;
public class SpecQo {
/**
* 机种号
*/
@NotBlank(message = "{SpecEntity.machineTypeNo.blank}", groups = {SpecQoInsert.class})
private String machineTypeNo;
/**
* 检验项代码
*/
@NotBlank(message = "{SpecEntity.inspectionItemCode.blank}", groups = {SpecQoInsert.class})
private String inspectionItemCode;
/**
* 工艺项目名称
*/
@NotBlank(message = "{SpecEntity.craftItemName.blank}", groups = {SpecQoInsert.class})
private String craftItemName;
/**
* 最大值
*/
@NotBlank(message = "{SpecEntity.max.blank}", groups = {SpecQoInsert.class})
private String max;
/**
* 平均值
*/
@NotBlank(message = "{SpecEntity.mean.blank}", groups = {SpecQoInsert.class})
private String mean;
/**
* 最小值
*/
@NotBlank(message = "{SpecEntity.min.blank}", groups = {SpecQoInsert.class})
private String min;
/**
* 单位
*/
@NotBlank(message = "{SpecEntity.unit.blank}", groups = {SpecQoInsert.class})
private String unit;
/**
* 检验方法
*/
@NotBlank(message = "{SpecEntity.inspectionMethod.blank}", groups = {SpecQoInsert.class})
private String inspectionMethod;
/**
* 检验标准
*/
@NotBlank(message = "{SpecEntity.inspectionStandard.blank}", groups = {SpecQoInsert.class})
private String inspectionStandard;
/**
* 备注
*/
private String remark;
public SpecQo() {
}
public String getMachineTypeNo() {
return machineTypeNo;
}
public void setMachineTypeNo(String machineTypeNo) {
this.machineTypeNo = machineTypeNo;
}
public String getInspectionItemCode() {
return inspectionItemCode;
}
public void setInspectionItemCode(String inspectionItemCode) {
this.inspectionItemCode = inspectionItemCode;
}
public String getCraftItemName() {
return craftItemName;
}
public void setCraftItemName(String craftItemName) {
this.craftItemName = craftItemName;
}
public String getMax() {
return max;
}
public void setMax(String max) {
this.max = max;
}
public String getMean() {
return mean;
}
public void setMean(String mean) {
this.mean = mean;
}
public String getMin() {
return min;
}
public void setMin(String min) {
this.min = min;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getInspectionMethod() {
return inspectionMethod;
}
public void setInspectionMethod(String inspectionMethod) {
this.inspectionMethod = inspectionMethod;
}
public String getInspectionStandard() {
return inspectionStandard;
}
public void setInspectionStandard(String inspectionStandard) {
this.inspectionStandard = inspectionStandard;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@ -1,4 +1,4 @@
package com.xkrs.model.validation;
package com.xkrs.model.va;
/**
* @Author: XinYi Song

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,8 +0,0 @@
package com.xkrs.model.validation;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 10:22
*/
public interface DataDictQoInsert {
}

View File

@ -1,8 +0,0 @@
package com.xkrs.model.validation;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 11:23
*/
public interface DataDictUpdateQoUpdate {
}

View File

@ -1,8 +0,0 @@
package com.xkrs.model.validation;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 16:39
*/
public interface DataSourceQoInsert {
}

View File

@ -1,4 +0,0 @@
package com.xkrs.model.validation;
public interface DeletePictureQoDelete {
}

View File

@ -1,8 +0,0 @@
package com.xkrs.model.validation;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 16:21
*/
public interface FileUpdateQoUpdate {
}

View File

@ -1,8 +0,0 @@
package com.xkrs.model.validation;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 15:26
*/
public interface PictureQoInsert {
}

View File

@ -1,8 +0,0 @@
package com.xkrs.model.validation;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 10:22
*/
public interface SpecQoInsert {
}

View File

@ -1,106 +0,0 @@
package com.xkrs.model.vo;
import java.util.List;
public class DataSourceVo {
private String lotNo;
private String machineNo;
private String materialNo;
private String modelNo;
private String machineTypeNo;
private String inspectionItemCode;
private String craftItemName;
private String inspectValue;
private List<String> picturePath;
public DataSourceVo() {
}
public String getLotNo() {
return lotNo;
}
public void setLotNo(String lotNo) {
this.lotNo = lotNo;
}
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 getModelNo() {
return modelNo;
}
public void setModelNo(String modelNo) {
this.modelNo = modelNo;
}
public String getMachineTypeNo() {
return machineTypeNo;
}
public void setMachineTypeNo(String machineTypeNo) {
this.machineTypeNo = machineTypeNo;
}
public String getInspectionItemCode() {
return inspectionItemCode;
}
public void setInspectionItemCode(String inspectionItemCode) {
this.inspectionItemCode = inspectionItemCode;
}
public String getCraftItemName() {
return craftItemName;
}
public void setCraftItemName(String craftItemName) {
this.craftItemName = craftItemName;
}
public String getInspectValue() {
return inspectValue;
}
public void setInspectValue(String inspectValue) {
this.inspectValue = inspectValue;
}
public List<String> getPicturePath() {
return picturePath;
}
public void setPicturePath(List<String> picturePath) {
this.picturePath = picturePath;
}
@Override
public String toString() {
return "DataSourceVo{" +
"lotNo='" + lotNo + '\'' +
", machineNo='" + machineNo + '\'' +
", materialNo='" + materialNo + '\'' +
", modelNo='" + modelNo + '\'' +
", machineTypeNo='" + machineTypeNo + '\'' +
", inspectionItemCode='" + inspectionItemCode + '\'' +
", craftItemName='" + craftItemName + '\'' +
", inspectValue='" + inspectValue + '\'' +
", picturePath=" + picturePath +
'}';
}
}

View File

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

View File

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

View File

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

View File

@ -1,18 +0,0 @@
package com.xkrs.service;
import com.xkrs.model.entity.DataDict;
import com.xkrs.model.qo.DataDictQo;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 10:10
*/
public interface DataDictService {
/**
* 添加字典数据
* @param dataDictQo
* @return
*/
String insertDataDict(DataDictQo dataDictQo);
}

View File

@ -1,17 +0,0 @@
package com.xkrs.service;
import com.xkrs.model.qo.DataSourceQo;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 16:42
*/
public interface DataSourceService {
/**
* 添加测量数据
* @param dataSourceQo
* @return
*/
String insertDataSource(DataSourceQo dataSourceQo);
}

View File

@ -4,7 +4,6 @@ import com.xkrs.model.qo.FileQo;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
@ -15,13 +14,15 @@ public interface FileService {
/**
* 添加模板信息
*
* @param fileQo
* @return
*/
String insertFileExcel(FileQo fileQo,MultipartFile fileExcel) throws IOException;
String insertFileExcel(FileQo fileQo, MultipartFile fileExcel) throws IOException;
/**
* 导出excel
*
* @param fileQo
* @return
*/

View File

@ -1,24 +0,0 @@
package com.xkrs.service;
import com.xkrs.model.qo.PictureQo;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 15:24
*/
public interface PictureService {
/**
* 添加图片
*/
String insertPicture(PictureQo pictureQo, MultipartFile pictureFile) throws IOException;
/**
* 删除图片
*/
String deletePicture(String picturePath);
}

View File

@ -1,8 +1,8 @@
package com.xkrs.newpro.service;
package com.xkrs.service;
import com.xkrs.newpro.model.qo.QcItemQoDelete;
import com.xkrs.newpro.model.qo.QcItemQoInsert;
import com.xkrs.newpro.model.qo.QcItemQoUpdate;
import com.xkrs.model.qo.QcItemQoDelete;
import com.xkrs.model.qo.QcItemQoInsert;
import com.xkrs.model.qo.QcItemQoUpdate;
public interface QcItemService {

View File

@ -1,7 +1,7 @@
package com.xkrs.newpro.service;
package com.xkrs.service;
import com.xkrs.newpro.model.qo.QcSourceQoDelete;
import com.xkrs.newpro.model.qo.QcSourceQoInsert;
import com.xkrs.model.qo.QcSourceQoDelete;
import com.xkrs.model.qo.QcSourceQoInsert;
import org.springframework.web.multipart.MultipartFile;
public interface QcSourceService {

View File

@ -1,8 +1,8 @@
package com.xkrs.newpro.service;
package com.xkrs.service;
import com.xkrs.newpro.model.qo.QcSpecQoDelete;
import com.xkrs.newpro.model.qo.QcSpecQoInsert;
import com.xkrs.newpro.model.qo.QcSpecQoUpdate;
import com.xkrs.model.qo.QcSpecQoDelete;
import com.xkrs.model.qo.QcSpecQoInsert;
import com.xkrs.model.qo.QcSpecQoUpdate;
public interface QcSpecService {

View File

@ -1,19 +0,0 @@
package com.xkrs.service;
import com.xkrs.model.qo.SpecQo;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 15:24
*/
public interface SpecService {
/**
* 添加规格数据
*
* @param specQo
* @return
*/
String insertSpec(SpecQo specQo);
}

View File

@ -1,46 +0,0 @@
package com.xkrs.service.impl;
import com.xkrs.dao.DataDictDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.DataDict;
import com.xkrs.model.qo.DataDictQo;
import com.xkrs.service.DataDictService;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Locale;
import java.util.Optional;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 10:28
*/
@Service
public class DataDictServiceImpl implements DataDictService {
@Resource
private DataDictDao dataDictDao;
/**
* 添加字典数据
*
* @param dataDictQo
* @return
*/
@Override
public String insertDataDict(DataDictQo dataDictQo) {
Locale locale = LocaleContextHolder.getLocale();
Optional<DataDict> byInspectionItemCode = dataDictDao.findByInspectionItemCode(dataDictQo.getInspectionItemCode());
if (byInspectionItemCode.isPresent()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "该产品变量已存在,请勿重复添加!", locale);
}
DataDict dataDict = new DataDict();
dataDict.setInspectionItemName(dataDictQo.getInspectionItemName());
dataDict.setInspectionItemCode(dataDictQo.getInspectionItemCode());
dataDictDao.save(dataDict);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
}
}

View File

@ -1,71 +0,0 @@
package com.xkrs.service.impl;
import com.xkrs.dao.DataDictDao;
import com.xkrs.dao.DataSourceDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.DataDict;
import com.xkrs.model.entity.DataSource;
import com.xkrs.model.qo.DataSourceQo;
import com.xkrs.service.DataSourceService;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Locale;
import java.util.Optional;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 16:43
*/
@Service
public class DataSourceServiceImpl implements DataSourceService {
@Resource
private DataSourceDao dataSourceDao;
@Resource
private DataDictDao dataDictDao;
/**
* 添加测量数据
*
* @param dataSourceQo
* @return
*/
@Override
public String insertDataSource(DataSourceQo dataSourceQo) {
Locale locale = LocaleContextHolder.getLocale();
Optional<DataDict> byInspectionItemCode = dataDictDao.findByInspectionItemCode(dataSourceQo.getInspectionItemCode());
if (byInspectionItemCode.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该字典类型!", locale);
}
DataSource dataSource = new DataSource();
initDataSource(dataSource);
dataSource.setLotNo(dataSourceQo.getLotNo());
dataSource.setMachineNo(dataSourceQo.getMachineNo());
dataSource.setMaterialNo(dataSourceQo.getMaterialNo());
dataSource.setModelNo(dataSourceQo.getModelNo());
dataSource.setMachineTypeNo(dataSourceQo.getMachineTypeNo());
dataSource.setCraftItemName(dataSourceQo.getCraftItemName());
dataSource.setInspectionItemCode(dataSourceQo.getInspectionItemCode());
dataSource.setInspectValue(dataSourceQo.getInspectValue());
dataSourceDao.save(dataSource);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
}
private void initDataSource(DataSource dataSource) {
dataSource.setLotNo("");
dataSource.setMachineNo("");
dataSource.setMaterialNo("");
dataSource.setModelNo("");
dataSource.setMachineTypeNo("");
dataSource.setInspectionItemCode("");
dataSource.setCraftItemName("");
dataSource.setInspectValue("");
dataSource.setPicturePath("");
}
}

View File

@ -1,12 +1,11 @@
package com.xkrs.service.impl;
import com.xkrs.dao.FileDao;
import com.xkrs.dao.QcSourceDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.DataSource;
import com.xkrs.model.entity.FileEntity;
import com.xkrs.model.qo.FileQo;
import com.xkrs.service.FileService;
import com.xkrs.util.DataSourceQuery;
import com.xkrs.util.ExcelUploadUtil;
import com.xkrs.util.ExportExcel;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@ -32,7 +31,7 @@ public class FileServiceImpl implements FileService {
private FileDao fileDao;
@Resource
private DataSourceQuery dataSourceQuery;
private QcSourceDao qcSourceDao;
/**
* 添加模板信息
@ -89,13 +88,13 @@ public class FileServiceImpl implements FileService {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的模板,请添加!", locale);
}
String fileUploadPath = fileEntity.get().getFileUploadPath();
List<DataSource> dataSources = dataSourceQuery.selectDataSource(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName);
if (dataSources == null || dataSources.size() == 0) {
List<Map<String, Object>> resultList = qcSourceDao.queryQcSource(lotNo, machineNo, materialNo, modelNo, machineTypeNo);
if (resultList == null || resultList.size() == 0) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的信息!", locale);
}
Map<String, String> map = new HashMap<>();
for (DataSource dataSource : dataSources) {
map.put(dataSource.getInspectionItemCode(), dataSource.getInspectValue());
for (Map<String, Object> result : resultList) {
map.put((String) result.get("qcItemNo"), (String) result.get("qcValue"));
}
String fill = ExportExcel.exportToProveExcel(map, fileUploadPath);
fileDao.updateFileDownloadPath(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName, fill);

View File

@ -1,74 +0,0 @@
package com.xkrs.service.impl;
import com.xkrs.dao.DataSourceDao;
import com.xkrs.dao.PictureDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.DataSource;
import com.xkrs.model.qo.PictureQo;
import com.xkrs.service.PictureService;
import com.xkrs.util.DataSourceQuery;
import com.xkrs.util.ExcelUploadUtil;
import org.apache.http.util.TextUtils;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@Service
public class PictureServiceImpl implements PictureService {
@Resource
private PictureDao pictureDao;
@Resource
private DataSourceDao dataSourceDao;
@Resource
private DataSourceQuery dataSourceQuery;
@Override
@Transactional(rollbackOn = Exception.class)
public String insertPicture(PictureQo pictureQo, MultipartFile pictureFile) throws IOException {
Locale locale = LocaleContextHolder.getLocale();
String filePath = ExcelUploadUtil.memoryFile(pictureFile, 2);
List<DataSource> dataSourceList = dataSourceQuery.selectDataSource(pictureQo.getLotNo(), pictureQo.getMachineNo(), pictureQo.getMaterialNo(), pictureQo.getModelNo(), pictureQo.getMachineTypeNo(), pictureQo.getCraftItemName());
if (dataSourceList == null || dataSourceList.isEmpty()) {
DataSource dataSource = new DataSource();
dataSource.setLotNo(pictureQo.getLotNo());
dataSource.setMachineNo(pictureQo.getMachineNo());
dataSource.setMaterialNo(pictureQo.getMaterialNo());
dataSource.setModelNo(pictureQo.getModelNo());
dataSource.setMachineTypeNo(pictureQo.getMachineTypeNo());
dataSource.setInspectionItemCode("");
dataSource.setCraftItemName(pictureQo.getCraftItemName());
dataSource.setInspectValue("");
dataSource.setPicturePath(filePath);
dataSourceDao.save(dataSource);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
}
for (DataSource dataSource : dataSourceList) {
String newFilePath;
if (TextUtils.isEmpty(dataSource.getPicturePath())) {
newFilePath = filePath;
} else {
newFilePath = dataSource.getPicturePath() + "," + filePath;
}
dataSourceDao.updatePicturePath(dataSource.getLotNo(), dataSource.getMachineNo(), dataSource.getMaterialNo(), dataSource.getModelNo(), dataSource.getMachineTypeNo(), dataSource.getCraftItemName(), newFilePath);
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
}
@Override
public String deletePicture(String picturePath) {
Locale locale = LocaleContextHolder.getLocale();
String deleteResult = ExcelUploadUtil.delFile(picturePath, 2);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, deleteResult, locale);
}
}

View File

@ -1,14 +1,14 @@
package com.xkrs.newpro.service.impl;
package com.xkrs.service.impl;
import com.xkrs.dao.QcItemDao;
import com.xkrs.encapsulation.PromptMessageEnum;
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.QcItemQoUpdate;
import com.xkrs.newpro.service.QcItemService;
import com.xkrs.newpro.utils.LocalDateUtils;
import com.xkrs.newpro.utils.LocalStringUtils;
import com.xkrs.model.entity.QcItemEntity;
import com.xkrs.model.qo.QcItemQoDelete;
import com.xkrs.model.qo.QcItemQoInsert;
import com.xkrs.model.qo.QcItemQoUpdate;
import com.xkrs.service.QcItemService;
import com.xkrs.util.LocalDateUtils;
import com.xkrs.util.LocalStringUtils;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
@ -54,6 +54,7 @@ public class QcItemServiceImpl implements QcItemService {
/**
* 删除检验项目
*/
@Transactional(rollbackOn = Exception.class)
@Override
public String deleteQcItem(QcItemQoDelete deleteQo) {
Integer id = deleteQo.getId();

View File

@ -1,27 +1,28 @@
package com.xkrs.newpro.service.impl;
package com.xkrs.service.impl;
import com.xkrs.dao.QcItemDao;
import com.xkrs.dao.QcSourceDao;
import com.xkrs.dao.QcSpecDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.newpro.dao.QcItemDao;
import com.xkrs.newpro.dao.QcSourceDao;
import com.xkrs.newpro.model.entity.QcItemEntity;
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.service.QcSourceService;
import com.xkrs.newpro.utils.Constant;
import com.xkrs.newpro.utils.LocalDateUtils;
import com.xkrs.newpro.utils.LocalStringUtils;
import com.xkrs.model.entity.QcItemEntity;
import com.xkrs.model.entity.QcSourceEntity;
import com.xkrs.model.entity.QcSpecEntity;
import com.xkrs.model.qo.QcSourceQoDelete;
import com.xkrs.model.qo.QcSourceQoInsert;
import com.xkrs.service.QcSourceService;
import com.xkrs.util.Constant;
import com.xkrs.util.ExcelUploadUtil;
import com.xkrs.util.LocalDateUtils;
import com.xkrs.util.LocalStringUtils;
import org.apache.http.util.TextUtils;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.*;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@ -36,6 +37,9 @@ public class QcSourceServiceImpl implements QcSourceService {
@Resource
private QcSourceDao qcSourceDao;
@Resource
private QcSpecDao qcSpecDao;
/**
* 添加检验数据
*/
@ -94,6 +98,7 @@ public class QcSourceServiceImpl implements QcSourceService {
/**
* 删除检验数据
*/
@Transactional(rollbackOn = Exception.class)
@Override
public String deleteQcSource(QcSourceQoDelete deleteQo) {
Integer id = deleteQo.getId();
@ -110,17 +115,103 @@ public class QcSourceServiceImpl implements QcSourceService {
*/
@Override
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()) {
List<QcItemEntity> qcItemList = qcItemDao.findAll();
if (qcItemList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "未添加检验项目,请先添加检验项目!", locale);
}
List<Map<String, Object>> sourceList = qcSourceDao.queryQcSource(LocalStringUtils.formatEmptyValue(batchNo), LocalStringUtils.formatEmptyValue(machineNo), LocalStringUtils.formatEmptyValue(materialNo), LocalStringUtils.formatEmptyValue(mouldNo), LocalStringUtils.formatEmptyValue(varietyNo));
List<Map<String, Object>> resultList = generateResultList(sourceList);
if (resultList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该检验数据的信息!", locale);
}
if (1 == 1) {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, resultList, locale);
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "查询成功!", locale);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, resultList, locale);
}
/**
* 生成返回结果
*/
private List<Map<String, Object>> generateResultList(List<Map<String, Object>> sourceList) {
List<Map<String, Object>> resultList = new ArrayList<>();
if (sourceList == null || sourceList.isEmpty()) {
return resultList;
}
for (Map<String, Object> source : sourceList) {
String batchNo = (String) source.getOrDefault("batchNo", "");
String machineNo = (String) source.getOrDefault("machineNo", "");
String materialNo = (String) source.getOrDefault("materialNo", "");
String mouldNo = (String) source.getOrDefault("mouldNo", "");
String varietyNo = (String) source.getOrDefault("varietyNo", "");
String qcItemNo = (String) source.getOrDefault("qcItemNo", "");
String qcValue = (String) source.getOrDefault("qcValue", "");
if (TextUtils.isEmpty(qcItemNo) || TextUtils.isEmpty(qcValue)) {
continue;
}
String formatValue = getFormatValue(varietyNo, qcItemNo, qcValue);
Map<String, Object> emptyRoom = findEmptyRoom(resultList, batchNo, qcItemNo);
if (emptyRoom == null) {
Map<String, Object> newRoom = new HashMap<>();
newRoom.put("batchNo", batchNo);
newRoom.put("machineNo", machineNo);
newRoom.put("materialNo", materialNo);
newRoom.put("mouldNo", mouldNo);
newRoom.put("varietyNo", varietyNo);
newRoom.put(qcItemNo, formatValue);
resultList.add(newRoom);
} else {
emptyRoom.put(qcItemNo, formatValue);
}
}
return resultList;
}
/**
* 获取添加了 ##H ##L 后缀的测量值如果可能的话
*/
private String getFormatValue(String varietyNo, String qcItemNo, String qcValue) {
Optional<QcSpecEntity> entityByVarietyNoAndQcItemNo = qcSpecDao.findByVarietyNoAndQcItemNo(varietyNo, qcItemNo);
if (entityByVarietyNoAndQcItemNo.isEmpty()) {
return qcValue;
}
QcSpecEntity qcSpec = entityByVarietyNoAndQcItemNo.get();
double valueMax = stringToDouble(qcSpec.getMax());
double valueMin = stringToDouble(qcSpec.getMin());
double value = stringToDouble(qcValue);
if (valueMax >= 0 && value >= 0 && value >= valueMax) {
return qcValue + "##H";
}
if (valueMin >= 0 && value >= 0 && value <= valueMin) {
return qcValue + "##L";
}
return qcValue;
}
/**
* 格式化字符串为Double
*/
private Double stringToDouble(String stringValue) {
try {
return Double.parseDouble(stringValue);
} catch (Exception e) {
e.printStackTrace();
return -1D;
}
}
/**
* 尝试找到一个qcItemNo有空位置的Map
*/
private Map<String, Object> findEmptyRoom(List<Map<String, Object>> mapList, String batchNo, String qcItemNo) {
if (mapList == null || mapList.isEmpty() || TextUtils.isEmpty(batchNo) || TextUtils.isEmpty(qcItemNo)) {
return null;
}
for (Map<String, Object> room : mapList) {
if (room.getOrDefault("batchNo", "").equals(batchNo)) {
if (!room.containsKey(qcItemNo)) {
return room;
}
}
}
return null;
}
}

View File

@ -1,20 +1,21 @@
package com.xkrs.newpro.service.impl;
package com.xkrs.service.impl;
import com.xkrs.dao.QcItemDao;
import com.xkrs.dao.QcSpecDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.newpro.dao.QcItemDao;
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.QcSpecQoDelete;
import com.xkrs.newpro.model.qo.QcSpecQoInsert;
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 com.xkrs.model.entity.QcItemEntity;
import com.xkrs.model.entity.QcSpecEntity;
import com.xkrs.model.qo.QcSpecQoDelete;
import com.xkrs.model.qo.QcSpecQoInsert;
import com.xkrs.model.qo.QcSpecQoUpdate;
import com.xkrs.service.QcSpecService;
import com.xkrs.util.LocalDateUtils;
import com.xkrs.util.LocalStringUtils;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@ -78,6 +79,7 @@ public class QcSpecServiceImpl implements QcSpecService {
/**
* 删除检验规格
*/
@Transactional(rollbackOn = Exception.class)
@Override
public String deleteQcSpec(QcSpecQoDelete deleteQo) {
Integer id = deleteQo.getId();
@ -92,6 +94,7 @@ public class QcSpecServiceImpl implements QcSpecService {
/**
* 更新检验规格
*/
@Transactional(rollbackOn = Exception.class)
@Override
public String updateQcSpec(QcSpecQoUpdate updateQo) {

View File

@ -1,48 +0,0 @@
package com.xkrs.service.impl;
import com.xkrs.dao.SpecDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.SpecEntity;
import com.xkrs.model.qo.SpecQo;
import com.xkrs.service.SpecService;
import com.xkrs.util.SpecQuery;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Locale;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@Service
public class SpecServiceImpl implements SpecService {
@Resource
private SpecQuery specQuery;
@Resource
private SpecDao specDao;
@Override
public String insertSpec(SpecQo specQo) {
Locale locale = LocaleContextHolder.getLocale();
List<SpecEntity> specEntities = specQuery.selectSpec(specQo.getMachineTypeNo(), specQo.getInspectionItemCode(),specQo.getCraftItemName());
if (!specEntities.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_EXIT, "已存在该测量规格!", locale);
}
SpecEntity specEntity1 = new SpecEntity();
specEntity1.setMachineTypeNo(specQo.getMachineTypeNo());
specEntity1.setInspectionItemCode(specQo.getInspectionItemCode());
specEntity1.setCraftItemName(specQo.getCraftItemName());
specEntity1.setMax(specQo.getMax());
specEntity1.setMean(specQo.getMean());
specEntity1.setMin(specQo.getMin());
specEntity1.setUnit(specQo.getUnit());
specEntity1.setInspectionMethod(specQo.getInspectionMethod());
specEntity1.setInspectionStandard(specQo.getInspectionStandard());
specEntity1.setRemark(specQo.getRemark());
specDao.save(specEntity1);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
}
}

View File

@ -1,4 +1,4 @@
package com.xkrs.newpro.utils;
package com.xkrs.util;
public interface Constant {

View File

@ -1,42 +0,0 @@
package com.xkrs.util;
import com.xkrs.dao.DataDictDao;
import com.xkrs.model.entity.DataDict;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.persistence.criteria.Predicate;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 13:56
*/
@Component
public class DataDictQuery {
@Resource
private DataDictDao dataDictDao;
/**
* 动态多条件查询字典信息
*
* @return
*/
public List<DataDict> selectDataDict(String inspectionItemName, String inspectionItemCode) {
Specification<DataDict> specification = (root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> list = new ArrayList<>();
if (inspectionItemName != null && !"".equals(inspectionItemName)) {
list.add(criteriaBuilder.equal(root.get("inspectionItemName").as(String.class), inspectionItemName));
}
if (inspectionItemCode != null && !"".equals(inspectionItemCode)) {
list.add(criteriaBuilder.equal(root.get("inspectionItemCode").as(String.class), inspectionItemCode));
}
Predicate[] predicates = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(predicates));
};
return dataDictDao.findAll(specification);
}
}

View File

@ -1,56 +0,0 @@
package com.xkrs.util;
import com.xkrs.dao.DataSourceDao;
import com.xkrs.model.entity.DataSource;
import org.apache.http.util.TextUtils;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.persistence.criteria.Predicate;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 13:56
*/
@Component
public class DataSourceQuery {
@Resource
private DataSourceDao dataSourceDao;
/**
* 动态多条件查询采集数据信息
*
* @return
*/
public List<DataSource> selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName) {
Specification<DataSource> specification = (root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> list = new ArrayList<>();
if (!TextUtils.isEmpty(lotNo)) {
list.add(criteriaBuilder.equal(root.get("lotNo").as(String.class), lotNo));
}
if (!TextUtils.isEmpty(machineNo)) {
list.add(criteriaBuilder.equal(root.get("machineNo").as(String.class), machineNo));
}
if (!TextUtils.isEmpty(materialNo)) {
list.add(criteriaBuilder.equal(root.get("materialNo").as(String.class), materialNo));
}
if (!TextUtils.isEmpty(modelNo)) {
list.add(criteriaBuilder.equal(root.get("modelNo").as(String.class), modelNo));
}
if (!TextUtils.isEmpty(machineTypeNo)) {
list.add(criteriaBuilder.equal(root.get("machineTypeNo").as(String.class), machineTypeNo));
}
if (!TextUtils.isEmpty(craftItemName)) {
list.add(criteriaBuilder.equal(root.get("craftItemName").as(String.class), craftItemName));
}
Predicate[] predicates = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(predicates));
};
return dataSourceDao.findAll(specification, Sort.by(Sort.Direction.DESC, "id"));
}
}

View File

@ -2,7 +2,8 @@ package com.xkrs.util;
import net.sf.jxls.transformer.XLSTransformer;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import java.io.*;
import java.io.IOException;
import java.util.Map;
/**
@ -39,8 +40,6 @@ public class ExportExcel {
return "http://118.24.27.47:2088/excel/"+s;
//return "http://192.168.2.139/"+s;
}*/
public static String exportToProveExcel(Map<String, String> dataMap, String srcFilePath) throws IOException, InvalidFormatException {
String s = System.currentTimeMillis() + ".xlsx";
//String path = "E:/shop/"+s;
@ -51,7 +50,7 @@ public class ExportExcel {
// 参数srcFilePath模板源文件 cMap需要导出的数据 destFile.getAbsolutePath()下载的目标文件
transformer.transformXLS(srcFilePath, dataMap, path);
//return "http://192.168.2.139/"+s;
return "http://118.24.27.47:2088/excel/"+s;
return "http://118.24.27.47:2088/excel/" + s;
}
/*public static void main(String[] args) throws IOException, InvalidFormatException {

View File

@ -1,4 +1,4 @@
package com.xkrs.newpro.utils;
package com.xkrs.util;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package com.xkrs.newpro.utils;
package com.xkrs.util;
public class LocalStringUtils {

View File

@ -1,55 +0,0 @@
package com.xkrs.util;
import com.xkrs.dao.PictureDao;
import com.xkrs.model.entity.PictureEntity;
import org.apache.http.util.TextUtils;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.persistence.criteria.Predicate;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 13:56
*/
@Component
public class PictureQuery {
@Resource
private PictureDao pictureDao;
/**
* 动态多条件查询图片信息
*
* @return
*/
public List<PictureEntity> selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName) {
Specification<PictureEntity> specification = (root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> list = new ArrayList<>();
if (!TextUtils.isEmpty(lotNo)) {
list.add(criteriaBuilder.equal(root.get("lotNo").as(String.class), lotNo));
}
if (!TextUtils.isEmpty(machineNo)) {
list.add(criteriaBuilder.equal(root.get("machineNo").as(String.class), machineNo));
}
if (!TextUtils.isEmpty(materialNo)) {
list.add(criteriaBuilder.equal(root.get("materialNo").as(String.class), materialNo));
}
if (!TextUtils.isEmpty(modelNo)) {
list.add(criteriaBuilder.equal(root.get("modelNo").as(String.class), modelNo));
}
if (!TextUtils.isEmpty(machineTypeNo)) {
list.add(criteriaBuilder.equal(root.get("machineTypeNo").as(String.class), machineTypeNo));
}
if (!TextUtils.isEmpty(craftItemName)) {
list.add(criteriaBuilder.equal(root.get("craftItemName").as(String.class), craftItemName));
}
Predicate[] predicates = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(predicates));
};
return pictureDao.findAll(specification);
}
}

View File

@ -1,46 +0,0 @@
package com.xkrs.util;
import com.xkrs.dao.SpecDao;
import com.xkrs.model.entity.SpecEntity;
import org.apache.http.util.TextUtils;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.persistence.criteria.Predicate;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 13:56
*/
@Component
public class SpecQuery {
@Resource
private SpecDao specDao;
/**
* 动态多条件查询规格信息
*
* @return
*/
public List<SpecEntity> selectSpec(String machineTypeNo, String inspectionItemCode, String craftItemName) {
Specification<SpecEntity> specification = (root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> list = new ArrayList<>();
if (!TextUtils.isEmpty(machineTypeNo)) {
list.add(criteriaBuilder.equal(root.get("machineTypeNo").as(String.class), machineTypeNo));
}
if (!TextUtils.isEmpty(inspectionItemCode)) {
list.add(criteriaBuilder.equal(root.get("inspectionItemCode").as(String.class), inspectionItemCode));
}
if (!TextUtils.isEmpty(craftItemName)) {
list.add(criteriaBuilder.equal(root.get("craftItemName").as(String.class), craftItemName));
}
Predicate[] predicates = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(predicates));
};
return specDao.findAll(specification);
}
}