多单位版国产化地质资料管理系统
zs
2025-12-18 4f0d9bde31a80f6279e26466250da7716eec627f
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package com.zbooksoft.gdmis.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruili.wcp.data.entity.management.User;
import com.zbooksoft.gdmis.dao.PhysicalDetailMapper;
import com.zbooksoft.gdmis.data.entity.*;
import com.zbooksoft.gdmis.data.vo.ParentPhysicalInfo;
import com.zbooksoft.gdmis.service.CatSwypService;
import com.zbooksoft.gdmis.service.CatSwyxxxService;
import com.zbooksoft.gdmis.service.PhysicalDetailService;
import com.zbooksoft.gdmis.service.ProcessingDetailService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
import java.util.List;
 
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
@Service
public class PhysicalDetailServiceImpl extends ServiceImpl<PhysicalDetailMapper, PhysicalDetail>
        implements PhysicalDetailService {
 
 
    @Autowired
    CatSwyxxxService catSwyxxxService;
 
    @Autowired
    ProcessingDetailService processingDetailService;
    @Autowired
    PhysicalDetailService physicalDetailService;
 
    @Autowired
    CatSwypService catSwypService;
 
    @Override
    public List<ParentPhysicalInfo> selectDistinctParentPhysicalInfo(Long createUserId) {
        return this.baseMapper.selectDistinctParentPhysicalInfo(createUserId);
    }
 
    /**
     * 获取具体申请单案卷
     */
    @Override
    public List<ParentPhysicalInfo> selectDistinctParentPhysicalInfoByFormId(Long formId) {
        return this.baseMapper.selectDistinctParentPhysicalInfoByFormId(formId);
    }
 
    /**
     * 添加实物信息
     *
     * @param catSwajxx
     */
    @Override
    public Integer setSwajxx(CatSwajxx catSwajxx) {
        int count = 0;
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        QueryWrapper<CatSwyxxx> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("aj_id", catSwajxx.getId());
        List<CatSwyxxx> catSwyxxxList = catSwyxxxService.list(queryWrapper);
        for (CatSwyxxx catSwyxxx : catSwyxxxList) {
            PhysicalDetail physicalDetail = new PhysicalDetail();
            physicalDetail.setFileId(catSwajxx.getAjId());
            physicalDetail.setItemId(catSwyxxx.getId());
 
            physicalDetail.setProjectName(catSwajxx.getXmmc());
            physicalDetail.setProjectNum(catSwyxxx.getZkmc());
            physicalDetail.setPosition(catSwyxxx.getZkbh());
            physicalDetail.setSampleNum(catSwajxx.getSwzldh());
            physicalDetail.setSampleType(catSwajxx.getSwzldh());
            physicalDetail.setVesselVoyage(catSwajxx.getSwzldh());
            physicalDetail.setSurveyedArea(catSwajxx.getSwzldh());
            physicalDetail.setCreateTime(new Date());
            physicalDetail.setCreateUserId(user.getUserId());
            physicalDetail.setCreateUserName(user.getTrueName());
            physicalDetail.setFormId(0L);
            physicalDetail.setSurvey(0);
            physicalDetail.setSampling(0);
            physicalDetailService.saveOrUpdate(physicalDetail);
            count++;
        }
        return count;
    }
 
    /**
     * 添加实物信息
     *
     * @param idList
     */
    @Override
    public Integer setCgwjxxByIds(List<Long> idList) {
 
        int count = 0;
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        for (Long id : idList) {
            CatSwyp catSwyp = catSwypService.getById(id);
            PhysicalDetail physicalDetail = new PhysicalDetail();
            physicalDetail.setFileId(catSwyp.getAjId());
            physicalDetail.setItemId(catSwyp.getId());
 
            physicalDetail.setProjectName(catSwyp.getXmmc());
            physicalDetail.setProjectNum(catSwyp.getXmbh());
            physicalDetail.setPosition(catSwyp.getZwmc());
            physicalDetail.setSampleNum(catSwyp.getYpbh());
            physicalDetail.setSampleType(catSwyp.getYplx());
            physicalDetail.setVesselVoyage(catSwyp.getDcchc());
            physicalDetail.setSurveyedArea(catSwyp.getDchy());
            physicalDetail.setCreateTime(new Date());
            physicalDetail.setCreateUserId(user.getUserId());
            physicalDetail.setCreateUserName(user.getTrueName());
            physicalDetail.setFormId(0L);
            physicalDetail.setSurvey(0);
            physicalDetail.setSampling(0);
            physicalDetailService.saveOrUpdate(physicalDetail);
            count++;
        }
        return count;
 
    }
}