张晓波
2023-09-19 164694c47c35d6654df69b533e8dbf8b5423efc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.thhy.mobile.modules.biz.checkhistory.service.impl;
 
import com.thhy.mobile.modules.biz.checkhistory.entity.*;
import com.thhy.mobile.modules.biz.checkhistory.service.CheckHistoryService;
import com.thhy.mobile.modules.biz.pipeinfo.entity.PipeCheckHistoryListVo;
import com.thhy.mobile.modules.biz.pipeinfo.entity.PipeInfo;
import com.thhy.mobile.modules.biz.pipeinfo.mapper.PipeInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@Service
public class CheckHistoryServiceImpl implements CheckHistoryService {
 
    @Autowired
    private PipeInfoMapper pipeInfoMapper;
 
    @Override
    public List<PipeCheckHistoryListVo> pipeCheckHistory(CheckHisDto checkHisDto) {
        return pipeInfoMapper.checkHistoryList(checkHisDto);
    }
 
    @Override
    public Map<String, Object> history(CheckHisDto checkHisDto) {
        Map<String,Object> map = new HashMap<>();
        PipeInfo pipeInfo = pipeInfoMapper.queryByPipeNum(checkHisDto.getPipeNum());
        SteelInfoVo steelInfoVo = pipeInfoMapper.hisSteelInfo(pipeInfo.getProduceNumber());
        List<MixStation> mixStationList = pipeInfoMapper.leastMixStation();
        WaterCulInfoVo waterCulInfoVo = pipeInfoMapper.queryWaterByRingNum(pipeInfo.getRingNum());
 
        List<SteelVo> steelVo = pipeInfoMapper.querySteelByPRSB(pipeInfo);
        map.put("steelInfo",steelInfoVo); //钢筋信息
        map.put("mixInfos",mixStationList); //搅拌站信息
        map.put("steel",steelVo); //钢筋过程信息
        map.put("waterExist",false);
        map.put("repoExist",false);
        map.put("outExist",false);
        if(waterCulInfoVo!=null){
            map.put("waterExist",true);
            map.put("waterCulInfo",waterCulInfoVo);
        }
        int repoCount = pipeInfoMapper.RepoRecordCountByPipeNum(checkHisDto.getPipeNum());
        if(repoCount>0){
            map.put("repoExist",true);
            RepoInfoVo repoInfoVo = pipeInfoMapper.RepoRecordByPipeNum(checkHisDto.getPipeNum());
            map.put("repoInfo",repoInfoVo);
            if(repoInfoVo.getOutRepo()==1){
                //出库
                map.put("outExist",true);
                OutInfoVo outInfoVo = pipeInfoMapper.PipeOutInfo(pipeInfo.getPipeId());
                map.put("outInfo",outInfoVo);
            }
        }
        return map;
    }
}