Crunchy
2024-05-26 23ea9d4b546819f4b888e029daf29c93f11e2a74
2024-5-23 小需求调整
已修改9个文件
已添加1个文件
155 ■■■■■ 文件已修改
framework/src/main/java/com/yuanchu/mom/controller/InformationNotificationController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/mom/service/InformationNotificationService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/mom/service/impl/InformationNotificationServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderPlanController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/mapper/InsSampleMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/InsOrderPlanService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/vo/InsOrderPlanTaskSwitchVo.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsSampleMapper.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/dto/Custom.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/mom/controller/InformationNotificationController.java
@@ -10,6 +10,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
 * <p>
 * æ¶ˆæ¯é€šçŸ¥ å‰ç«¯æŽ§åˆ¶å™¨
@@ -71,4 +73,12 @@
        informationNotificationService.triggerModificationStatusToRead(id);
        return Result.success();
    }
    @ApiOperation(value = "消息通知-获取首页四种消息数量")
    @GetMapping("getNumberFourTypesMessagesHomePage")
    @ValueAuth
    public Result<?> getNumberFourTypesMessagesHomePage() {
        Map<String, Object> data = informationNotificationService.getNumberFourTypesMessagesHomePage();
        return Result.success(data);
    }
}
framework/src/main/java/com/yuanchu/mom/service/InformationNotificationService.java
@@ -6,6 +6,8 @@
import com.yuanchu.mom.pojo.InformationNotification;
import com.yuanchu.mom.pojo.InformationNotificationDto;
import java.util.Map;
/**
 * <p>
 * æ¶ˆæ¯é€šçŸ¥ æœåŠ¡ç±»
@@ -25,4 +27,6 @@
    void triggerModificationStatusToRead(Integer id);
    int addInformationNotification(InformationNotification informationNotification);
    Map<String, Object> getNumberFourTypesMessagesHomePage();
}
framework/src/main/java/com/yuanchu/mom/service/impl/InformationNotificationServiceImpl.java
@@ -12,6 +12,8 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -76,4 +78,27 @@
    public int addInformationNotification(InformationNotification informationNotification) {
        return baseMapper.insert(informationNotification);
    }
    @Override
    public Map<String, Object> getNumberFourTypesMessagesHomePage() {
        Map<String, Integer> map1 = null;
        Map<String, Object> map = new HashMap<>();
        map1 = getLook.selectPowerByMethodAndUserId("selectInsOrderParameter");
        Long totalNumberOfMessages = baseMapper.selectCount(Wrappers.<InformationNotification>lambdaQuery()
                .eq(InformationNotification::getConsigneeId, map1.get("userId")));
        Long totalNumberOfReadMessages = baseMapper.selectCount(Wrappers.<InformationNotification>lambdaQuery()
                .eq(InformationNotification::getConsigneeId, map1.get("userId"))
                .eq(InformationNotification::getViewStatus, true));
        LocalDate today = LocalDate.now();
        LocalDate sevenDaysAgo = today.minusDays(7);
        Long totalNumberOfMessagesInThePastSevenDays = baseMapper.selectCount(Wrappers.<InformationNotification>lambdaQuery()
                .eq(InformationNotification::getConsigneeId, map1.get("userId"))
                .between(InformationNotification::getCreateTime, today, sevenDaysAgo));
        long remainingToDo = totalNumberOfMessages - totalNumberOfReadMessages;
        map.put("totalNumberOfMessages", totalNumberOfMessages);
        map.put("remainingToDo", remainingToDo);
        map.put("totalNumberOfReadMessages", totalNumberOfReadMessages);
        map.put("totalNumberOfMessagesInThePastSevenDays", totalNumberOfMessagesInThePastSevenDays);
        return map;
    }
}
inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderPlanController.java
@@ -38,6 +38,17 @@
        InsOrderPlanDTO insOrderPlanDTO = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), InsOrderPlanDTO.class);
        return Result.success(insOrderPlanService.selectInsOrderPlanList(page, insOrderPlanDTO));
    }
    @ValueClassify("检验任务")
    @ApiOperation(value = "检验单详情-任务切换")
    @PostMapping("/inspectionOrderDetailsTaskSwitching")
    public Result inspectionOrderDetailsTaskSwitching(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        page.setOptimizeCountSql(false);
        InsOrderPlanDTO insOrderPlanDTO = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), InsOrderPlanDTO.class);
        return Result.success(insOrderPlanService.inspectionOrderDetailsTaskSwitching(page, insOrderPlanDTO));
    }
    @ValueClassify("检验任务")
    @ApiOperation(value = "认领任务计划")
    @PostMapping("/claimInsOrderPlan")
inspect-server/src/main/java/com/yuanchu/mom/mapper/InsSampleMapper.java
@@ -7,6 +7,7 @@
import com.yuanchu.mom.dto.InsOrderPlanDTO;
import com.yuanchu.mom.dto.SampleProductDto;
import com.yuanchu.mom.pojo.InsSample;
import com.yuanchu.mom.vo.InsOrderPlanTaskSwitchVo;
import com.yuanchu.mom.vo.InsOrderPlanVO;
import java.util.List;
@@ -21,6 +22,8 @@
    IPage<InsOrderPlanVO> findInsSampleAndOrder(Page page, QueryWrapper<InsOrderPlanDTO> ew, Integer userId);
    IPage<InsOrderPlanTaskSwitchVo> inspectionOrderDetailsTaskSwitching(Page page, QueryWrapper<InsOrderPlanDTO> ew, Integer userId);
    List<SampleProductDto> selectSampleProductListByOrderId(Integer id);
    List<SampleProductDto> getInsOrderAndSample(Integer id, String laboratory);
inspect-server/src/main/java/com/yuanchu/mom/service/InsOrderPlanService.java
@@ -2,8 +2,6 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.dto.InsOrderPlanDTO;
import com.yuanchu.mom.pojo.InsOrder;
import com.yuanchu.mom.pojo.InsSample;
import java.util.Map;
@@ -13,6 +11,8 @@
public interface InsOrderPlanService {
    Map<String,Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO);
    Map<String,Object> inspectionOrderDetailsTaskSwitching(Page page, InsOrderPlanDTO insOrderPlanDTO);
    boolean claimInsOrderPlan(InsOrderPlanDTO entity);
    void saveInsContext(Map<String, Object> insContext);
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -33,6 +33,7 @@
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.utils.MatrixToImageWriter;
import com.yuanchu.mom.utils.QueryWrappers;
import com.yuanchu.mom.vo.InsOrderPlanTaskSwitchVo;
import com.yuanchu.mom.vo.InsOrderPlanVO;
import org.apache.commons.io.IOUtils;
import org.apache.poi.xwpf.usermodel.*;
@@ -114,6 +115,20 @@
    }
    @Override
    public Map<String, Object> inspectionOrderDetailsTaskSwitching(Page page, InsOrderPlanDTO insOrderPlanDTO) {
        Map<String, Object> map = new HashMap<>();
        map.put("head", PrintChina.printChina(InsOrderPlanTaskSwitchVo.class));
        Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null);
        Integer userId = map1.get("userId");
        if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) {
            insOrderPlanDTO.setUserId(userId.longValue());
        }
        IPage<InsOrderPlanTaskSwitchVo> insOrderPage = insSampleMapper.inspectionOrderDetailsTaskSwitching(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId);
        map.put("body", insOrderPage);
        return map;
    }
    @Override
    public boolean claimInsOrderPlan(InsOrderPlanDTO entity) {
        if (Objects.isNull(entity)) {
            return false;
inspect-server/src/main/java/com/yuanchu/mom/vo/InsOrderPlanTaskSwitchVo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.yuanchu.mom.vo;
import com.yuanchu.mom.annotation.ValueTableShow;
import com.yuanchu.mom.common.OrderBy;
import lombok.Data;
@Data
public class InsOrderPlanTaskSwitchVo extends OrderBy {
    private String id;
    @ValueTableShow(value = 1,name = "委托编号")
    private String entrustCode;
    @ValueTableShow(value = 2,name = "检验对象")
    private String sampleType;
    @ValueTableShow(value = 4,name = "紧急程度")
    private String type;
    @ValueTableShow(value = 5,name = "状态")
    private String insState;
    @ValueTableShow(value = 6,name = "约定时间")
    private String appointed;
    @ValueTableShow(value = 7,name = "下发时间")
    private String sendTime;
    private Integer userId;
    private String sonLaboratory;
    private Integer orderUserId;
    private Integer verifyUser;
}
inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -67,6 +67,48 @@
        </if>
    </select>
    <select id="inspectionOrderDetailsTaskSwitching" resultType="com.yuanchu.mom.vo.InsOrderPlanTaskSwitchVo">
        select * from(
        SELECT
        a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,(ios.verify_user = #{userId}) verify_user
        FROM
        (
        SELECT
        io.id,
        io.entrust_code,
        io.type,
        io.appointed,
        io.send_time,
        io.sample_type,
        isu.user_id,
        ip.son_laboratory,
        io.ins_time
        FROM
        ins_order io
        LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id
        LEFT JOIN ( SELECT * FROM ins_sample_user GROUP BY ins_sample_id, user_id ) isu ON isu.ins_sample_id = io.id
        LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id
        WHERE
        io.state = 1
        #         AND io.ins_state != 5
        and send_time is not null
        and (isu.user_id = #{userId} OR isu.user_id is NULL)
        GROUP BY
        ip.son_laboratory,
        io.id
        ) a
        LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory
        left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM ins_sample_user GROUP BY ins_sample_id) md  where td.id = md.id and user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id
        ORDER BY
        a.user_id DESC,
        a.type DESC,
        a.id
        ) b
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="selectSampleProductListByOrderId" resultMap="sampleDto">
        select isa.*,
               ip.id ip_id,
user-server/src/main/java/com/yuanchu/mom/dto/Custom.java
@@ -84,4 +84,9 @@
    private Integer isCustom;
    @ApiModelProperty(value = "英文客户单位")
    private String companyEn;
    @ApiModelProperty(value = "英文单位地址")
    private String addressEn;
}