| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¶æ¯éç¥ å端æ§å¶å¨ |
| | |
| | | informationNotificationService.triggerModificationStatusToRead(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¶æ¯éç¥-è·åé¦é¡µåç§æ¶æ¯æ°é") |
| | | @GetMapping("getNumberFourTypesMessagesHomePage") |
| | | @ValueAuth |
| | | public Result<?> getNumberFourTypesMessagesHomePage() { |
| | | Map<String, Object> data = informationNotificationService.getNumberFourTypesMessagesHomePage(); |
| | | return Result.success(data); |
| | | } |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.InformationNotification; |
| | | import com.yuanchu.mom.pojo.InformationNotificationDto; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¶æ¯éç¥ æå¡ç±» |
| | |
| | | void triggerModificationStatusToRead(Integer id); |
| | | |
| | | int addInformationNotification(InformationNotification informationNotification); |
| | | |
| | | Map<String, Object> getNumberFourTypesMessagesHomePage(); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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") |
| | |
| | | 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; |
| | |
| | | |
| | | 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); |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | 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); |
| | |
| | | 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.*; |
| | |
| | | } |
| | | |
| | | @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; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | |
| | | </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, |
| | |
| | | |
| | | private Integer isCustom; |
| | | |
| | | @ApiModelProperty(value = "è±æå®¢æ·åä½") |
| | | private String companyEn; |
| | | |
| | | @ApiModelProperty(value = "è±æåä½å°å") |
| | | private String addressEn; |
| | | } |