Ver Fonte

储备项目库

JiangPengLi há 4 meses atrás
pai
commit
f09a2992f5

+ 13 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/dao/RptContDao.java

@@ -118,4 +118,17 @@ public class RptContDao extends EntityServiceImpl<RptCont> {
 
 		return (RptCont)this.queryForObject(detachedCriteria);
 	}
+
+	public RptCont getContBySubIdAndKind(String subId, String kind) {
+		DetachedCriteria detachedCriteria = DetachedCriteria.forClass(RptCont.class);
+		Criterion criterion = Restrictions.eq("subId", subId);
+		criterion = Restrictions.and(criterion, Restrictions.eq("logicDeleteFlag", 0));
+		criterion = Restrictions.and(criterion, Restrictions.eq("kind", kind));
+		criterion = Restrictions.and(criterion, Restrictions.isNotNull("content"));
+		detachedCriteria.add(criterion);
+		detachedCriteria.addOrder(Order.desc("kjMonth"));
+		// 取最新一条数据
+
+		return null;
+	}
 }

+ 6 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/mapper/SubInfoMapper.xml

@@ -181,6 +181,9 @@
             <if test="vo.status!=null and vo.status!=''">
                 and status = #{vo.status}
             </if>
+            <if test="vo.abc!=null and vo.abc!=''">
+                and abc = #{vo.abc}
+            </if>
         </where>
     </select>
     <select id="queryStatistics" resultType="com.rtrh.projects.modules.projects.po.SubInfoGxj">
@@ -210,6 +213,9 @@
             <if test="vo.status!=null and vo.status!=''">
                 and status = #{vo.status}
             </if>
+            <if test="vo.abc!=null and vo.abc!=''">
+                and abc = #{vo.abc}
+            </if>
         </where>
     </select>
     <select id="findById" resultType="com.rtrh.projects.modules.projects.po.SubInfoGxj">

+ 26 - 10
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoQueryServiceImpl.java

@@ -13,10 +13,10 @@ import cn.hutool.core.util.StrUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.google.common.base.Strings;
-import com.rtrh.projects.modules.projects.dao.SubAmtPlanDao;
-import com.rtrh.projects.modules.projects.dao.SubLabelDao;
-import com.rtrh.projects.modules.projects.dao.SubSourceDao;
+import com.rtrh.projects.modules.projects.dao.*;
 import com.rtrh.projects.modules.projects.dto.SubFixCbSearch;
+import com.rtrh.projects.modules.projects.enums.RptContKindEnum;
+import com.rtrh.projects.modules.projects.po.RptCont;
 import com.rtrh.projects.modules.projects.po.SubAmtPlan;
 import com.rtrh.projects.modules.projects.po.SubInfo;
 import com.rtrh.projects.modules.projects.po.SubInfoGxj;
@@ -33,14 +33,15 @@ import com.rtrh.projects.modules.utils.DateUtils;
 import com.rtrh.projects.vo.statics.OtherQueryVO;
 import com.rtrh.projects.vo.statics.ProjectQueryVO;
 import org.apache.commons.lang3.StringUtils;
+import org.hibernate.Query;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
 import org.springframework.stereotype.Service;
 
 import com.google.common.base.CaseFormat;
 import com.rtrh.common.util.StringUtil;
 import com.rtrh.core.repository.Page;
 import com.rtrh.projects.modules.hik.service.IHikApiService;
-import com.rtrh.projects.modules.projects.dao.SubInfoDao;
 import com.rtrh.projects.modules.projects.enums.ProjectStatusEnum;
 import com.rtrh.projects.modules.projects.enums.SubIsHideStatusEnum;
 import com.rtrh.projects.modules.projects.mapper.StaticsMapper;
@@ -84,6 +85,8 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
     private TSysTableService tSysTableService;
     @Autowired
     private SubLabelDao subLabelDao;
