basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java
@@ -1,41 +1,26 @@ package com.ruoyi.basic.controller; import cn.hutool.core.util.ObjectUtil; import cn.hutool.poi.excel.ExcelUtil; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.system.service.ISysDictTypeService; import com.ruoyi.basic.dto.PageTestObjectDto; import com.ruoyi.basic.dto.ProductDTO1; import com.ruoyi.basic.excel.StructureTestObjectData; import com.ruoyi.basic.excel.StructureTestObjectListener; import com.ruoyi.basic.pojo.Product; import com.ruoyi.basic.pojo.StandardTemplate; import com.ruoyi.basic.pojo.StructureItemParameter; import com.ruoyi.basic.pojo.StructureTestObject; import com.ruoyi.basic.service.CapacityScopeService; import com.ruoyi.basic.service.ProductService; import com.ruoyi.basic.service.StandardTemplateService; import com.ruoyi.basic.service.StructureItemParameterService; import com.ruoyi.common.core.domain.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.apache.commons.lang3.ObjectUtils; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** * æ£éªé¡¹ç®åæ°(StructureItemParameter)表æ§å¶å± @@ -55,9 +40,6 @@ private StructureItemParameterService structureItemParameterService; private ISysDictTypeService dictTypeService; private StandardTemplateService standardTemplateService; @ApiOperation(value = "è·åé¡¹ç®æ£éªåæ°å表") @GetMapping("/selectItemParameterList") @@ -154,229 +136,7 @@ @PostMapping("/importEquipData") @Transactional public Result importEquipData(@RequestParam("file") MultipartFile file) throws Exception { InputStream inputStream = file.getInputStream(); List<StructureItemParameter> lists = new ArrayList<>(); AtomicReference<String> sample = new AtomicReference<>(); ExcelUtil.readBySax(inputStream, -1, (i, l, list1) -> { if (l == 1) { sample.set(list1.get(1) + ""); } if (l >= 1) { StructureItemParameter str = new StructureItemParameter(); // æµè¯å¯¹è±¡ if (list1.get(1) == null) { str.setSample(null); } else { String brand = (String) list1.get(1); StringBuilder builder = new StringBuilder(); builder.append("["); // 产å if (ObjectUtil.isNotEmpty(list1.get(2))) { String production = (String) list1.get(2); if (!production.contains("ï¼")) { builder.append(String.format("[\"%s\",\"%s\"]", brand, production)); } else { Arrays.stream(production.split("ï¼")).forEach(item -> { builder.append(String.format("[\"%s\",\"%s\"],", brand, item)); }); builder.deleteCharAt(builder.length() - 1); } } else { builder.append("["); builder.append(String.format("\"%s\"", brand)); builder.append("]"); } builder.append("]"); str.setSample(builder.toString()); } // æ£éªé¡¹ str.setInspectionItem(list1.get(4).toString().trim()); // æ£éªé¡¹è±æ if (list1.get(5) != null) { str.setInspectionItemEn(list1.get(5).toString()); } // æ£éªå项 if (list1.get(6) == null) { str.setInspectionItemSubclass(null); } else { str.setInspectionItemSubclass(list1.get(6).toString().trim()); } // æ£éªåé¡¹è±æ if (list1.get(7) == null) { str.setInspectionItemSubclassEn(null); } else { str.setInspectionItemSubclassEn(String.valueOf(list1.get(7).toString())); } // æ£éªé¡¹åç±» if (list1.get(22) != null && list1.get(22) != "") { str.setInspectionItemClass(list1.get(22).toString().trim()); } else { str.setInspectionItemClass(null); } // æ£éªé¡¹åç±»è±æ if (list1.get(23) != null && list1.get(23) != "") { str.setInspectionItemClassEn(list1.get(23) + ""); } else { str.setInspectionItemClassEn(null); } LambdaQueryWrapper<StructureItemParameter> wrapper = Wrappers.lambdaQuery(StructureItemParameter.class) .eq(StructureItemParameter::getInspectionItem, str.getInspectionItem()) .eq(StructureItemParameter::getSample, str.getSample()) .last("limit 1"); // 夿æ¯å¦ææ£éªé¡¹ç±»å if (ObjectUtils.isNotEmpty(str.getInspectionItemClass())) { wrapper.eq(StructureItemParameter::getInspectionItemClass, str.getInspectionItemClass()); } // 夿æ¯å¦ææ£éªå项 if (ObjectUtils.isNotEmpty(str.getInspectionItemSubclass())) { wrapper.eq(StructureItemParameter::getInspectionItemSubclass, str.getInspectionItemSubclass()); } StructureItemParameter db_str = structureItemParameterService.getOne(wrapper); if (ObjectUtils.isNotEmpty(db_str)) { str.setId(db_str.getId()); } // æ¹æ³åç§° if (list1.get(8) == null) { str.setMethod(null); } else { StringBuffer buffer = new StringBuffer(); String input = list1.get(8).toString(); buffer.append("["); String[] values = input.split("ï¼"); for (String value : values) { buffer.append("\"").append(value.trim()).append("\","); } buffer.deleteCharAt(buffer.length() - 1); buffer.append("]"); str.setMethod(buffer.toString()); } // è¯éªå®¤ if (list1.get(9) == null) { str.setSonLaboratory(null); } else { str.setSonLaboratory(list1.get(9).toString()); } // 计éåä½ if (list1.get(10) == null) { str.setUnit(null); } else { str.setUnit(list1.get(10).toString()); } // è¦æ±å¼ if (list1.get(11) == null) { str.setAskTell(null); } else { str.setAskTell(list1.get(11).toString()); } // è¦æ±æè¿° if (list1.get(12) == null) { str.setAsk(null); } else { str.setAsk(list1.get(12).toString()); } // åä»· if (list1.get(13) == null) { str.setPrice(null); } else { str.setPrice(list1.get(13) + ""); } // å·¥æ¶ç³»æ° if (list1.get(14) == null) { str.setManHour(null); } else { str.setManHour(Double.valueOf(list1.get(14).toString())); } // å·¥æ¶åç» if (list1.get(15) == null) { str.setManHourGroup(null); } else { str.setManHourGroup(list1.get(15).toString()); } // é¢è®¡å®ææ¶é´ if (list1.get(16) == null) { str.setManDay(null); } else { str.setManDay(Integer.valueOf(list1.get(16).toString())); } // æ°æ®ç±»å String jy; if (list1.get(17).toString().equals("éééç±»å")) { jy = "0"; } else { jy = "1"; } str.setInspectionItemType(jy); // æ£éªé¡¹ç±»å String validateValueType = list1.get(18).toString(); if (ObjectUtils.isNotEmpty(validateValueType)) { List<SysDictData> enums = dictTypeService.selectDictDataByName("æ£éªå¼ç±»å") .stream().filter(sysDictData -> sysDictData.getDictLabel().equals(validateValueType)).collect(Collectors.toList()); str.setInspectionValueType(enums.get(0).getDictValue()); } int bsm; //ç¹æ®æ è¯ if (list1.get(19).toString().equals("å¦")) { bsm = 0; } else { bsm = 1; } str.setBsm(bsm + ""); // æ°ååå ¸ if (list1.get(20) != null) { str.setDic(list1.get(20) + ""); } else { str.setDic(null); } // åå§è®°å½æ¨¡æ¿ StandardTemplate standTempIdByName = standardTemplateService.getStandTempIdByName(String.valueOf(list1.get(21))); if (standTempIdByName != null) { str.setTemplateId(standTempIdByName.getId()); } else { str.setTemplateId(null); } try { if (list1.get(24) != null) { str.setLaboratory(list1.get(24) + ""); } } catch (Exception e) { } // æ¡ä»¶ if (list1.get(25) == null) { str.setRadiusList(null); } else { StringBuffer buffer = new StringBuffer(); String input = list1.get(25).toString(); buffer.append("["); String[] values = input.split("ï¼"); for (String value : values) { buffer.append("\"").append(value.trim()).append("\","); } buffer.deleteCharAt(buffer.length() - 1); buffer.append("]"); str.setRadiusList(buffer.toString()); } //æ¶è´¹æ å if (list1.get(26) == null) { str.setRates(null); } else { str.setRates(list1.get(26) + ""); } lists.add(str); } }); // structureItemParameterService.removeNoSample(sample.get()); // å¦ææ°æ®åºéé¢çæ°æ®åå¨é£ä¹å°±æ§è¡æ´æ°æ·è´æä½ try { structureItemParameterService.saveOrUpdateBatch(lists); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("æå¡ç«¯æ¥é"); } structureItemParameterService.importEquipData(file); return Result.success(); } basic-server/src/main/java/com/ruoyi/basic/mapper/StructureItemParameterMapper.java
@@ -25,6 +25,12 @@ List<TestItemDto> getItemTree(); int removeNoSample(@Param("sample") String sample); /** * æ¥è¯¢è®¾å¤ä¿¡æ¯ * @param managementNumberList * @return */ List<Integer> selectDeviceIdsByNumber(@Param("managementNumberList") List<String> managementNumberList); } basic-server/src/main/java/com/ruoyi/basic/pojo/StructureItemParameter.java
@@ -120,5 +120,8 @@ @ApiModelProperty(value = "设å¤id") private String deviceIds; @ApiModelProperty(value = "æ½æ£ç±»å, 1:æåº¦, 2:å£åº¦, 3:年度") private String spotCheckType; } basic-server/src/main/java/com/ruoyi/basic/service/StructureItemParameterService.java
@@ -2,7 +2,15 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.basic.pojo.StructureItemParameter; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; public interface StructureItemParameterService extends IService<StructureItemParameter> { void removeNoSample(String sample); /** * å¯¼å ¥æ£éªé¡¹ç® * @param file */ void importEquipData(MultipartFile file) throws IOException; } basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureItemParameterServiceImpl.java
@@ -1,14 +1,34 @@ package com.ruoyi.basic.service.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.poi.excel.ExcelUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.basic.mapper.StructureItemParameterMapper; import com.ruoyi.basic.pojo.StandardTemplate; import com.ruoyi.basic.pojo.StructureItemParameter; import com.ruoyi.basic.service.StandardTemplateService; import com.ruoyi.basic.service.StructureItemParameterService; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.system.service.ISysDictTypeService; import lombok.AllArgsConstructor; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @Service @AllArgsConstructor @@ -16,9 +36,257 @@ @Resource private StructureItemParameterMapper structureItemParameterMapper; @Resource private ISysDictTypeService dictTypeService; @Resource private StandardTemplateService standardTemplateService; /** * * @param file */ @Override public void removeNoSample(String sample) { structureItemParameterMapper.removeNoSample("\""+sample+"\""); public void importEquipData(MultipartFile file) throws IOException { InputStream inputStream = file.getInputStream(); List<StructureItemParameter> lists = new ArrayList<>(); AtomicReference<String> sample = new AtomicReference<>(); ExcelUtil.readBySax(inputStream, -1, (i, l, list1) -> { if (l == 1) { sample.set(list1.get(1) + ""); } if (l >= 1) { StructureItemParameter str = new StructureItemParameter(); // æµè¯å¯¹è±¡ if (list1.get(1) == null) { str.setSample(null); } else { String brand = (String) list1.get(1); StringBuilder builder = new StringBuilder(); builder.append("["); // 产å if (ObjectUtil.isNotEmpty(list1.get(2))) { String production = (String) list1.get(2); if (!production.contains("ï¼")) { builder.append(String.format("[\"%s\",\"%s\"]", brand, production)); } else { Arrays.stream(production.split("ï¼")).forEach(item -> { builder.append(String.format("[\"%s\",\"%s\"],", brand, item)); }); builder.deleteCharAt(builder.length() - 1); } } else { builder.append("["); builder.append(String.format("\"%s\"", brand)); builder.append("]"); } builder.append("]"); str.setSample(builder.toString()); } // æ£éªé¡¹ str.setInspectionItem(list1.get(4).toString().trim()); // æ£éªé¡¹è±æ if (list1.get(5) != null) { str.setInspectionItemEn(list1.get(5).toString()); } // æ£éªå项 if (list1.get(6) == null) { str.setInspectionItemSubclass(null); } else { str.setInspectionItemSubclass(list1.get(6).toString().trim()); } // æ£éªåé¡¹è±æ if (list1.get(7) == null) { str.setInspectionItemSubclassEn(null); } else { str.setInspectionItemSubclassEn(String.valueOf(list1.get(7).toString())); } // æ£éªé¡¹åç±» if (list1.get(22) != null && list1.get(22) != "") { str.setInspectionItemClass(list1.get(22).toString().trim()); } else { str.setInspectionItemClass(null); } // æ£éªé¡¹åç±»è±æ if (list1.get(23) != null && list1.get(23) != "") { str.setInspectionItemClassEn(list1.get(23) + ""); } else { str.setInspectionItemClassEn(null); } LambdaQueryWrapper<StructureItemParameter> wrapper = Wrappers.lambdaQuery(StructureItemParameter.class) .eq(StructureItemParameter::getInspectionItem, str.getInspectionItem()) .eq(StructureItemParameter::getSample, str.getSample()) .last("limit 1"); // 夿æ¯å¦ææ£éªé¡¹ç±»å if (ObjectUtils.isNotEmpty(str.getInspectionItemClass())) { wrapper.eq(StructureItemParameter::getInspectionItemClass, str.getInspectionItemClass()); } // 夿æ¯å¦ææ£éªå项 if (ObjectUtils.isNotEmpty(str.getInspectionItemSubclass())) { wrapper.eq(StructureItemParameter::getInspectionItemSubclass, str.getInspectionItemSubclass()); } StructureItemParameter db_str = this.getOne(wrapper); if (ObjectUtils.isNotEmpty(db_str)) { str.setId(db_str.getId()); } // æ¹æ³åç§° if (list1.get(8) == null) { str.setMethod(null); } else { StringBuffer buffer = new StringBuffer(); String input = list1.get(8).toString(); buffer.append("["); String[] values = input.split("ï¼"); for (String value : values) { buffer.append("\"").append(value.trim()).append("\","); } buffer.deleteCharAt(buffer.length() - 1); buffer.append("]"); str.setMethod(buffer.toString()); } // è¯éªå®¤ if (list1.get(9) == null) { str.setSonLaboratory(null); } else { str.setSonLaboratory(list1.get(9).toString()); } // 计éåä½ if (list1.get(10) == null) { str.setUnit(null); } else { str.setUnit(list1.get(10).toString()); } // è¦æ±å¼ if (list1.get(11) == null) { str.setAskTell(null); } else { str.setAskTell(list1.get(11).toString()); } // è¦æ±æè¿° if (list1.get(12) == null) { str.setAsk(null); } else { str.setAsk(list1.get(12).toString()); } // åä»· if (list1.get(13) == null) { str.setPrice(null); } else { str.setPrice(list1.get(13) + ""); } // å·¥æ¶ç³»æ° if (list1.get(14) == null) { str.setManHour(null); } else { str.setManHour(Double.valueOf(list1.get(14).toString())); } // å·¥æ¶åç» if (list1.get(15) == null) { str.setManHourGroup(null); } else { str.setManHourGroup(list1.get(15).toString()); } // é¢è®¡å®ææ¶é´ if (list1.get(16) == null) { str.setManDay(null); } else { str.setManDay(Integer.valueOf(list1.get(16).toString())); } // æ°æ®ç±»å String jy; if (list1.get(17).toString().equals("éééç±»å")) { jy = "0"; } else { jy = "1"; // ç»å®è®¾å¤ if (list1.get(28) == null) { str.setRates(null); } else { // æ¥è¯¢è®¾å¤ä¿¡æ¯ List<String> managementNumberList = StrUtil.split(list1.get(28).toString(), 'ï¼'); if (CollectionUtils.isNotEmpty(managementNumberList)) { List<Integer> deviceIds = structureItemParameterMapper.selectDeviceIdsByNumber(managementNumberList); if (CollectionUtils.isNotEmpty(deviceIds)) { str.setDeviceIds(CollUtil.join(deviceIds, ",")); } } } } str.setInspectionItemType(jy); // æ£éªé¡¹ç±»å String validateValueType = list1.get(18).toString(); if (ObjectUtils.isNotEmpty(validateValueType)) { List<SysDictData> enums = dictTypeService.selectDictDataByName("æ£éªå¼ç±»å") .stream().filter(sysDictData -> sysDictData.getDictLabel().equals(validateValueType)).collect(Collectors.toList()); str.setInspectionValueType(enums.get(0).getDictValue()); } int bsm; //ç¹æ®æ è¯ if (list1.get(19).toString().equals("å¦")) { bsm = 0; } else { bsm = 1; } str.setBsm(bsm + ""); // æ°ååå ¸ if (list1.get(20) != null) { str.setDic(list1.get(20) + ""); } else { str.setDic(null); } // åå§è®°å½æ¨¡æ¿ StandardTemplate standTempIdByName = standardTemplateService.getStandTempIdByName(String.valueOf(list1.get(21))); if (standTempIdByName != null) { str.setTemplateId(standTempIdByName.getId()); } else { str.setTemplateId(null); } try { if (list1.get(24) != null) { str.setLaboratory(list1.get(24) + ""); } } catch (Exception e) { } // æ¡ä»¶ if (list1.get(25) == null) { str.setRadiusList(null); } else { StringBuffer buffer = new StringBuffer(); String input = list1.get(25).toString(); buffer.append("["); String[] values = input.split("ï¼"); for (String value : values) { buffer.append("\"").append(value.trim()).append("\","); } buffer.deleteCharAt(buffer.length() - 1); buffer.append("]"); str.setRadiusList(buffer.toString()); } //æ¶è´¹æ å if (list1.get(26) == null) { str.setRates(null); } else { str.setRates(list1.get(26) + ""); } // æ½æ ·ç±»å String spotCheckType = list1.get(27).toString(); if (ObjectUtils.isNotEmpty(spotCheckType)) { List<SysDictData> enums = dictTypeService.selectDictDataByName("æ½æ£ç±»å") .stream().filter(sysDictData -> sysDictData.getDictLabel().equals(spotCheckType)).collect(Collectors.toList()); str.setSpotCheckType(enums.get(0).getDictValue()); } lists.add(str); } }); try { this.saveOrUpdateBatch(lists); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("æå¡ç«¯æ¥é"); } } } basic-server/src/main/resources/mapper/StructureItemParameterMapper.xml
@@ -3,11 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.basic.mapper.StructureItemParameterMapper"> <delete id="removeNoSample"> delete from structure_item_parameter where sample like concat('%', #{sample}, '%') </delete> <select id="selectItemParameterList" resultType="com.ruoyi.basic.pojo.StructureItemParameter"> select * from (select A.id, inspection_item, @@ -41,7 +37,8 @@ code, radius_list, rates, device_ids device_ids, spot_check_type from (select *, CASE WHEN INSTR(sample, ',') > 0 THEN @@ -109,6 +106,13 @@ from structure_test_object sto left join product p on p.object_id = sto.id </select> <select id="selectDeviceIdsByNumber" resultType="java.lang.Integer"> select id from device where management_number in <foreach item="item" collection="managementNumberList" open="(" separator="),(" close=")"> #{item} </foreach> </select> <resultMap id="itemDto" type="com.ruoyi.basic.dto.TestItemDto"> <result column="sId" property="id"/> cnas-device/src/main/java/com/ruoyi/device/mapper/DeviceMapper.java
@@ -36,5 +36,11 @@ List<Map<String, Object>> treeDevice(@Param("deviceName") String deviceName); DeviceDto selectDeviceByCode(Integer id); /** * æ¥è¯¢å°è¾¾æ ¡åæææç设å¤-æå5天 * @return */ List<Device> selectOverdueDevice(); } cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceAcceptanceServiceImpl.java
@@ -151,6 +151,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceAccidentReportServiceImpl.java
@@ -181,6 +181,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceBreakdownMaintenanceServiceImpl.java
@@ -144,6 +144,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceCalibrationPlanServiceImpl.java
@@ -301,6 +301,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceExaminePlanServiceImpl.java
@@ -304,6 +304,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceExamineRecordContrastServiceImpl.java
@@ -185,6 +185,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceExamineRecordServiceImpl.java
@@ -229,6 +229,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceExternalApplyServiceImpl.java
@@ -153,6 +153,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceImpowerServiceImpl.java
@@ -290,6 +290,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceInspectionRecordServiceImpl.java
@@ -215,6 +215,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceMaintenanceImpl.java
@@ -135,6 +135,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceMaintenancePlanServiceImpl.java
@@ -196,6 +196,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceRecordServiceImpl.java
@@ -138,6 +138,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceScrappedServiceImpl.java
@@ -170,6 +170,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceServiceImpl.java
@@ -353,6 +353,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); @@ -488,6 +489,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceStateServiceImpl.java
@@ -151,6 +151,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/service/impl/DeviceTraceabilityManagementServiceImpl.java
@@ -281,6 +281,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-device/src/main/java/com/ruoyi/device/task/DeviceRecordSchedule.java
@@ -3,7 +3,9 @@ import com.ruoyi.common.core.domain.entity.User; import com.ruoyi.common.utils.WxCpUtils; import com.ruoyi.device.dto.DeviceRecordDto; import com.ruoyi.device.mapper.DeviceMapper; import com.ruoyi.device.mapper.DeviceRecordMapper; import com.ruoyi.device.pojo.Device; import com.ruoyi.device.pojo.DeviceRecord; import com.ruoyi.system.mapper.UserMapper; import org.springframework.scheduling.annotation.Scheduled; @@ -20,6 +22,9 @@ */ @Component public class DeviceRecordSchedule { @Resource private DeviceMapper deviceMapper; @Resource private DeviceRecordMapper deviceRecordMapper; @Resource @@ -31,7 +36,7 @@ * æéå¡«å设å¤ä½¿ç¨è®°å½ */ // @Scheduled(cron = "0/5 * * * * *") @Scheduled(cron = "0 0 9 * * 6") // æ¯å¨å æ§è¡ä¸æ¬¡ // @Scheduled(cron = "0 0 9 * * 6") // æ¯å¨å æ§è¡ä¸æ¬¡ public void task1() { // æ¥è¯¢æªå¡«åç设å¤ä½¿ç¨è®°å½ List<DeviceRecordDto> deviceRecords = deviceRecordMapper.selectNotFilled(); @@ -58,8 +63,41 @@ }); }); } /** * æ¯å¤©9ç¹æ§è¡ä¸æ¬¡ é¤äºææå¤© * 夿æ¯å¦æè®¾å¤å°è¾¾æ ¡åæææ */ // @Scheduled(cron = "0/5 * * * * *") // @Scheduled(cron = "0 0 9 * * 1-6") // æ¯å¤©9ç¹æ§è¡ä¸æ¬¡ é¤äºææå¤© public void task2() { // æ¥è¯¢å°è¾¾æ ¡åæææç设å¤-æå5天 List<Device> deviceList = deviceMapper.selectOverdueDevice(); Map<Integer, List<Device>> userPersonIdMap = deviceList.stream().collect(Collectors.groupingBy(Device::getEquipmentManager)); userPersonIdMap.forEach((userId, recordList) -> { threadPoolTaskExecutor.execute(() -> { // ä¼ä¸å¾®ä¿¡éç¥å¡«å设å¤ä½¿ç¨è®°å½ User user = userMapper.selectById(userId); String message = ""; message += "设å¤ä½¿ç¨è®°å½æªå¡«åæééç¥"; for (Device deviceRecord : recordList) { message += "\n设å¤åç§°ç¼å·: " + deviceRecord.getDeviceName() + "-" + deviceRecord.getManagementNumber(); message += "\nå§æç¼å·: " + deviceRecord.getSampleCode(); message += "\n"; } message += "\n请å»å¡«å设å¤ä½¿ç¨è®°å½"; //åéä¼ä¸å¾®ä¿¡æ¶æ¯éç¥ try { WxCpUtils.inform(user.getAccount(), message, null); } catch (Exception e) { throw new RuntimeException(e); } }); }); } } cnas-device/src/main/resources/mapper/DeviceMapper.xml
@@ -142,6 +142,7 @@ <resultMap id="deviceNameMap" type="map"> <result property="value" column="id"/> <result property="label" column="device_name"/> <result property="activationDate" column="activation_date"/> <result property="managementNumber" column="management_number"/> </resultMap> @@ -152,7 +153,8 @@ case when d.storage_point is null || d.storage_point ='' then 'å ¶ä»' else d.storage_point end as storage_point, d.device_name, d.management_number, null as value null as value, d.activation_date from device d LEFT JOIN laboratory l ON l.id = d.subordinate_departments_id <where> @@ -160,7 +162,6 @@ and device_name like concat('%',#{deviceName},'%') </if> </where> order by l.laboratory_name desc, d.storage_point desc </select> <select id="selectDeviceByCode" resultType="com.ruoyi.device.dto.DeviceDto"> @@ -181,4 +182,15 @@ u1.name, u2.name </select> <!-- æ¥è¯¢å°è¾¾æ ¡åæææç设å¤-æå5天 --> <select id="selectOverdueDevice" resultType="com.ruoyi.device.pojo.Device"> SELECT * FROM device WHERE -- çéåº activation_date å¨å½åæ¥æåäºå¤©å çæ°æ® activation_date BETWEEN now() AND now() + INTERVAL 5 DAY -- çéåº activation_date å·²ç»è¶ è¿å½åæ¥æçæ°æ® OR activation_date < now() </select> </mapper> cnas-manage/src/main/java/com/ruoyi/manage/schedule/ManageRecordTotalSchedule.java
@@ -20,7 +20,7 @@ @Resource private ManageRecordIntervalsTotalService manageRecordIntervalsTotalService; @Scheduled(cron = "0 0 2 1 1 ?") //æ¯å¹´1æ1å·2ç¹ // @Scheduled(cron = "0 0 2 1 1 ?") //æ¯å¹´1æ1å·2ç¹ public void manageRecordTotal() { ManageRecordTotal manageRecordTotal = new ManageRecordTotal(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ClientSatisfactionServiceImpl.java
@@ -161,6 +161,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/InternalCheckServiceImpl.java
@@ -221,6 +221,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/InternalCorrectServiceImpl.java
@@ -310,6 +310,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/InternalImplementServiceImpl.java
@@ -228,6 +228,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/InternalMeetingServiceImpl.java
@@ -191,6 +191,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/InternalPlanServiceImpl.java
@@ -248,6 +248,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/InternalReportServiceImpl.java
@@ -155,6 +155,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageControlPlanListServiceImpl.java
@@ -120,6 +120,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageMeetingServiceImpl.java
@@ -152,6 +152,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageRecordAuditServiceImpl.java
@@ -155,6 +155,8 @@ OutputStream outputStream = new FileOutputStream(file); IOUtils.copy(inputStream, outputStream); url = file.getAbsolutePath(); inputStream.close(); outputStream.close(); } catch (FileNotFoundException e) { throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); } catch (IOException e) { cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageRecordCancelServiceImpl.java
@@ -90,6 +90,8 @@ OutputStream outputStream = new FileOutputStream(file); IOUtils.copy(inputStream, outputStream); url = file.getAbsolutePath(); inputStream.close(); outputStream.close(); } catch (FileNotFoundException e) { throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); } catch (IOException e) { cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageRecordCheckServiceImpl.java
@@ -100,6 +100,8 @@ OutputStream outputStream = new FileOutputStream(file); IOUtils.copy(inputStream, outputStream); url = file.getAbsolutePath(); inputStream.close(); outputStream.close(); } catch (FileNotFoundException e) { throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); } catch (IOException e) { cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageRecordIntervalsServiceImpl.java
@@ -76,6 +76,8 @@ OutputStream outputStream = new FileOutputStream(file); IOUtils.copy(inputStream, outputStream); url = file.getAbsolutePath(); inputStream.close(); outputStream.close(); } catch (FileNotFoundException e) { throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); } catch (IOException e) { cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageRecordIntervalsTotalServiceImpl.java
@@ -130,6 +130,8 @@ OutputStream outputStream = new FileOutputStream(file); IOUtils.copy(inputStream, outputStream); url = file.getAbsolutePath(); inputStream.close(); outputStream.close(); } catch (FileNotFoundException e) { throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); } catch (IOException e) { cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageRecordIssueRecycleServiceImpl.java
@@ -78,6 +78,8 @@ OutputStream outputStream = new FileOutputStream(file); IOUtils.copy(inputStream, outputStream); url = file.getAbsolutePath(); inputStream.close(); outputStream.close(); } catch (FileNotFoundException e) { throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); } catch (IOException e) { cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageRecordTotalServiceImpl.java
@@ -131,6 +131,8 @@ OutputStream outputStream = new FileOutputStream(file); IOUtils.copy(inputStream, outputStream); url = file.getAbsolutePath(); inputStream.close(); outputStream.close(); } catch (FileNotFoundException e) { throw new ErrorException("æ¾ä¸å°æ¨¡æ¿æä»¶"); } catch (IOException e) { cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageReviewProgramServiceImpl.java
@@ -107,6 +107,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageReviewReportServiceImpl.java
@@ -128,6 +128,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-manage/src/main/java/com/ruoyi/manage/service/impl/ManageRiskAssessmentResultsServiceImpl.java
@@ -115,6 +115,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-personnel/src/main/java/com/ruoyi/personnel/service/impl/PersonBasicInfoServiceImpl.java
@@ -246,6 +246,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-personnel/src/main/java/com/ruoyi/personnel/service/impl/PersonCommunicationAbilityServiceImpl.java
@@ -105,6 +105,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-personnel/src/main/java/com/ruoyi/personnel/service/impl/PersonJobResponsibilitiesServiceImpl.java
@@ -105,6 +105,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-personnel/src/main/java/com/ruoyi/personnel/service/impl/PersonPersonnelCapacityServiceImpl.java
@@ -103,6 +103,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-personnel/src/main/java/com/ruoyi/personnel/service/impl/PersonPostAuthorizationRecordServiceImpl.java
@@ -123,6 +123,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-personnel/src/main/java/com/ruoyi/personnel/service/impl/PersonTrainingRecordServiceImpl.java
@@ -117,6 +117,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-personnel/src/main/java/com/ruoyi/personnel/service/impl/PersonTrainingServiceImpl.java
@@ -288,6 +288,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); @@ -364,6 +365,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-personnel/src/main/java/com/ruoyi/personnel/task/PersonTrainingSchedule.java
@@ -28,10 +28,10 @@ private ThreadPoolTaskExecutor threadPoolTaskExecutor; /** * æéå¡«å设å¤ä½¿ç¨è®°å½ * æéå¡«å人åå¹è®è®°å½ */ // @Scheduled(cron = "0/5 * * * * *") @Scheduled(cron = "0 0 9 1 * *") // æ¯æä¸å·æ§è¡ // @Scheduled(cron = "0 0 9 1,15 * *") // æ¯æä¸å·æ§è¡ public void task1() { // æ¥è¯¢å½æå¹è®è®¡å DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.M"); cnas-process/src/main/java/com/ruoyi/process/controller/ProcessReportController.java
@@ -34,7 +34,7 @@ @ApiOperation(value = "æ¥è¯¢æ£éªæ¥ååæ¾ç»è®°å表") @GetMapping("/pageProcessReport") public Result pageProcessReport(ProcessReport processReport , Page page) { public Result pageProcessReport(ProcessReportDto processReport , Page page) { return Result.success(processReportService.pageProcessReport(page, processReport)); } @@ -64,11 +64,8 @@ @ApiOperation(value = "å¯¼åºæ£éªæ¥ååæ¾ç»è®°è¡¨") @GetMapping("/exportProcessReport") public void exportProcessReport(String ids, HttpServletResponse response) { List<Integer> list = Arrays.stream(ids.split(",")) .map(Integer::parseInt) .collect(Collectors.toList()); processReportService.exportProcessReport(list, response); public void exportProcessReport(ProcessReportDto dto, HttpServletResponse response) { processReportService.exportProcessReport(dto, response); } } cnas-process/src/main/java/com/ruoyi/process/controller/QualitySuperviseManagementReviewController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,71 @@ package com.ruoyi.process.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.Result; import com.ruoyi.process.pojo.QualitySupervise; import com.ruoyi.process.pojo.QualitySuperviseManagementReview; import com.ruoyi.process.service.QualitySuperviseManagementReviewService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; /** * <p> * è´¨éçç£ç®¡çè¯å®¡è¾å ¥ææ å端æ§å¶å¨ * </p> * * @author * @since 2025-05-07 10:46:11 */ @RestController @RequestMapping("/managementReview") @Api(tags = "è´¨éçç£ç®¡çè¯å®¡è¾å ¥ææ") @AllArgsConstructor public class QualitySuperviseManagementReviewController { private QualitySuperviseManagementReviewService qualitySuperviseManagementReviewService; /** * å页æ¥è¯¢ * @return */ @ApiOperation(value = "å页æ¥è¯¢") @GetMapping("/pageManagementReview") public Result<IPage<QualitySuperviseManagementReview>> pageManagementReview(QualitySuperviseManagementReview managementReview, Page page) { return Result.success(qualitySuperviseManagementReviewService.pageManagementReview(page, managementReview)); } /** * æ°å¢æä¿®æ¹ * @return */ @ApiOperation(value = "æ°å¢æä¿®æ¹") @PostMapping("/saveOrUpdateManagementReview") public Result saveOrUpdateManagementReview(@RequestBody QualitySuperviseManagementReview managementReview) { return Result.success(qualitySuperviseManagementReviewService.saveOrUpdate(managementReview)); } /** * å é¤ * @return */ @ApiOperation(value = "å é¤") @DeleteMapping("/deleteManagementReview") public Result deleteManagementReview(Integer managementReviewId) { return Result.success(qualitySuperviseManagementReviewService.removeById(managementReviewId)); } /** * å¯¼åº * @return */ @ApiOperation(value = "导åº") @GetMapping("/exportManagementReview") public void exportManagementReview(Integer managementReviewId,HttpServletResponse response) { qualitySuperviseManagementReviewService.exportManagementReview(managementReviewId, response); } } cnas-process/src/main/java/com/ruoyi/process/dto/ProcessDealDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,19 @@ package com.ruoyi.process.dto; import com.baomidou.mybatisplus.annotation.TableField; import com.ruoyi.process.pojo.ProcessDeal; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @Author zhuo * @Date 2025/4/23 */ @Data public class ProcessDealDto extends ProcessDeal { @ApiModelProperty("åºå·") private String indexs; @ApiModelProperty("æ¶é´") private String dealTimeStr; } cnas-process/src/main/java/com/ruoyi/process/dto/ProcessReportDto.java
@@ -1,12 +1,30 @@ package com.ruoyi.process.dto; import com.baomidou.mybatisplus.annotation.TableField; import com.deepoove.poi.data.PictureRenderData; import com.ruoyi.process.pojo.ProcessReport; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data //å¯¼åº public class ProcessReportDto { public class ProcessReportDto extends ProcessReport { private List<Integer> ids; @ApiModelProperty("åé人å§å") private String sendUserName; @ApiModelProperty("åé人å°å") private String sendUserUrl; @ApiModelProperty("åé人ç¾å") private PictureRenderData sendUserRender; @ApiModelProperty("ç¾æ¶ç¾å") private PictureRenderData signatoryRender; } cnas-process/src/main/java/com/ruoyi/process/mapper/ProcessDealMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.process.dto.ProcessDealDto; import com.ruoyi.process.pojo.ProcessDeal; import org.apache.ibatis.annotations.Param; @@ -21,6 +22,6 @@ IPage<ProcessDeal> pageProcessDeal(Page page, @Param("ew") QueryWrapper<ProcessDeal> queryWrappers); List<ProcessDeal> selectDeal(@Param("id") Integer id); List<ProcessDealDto> selectDeal(@Param("id") Integer id); } cnas-process/src/main/java/com/ruoyi/process/mapper/ProcessOrderDeviceMapper.java
@@ -21,7 +21,7 @@ Set<String> selectDeviceNumber(@Param("inspectionOrderId") Integer inspectionOrderId); List<Integer> selectDeviceIdsByNumbers(@Param("orderDeviceNumbers") Set<String> orderDeviceNumbers); List<Integer> selectDeviceIdsByNumbers(@Param("deviceNumbers") Set<String> deviceNumbers); IPage<ProcessOrderDevice> deviceRecordPage(@Param("deviceId") Integer deviceId, @Param("page") Page page, @Param("sampleCode") String sampleCode, @Param("managementNumber") String managementNumber); } cnas-process/src/main/java/com/ruoyi/process/mapper/ProcessReportMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.process.dto.ProcessReportDto; import com.ruoyi.process.pojo.ProcessReport; import org.apache.ibatis.annotations.Param; @@ -19,7 +20,7 @@ */ public interface ProcessReportMapper extends BaseMapper<ProcessReport> { IPage<ProcessReport> pageProcessReport(Page page, @Param("ew") QueryWrapper<ProcessReport> queryWrappers); IPage<ProcessReportDto> pageProcessReport(Page page, @Param("ew") QueryWrapper<ProcessReportDto> queryWrappers); List<ProcessReport> getIds(@Param("ids") List<Integer> ids); List<ProcessReportDto> exportProcessReport(); } cnas-process/src/main/java/com/ruoyi/process/mapper/QualitySuperviseManagementReviewMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,26 @@ package com.ruoyi.process.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.process.pojo.QualitySuperviseManagementReview; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; /** * <p> * è´¨éçç£ç®¡çè¯å®¡è¾å ¥ææ Mapper æ¥å£ * </p> * * @author * @since 2025-05-07 10:46:11 */ public interface QualitySuperviseManagementReviewMapper extends BaseMapper<QualitySuperviseManagementReview> { /** * å页æ¥è¯¢ * @param page * @return */ IPage<QualitySuperviseManagementReview> pageManagementReview(@Param("page") Page page, @Param("ew") QueryWrapper<QualitySuperviseManagementReview> ew); } cnas-process/src/main/java/com/ruoyi/process/pojo/ProcessDeal.java
@@ -65,8 +65,4 @@ @ApiModelProperty("å ³èçæ ·åæ¥æ¶id") private Integer processSampleId; @ApiModelProperty("åºå·") @TableField(select = false,exist = false) private String indexs; } cnas-process/src/main/java/com/ruoyi/process/pojo/ProcessReport.java
@@ -54,19 +54,8 @@ @ApiModelProperty("åé人") private Integer sendUser; @TableField(select = false,exist = false) private String sendUserName; @ApiModelProperty("ç¾æ¶äºº") private String signatory; @TableField(select = false,exist = false) private String signatoryUrl; @TableField(select = false,exist = false) private String signatoryName; @ApiModelProperty("夿³¨") private String remark; cnas-process/src/main/java/com/ruoyi/process/pojo/QualitySuperviseManagementReview.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,63 @@ package com.ruoyi.process.pojo; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; /** * <p> * è´¨éçç£ç®¡çè¯å®¡è¾å ¥ææ * </p> * * @author * @since 2025-05-07 10:46:11 */ @Getter @Setter @TableName("cnas_quality_supervise_management_review") @ApiModel(value = "QualitySuperviseManagementReview对象", description = "è´¨éçç£ç®¡çè¯å®¡è¾å ¥ææ") public class QualitySuperviseManagementReview implements Serializable { @TableId(value = "management_review_id", type = IdType.AUTO) private Integer managementReviewId; @ApiModelProperty("æä»¶åç§°") private String fileName; @ApiModelProperty("计åå 容") private String implementationContent; @ApiModelProperty("卿å 容") private String dynamicContent; @ApiModelProperty("çç£äºº") private String supervisor; @ApiModelProperty("è´¨éè¯å®¡æ¥æ") private LocalDate superviseDate; @ApiModelProperty("å建人") @TableField(fill = FieldFill.INSERT) private Integer createUser; @ApiModelProperty("å建æ¶é´") @TableField(fill = FieldFill.INSERT) private LocalDateTime createTime; @ApiModelProperty("ä¿®æ¹äºº") @TableField(fill = FieldFill.INSERT_UPDATE) private Integer updateUser; @ApiModelProperty("ä¿®æ¹æ¶é´") @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateTime; } cnas-process/src/main/java/com/ruoyi/process/service/ProcessReportService.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.process.dto.ProcessReportDto; import com.ruoyi.process.pojo.ProcessReport; import javax.servlet.http.HttpServletResponse; @@ -19,7 +20,7 @@ */ public interface ProcessReportService extends IService<ProcessReport> { IPage<ProcessReport> pageProcessReport(Page page, ProcessReport processReport); IPage<ProcessReportDto> pageProcessReport(Page page, ProcessReportDto processReport); void exportProcessReport(List<Integer> ids, HttpServletResponse response); void exportProcessReport(ProcessReportDto dto, HttpServletResponse response); } cnas-process/src/main/java/com/ruoyi/process/service/QualitySuperviseManagementReviewService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ package com.ruoyi.process.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.process.pojo.QualitySuperviseManagementReview; import com.baomidou.mybatisplus.extension.service.IService; import javax.servlet.http.HttpServletResponse; /** * <p> * è´¨éçç£ç®¡çè¯å®¡è¾å ¥ææ æå¡ç±» * </p> * * @author * @since 2025-05-07 10:46:11 */ public interface QualitySuperviseManagementReviewService extends IService<QualitySuperviseManagementReview> { /** * å页æ¥è¯¢ * @param page * @param managementReview * @return */ IPage<QualitySuperviseManagementReview> pageManagementReview(Page page, QualitySuperviseManagementReview managementReview); /** * å¯¼åº * @param managementReviewId * @param response */ void exportManagementReview(Integer managementReviewId, HttpServletResponse response); } cnas-process/src/main/java/com/ruoyi/process/service/impl/InconsistentDistributionServiceImpl.java
@@ -221,6 +221,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-process/src/main/java/com/ruoyi/process/service/impl/InspectionOrderServiceImpl.java
@@ -401,6 +401,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-process/src/main/java/com/ruoyi/process/service/impl/ProcessMethodVerifyServiceImpl.java
@@ -345,6 +345,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-process/src/main/java/com/ruoyi/process/service/impl/ProcessReportServiceImpl.java
@@ -3,6 +3,7 @@ import cn.hutool.core.lang.UUID; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.deepoove.poi.XWPFTemplate; @@ -13,14 +14,15 @@ import com.ruoyi.common.core.domain.entity.User; import com.ruoyi.common.utils.QueryWrappers; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SignatureImageUtil; import com.ruoyi.framework.exception.ErrorException; import com.ruoyi.inspect.util.HackLoopTableRenderPolicy; import com.ruoyi.process.dto.ProcessReportDto; import com.ruoyi.process.mapper.ProcessReportMapper; import com.ruoyi.process.pojo.ProcessReport; import com.ruoyi.process.service.ProcessReportService; import com.ruoyi.system.mapper.UserMapper; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.xwpf.usermodel.*; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -52,45 +54,32 @@ @Resource private ProcessReportMapper processReportMapper; @Value("${wordUrl}") private String wordUrl; @Value("${file.path}") private String imgUrl; @Resource private UserMapper userMapper; @Override public IPage<ProcessReport> pageProcessReport(Page page, ProcessReport processReport) { //todo ä» çæ IPage<ProcessReport> processReportIPage = processReportMapper.pageProcessReport(page, QueryWrappers.queryWrappers(processReport)); // for (ProcessReport record : processReportIPage.getRecords()) { // List<String> name = new ArrayList<>(); // for (String s : record.getSignatory().split(",")) { // User user = userMapper.selectById(Integer.parseInt(s)); // name.add(user.getName()); // } // String signatoryName = name.stream().collect(Collectors.joining(",")); // record.setSignatoryName(signatoryName); // } public IPage<ProcessReportDto> pageProcessReport(Page page, ProcessReportDto processReport) { IPage<ProcessReportDto> processReportIPage = processReportMapper.pageProcessReport(page, QueryWrappers.queryWrappers(processReport)); return processReportIPage; } @Override public void exportProcessReport(List<Integer> ids, HttpServletResponse response) { List<ProcessReport> processReports = processReportMapper.getIds(ids); // for (ProcessReport record : processReports) { // List<String> name = new ArrayList<>(); // if(StringUtils.isNotBlank(record.getSignatory())){ // for (String s : record.getSignatory().split(",")) { // User user = userMapper.selectById(Integer.parseInt(s)); // name.add(user.getName()); // } // String signatoryName = name.stream().collect(Collectors.joining(",")); // record.setSignatoryName(signatoryName); // } // } public void exportProcessReport(ProcessReportDto dto, HttpServletResponse response) { List<ProcessReportDto> processReports = processReportMapper.exportProcessReport(); for (ProcessReportDto processReport : processReports) { // åé人çæç¾åå¾ç processReport.setSendUserRender(StringUtils.isNotBlank(processReport.getSendUserUrl()) ? Pictures.ofLocal(imgUrl + "/" + processReport.getSendUserUrl()).create() : null); // ç¾æ¶äººçæå¾ç processReport.setSignatoryRender(StringUtils.isNotBlank(processReport.getSignatory()) ? Pictures.ofStream(SignatureImageUtil.saveImageToFile(processReport.getSignatory())).create() : null); } // è·åè·¯å¾ InputStream inputStream = this.getClass().getResourceAsStream("/static/report-deal.docx"); Configure configure = Configure.builder() @@ -110,6 +99,8 @@ template.write(os); os.flush(); os.close(); inputStream.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-process/src/main/java/com/ruoyi/process/service/impl/ProcessSampleServiceImpl.java
@@ -61,6 +61,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-process/src/main/java/com/ruoyi/process/service/impl/ProcessTotaldealServiceImpl.java
@@ -17,6 +17,7 @@ import com.ruoyi.framework.exception.ErrorException; import com.ruoyi.inspect.util.HackLoopTableRenderPolicy; import com.ruoyi.inspect.util.UserUtils; import com.ruoyi.process.dto.ProcessDealDto; import com.ruoyi.process.mapper.InspectionOrderMapper; import com.ruoyi.process.mapper.ProcessDealMapper; import com.ruoyi.process.mapper.ProcessSampleMapper; @@ -185,7 +186,7 @@ @Override public void exportProcessTotaldeal(Integer id, HttpServletResponse response) { List<ProcessDeal> sampleDealDtos = processDealMapper.selectDeal(id); List<ProcessDealDto> sampleDealDtos = processDealMapper.selectDeal(id); ProcessTotaldeal processTotaldeal = processTotaldealMapper.selectById(id); // è·åè·¯å¾ @@ -210,6 +211,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-process/src/main/java/com/ruoyi/process/service/impl/QualityMonitorServiceImpl.java
@@ -373,6 +373,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); @@ -519,6 +520,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); @@ -732,6 +734,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); @@ -751,11 +754,9 @@ if (qualityMonitorDetailsId == null) { throw new ErrorException("缺å°çæ§è¯¦æ id"); } QualityMonitorDetails qualityMonitorDetails = qualityMonitorDetailsService.getOne(Wrappers.<QualityMonitorDetails>lambdaUpdate() .eq(QualityMonitorDetails::getQualityMonitorDetailsId, qualityMonitorDetailsId)); LocalDateTime now = LocalDateTime.now(); Integer userId =SecurityUtils.getUserId().intValue(); String contentType = file.getContentType(); String urlString; String pathName; try { @@ -768,10 +769,13 @@ urlString = realpath + "/" + pathName; file.transferTo(new File(urlString)); // 夿æ¯å¦æ¯pdf if (!contentType.contains("pdf")) { wordInsertUrl(new HashMap<String, Object>() {{ put("writeUrl", UserUtils.getFinalUserSignatureUrl(userId)); put("writeDateUrl", Pictures.ofStream(DateImageUtil.createDateImage(now)).create()); }}, wordUrl + "/" + pathName.replace("/word", wordUrl)); } qualityMonitorDetailsService.update(Wrappers.<QualityMonitorDetails>lambdaUpdate() .eq(QualityMonitorDetails::getQualityMonitorDetailsId, qualityMonitorDetailsId) @@ -807,7 +811,7 @@ // æ·»å æ¹å人 QualityMonitorDetails details = qualityMonitorDetailsMapper.selectById(qualityMonitorDetails.getQualityMonitorDetailsId()); if (StringUtils.isNotBlank(details.getFinishReportUrl())) { if (StringUtils.isNotBlank(details.getFinishReportUrl()) && !details.getFinishReportUrl().contains(".pdf")) { wordInsertUrl(new HashMap<String, Object>() {{ put("ratifyUrl", UserUtils.getFinalUserSignatureUrl(userId)); put("ratifyDateUrl", Pictures.ofStream(DateImageUtil.createDateImage(now)).create()); cnas-process/src/main/java/com/ruoyi/process/service/impl/QualitySuperviseManagementReviewServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,86 @@ package com.ruoyi.process.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.ConfigureBuilder; import com.deepoove.poi.data.Pictures; import com.ruoyi.common.utils.QueryWrappers; import com.ruoyi.framework.exception.ErrorException; import com.ruoyi.process.dto.QualitySuperviseDetailsCorrectDto; import com.ruoyi.process.pojo.QualitySuperviseDetailsCorrect; import com.ruoyi.process.pojo.QualitySuperviseManagementReview; import com.ruoyi.process.mapper.QualitySuperviseManagementReviewMapper; import com.ruoyi.process.service.QualitySuperviseManagementReviewService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; import java.io.OutputStream; import java.net.URLEncoder; import java.time.format.DateTimeFormatter; import java.util.HashMap; /** * <p> * è´¨éçç£ç®¡çè¯å®¡è¾å ¥ææ æå¡å®ç°ç±» * </p> * * @author * @since 2025-05-07 10:46:11 */ @Service public class QualitySuperviseManagementReviewServiceImpl extends ServiceImpl<QualitySuperviseManagementReviewMapper, QualitySuperviseManagementReview> implements QualitySuperviseManagementReviewService { /** * å页æ¥è¯¢ * @param page * @param managementReview * @return */ @Override public IPage<QualitySuperviseManagementReview> pageManagementReview(Page page, QualitySuperviseManagementReview managementReview) { return baseMapper.pageManagementReview(page, QueryWrappers.queryWrappers(managementReview)); } /** * å¯¼åº * @param managementReviewId * @param response */ @Override public void exportManagementReview(Integer managementReviewId, HttpServletResponse response) { QualitySuperviseManagementReview managementReview = baseMapper.selectById(managementReviewId); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyå¹´MMæddæ¥"); // è·åè·¯å¾ InputStream inputStream = this.getClass().getResourceAsStream("/static/supervise-management-eview.docx"); ConfigureBuilder builder = Configure.builder(); builder.useSpringEL(true); XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( new HashMap<String, Object>() {{ put("managementReview", managementReview); put("superviseDateStr", managementReview.getSuperviseDate() == null ? null : managementReview.getSuperviseDate().format(formatter)); }}); try { response.setContentType("application/msword"); String fileName = URLEncoder.encode( managementReview.getFileName(), "UTF-8"); response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".docx"); OutputStream os = response.getOutputStream(); template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); } } } cnas-process/src/main/java/com/ruoyi/process/service/impl/QualitySuperviseServiceImpl.java
@@ -335,6 +335,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); @@ -524,25 +525,25 @@ public void exportSuperviseDetailRecord(Integer superviseDetailsId, HttpServletResponse response) { QualitySuperviseDetailsRecord recordDto = qualitySuperviseDetailsRecordMapper.selectSuperviseDetailRecord(superviseDetailsId); //è·åææ¯è´è´£äººçç¾åå°å String ratifyUrl = null; if (recordDto.getRatifyUserId() != null) { ratifyUrl = userMapper.selectById(recordDto.getRatifyUserId()).getSignatureUrl(); if (StringUtils.isBlank(ratifyUrl)) { throw new ErrorException("æ¾ä¸å°ææ¯è´è´£äººçç¾å"); } // æ¥è¯¢æ£æµäººå User tserUser = new User(); if (StringUtils.isNotBlank(recordDto.getTestMember())) { tserUser = userMapper.selectOne(Wrappers.<User>lambdaQuery() .eq(User::getName, recordDto.getTestMember()) .last("limit 1")); } // è·åè·¯å¾ InputStream inputStream = this.getClass().getResourceAsStream("/static/supervision-detail-record.docx"); ConfigureBuilder builder = Configure.builder(); builder.useSpringEL(true); String finalRatifyUrl = ratifyUrl; User finalTserUser = tserUser; XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( new HashMap<String, Object>() {{ put("supervision", recordDto); put("testMemberUrl", UserUtils.getFinalUserSignatureUrl(finalTserUser.getId())); put("supervisoruUrl", UserUtils.getFinalUserSignatureUrl(recordDto.getSupervisor())); put("technicalDirectorUrl", StringUtils.isNotBlank(finalRatifyUrl) ? Pictures.ofLocal(imgUrl + "/" + finalRatifyUrl).create() : null); put("technicalDirectorUrl", UserUtils.getFinalUserSignatureUrl(recordDto.getRatifyUserId())); put("technicalDirectorDateUrl", recordDto.getRatifyTime() != null ? Pictures.ofStream(DateImageUtil.createDateImage(recordDto.getRatifyTime())).create() : null); }}); @@ -557,6 +558,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); @@ -875,6 +877,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); @@ -1253,6 +1256,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-process/src/main/java/com/ruoyi/process/task/QualitySuperviseSchedule.java
@@ -1,23 +1,33 @@ package com.ruoyi.process.task; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.common.core.domain.entity.User; import com.ruoyi.common.utils.WxCpUtils; import com.ruoyi.process.mapper.QualitySuperviseDetailsMapper; import com.ruoyi.process.mapper.QualitySuperviseDetailsRecordMapper; import com.ruoyi.process.mapper.QualitySuperviseManagementReviewMapper; import com.ruoyi.process.pojo.QualitySuperviseDetails; import com.ruoyi.process.pojo.QualitySuperviseDetailsRecord; import com.ruoyi.process.pojo.QualitySuperviseManagementReview; import com.ruoyi.system.mapper.UserMapper; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * å¹è®è®¡åä½¿ç¨æéè®°å½æé * è´¨éçç£å¡«åæé */ @Component public class QualitySuperviseSchedule { @@ -27,12 +37,16 @@ private UserMapper userMapper; @Resource private ThreadPoolTaskExecutor threadPoolTaskExecutor; @Resource private QualitySuperviseManagementReviewMapper qualitySuperviseManagementReviewMapper; @Resource private QualitySuperviseDetailsRecordMapper qualitySuperviseDetailsRecordMapper; /** * æéå¡«å设å¤ä½¿ç¨è®°å½ * è´¨éçç£å¡«åæé */ // @Scheduled(cron = "0/5 * * * * *") @Scheduled(cron = "0 0 9 1 * *") // æ¯æ1å·æ§è¡ // @Scheduled(cron = "0 0 9 1 * *") // æ¯æ1å·æ§è¡ public void task1() { // æ¥è¯¢å½æçç£è®¡å DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.M"); @@ -63,4 +77,66 @@ } } /** * æ¯æ28å·èªå¨çæè´¨éçç£æ»ç» */ // @Scheduled(cron = "0/5 * * * * *") // @Scheduled(cron = "0 0 9 28 * *") // æ¯æ28å·æ§è¡ public void task2() { LocalDateTime now = LocalDateTime.now(); // æ¥è¯¢å½æçç£è®¡å DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.M"); String format = now.format(formatter); List<QualitySuperviseDetails> qualitySuperviseDetails = qualitySuperviseDetailsMapper.selectList(Wrappers.<QualitySuperviseDetails>lambdaQuery() .eq(QualitySuperviseDetails::getSuperviseTime, format)); // æ ¹æ®å®æçç£å卿çç£åºå Map<String, List<QualitySuperviseDetails>> superviseReasonMap = qualitySuperviseDetails.stream().collect(Collectors.groupingBy(QualitySuperviseDetails::getSuperviseReason)); // è·åå½ææ¥æ DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyyå¹´MMæ"); String format2 = now.format(formatter2); // è·å计åå 容 String implementationSupervisee = ""; List<QualitySuperviseDetails> implementationList = superviseReasonMap.get("宿çç£"); if (CollectionUtils.isNotEmpty(implementationList)) { // è·å宿çç£äººåä¿¡æ¯ List<String> collect = implementationList.stream().map(QualitySuperviseDetails::getSupervisee).collect(Collectors.toList()); implementationSupervisee = CollUtil.join(collect, ","); } String implementationContent = "å·¥ä½ä¸ä¸¥æ ¼æç §å¹´åº¦è´¨éçç£å·¥ä½è®¡åè¿è¡æ§è¡ã{}对{}è¿è¡ä¸æ¬¡å®æçç£ãå¨çç£è¿ç¨ä¸ï¼æ²¡æåç°ä¸ç¬¦åçç°è±¡ãæ£éªåè½çç»çæç §è§å®çè¦æ±è¿è¡è®¾å¤çæä½ï¼å¯¹äºæ åè½çè®°ï¼æä½¿ç¨ç设å¤å卿 ¡å卿å ï¼è½æ¸ æ¥å®æ´ççè®°å½åå§æ°æ®å¹¶åºå ·æ¥åï¼å¨è¯éªç¯å¢æ¹é¢ï¼è½å¤ä¸¥æ ¼çæç §æ åæ§è¡ã"; String formatImplementationContent = StrUtil.format(implementationContent, format2, implementationSupervisee); //è·å卿å 容 String dynamicSupervisee = ""; List<QualitySuperviseDetails> dynamicList = superviseReasonMap.get("卿çç£"); if (CollectionUtils.isNotEmpty(dynamicList)) { List<String> collect = dynamicList.stream() .map(details -> StrUtil.format("对{}卿çç£1次å¨çç£è¿ç¨ä¸", details.getSupervisee())).collect(Collectors.toList()); dynamicSupervisee = CollUtil.join(collect, "ï¼"); } String dynamicContent = "å¨ä¿è¯è´¨éçç£è®¡åçåæ¶ï¼ä¹åææç §é¢å¯¼è¦æ±å 强ä¸å®æçç£å¨ä½ã{}份{}ï¼æ²¡æåç°ä¸ç¬¦åçç°è±¡ãæ£éªåè½çç»çæç §è§å®çè¦æ±è¿è¡è®¾å¤çæä½ï¼å¯¹äºæ åè½çè®°ï¼æä½¿ç¨ç设å¤å卿 ¡å卿å ï¼è½æ¸ æ¥å®æ´ççè®°å½åå§æ°æ®å¹¶åºå ·æ¥åï¼å¨è¯éªç¯å¢æ¹é¢ï¼è½å¤ä¸¥æ ¼çæç §æ åæ§è¡ã"; String formatdynamicContent = StrUtil.format(dynamicContent, format2, dynamicSupervisee); // è·åçç£åä¿¡æ¯ QualitySuperviseDetails superviseDetails = qualitySuperviseDetails.get(0); QualitySuperviseDetailsRecord detailsRecord = qualitySuperviseDetailsRecordMapper.selectOne(Wrappers.<QualitySuperviseDetailsRecord>lambdaQuery() .eq(QualitySuperviseDetailsRecord::getSuperviseDetailsId, superviseDetails.getSuperviseDetailsId()) .last("limit 1")); String supervisor = detailsRecord.getSupervisor(); // å建è¯å®¡å¯¹è±¡ QualitySuperviseManagementReview managementReview = new QualitySuperviseManagementReview(); String yearDate = now.format(DateTimeFormatter.ofPattern("yyyyå¹´")); String monthDate = now.format(DateTimeFormatter.ofPattern("MMæ")); managementReview.setFileName(StrUtil.format("{}管çè¯å®¡è¾å ¥ææï¼{}ï¼_{}", yearDate, supervisor, monthDate)); managementReview.setImplementationContent(formatImplementationContent); managementReview.setDynamicContent(formatdynamicContent); managementReview.setSupervisor(supervisor); managementReview.setSuperviseDate(LocalDate.now()); qualitySuperviseManagementReviewMapper.insert(managementReview); } } cnas-process/src/main/resources/mapper/ProcessDealMapper.xml
@@ -24,7 +24,7 @@ </if> </select> <select id="selectDeal" resultType="com.ruoyi.process.pojo.ProcessDeal"> <select id="selectDeal" resultType="com.ruoyi.process.dto.ProcessDealDto"> select ROW_NUMBER() OVER (ORDER BY id) AS indexs, id, sample_name, @@ -32,7 +32,7 @@ sample_supplier, num, deal_method, deal_time DATE_FORMAT(deal_time, '%Y-%m-%d') dealTimeStr from cnas_process_deal where totaldeal_id = #{id} </select> cnas-process/src/main/resources/mapper/ProcessReportMapper.xml
@@ -18,7 +18,7 @@ <result column="update_user" property="updateUser"/> <result column="update_time" property="updateTime"/> </resultMap> <select id="pageProcessReport" resultType="com.ruoyi.process.pojo.ProcessReport"> <select id="pageProcessReport" resultType="com.ruoyi.process.dto.ProcessReportDto"> select * from (select cpr.* , u1.name sendUserName from cnas_process_report cpr @@ -27,16 +27,11 @@ ${ew.customSqlSegment} </if> </select> <select id="getIds" resultType="com.ruoyi.process.pojo.ProcessReport"> <select id="exportProcessReport" resultType="com.ruoyi.process.dto.ProcessReportDto"> select ROW_NUMBER() OVER (ORDER BY cpr.id) AS indexs, cpr.* , u1.name sendUserName u1.signature_url sendUserUrl from cnas_process_report cpr left join user u1 on send_user=u1.id where 1=1 and cpr.id in <foreach collection="ids" separator="," item="id" open="(" close=")"> #{id} </foreach> </select> </mapper> cnas-process/src/main/resources/mapper/QualitySuperviseManagementReviewMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.process.mapper.QualitySuperviseManagementReviewMapper"> <select id="pageManagementReview" resultType="com.ruoyi.process.pojo.QualitySuperviseManagementReview"> select * from cnas_quality_supervise_management_review <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> ${ew.customSqlSegment} </if> </select> </mapper> cnas-process/src/main/resources/static/report-deal.docxBinary files differ
cnas-process/src/main/resources/static/sample-deal.docxBinary files differ
cnas-process/src/main/resources/static/supervise-management-eview.docxBinary files differ
cnas-process/src/main/resources/static/supervision-detail-record.docxBinary files differ
cnas-require/src/main/java/com/ruoyi/require/service/impl/FeCalibrationScheduleServiceImpl.java
@@ -50,7 +50,6 @@ Configure configure = Configure.builder() .bind("feCalibrationSchedule", new HackLoopTableRenderPolicy()) .build(); FeCalibrationSchedule feCalibrationSchedule = size > 0 ? feCalibrationSchedules.get(0) : null; XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render( new HashMap<String, Object>() {{ put("feCalibrationSchedule", feCalibrationSchedules); @@ -67,6 +66,8 @@ template.write(os); os.flush(); os.close(); inputStream.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-require/src/main/java/com/ruoyi/require/service/impl/FeIlluminationServiceImpl.java
@@ -115,6 +115,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-require/src/main/java/com/ruoyi/require/service/impl/FePowerStableServiceImpl.java
@@ -115,6 +115,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-require/src/main/java/com/ruoyi/require/service/impl/FeTempHumDateServiceImpl.java
@@ -121,6 +121,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-require/src/main/java/com/ruoyi/require/service/impl/ForeignRegisterServiceImpl.java
@@ -93,6 +93,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-require/src/main/java/com/ruoyi/require/service/impl/InternalWastesServiceImpl.java
@@ -159,6 +159,7 @@ template.write(os); os.flush(); os.close(); inputStream.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导åºå¤±è´¥"); cnas-require/src/main/java/com/ruoyi/require/task/FeTempHumDateSchedule.java
@@ -86,7 +86,7 @@ * è·å温度湿度 */ // @Scheduled(cron = "0/5 * * * * *") @Scheduled(cron = "0 0 9 * * 1-6") // æ¯å¤©9ç¹æ§è¡ä¸æ¬¡ é¤äºææå¤© // @Scheduled(cron = "0 0 9 * * 1-6") // æ¯å¤©9ç¹æ§è¡ä¸æ¬¡ é¤äºææå¤© public void task1() { checkLaboratoriesSchedule(); // æ ¹æ®æ¶é´éåºï¼è·åå°ææ°ç䏿¡æ°æ® @@ -183,7 +183,7 @@ * è·å温度湿度 */ // @Scheduled(cron = "0/5 * * * * *") @Scheduled(cron = "0 0 14 * * 1-5") // æ¯å¤©14ç¹æ§è¡ä¸æ¬¡ é¤äºææå 忿天 // @Scheduled(cron = "0 0 14 * * 1-5") // æ¯å¤©14ç¹æ§è¡ä¸æ¬¡ é¤äºææå 忿天 public void task2() { // æ£æ¥å®éªå®¤æ¯å¦æä»»å¡ å¦ææ²¡ææ°å¢ä»»å¡ @@ -295,7 +295,7 @@ * è·å温度湿度 */ // @Scheduled(cron = "0/5 * * * * *") @Scheduled(cron = "0 0 9 * * 7") // // @Scheduled(cron = "0 0 9 * * 7") // public void task3() { checkLaboratoriesSchedule(); @@ -338,7 +338,7 @@ * */ // @Scheduled(cron = "0/5 * * * * *") @Scheduled(cron = "0 0 16 * * 1-6") // æ¯å¤©15ç¹æ§è¡ä¸æ¬¡ é¤äºææå¤© // @Scheduled(cron = "0 0 16 * * 1-6") // æ¯å¤©15ç¹æ§è¡ä¸æ¬¡ é¤äºææå¤© public void affirmTempHum() { // æ¥è¯¢ææ¥æä½æ¯æªå¡«åååç List<FeTempHumRecordDto> feTempHumRecordList = feTempHumRecordMapper.selectNoaffirm(LocalDate.now()); ruoyi-common/src/main/java/com/ruoyi/common/utils/SignatureImageUtil.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,66 @@ package com.ruoyi.common.utils; import org.springframework.core.io.ClassPathResource; import javax.imageio.ImageIO; import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.*; /** * @Author zhuo * @Date 2025/5/7 */ public class SignatureImageUtil { /** * æ ¹æ®ä¸æå¯¼åºç¾åå¾ç * @param text * @return * @throws IOException * @throws FontFormatException */ public static InputStream saveImageToFile(String text){ // è·ååä½åº Font font = null; try (InputStream is = new ClassPathResource("/ttf/signature.ttf").getInputStream()) { font = Font.createFont(Font.TRUETYPE_FONT, is).deriveFont(50f); } catch (FontFormatException | IOException e) { throw new RuntimeException(e); } int width = 100; // å¾çç宽度 int height = 50; // å¾ççé«åº¦ BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = image.createGraphics(); g2d.setFont(font); // 设置æåé¢è²ä¸ºé»è² g2d.setColor(Color.black); // 设置æåå¨å¾çä¸çä½ç½® FontRenderContext context = g2d.getFontRenderContext(); Rectangle2D bounds = font.getStringBounds(text, context); double x = (width - bounds.getWidth()) / 2; double y = (height - bounds.getHeight()) / 2; double ascent = -bounds.getY(); double baseY = y + ascent; g2d.drawString(text, (int) x, (int) baseY); g2d.dispose(); ByteArrayOutputStream os = new ByteArrayOutputStream(); try { ImageIO.write(image, "png", os); } catch (IOException e) { throw new RuntimeException(e); } return new ByteArrayInputStream(os.toByteArray()); } } ruoyi-common/src/main/java/com/ruoyi/common/utils/WxCpUtils.java
@@ -93,7 +93,7 @@ } /** * todo:æ¨éç¾¤æ¶æ¯ * æ¨éç¾¤æ¶æ¯ * * @param webHook ä¼ä¸å¾®ä¿¡æºå¨äººå°å * @param content æ°æ® ruoyi-common/src/main/resources/ttf/signature.ttfBinary files differ