| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.yuanchu.mom.pojo.InsOrder; |
| | | import com.yuanchu.mom.pojo.InsSampleUser; |
| | | import com.yuanchu.mom.service.InsOrderPlanService; |
| | | import com.yuanchu.mom.service.InsOrderService; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import com.yuanchu.mom.vo.InsOrderPlanVO; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | private GetLook getLook; |
| | | |
| | | private InsOrderMapper insOrderMapper; |
| | | |
| | | private InsOrderService insOrderService; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { |
| | | //获取表头 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(InsOrderPlanVO.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectInsOrderPlanList"); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | Integer userId = map1.get("userId"); |
| | | //查询 |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | insOrderPlanDTO.setState(1); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, insOrderPlanDTO); |
| | | if(ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())){ |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | } |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId); |
| | | map.put("body", insOrderPage); |
| | | return map; |
| | | } |
| | |
| | | if(Objects.isNull(entity)){ |
| | | return false; |
| | | } |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("claimInsOrderPlan"); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | Integer userId = map1.get("userId"); |
| | | InsSampleUser insSampleUser = new InsSampleUser(entity.getInsSampleId().intValue(), userId, 1); |
| | | return insSampleUserMapper.insert(insSampleUser)>0; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> doInsOrder(Integer id) { |
| | | InsOrder insOrder = new InsOrder(); |
| | | insOrder.setId(id); |
| | | insOrder.setInsState(1); |
| | | insOrderMapper.updateById(insOrder); |
| | | return insOrderService.getInsOrder(id); |
| | | } |
| | | } |