| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.mapper.MeteringPlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.GetPlanMeasureInstrumentDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeteringPlanDto; |
| | | import com.yuanchu.limslaboratory.service.MeteringPlanService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Override |
| | | public Integer addMeteringPlanInformation(MeteringPlan meteringPlan) { |
| | | String timeSixNumber = MyUtil.getTimeSixNumberCode("P"); |
| | | String timeSixNumber = MyUtil.getTimeSixNumberCode("P","P"); |
| | | meteringPlan.setPlannedOrderNumber(timeSixNumber); |
| | | return meteringPlanMapper.insert(meteringPlan); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagingQueryOfMeteringPlan(String measureCodeOrNameOrUnit, Page<Objects> page) { |
| | | return null; |
| | | public Map<String, Object> pagingQueryOfMeteringPlan(SelectMeteringPlanDto dto) { |
| | | List<MeteringPlanAndInfo> page= meteringPlanMapper |
| | | .limitConditionMeteringPlan(dto,new LimitPage((dto.getCurrentPage()-1)*dto.getPageSize(), dto.getPageSize())); |
| | | page.forEach(l->{ |
| | | l.getResultList().forEach(r->{ |
| | | if (r.getResult() < 1) { |
| | | l.setStatus(0); |
| | | }else { |
| | | l.setStatus(1); |
| | | } |
| | | }); |
| | | l.setResultList(null); |
| | | }); |
| | | Map<String, Object>all=new HashMap<>(2); |
| | | all.put("total",meteringPlanMapper.getTotal(dto).get("num")); |
| | | all.put("list",page); |
| | | return all; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page) { |
| | | return meteringPlanMapper.pagingQueryOfMeasurementLedger(page); |
| | | public IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(SelectMeasurementLedgerDto dto) { |
| | | return meteringPlanMapper.pagingQueryOfMeasurementLedger(new Page<>(dto.getCurrentPage(),dto.getPageSize(),true),dto); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto) { |
| | | MeteringPlanAndInfoAndIns planMeasureInstrument = |
| | | meteringPlanMapper.getPlanMeasureInstrument |
| | | (new LimitPage((dto.getCurrentPage()-1)*dto.getPageSize(), |
| | | dto.getPageSize()), dto.getId()); |
| | | Map<String, Object> map = meteringPlanMapper.countPlanMeasurIns(dto.getId()); |
| | | map.put("list",planMeasureInstrument); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> limitGetPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto) { |
| | | Map<String, Object> map = meteringPlanMapper.countPlanMeasurIns(dto.getId()); |
| | | map.put("list",meteringPlanMapper |
| | | .limitGetPlanMeasureInstrument(new LimitPage((dto.getCurrentPage()-1)*dto.getPageSize() |
| | | ,dto.getPageSize()),dto.getId())); |
| | | return map; |
| | | } |
| | | } |