|
@@ -2,21 +2,31 @@
|
|
|
package org.sky.scientific.service.impl;
|
|
package org.sky.scientific.service.impl;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.sky.core.log.exception.ServiceException;
|
|
import org.sky.core.log.exception.ServiceException;
|
|
|
import org.sky.core.mp.base.BaseServiceImpl;
|
|
import org.sky.core.mp.base.BaseServiceImpl;
|
|
|
|
|
+import org.sky.core.mp.support.Condition;
|
|
|
|
|
+import org.sky.core.mp.support.Query;
|
|
|
import org.sky.core.secure.utils.SecureUtil;
|
|
import org.sky.core.secure.utils.SecureUtil;
|
|
|
import org.sky.core.tool.utils.DateUtil;
|
|
import org.sky.core.tool.utils.DateUtil;
|
|
|
import org.sky.core.tool.utils.Func;
|
|
import org.sky.core.tool.utils.Func;
|
|
|
import org.sky.scientific.mapper.*;
|
|
import org.sky.scientific.mapper.*;
|
|
|
|
|
+import org.sky.scientific.pojo.dto.CostSummaryDTO;
|
|
|
|
|
+import org.sky.scientific.pojo.dto.TechnicianDTO;
|
|
|
|
|
+import org.sky.scientific.pojo.dto.XmAssetQueryParam;
|
|
|
import org.sky.scientific.pojo.entity.*;
|
|
import org.sky.scientific.pojo.entity.*;
|
|
|
import org.sky.scientific.pojo.vo.*;
|
|
import org.sky.scientific.pojo.vo.*;
|
|
|
import org.sky.scientific.service.IEnterpriseInfoService;
|
|
import org.sky.scientific.service.IEnterpriseInfoService;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
|
|
+import java.text.DateFormat;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -34,6 +44,12 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
private final A107012Mapper a107012Mapper;
|
|
private final A107012Mapper a107012Mapper;
|
|
|
private final A107041Mapper a107041Mapper;
|
|
private final A107041Mapper a107041Mapper;
|
|
|
private final HighTechYbMapper highTechYbMapper;
|
|
private final HighTechYbMapper highTechYbMapper;
|
|
|
|
|
+ private final TechnicianMapper technicianMapper;
|
|
|
|
|
+ private final AssetMapper assetMapper;
|
|
|
|
|
+ private final XmFixedAssetMapper fixedAssetMapper;
|
|
|
|
|
+ private final CgZlMapper zlMapper;
|
|
|
|
|
+ private final CgKylwMapper kylwMapper;
|
|
|
|
|
+ private final CgJsbzMapper jsbzMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
@@ -90,9 +106,7 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<A107_1VO> qyyjkfxmqk(String year) {
|
|
public List<A107_1VO> qyyjkfxmqk(String year) {
|
|
|
- List<A107_1VO> list = new ArrayList<>();
|
|
|
|
|
- A107_1VO vo = new A107_1VO();
|
|
|
|
|
- list.add(vo);
|
|
|
|
|
|
|
+ List<A107_1VO> list = a107_1Mapper.qyyjkfxmqk(year, SecureUtil.getTenantId());
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -112,7 +126,141 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public A107_2VO qyyjkfhdjxgfy(String year) {
|
|
public A107_2VO qyyjkfhdjxgfy(String year) {
|
|
|
- return new A107_2VO();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ A107_2VO vo = new A107_2VO();
|
|
|
|
|
+ A107_2 db = a107_2Mapper.selectOne(Wrappers.<A107_2>lambdaQuery().eq(A107_2::getYearAndMonth, year).eq(A107_2::getTenantId, SecureUtil.getTenantId()));
|
|
|
|
|
+ if(Func.notNull(db)){
|
|
|
|
|
+ vo.setD2(db.getD2());
|
|
|
|
|
+ vo.setD58(db.getD58());
|
|
|
|
|
+ vo.setD55(db.getD55());
|
|
|
|
|
+ vo.setD56(db.getD56());
|
|
|
|
|
+ vo.setD45(db.getD45());
|
|
|
|
|
+ vo.setD22(db.getD22());
|
|
|
|
|
+ vo.setD23(db.getD23());
|
|
|
|
|
+ vo.setD24(db.getD24());
|
|
|
|
|
+ vo.setD25(db.getD25());
|
|
|
|
|
+ vo.setD26(db.getD26());
|
|
|
|
|
+ vo.setD53(db.getD53());
|
|
|
|
|
+ vo.setD54(db.getD54());
|
|
|
|
|
+ vo.setD36(db.getD36());
|
|
|
|
|
+ vo.setD37(db.getD37());
|
|
|
|
|
+ vo.setD38(db.getD38());
|
|
|
|
|
+ vo.setD46(db.getD46());
|
|
|
|
|
+ vo.setD47(db.getD47());
|
|
|
|
|
+ vo.setD48(db.getD48());
|
|
|
|
|
+ vo.setD49(db.getD49());
|
|
|
|
|
+ vo.setD50(db.getD50());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //一、研究开发人员情况
|
|
|
|
|
+ Query query = new Query();
|
|
|
|
|
+ query.setCurrent(1);
|
|
|
|
|
+ query.setSize(Integer.MAX_VALUE);
|
|
|
|
|
+ IPage<TechnicianVO> page = Condition.getPage(query);
|
|
|
|
|
+ TechnicianDTO dto = new TechnicianDTO();
|
|
|
|
|
+ dto.setYearAndMonth(year);
|
|
|
|
|
+ dto.setTenantId(SecureUtil.getTenantId());
|
|
|
|
|
+ List<TechnicianVO> technicianVOList = technicianMapper.niandugaokejirenyuanhuizongbiao(page, dto);
|
|
|
|
|
+
|
|
|
|
|
+ int d1=0, d3=0,d4=0,d5=0,d6=0;
|
|
|
|
|
+ if(Func.isNotEmpty(technicianVOList)){
|
|
|
|
|
+ d1 = technicianVOList.size();
|
|
|
|
|
+
|
|
|
|
|
+ d3 = (int)technicianVOList.stream().filter(item -> item.getGender()==2).count();
|
|
|
|
|
+
|
|
|
|
|
+ d5 = (int)technicianVOList.stream().filter(item -> List.of("本科", "硕士研究生", "博士研究生").contains(item.getEducation())).count();
|
|
|
|
|
+ }
|
|
|
|
|
+ vo.setD1(d1);
|
|
|
|
|
+ vo.setD3(d3);
|
|
|
|
|
+ vo.setD4(d4);
|
|
|
|
|
+ vo.setD5(d5);
|
|
|
|
|
+ vo.setD6(d6);
|
|
|
|
|
+
|
|
|
|
|
+ //二、研究开发费用情况
|
|
|
|
|
+ CostSummaryDTO costSummaryDTO = new CostSummaryDTO();
|
|
|
|
|
+
|
|
|
|
|
+ costSummaryDTO.setStartYearMonth(year + "01");
|
|
|
|
|
+ costSummaryDTO.setMonthCount(12);
|
|
|
|
|
+ costSummaryDTO.setTenantId(SecureUtil.getTenantId());
|
|
|
|
|
+ List<CostSummaryVO> list = assetMapper.costSummary(costSummaryDTO);
|
|
|
|
|
+ for (CostSummaryVO costSummaryVO : list) {
|
|
|
|
|
+
|
|
|
|
|
+ costSummaryVO.setWwfyAdjust(costSummaryVO.getWwfy().multiply(new BigDecimal("0.8")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+
|
|
|
|
|
+ costSummaryVO.setTotal(costSummaryVO.getRyrgfy().add(costSummaryVO.getZjtrfy()).add(costSummaryVO.getZjfyycqdtfy()).add(costSummaryVO.getSjfy()).add(costSummaryVO.getWxzctxfy()).add(costSummaryVO.getZbtsfyysyfy()).add(costSummaryVO.getQtfy()).add(costSummaryVO.getWwfyAdjust()).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+
|
|
|
|
|
+ vo.setD8(vo.getD8().add(costSummaryVO.getRyrgfy()));
|
|
|
|
|
+ vo.setD9(vo.getD9().add(costSummaryVO.getZjtrfy()));
|
|
|
|
|
+ vo.setD10(vo.getD10().add(costSummaryVO.getZjfyycqdtfy()));
|
|
|
|
|
+ vo.setD11(vo.getD11().add(costSummaryVO.getWxzctxfy()));
|
|
|
|
|
+ vo.setD12(vo.getD12().add(costSummaryVO.getSjfy()));
|
|
|
|
|
+ vo.setD13(vo.getD13().add(costSummaryVO.getZbtsfyysyfy()));
|
|
|
|
|
+ vo.setD14(vo.getD14().add(costSummaryVO.getWwfy()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //换算成千元
|
|
|
|
|
+ vo.setD8(vo.getD8().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setD9(vo.getD9().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setD10(vo.getD10().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setD11(vo.getD11().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setD12(vo.getD12().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setD13(vo.getD13().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setD14(vo.getD14().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+
|
|
|
|
|
+ List<A107_1> d43List = a107_1Mapper.selectList(Wrappers.<A107_1>lambdaQuery().eq(A107_1::getYearAndMonth, year));
|
|
|
|
|
+ for (A107_1 a1071 : d43List) {
|
|
|
|
|
+ vo.setD43(vo.getD43().add(a1071.getGovBonus()));
|
|
|
|
|
+ }
|
|
|
|
|
+ vo.setD43(vo.getD43().setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ IPage<XmFixedAsset> p2 = Condition.getPage(query);
|
|
|
|
|
+ XmAssetQueryParam param = new XmAssetQueryParam();
|
|
|
|
|
+ param.setYearAndMonth(year+"12");
|
|
|
|
|
+ List<XmFixedAsset> yiqishebeiList = fixedAssetMapper.selectXmFixedAssetPageByYearAndMonth(p2, param, "仪器设备");
|
|
|
|
|
+ for (XmFixedAsset asset : yiqishebeiList) {
|
|
|
|
|
+ vo.setD27(vo.getD7().add(asset.getAsset().getZcyz()));
|
|
|
|
|
+ }
|
|
|
|
|
+ vo.setD27(vo.getD27().setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+
|
|
|
|
|
+ //七、研究开发产出及相关情况
|
|
|
|
|
+ List<CgZlEntity> zlList = zlMapper.selectList(Wrappers.<CgZlEntity>lambdaQuery().eq(CgZlEntity::getTenantId, SecureUtil.getTenantId()));
|
|
|
|
|
+
|
|
|
|
|
+ int d29=0,d30=0,d32=0;
|
|
|
|
|
+ Date dateMin = DateUtil.parse(year+"-01-01", DateUtil.PATTERN_DATE);
|
|
|
|
|
+ Date dateMax = DateUtil.parse(year+"-12-31", DateUtil.PATTERN_DATE);
|
|
|
|
|
+ for (CgZlEntity zl : zlList) {
|
|
|
|
|
+ Date shenqingRq = zl.getShenqingRq();
|
|
|
|
|
+ Date shouquanRq = zl.getShouquanRq();
|
|
|
|
|
+ if(Func.notNull(shenqingRq)){
|
|
|
|
|
+ d29 ++;
|
|
|
|
|
+ if(Func.equals(year ,DateUtil.format(shenqingRq, DateUtil.PATTERN_YYYY))){
|
|
|
|
|
+ d30 ++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(Func.notNull(shouquanRq) && shouquanRq.before(dateMax) && shouquanRq.after(dateMin)){
|
|
|
|
|
+ d32 ++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ vo.setD29(d29);
|
|
|
|
|
+ vo.setD30(d30);
|
|
|
|
|
+ vo.setD32(d32);
|
|
|
|
|
+ vo.setD33(vo.getD32());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ Long d40 = kylwMapper.selectCount(Wrappers.<CgKylwEntity>lambdaQuery().between(CgKylwEntity::getFbrq, dateMin, dateMax));
|
|
|
|
|
+ vo.setD40(Func.toInt(d40, 0));
|
|
|
|
|
+
|
|
|
|
|
+ Long d41 = jsbzMapper.selectCount(Wrappers.<CgJsbzEntity>lambdaQuery()
|
|
|
|
|
+ .between(CgJsbzEntity::getSsrq, dateMin, dateMax)
|
|
|
|
|
+ .eq(CgJsbzEntity::getState, "现行有效")
|
|
|
|
|
+ .in(CgJsbzEntity::getBzlb, List.of("国家标准", "行业标准")));
|
|
|
|
|
+ vo.setD41(Func.toInt(d41, 0));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return vo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|