+    @Autowired
+    private RptContDao rptContDao;
 
     @Override
     public Map<String, Integer> getWarningBySubId(String subId) {
@@ -162,6 +165,10 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
 
     @Override
     public Page queryPage(Page page, LoginUserVO loginUser, SubInfoQueryTzVO queryVO) {
+        if (StringUtils.isBlank(queryVO.getAbc())) {
+            String abcs = queryVO.getAbcs();
+            queryVO.setAbc(abcs);
+        }
         PageHelper.startPage(page.getPageNo(), page.getPageSize());
         if (StringUtils.isNotBlank(queryVO.getStartAmt()))
             queryVO.setStartAmt(new BigDecimal(queryVO.getStartAmt()).multiply(new BigDecimal("10000")).toString());
@@ -170,16 +177,25 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
         }
         List<SubInfoGxj> data = subInfoMapper.queryPage(queryVO);
 
+
         PageInfo<SubInfoGxj> pageInfo = new PageInfo<>(data);
         page.setList(data);
         List<TSystable> byKind = tSysTableService.getByKind(SysTableKind.JSDD);
         if (CollectionUtil.isNotEmpty(data)) {
-            data.forEach(e ->
-                    byKind.stream()
-                            .filter(k -> e.getSubjectId().equals(k.getCode()))
-                            .findFirst()
-                            .ifPresent(k -> e.setSubjectName(k.getTitle()))
-            );
+            for (SubInfoGxj e : data) {
+                String hql = "FROM RptCont WHERE logicDeleteFlag = 0 AND subId = :subId AND kind = :kind AND content IS NOT NULL ORDER BY kjMonth DESC";
+                Query query = rptContDao.createQuery(hql);
+                query.setParameter("subId", e.getSubId());
+                query.setParameter("kind", RptContKindEnum.MONTH.getCode());
+                query.setMaxResults(1);
+                Object result = query.uniqueResult();
+                Optional.ofNullable(result).map(o -> (RptCont) o).ifPresent(o -> e.setProgress(o.getContent()));
+
+                byKind.stream()
+                        .filter(k -> e.getSubjectId().equals(k.getCode()))
+                        .findFirst()
+                        .ifPresent(k -> e.setSubjectName(k.getTitle()));
+            }
         }
         page.setTotalCount(pageInfo.getTotal());
         return page;

+ 8 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoServiceImpl.java

@@ -25,6 +25,7 @@ import com.rtrh.projects.vo.SubIdVO;
 import com.rtrh.projects.vo.subject.MoveDbParamVo;
 import com.rtrh.projects.vo.subject.SubinfoPreQueryVo;
 import org.apache.commons.lang3.StringUtils;
+import org.hibernate.Query;
 import org.hibernate.criterion.Criterion;
 import org.hibernate.criterion.DetachedCriteria;
 import org.hibernate.criterion.MatchMode;
@@ -4686,6 +4687,13 @@ public class SubInfoServiceImpl implements SubInfoService {
     @Override
     public SubInfoGxj findById(String subId) {
         SubInfoGxj subInfo = subInfoMapper.findById(subId);
+        String hql = "FROM RptCont WHERE logicDeleteFlag = 0 AND subId = :subId AND kind = :kind AND content IS NOT NULL ORDER BY kjMonth DESC";
+        Query query = rptContDao.createQuery(hql);
+        query.setParameter("subId", subInfo.getSubId());
+        query.setParameter("kind", RptContKindEnum.MONTH.getCode());
+        query.setMaxResults(1);
+        Object result = query.uniqueResult();
+        Optional.ofNullable(result).map(o -> (RptCont) o).ifPresent(o -> subInfo.setProgress(o.getContent()));
         sysTableService.getByKind(SysTableKind.HYFL).stream()
                 .filter(e -> e.getCode().equals(subInfo.getIndusKind()))
                 .findFirst().ifPresent(e-> subInfo.setIndusName(e.getTitle()));

+ 3 - 3
projects/src/main/webapp/vmodules/project/projInfo_yb.jsp

@@ -461,8 +461,8 @@
                     cols: [[ // 设置表头
                         {type: 'numbers', title: '序号', width: '50'},
                         {field: 'kjMonth', title: '月份', width: '80', totalRowText: '合计'},
-                        {field: 'progress', title: '进度比例-%', width: '200'},
-                        {field: 'Instructions', title: '进度说明', width: '200'},
+                        {field: 'numBl', title: '进度比例-%', width: '200'},
+                        {field: 'content', title: '进度说明', width: '200'},
 /*                        {
                             field: 'amtPlan',
                             totalRow: true,
@@ -890,7 +890,7 @@
                         self.weekInfo = datas[0]
                         self.weekData = datas
                         self.createSelect(datas)
-                        self.setFileValue(self.weekInfo.subId, self.weekInfo.year, self.weekInfo.beginDate)
+                        // self.setFileValue(self.weekInfo.subId, self.weekInfo.year, self.weekInfo.beginDate)
                     }
                 });
             },

+ 18 - 18
projects/src/main/webapp/vmodules/subject/subInfo/tz/cb_sum.jsp

@@ -421,15 +421,15 @@
                             </div>
                         </div>
                     </label>
-                    <label class="juli">
-                        <%--                        已开工项目数--%>储备已转化的项目数
-                        <span class="lanse-first">{{beginRate.cbzh}}</span>
-                        <div class="progress-div">
-                            <div class="layui-progress">
-                                <div class="layui-progress-bar" :style="'width:'+beginRate.beginRate"></div>
-                            </div>
-                        </div>
-                    </label>
+<%--                    <label class="juli">--%>
+<%--                        &lt;%&ndash;                        已开工项目数&ndash;%&gt;储备已转化的项目数--%>
+<%--                        <span class="lanse-first">{{beginRate.cbzh}}</span>--%>
+<%--                        <div class="progress-div">--%>
+<%--                            <div class="layui-progress">--%>
+<%--                                <div class="layui-progress-bar" :style="'width:'+beginRate.beginRate"></div>--%>
+<%--                            </div>--%>
+<%--                        </div>--%>
+<%--                    </label>--%>
                     <%--                    <label class="juli">--%>
                     <%--                        已竣工项目数<span class="lanse-first">{{beginRate.endNum}}</span>--%>
                     <%--                        <div class="progress-div">--%>
@@ -446,15 +446,15 @@
                     <%--                            </div>--%>
                     <%--                        </div>--%>
                     <%--                    </label>--%>
-                    <label class="juli">
-                        <%--                        开工率--%>储备转化率
-                        <span class="lanse-first">{{beginRate.cbRate}}%</span>
-                        <div class="progress-div">
-                            <div class="layui-progress">
-                                <div class="layui-progress-bar" :style="'width:'+beginRate.beginRate"></div>
-                            </div>
-                        </div>
-                    </label>
+<%--                    <label class="juli">--%>
+<%--                        &lt;%&ndash;                        开工率&ndash;%&gt;储备转化率--%>
+<%--                        <span class="lanse-first">{{beginRate.cbRate}}%</span>--%>
+<%--                        <div class="progress-div">--%>
+<%--                            <div class="layui-progress">--%>
+<%--                                <div class="layui-progress-bar" :style="'width:'+beginRate.beginRate"></div>--%>
+<%--                            </div>--%>
+<%--                        </div>--%>
+<%--                    </label>--%>
                     <%--                    <label class="juli">--%>
                     <%--                        竣工率--%>
                     <%--                        --%>