value
2024-04-25 c623c05868d94854e31652181570537a6493a7eb
完善检验流程;检验报告流程
已修改7个文件
51 ■■■■ 文件已修改
cnas-server/src/main/java/com/yuanchu/mom/controller/CertificationController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/pojo/Certification.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/mom/controller/InformationNotificationController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/dto/SampleProductDto2.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsOrderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/controller/CertificationController.java
@@ -28,7 +28,6 @@
    @ApiOperation(value = "查询资质明细列表")
    @PostMapping("/getCertificationDetail")
    @ValueAuth
    public Result getCertificationDetail(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        Certification certification = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Certification.class);
cnas-server/src/main/java/com/yuanchu/mom/pojo/Certification.java
@@ -39,7 +39,6 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime firstTime;
    @ValueTableShow(7)
    @ApiModelProperty(value = "最近颁发时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime recentlyTime;
@@ -54,20 +53,19 @@
    private Integer createUser;
    @ValueTableShow(9)
    @ApiModelProperty(value = "创建人")
    @ApiModelProperty(value = "更新人")
    private String createUserName;
    @ApiModelProperty(value = "修改人id")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    @ValueTableShow(10)
    @ApiModelProperty(value = "创建时间")
    @ValueTableShow(7)
    @ApiModelProperty(value = "最近颁发时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
framework/src/main/java/com/yuanchu/mom/controller/InformationNotificationController.java
@@ -1,6 +1,7 @@
package com.yuanchu.mom.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.annotation.ValueAuth;
import com.yuanchu.mom.mapper.InformationNotificationMapper;
import com.yuanchu.mom.pojo.InformationNotification;
import com.yuanchu.mom.pojo.InformationNotificationDto;
@@ -33,12 +34,14 @@
    @ApiOperation(value = "滚动分页查询")
    @GetMapping("page")
    @ValueAuth
    public Result<?> getPage(Long size, Long current, String messageType) {
        return Result.success(informationNotificationService.getPage(new Page<>(current, size), messageType));
    }
    @ApiOperation(value = "更新消息状态(拒绝、接收)")
    @PutMapping("updateMessageStatus")
    @ValueAuth
    public Result<?> updateMessageStatus(@RequestBody InformationNotification informationNotification) {
        informationNotificationService.updateById(informationNotification);
        return Result.success();
@@ -46,6 +49,7 @@
    @ApiOperation(value = "标记所有信息为已读/删除所有已读消息")
    @PutMapping("informationReadOrDelete/{isMarkAllInformationRead}")
    @ValueAuth
    public Result<?> markAllInformationReadOrDeleteAllReadMessages(@PathVariable("isMarkAllInformationRead") Boolean isMarkAllInformationRead) {
        informationNotificationService.markAllInformationReadOrDeleteAllReadMessages(isMarkAllInformationRead);
        return Result.success();
@@ -53,6 +57,7 @@
    @ApiOperation(value = "根据Id删除数据")
    @DeleteMapping("deleteDataBasedOnId")
    @ValueAuth
    public Result<?> deleteDataBasedOnId(Integer id) {
        informationNotificationService.removeById(id);
        return Result.success();
@@ -60,12 +65,14 @@
    @ApiOperation(value = "查询是否存在未读数据")
    @GetMapping("checkForUnreadData")
    @ValueAuth
    public Result<?> checkForUnreadData() {
        return Result.success(informationNotificationService.checkForUnreadData());
    }
    @ApiOperation(value = "点击详情触发修改状态为已读")
    @PutMapping("triggerModificationStatusToRead/{id}")
    @ValueAuth
    public Result<?> triggerModificationStatusToRead(@PathVariable("id") Integer id) {
        informationNotificationService.triggerModificationStatusToRead(id);
        return Result.success();
inspect-server/src/main/java/com/yuanchu/mom/dto/SampleProductDto2.java
@@ -20,7 +20,7 @@
    @ValueTableShow(value = 4, name = "样品型号")
    private String model;
    @ValueTableShow(value = 5, name = "样品状态")
//    @ValueTableShow(value = 5, name = "样品状态")
    private Integer insState;
    @ValueTableShow(value = 15, name = "单位")
@@ -37,7 +37,7 @@
    private String inspectionItemType;
    @ValueTableShow(value = 11, name = "检验值类型")
//    @ValueTableShow(value = 11, name = "检验值类型")
    private String inspectionValueType;
    @ValueTableShow(value = 12, name = "要求值")
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -276,14 +276,14 @@
            List<Map<String, Object>> tables = new ArrayList<>();
            Set<String> standardMethod = new HashSet<>();
            Set<String> deviceSet = new HashSet<>();
            AtomicReference<String> models = new AtomicReference<>("");
            Set<String> models = new HashSet<>();
            AtomicReference<Integer> productSize = new AtomicReference<>(0);
            String[] monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
            samples.forEach(a -> {
                models.add(a.getModel());
                Set<String> templateSet = new HashSet<>();
                getTemplateThing(set, map2, a);
                for (InsProduct b : a.getInsProduct()) {
                    models.set(models.get()+b.getModel());
                    standardMethod.add(b.getMethodS());
                    productSize.set(productSize.get()+1);
                    if (b.getInsProductResult() != null) {
@@ -509,7 +509,8 @@
            String url;
            try {
                InputStream inputStream = this.getClass().getResourceAsStream("/static/report-template.docx");
                File file = File.createTempFile("temp", ".tmp");OutputStream outputStream = new FileOutputStream(file);
                File file = File.createTempFile("temp", ".tmp");
                OutputStream outputStream = new FileOutputStream(file);
                IOUtils.copy(inputStream, outputStream);
                url = file.getAbsolutePath();
            } catch (FileNotFoundException e) {
@@ -539,6 +540,11 @@
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            String modelStr = "";
            for (String model : models) {
                modelStr += "," + model;
            }
            String finalModelStr = modelStr;
            ConfigureBuilder builder = Configure.builder();
            builder.useSpringEL(true);
            XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render(
@@ -553,7 +559,7 @@
                        put("standardMethod", standardMethod2);
                        put("deviceList", deviceList);
                        put("twoCode", Pictures.ofLocal(codePath).create());
                        put("models", models);
                        put("models", finalModelStr.replace(",", ""));
                        put("productSize", productSize);
                        put("createTime", now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日")));
                        put("createTimeEn", monthNames[now.getMonthValue()-1]+" "+now.getDayOfMonth()+", "+now.getYear());
@@ -565,7 +571,7 @@
                        put("ratifyUrl", null);
                    }});
            try {
                String name = now.format(DateTimeFormatter.ofPattern("yy_MM_dd&HH_mm_ss")) + ".docx";
                String name = insReport.getCode().replace("/", "") + ".docx";
                template.writeAndClose(Files.newOutputStream(Paths.get(wordUrl + "/" + name)));
                insReport.setUrl("/word/" + name);
                insReportMapper.insert(insReport);
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java
@@ -15,7 +15,9 @@
import com.yuanchu.mom.dto.ReportPageDto;
import com.yuanchu.mom.dto.SampleOrderDto;
import com.yuanchu.mom.exception.ErrorException;
import com.yuanchu.mom.mapper.InsOrderMapper;
import com.yuanchu.mom.mapper.UserMapper;
import com.yuanchu.mom.pojo.InsOrder;
import com.yuanchu.mom.pojo.InsReport;
import com.yuanchu.mom.service.InsReportService;
import com.yuanchu.mom.mapper.InsReportMapper;
@@ -23,6 +25,7 @@
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
@@ -58,6 +61,9 @@
    @Value("${file.path}")
    private String imgUrl;
    @Resource
    private InsOrderMapper insOrderMapper;
    @Override
    public Map<String, Object> pageInsReport(Page page, ReportPageDto reportPageDto) {
@@ -127,6 +133,7 @@
        if (isExamine==0){
            //如果审核不通过
            insReport.setState(0);//提交状态改为待提交
            return insReportMapper.updateById(insReport);
        }
        //获取审核人的签名地址
        String signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl();
@@ -142,6 +149,7 @@
    //批准
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int ratifyReport(Integer id, Integer isRatify, String ratifyTell) {
        InsReport insReport = insReportMapper.selectById(id);
        insReport.setIsRatify(isRatify);
@@ -153,6 +161,7 @@
        if (isRatify==0){
            //如果批准不通过
            insReport.setState(0);//提交状态改为待提交
            return insReportMapper.updateById(insReport);
        }
        //获取审核人的签名地址
        String signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl();
@@ -163,6 +172,10 @@
        wordInsertUrl(new HashMap<String, Object>(){{
            put("ratifyUrl", Pictures.ofLocal(imgUrl+"/"+signatureUrl).create());
        }}, (urlS==null?url:urlS).replace("/word", wordUrl));
        InsOrder insOrder = new InsOrder();
        insOrder.setId(insReportMapper.selectById(id).getInsOrderId());
        insOrder.setState(4);
        insOrderMapper.updateById(insOrder);
        return insReportMapper.updateById(insReport);
    }
inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -116,7 +116,7 @@
    <select id="selectSampleAndProductByOrderId" resultType="com.yuanchu.mom.dto.SampleProductDto2">
        select *
        from (
        select i.id,isa.sample_code,isa.sample,isa.model,ip.state,ip.unit,ip.inspection_item,ip.inspection_item_subclass,
        select i.id,isa.sample_code,isa.sample,isa.model,isa.ins_state,ip.state,ip.unit,ip.inspection_item,ip.inspection_item_subclass,
        ip.son_laboratory,ip.inspection_item_type,ip.inspection_value_type,ip.ask,ip.`last_value`,ip.ins_result,ipr.equip_value
        from ins_sample isa
        left join ins_order i on isa.ins_order_id = i.id