From 1ddf362e058842d7756c0e01413867c55c50c07c Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Fri, 11 Mar 2022 17:30:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/controller/DataDictController.java | 95 --------- .../xkrs/controller/DataSourceController.java | 118 ----------- .../xkrs/controller/PictureController.java | 61 ------ .../controller/QcItemController.java | 2 +- .../controller/QcSourceController.java | 2 +- .../controller/QcSpecController.java | 2 +- .../com/xkrs/controller/SpecController.java | 55 ------ src/main/java/com/xkrs/dao/DataDictDao.java | 42 ---- src/main/java/com/xkrs/dao/DataSourceDao.java | 25 --- src/main/java/com/xkrs/dao/PictureDao.java | 33 ---- .../com/xkrs/{newpro => }/dao/QcItemDao.java | 2 +- .../xkrs/{newpro => }/dao/QcSourceDao.java | 2 +- .../com/xkrs/{newpro => }/dao/QcSpecDao.java | 2 +- src/main/java/com/xkrs/dao/SpecDao.java | 18 -- .../java/com/xkrs/model/entity/DataDict.java | 68 ------- .../com/xkrs/model/entity/DataSource.java | 173 ----------------- .../com/xkrs/model/entity/PictureEntity.java | 138 ------------- .../com/xkrs/model/entity/SpecEntity.java | 183 ------------------ .../java/com/xkrs/model/qo/DataDictQo.java | 43 ---- .../com/xkrs/model/qo/DataDictUpdateQo.java | 40 ---- .../java/com/xkrs/model/qo/DataSourceQo.java | 128 ------------ .../com/xkrs/model/qo/DeletePictureQo.java | 30 --- .../java/com/xkrs/model/qo/PictureQo.java | 95 --------- src/main/java/com/xkrs/model/qo/SpecQo.java | 150 -------------- .../model/validation/DataDictQoInsert.java | 8 - .../validation/DataDictUpdateQoUpdate.java | 8 - .../model/validation/DataSourceQoInsert.java | 8 - .../validation/DeletePictureQoDelete.java | 4 - .../model/validation/FileUpdateQoUpdate.java | 8 - .../model/validation/PictureQoInsert.java | 8 - .../xkrs/model/validation/SpecQoInsert.java | 8 - .../java/com/xkrs/model/vo/DataSourceVo.java | 106 ---------- .../service/impl/QcItemServiceImpl.java | 2 +- .../service/impl/QcSourceServiceImpl.java | 4 +- .../service/impl/QcSpecServiceImpl.java | 4 +- .../com/xkrs/service/DataDictService.java | 18 -- .../com/xkrs/service/DataSourceService.java | 17 -- .../java/com/xkrs/service/PictureService.java | 24 --- .../java/com/xkrs/service/SpecService.java | 19 -- .../service/impl/DataDictServiceImpl.java | 46 ----- .../service/impl/DataSourceServiceImpl.java | 71 ------- .../xkrs/service/impl/FileServiceImpl.java | 53 +++-- .../xkrs/service/impl/PictureServiceImpl.java | 74 ------- .../xkrs/service/impl/SpecServiceImpl.java | 48 ----- .../java/com/xkrs/util/DataDictQuery.java | 42 ---- .../java/com/xkrs/util/DataSourceQuery.java | 56 ------ src/main/java/com/xkrs/util/PictureQuery.java | 55 ------ src/main/java/com/xkrs/util/SpecQuery.java | 46 ----- 48 files changed, 37 insertions(+), 2207 deletions(-) delete mode 100644 src/main/java/com/xkrs/controller/DataDictController.java delete mode 100644 src/main/java/com/xkrs/controller/DataSourceController.java delete mode 100644 src/main/java/com/xkrs/controller/PictureController.java rename src/main/java/com/xkrs/{newpro => }/controller/QcItemController.java (97%) rename src/main/java/com/xkrs/{newpro => }/controller/QcSourceController.java (97%) rename src/main/java/com/xkrs/{newpro => }/controller/QcSpecController.java (97%) delete mode 100644 src/main/java/com/xkrs/controller/SpecController.java delete mode 100644 src/main/java/com/xkrs/dao/DataDictDao.java delete mode 100644 src/main/java/com/xkrs/dao/DataSourceDao.java delete mode 100644 src/main/java/com/xkrs/dao/PictureDao.java rename src/main/java/com/xkrs/{newpro => }/dao/QcItemDao.java (97%) rename src/main/java/com/xkrs/{newpro => }/dao/QcSourceDao.java (97%) rename src/main/java/com/xkrs/{newpro => }/dao/QcSpecDao.java (97%) delete mode 100644 src/main/java/com/xkrs/dao/SpecDao.java delete mode 100644 src/main/java/com/xkrs/model/entity/DataDict.java delete mode 100644 src/main/java/com/xkrs/model/entity/DataSource.java delete mode 100644 src/main/java/com/xkrs/model/entity/PictureEntity.java delete mode 100644 src/main/java/com/xkrs/model/entity/SpecEntity.java delete mode 100644 src/main/java/com/xkrs/model/qo/DataDictQo.java delete mode 100644 src/main/java/com/xkrs/model/qo/DataDictUpdateQo.java delete mode 100644 src/main/java/com/xkrs/model/qo/DataSourceQo.java delete mode 100644 src/main/java/com/xkrs/model/qo/DeletePictureQo.java delete mode 100644 src/main/java/com/xkrs/model/qo/PictureQo.java delete mode 100644 src/main/java/com/xkrs/model/qo/SpecQo.java delete mode 100644 src/main/java/com/xkrs/model/validation/DataDictQoInsert.java delete mode 100644 src/main/java/com/xkrs/model/validation/DataDictUpdateQoUpdate.java delete mode 100644 src/main/java/com/xkrs/model/validation/DataSourceQoInsert.java delete mode 100644 src/main/java/com/xkrs/model/validation/DeletePictureQoDelete.java delete mode 100644 src/main/java/com/xkrs/model/validation/FileUpdateQoUpdate.java delete mode 100644 src/main/java/com/xkrs/model/validation/PictureQoInsert.java delete mode 100644 src/main/java/com/xkrs/model/validation/SpecQoInsert.java delete mode 100644 src/main/java/com/xkrs/model/vo/DataSourceVo.java delete mode 100644 src/main/java/com/xkrs/service/DataDictService.java delete mode 100644 src/main/java/com/xkrs/service/DataSourceService.java delete mode 100644 src/main/java/com/xkrs/service/PictureService.java delete mode 100644 src/main/java/com/xkrs/service/SpecService.java delete mode 100644 src/main/java/com/xkrs/service/impl/DataDictServiceImpl.java delete mode 100644 src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java delete mode 100644 src/main/java/com/xkrs/service/impl/PictureServiceImpl.java delete mode 100644 src/main/java/com/xkrs/service/impl/SpecServiceImpl.java delete mode 100644 src/main/java/com/xkrs/util/DataDictQuery.java delete mode 100644 src/main/java/com/xkrs/util/DataSourceQuery.java delete mode 100644 src/main/java/com/xkrs/util/PictureQuery.java delete mode 100644 src/main/java/com/xkrs/util/SpecQuery.java diff --git a/src/main/java/com/xkrs/controller/DataDictController.java b/src/main/java/com/xkrs/controller/DataDictController.java deleted file mode 100644 index 341d2cd..0000000 --- a/src/main/java/com/xkrs/controller/DataDictController.java +++ /dev/null @@ -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 = 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 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); - } -} diff --git a/src/main/java/com/xkrs/controller/DataSourceController.java b/src/main/java/com/xkrs/controller/DataSourceController.java deleted file mode 100644 index 490336d..0000000 --- a/src/main/java/com/xkrs/controller/DataSourceController.java +++ /dev/null @@ -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> groupList = dataSourceDao.selectAllDataSourceGroup(); - if (groupList == null || groupList.isEmpty()) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的测量信息!", locale); - } - List> dataSourceListList = new ArrayList<>(); - for (Map 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 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 dataSources = dataSourceDao.findAll(); - if (dataSources.size() == 0) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的测量信息!", locale); - } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, dataSources, locale); - } -} diff --git a/src/main/java/com/xkrs/controller/PictureController.java b/src/main/java/com/xkrs/controller/PictureController.java deleted file mode 100644 index 6f8b2c1..0000000 --- a/src/main/java/com/xkrs/controller/PictureController.java +++ /dev/null @@ -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 pictureEntities = pictureQuery.selectPicture(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); -// if (pictureEntities.isEmpty()) { -// return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该图片!", locale); -// } -// return outputEncapsulationObject(PromptMessageEnum.SUCCESS, pictureEntities, locale); -// } -} diff --git a/src/main/java/com/xkrs/newpro/controller/QcItemController.java b/src/main/java/com/xkrs/controller/QcItemController.java similarity index 97% rename from src/main/java/com/xkrs/newpro/controller/QcItemController.java rename to src/main/java/com/xkrs/controller/QcItemController.java index 4d6e733..b15d602 100644 --- a/src/main/java/com/xkrs/newpro/controller/QcItemController.java +++ b/src/main/java/com/xkrs/controller/QcItemController.java @@ -1,4 +1,4 @@ -package com.xkrs.newpro.controller; +package com.xkrs.controller; import com.xkrs.newpro.model.qo.QcItemQoDelete; import com.xkrs.newpro.model.qo.QcItemQoInsert; diff --git a/src/main/java/com/xkrs/newpro/controller/QcSourceController.java b/src/main/java/com/xkrs/controller/QcSourceController.java similarity index 97% rename from src/main/java/com/xkrs/newpro/controller/QcSourceController.java rename to src/main/java/com/xkrs/controller/QcSourceController.java index bb64b9d..edae14e 100644 --- a/src/main/java/com/xkrs/newpro/controller/QcSourceController.java +++ b/src/main/java/com/xkrs/controller/QcSourceController.java @@ -1,4 +1,4 @@ -package com.xkrs.newpro.controller; +package com.xkrs.controller; import com.xkrs.newpro.model.qo.QcSourceQoDelete; import com.xkrs.newpro.model.qo.QcSourceQoInsert; diff --git a/src/main/java/com/xkrs/newpro/controller/QcSpecController.java b/src/main/java/com/xkrs/controller/QcSpecController.java similarity index 97% rename from src/main/java/com/xkrs/newpro/controller/QcSpecController.java rename to src/main/java/com/xkrs/controller/QcSpecController.java index febcb06..a6882a1 100644 --- a/src/main/java/com/xkrs/newpro/controller/QcSpecController.java +++ b/src/main/java/com/xkrs/controller/QcSpecController.java @@ -1,4 +1,4 @@ -package com.xkrs.newpro.controller; +package com.xkrs.controller; import com.xkrs.newpro.model.qo.QcSpecQoDelete; import com.xkrs.newpro.model.qo.QcSpecQoInsert; diff --git a/src/main/java/com/xkrs/controller/SpecController.java b/src/main/java/com/xkrs/controller/SpecController.java deleted file mode 100644 index 645eefd..0000000 --- a/src/main/java/com/xkrs/controller/SpecController.java +++ /dev/null @@ -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 specEntities = specQuery.selectSpec(machineTypeNo, inspectionItemCode, craftItemName); - if (specEntities.isEmpty()) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该规格信息!", locale); - } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, specEntities, locale); - } - -} diff --git a/src/main/java/com/xkrs/dao/DataDictDao.java b/src/main/java/com/xkrs/dao/DataDictDao.java deleted file mode 100644 index f59496a..0000000 --- a/src/main/java/com/xkrs/dao/DataDictDao.java +++ /dev/null @@ -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, JpaSpecificationExecutor { - - /** - * 通过质检项代码查询字典表的数据 - * @param inspectionItemCode - * @return - */ - Optional findByInspectionItemCode(String inspectionItemCode); - - /** - * 根据id查询字典信息 - * @param id - * @return - */ - Optional 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); -} diff --git a/src/main/java/com/xkrs/dao/DataSourceDao.java b/src/main/java/com/xkrs/dao/DataSourceDao.java deleted file mode 100644 index 74e70a4..0000000 --- a/src/main/java/com/xkrs/dao/DataSourceDao.java +++ /dev/null @@ -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, JpaSpecificationExecutor { - - @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> 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 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); -} diff --git a/src/main/java/com/xkrs/dao/PictureDao.java b/src/main/java/com/xkrs/dao/PictureDao.java deleted file mode 100644 index b10191a..0000000 --- a/src/main/java/com/xkrs/dao/PictureDao.java +++ /dev/null @@ -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, JpaSpecificationExecutor { - - /** - * 查询图片信息 - * - * @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 selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName); - -} diff --git a/src/main/java/com/xkrs/newpro/dao/QcItemDao.java b/src/main/java/com/xkrs/dao/QcItemDao.java similarity index 97% rename from src/main/java/com/xkrs/newpro/dao/QcItemDao.java rename to src/main/java/com/xkrs/dao/QcItemDao.java index b10b2ee..01c7656 100644 --- a/src/main/java/com/xkrs/newpro/dao/QcItemDao.java +++ b/src/main/java/com/xkrs/dao/QcItemDao.java @@ -1,4 +1,4 @@ -package com.xkrs.newpro.dao; +package com.xkrs.dao; import com.xkrs.newpro.model.entity.QcItemEntity; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/xkrs/newpro/dao/QcSourceDao.java b/src/main/java/com/xkrs/dao/QcSourceDao.java similarity index 97% rename from src/main/java/com/xkrs/newpro/dao/QcSourceDao.java rename to src/main/java/com/xkrs/dao/QcSourceDao.java index 722ac99..7d7047a 100644 --- a/src/main/java/com/xkrs/newpro/dao/QcSourceDao.java +++ b/src/main/java/com/xkrs/dao/QcSourceDao.java @@ -1,4 +1,4 @@ -package com.xkrs.newpro.dao; +package com.xkrs.dao; import com.xkrs.newpro.model.entity.QcSourceEntity; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/xkrs/newpro/dao/QcSpecDao.java b/src/main/java/com/xkrs/dao/QcSpecDao.java similarity index 97% rename from src/main/java/com/xkrs/newpro/dao/QcSpecDao.java rename to src/main/java/com/xkrs/dao/QcSpecDao.java index 31cd51d..5f37881 100644 --- a/src/main/java/com/xkrs/newpro/dao/QcSpecDao.java +++ b/src/main/java/com/xkrs/dao/QcSpecDao.java @@ -1,4 +1,4 @@ -package com.xkrs.newpro.dao; +package com.xkrs.dao; import com.xkrs.newpro.model.entity.QcSpecEntity; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/xkrs/dao/SpecDao.java b/src/main/java/com/xkrs/dao/SpecDao.java deleted file mode 100644 index a81f3a0..0000000 --- a/src/main/java/com/xkrs/dao/SpecDao.java +++ /dev/null @@ -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, JpaSpecificationExecutor { - -} diff --git a/src/main/java/com/xkrs/model/entity/DataDict.java b/src/main/java/com/xkrs/model/entity/DataDict.java deleted file mode 100644 index 7c94805..0000000 --- a/src/main/java/com/xkrs/model/entity/DataDict.java +++ /dev/null @@ -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 + '\'' + - '}'; - } -} diff --git a/src/main/java/com/xkrs/model/entity/DataSource.java b/src/main/java/com/xkrs/model/entity/DataSource.java deleted file mode 100644 index 6908315..0000000 --- a/src/main/java/com/xkrs/model/entity/DataSource.java +++ /dev/null @@ -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 + '\'' + - '}'; - } -} diff --git a/src/main/java/com/xkrs/model/entity/PictureEntity.java b/src/main/java/com/xkrs/model/entity/PictureEntity.java deleted file mode 100644 index 9c1c866..0000000 --- a/src/main/java/com/xkrs/model/entity/PictureEntity.java +++ /dev/null @@ -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 + '\'' + - '}'; - } -} diff --git a/src/main/java/com/xkrs/model/entity/SpecEntity.java b/src/main/java/com/xkrs/model/entity/SpecEntity.java deleted file mode 100644 index d6bf18d..0000000 --- a/src/main/java/com/xkrs/model/entity/SpecEntity.java +++ /dev/null @@ -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 + '\'' + - '}'; - } -} diff --git a/src/main/java/com/xkrs/model/qo/DataDictQo.java b/src/main/java/com/xkrs/model/qo/DataDictQo.java deleted file mode 100644 index b3b2c67..0000000 --- a/src/main/java/com/xkrs/model/qo/DataDictQo.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/com/xkrs/model/qo/DataDictUpdateQo.java b/src/main/java/com/xkrs/model/qo/DataDictUpdateQo.java deleted file mode 100644 index a81276b..0000000 --- a/src/main/java/com/xkrs/model/qo/DataDictUpdateQo.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/com/xkrs/model/qo/DataSourceQo.java b/src/main/java/com/xkrs/model/qo/DataSourceQo.java deleted file mode 100644 index 69727ed..0000000 --- a/src/main/java/com/xkrs/model/qo/DataSourceQo.java +++ /dev/null @@ -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; - } - -} diff --git a/src/main/java/com/xkrs/model/qo/DeletePictureQo.java b/src/main/java/com/xkrs/model/qo/DeletePictureQo.java deleted file mode 100644 index 8fb5451..0000000 --- a/src/main/java/com/xkrs/model/qo/DeletePictureQo.java +++ /dev/null @@ -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 + '\'' + '}'; - } -} diff --git a/src/main/java/com/xkrs/model/qo/PictureQo.java b/src/main/java/com/xkrs/model/qo/PictureQo.java deleted file mode 100644 index c8efaa7..0000000 --- a/src/main/java/com/xkrs/model/qo/PictureQo.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/com/xkrs/model/qo/SpecQo.java b/src/main/java/com/xkrs/model/qo/SpecQo.java deleted file mode 100644 index fe4ebdd..0000000 --- a/src/main/java/com/xkrs/model/qo/SpecQo.java +++ /dev/null @@ -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; - } -} diff --git a/src/main/java/com/xkrs/model/validation/DataDictQoInsert.java b/src/main/java/com/xkrs/model/validation/DataDictQoInsert.java deleted file mode 100644 index e6cfc40..0000000 --- a/src/main/java/com/xkrs/model/validation/DataDictQoInsert.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xkrs.model.validation; - -/** - * @Author: XinYi Song - * @Date: 2022/1/19 10:22 - */ -public interface DataDictQoInsert { -} diff --git a/src/main/java/com/xkrs/model/validation/DataDictUpdateQoUpdate.java b/src/main/java/com/xkrs/model/validation/DataDictUpdateQoUpdate.java deleted file mode 100644 index c24b6e2..0000000 --- a/src/main/java/com/xkrs/model/validation/DataDictUpdateQoUpdate.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xkrs.model.validation; - -/** - * @Author: XinYi Song - * @Date: 2022/1/20 11:23 - */ -public interface DataDictUpdateQoUpdate { -} diff --git a/src/main/java/com/xkrs/model/validation/DataSourceQoInsert.java b/src/main/java/com/xkrs/model/validation/DataSourceQoInsert.java deleted file mode 100644 index e15cd7d..0000000 --- a/src/main/java/com/xkrs/model/validation/DataSourceQoInsert.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xkrs.model.validation; - -/** - * @Author: XinYi Song - * @Date: 2022/1/19 16:39 - */ -public interface DataSourceQoInsert { -} diff --git a/src/main/java/com/xkrs/model/validation/DeletePictureQoDelete.java b/src/main/java/com/xkrs/model/validation/DeletePictureQoDelete.java deleted file mode 100644 index 2576073..0000000 --- a/src/main/java/com/xkrs/model/validation/DeletePictureQoDelete.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.xkrs.model.validation; - -public interface DeletePictureQoDelete { -} diff --git a/src/main/java/com/xkrs/model/validation/FileUpdateQoUpdate.java b/src/main/java/com/xkrs/model/validation/FileUpdateQoUpdate.java deleted file mode 100644 index 912133c..0000000 --- a/src/main/java/com/xkrs/model/validation/FileUpdateQoUpdate.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xkrs.model.validation; - -/** - * @Author: XinYi Song - * @Date: 2022/1/20 16:21 - */ -public interface FileUpdateQoUpdate { -} diff --git a/src/main/java/com/xkrs/model/validation/PictureQoInsert.java b/src/main/java/com/xkrs/model/validation/PictureQoInsert.java deleted file mode 100644 index 7036491..0000000 --- a/src/main/java/com/xkrs/model/validation/PictureQoInsert.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xkrs.model.validation; - -/** - * @Author: XinYi Song - * @Date: 2022/1/20 15:26 - */ -public interface PictureQoInsert { -} diff --git a/src/main/java/com/xkrs/model/validation/SpecQoInsert.java b/src/main/java/com/xkrs/model/validation/SpecQoInsert.java deleted file mode 100644 index 93f09aa..0000000 --- a/src/main/java/com/xkrs/model/validation/SpecQoInsert.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xkrs.model.validation; - -/** - * @Author: XinYi Song - * @Date: 2022/1/19 10:22 - */ -public interface SpecQoInsert { -} diff --git a/src/main/java/com/xkrs/model/vo/DataSourceVo.java b/src/main/java/com/xkrs/model/vo/DataSourceVo.java deleted file mode 100644 index 9bb0de3..0000000 --- a/src/main/java/com/xkrs/model/vo/DataSourceVo.java +++ /dev/null @@ -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 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 getPicturePath() { - return picturePath; - } - - public void setPicturePath(List 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 + - '}'; - } -} diff --git a/src/main/java/com/xkrs/newpro/service/impl/QcItemServiceImpl.java b/src/main/java/com/xkrs/newpro/service/impl/QcItemServiceImpl.java index 92a10cf..78707e5 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcItemServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcItemServiceImpl.java @@ -1,7 +1,7 @@ package com.xkrs.newpro.service.impl; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.newpro.dao.QcItemDao; +import com.xkrs.dao.QcItemDao; import com.xkrs.newpro.model.entity.QcItemEntity; import com.xkrs.newpro.model.qo.QcItemQoDelete; import com.xkrs.newpro.model.qo.QcItemQoInsert; diff --git a/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java b/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java index 86c15ae..cd8b1bc 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java @@ -1,8 +1,8 @@ package com.xkrs.newpro.service.impl; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.newpro.dao.QcItemDao; -import com.xkrs.newpro.dao.QcSourceDao; +import com.xkrs.dao.QcItemDao; +import com.xkrs.dao.QcSourceDao; import com.xkrs.newpro.model.entity.QcItemEntity; import com.xkrs.newpro.model.entity.QcSourceEntity; import com.xkrs.newpro.model.qo.QcSourceQoDelete; diff --git a/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java b/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java index 5cd623f..facba70 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java @@ -1,8 +1,8 @@ package com.xkrs.newpro.service.impl; import com.xkrs.encapsulation.PromptMessageEnum; -import com.xkrs.newpro.dao.QcItemDao; -import com.xkrs.newpro.dao.QcSpecDao; +import com.xkrs.dao.QcItemDao; +import com.xkrs.dao.QcSpecDao; import com.xkrs.newpro.model.entity.QcItemEntity; import com.xkrs.newpro.model.entity.QcSpecEntity; import com.xkrs.newpro.model.qo.QcSpecQoDelete; diff --git a/src/main/java/com/xkrs/service/DataDictService.java b/src/main/java/com/xkrs/service/DataDictService.java deleted file mode 100644 index b233e12..0000000 --- a/src/main/java/com/xkrs/service/DataDictService.java +++ /dev/null @@ -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); -} diff --git a/src/main/java/com/xkrs/service/DataSourceService.java b/src/main/java/com/xkrs/service/DataSourceService.java deleted file mode 100644 index d5aa9fe..0000000 --- a/src/main/java/com/xkrs/service/DataSourceService.java +++ /dev/null @@ -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); -} diff --git a/src/main/java/com/xkrs/service/PictureService.java b/src/main/java/com/xkrs/service/PictureService.java deleted file mode 100644 index 1a532c1..0000000 --- a/src/main/java/com/xkrs/service/PictureService.java +++ /dev/null @@ -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); - -} diff --git a/src/main/java/com/xkrs/service/SpecService.java b/src/main/java/com/xkrs/service/SpecService.java deleted file mode 100644 index d215ea4..0000000 --- a/src/main/java/com/xkrs/service/SpecService.java +++ /dev/null @@ -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); - -} diff --git a/src/main/java/com/xkrs/service/impl/DataDictServiceImpl.java b/src/main/java/com/xkrs/service/impl/DataDictServiceImpl.java deleted file mode 100644 index 4fa2227..0000000 --- a/src/main/java/com/xkrs/service/impl/DataDictServiceImpl.java +++ /dev/null @@ -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 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); - } -} diff --git a/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java b/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java deleted file mode 100644 index cb40870..0000000 --- a/src/main/java/com/xkrs/service/impl/DataSourceServiceImpl.java +++ /dev/null @@ -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 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(""); - } - -} diff --git a/src/main/java/com/xkrs/service/impl/FileServiceImpl.java b/src/main/java/com/xkrs/service/impl/FileServiceImpl.java index 5488a3a..6964f84 100644 --- a/src/main/java/com/xkrs/service/impl/FileServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FileServiceImpl.java @@ -2,11 +2,9 @@ package com.xkrs.service.impl; import com.xkrs.dao.FileDao; 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; @@ -31,8 +29,8 @@ public class FileServiceImpl implements FileService { @Resource private FileDao fileDao; - @Resource - private DataSourceQuery dataSourceQuery; +// @Resource +// private DataSourceQuery dataSourceQuery; /** * 添加模板信息 @@ -77,28 +75,29 @@ public class FileServiceImpl implements FileService { @Transactional(rollbackOn = Exception.class) @Override public String exportExcel(FileQo fileQo) throws IOException, InvalidFormatException { - String lotNo = fileQo.getLotNo(); - String machineNo = fileQo.getMachineNo(); - String materialNo = fileQo.getMaterialNo(); - String modelNo = fileQo.getModelNo(); - String machineTypeNo = fileQo.getMachineTypeNo(); - String craftItemName = fileQo.getCraftItemName(); - Locale locale = LocaleContextHolder.getLocale(); - Optional fileEntity = fileDao.selectFile(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); - if (fileEntity.isEmpty()) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的模板,请添加!", locale); - } - String fileUploadPath = fileEntity.get().getFileUploadPath(); - List dataSources = dataSourceQuery.selectDataSource(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); - if (dataSources == null || dataSources.size() == 0) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的信息!", locale); - } - Map map = new HashMap<>(); - for (DataSource dataSource : dataSources) { - map.put(dataSource.getInspectionItemCode(), dataSource.getInspectValue()); - } - String fill = ExportExcel.exportToProveExcel(map, fileUploadPath); - fileDao.updateFileDownloadPath(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName, fill); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, fill, locale); + return null; +// String lotNo = fileQo.getLotNo(); +// String machineNo = fileQo.getMachineNo(); +// String materialNo = fileQo.getMaterialNo(); +// String modelNo = fileQo.getModelNo(); +// String machineTypeNo = fileQo.getMachineTypeNo(); +// String craftItemName = fileQo.getCraftItemName(); +// Locale locale = LocaleContextHolder.getLocale(); +// Optional fileEntity = fileDao.selectFile(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); +// if (fileEntity.isEmpty()) { +// return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的模板,请添加!", locale); +// } +// String fileUploadPath = fileEntity.get().getFileUploadPath(); +// List dataSources = dataSourceQuery.selectDataSource(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName); +// if (dataSources == null || dataSources.size() == 0) { +// return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该产品的信息!", locale); +// } +// Map map = new HashMap<>(); +// for (DataSource dataSource : dataSources) { +// map.put(dataSource.getInspectionItemCode(), dataSource.getInspectValue()); +// } +// String fill = ExportExcel.exportToProveExcel(map, fileUploadPath); +// fileDao.updateFileDownloadPath(lotNo, machineNo, materialNo, modelNo, machineTypeNo, craftItemName, fill); +// return outputEncapsulationObject(PromptMessageEnum.SUCCESS, fill, locale); } } diff --git a/src/main/java/com/xkrs/service/impl/PictureServiceImpl.java b/src/main/java/com/xkrs/service/impl/PictureServiceImpl.java deleted file mode 100644 index 6163c4f..0000000 --- a/src/main/java/com/xkrs/service/impl/PictureServiceImpl.java +++ /dev/null @@ -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 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); - } -} diff --git a/src/main/java/com/xkrs/service/impl/SpecServiceImpl.java b/src/main/java/com/xkrs/service/impl/SpecServiceImpl.java deleted file mode 100644 index ccac25e..0000000 --- a/src/main/java/com/xkrs/service/impl/SpecServiceImpl.java +++ /dev/null @@ -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 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); - } -} diff --git a/src/main/java/com/xkrs/util/DataDictQuery.java b/src/main/java/com/xkrs/util/DataDictQuery.java deleted file mode 100644 index 5d8e4a5..0000000 --- a/src/main/java/com/xkrs/util/DataDictQuery.java +++ /dev/null @@ -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 selectDataDict(String inspectionItemName, String inspectionItemCode) { - Specification specification = (root, criteriaQuery, criteriaBuilder) -> { - List 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); - } -} diff --git a/src/main/java/com/xkrs/util/DataSourceQuery.java b/src/main/java/com/xkrs/util/DataSourceQuery.java deleted file mode 100644 index c982332..0000000 --- a/src/main/java/com/xkrs/util/DataSourceQuery.java +++ /dev/null @@ -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 selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName) { - Specification specification = (root, criteriaQuery, criteriaBuilder) -> { - List 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")); - } -} diff --git a/src/main/java/com/xkrs/util/PictureQuery.java b/src/main/java/com/xkrs/util/PictureQuery.java deleted file mode 100644 index cd7ab46..0000000 --- a/src/main/java/com/xkrs/util/PictureQuery.java +++ /dev/null @@ -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 selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName) { - Specification specification = (root, criteriaQuery, criteriaBuilder) -> { - List 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); - } -} diff --git a/src/main/java/com/xkrs/util/SpecQuery.java b/src/main/java/com/xkrs/util/SpecQuery.java deleted file mode 100644 index d744a90..0000000 --- a/src/main/java/com/xkrs/util/SpecQuery.java +++ /dev/null @@ -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 selectSpec(String machineTypeNo, String inspectionItemCode, String craftItemName) { - Specification specification = (root, criteriaQuery, criteriaBuilder) -> { - List 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); - } -}