|
|
@@ -31,7 +31,9 @@ import org.sky.scientific.pojo.entity.*;
|
|
|
import org.sky.scientific.pojo.vo.*;
|
|
|
import org.sky.scientific.service.IEnterpriseInfoService;
|
|
|
import org.sky.scientific.service.IXmCostDetailsService;
|
|
|
+import org.sky.system.cache.RegionCache;
|
|
|
import org.sky.system.feign.ISysClient;
|
|
|
+import org.sky.system.pojo.entity.Region;
|
|
|
import org.sky.system.pojo.entity.Tenant;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -77,6 +79,8 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
private final ISysClient sysClient;
|
|
|
private final FreeMarkerConfigurer freeMarkerConfigurer;
|
|
|
private final XmFixedAssetMapper xmFixedAssetMapper;
|
|
|
+ private final SettingMapper settingMapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
@@ -143,6 +147,7 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
for (A107_1VO vo : list) {
|
|
|
|
|
|
// TODO 项目人员实际工作时间(人月)
|
|
|
+// vo.setWorkTime();
|
|
|
|
|
|
//当列15等于基础研究时,列14=P088中对应研发项目的受托方类型的前5项的委外金额合计。当列15不等于基础研究时,列14等于0
|
|
|
if (Func.equals(vo.getYjlx(), "基础研究")) {
|
|
|
@@ -240,27 +245,28 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
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());
|
|
|
- vo.setAttachment(db.getAttachment());
|
|
|
+// 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());
|
|
|
+// vo.setAttachment(db.getAttachment());
|
|
|
+ BeanUtil.copyProperties(db, vo);
|
|
|
}
|
|
|
|
|
|
//一、研究开发人员情况
|
|
|
@@ -285,60 +291,11 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
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.setD19(vo.getD19().add(costSummaryVO.getQtfy()));
|
|
|
+ statisticsCost( vo, year);
|
|
|
+ if(Func.isNull(vo.getD26()) || vo.getD26().compareTo(BigDecimal.ZERO) <=0){
|
|
|
+ vo.setD26(vo.getD7());
|
|
|
}
|
|
|
|
|
|
- //换算成千元
|
|
|
- //1.人员人工费用
|
|
|
- vo.setD8(vo.getD8().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //2.直接投入费用
|
|
|
- vo.setD9(vo.getD9().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //3.折旧费用与长期待摊费用
|
|
|
- vo.setD10(vo.getD10().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //4.无形资产摊销费用
|
|
|
- vo.setD11(vo.getD11().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //5.设计费用
|
|
|
- vo.setD12(vo.getD12().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //6.装备调试费用与试验费用
|
|
|
- vo.setD13(vo.getD13().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //7.委托外部研究开发费用
|
|
|
- vo.setD14(vo.getD14().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //8.其他费用
|
|
|
- vo.setD19(vo.getD19().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
-
|
|
|
- XmWwxmCostQuery wwxmCostQuery = new XmWwxmCostQuery();
|
|
|
- wwxmCostQuery.setYearAndMonth(year);
|
|
|
- List<XmWwxmCostVO> wwxmCostVOList = wwxmCostMapper.selectPageByYear(Condition.getPage(new Query().setCurrent(1).setSize(Integer.MAX_VALUE)), wwxmCostQuery);
|
|
|
-
|
|
|
- //①委托境内研究机构
|
|
|
- BigDecimal d15 = wwxmCostVOList.stream().filter(item -> Func.equals(item.getStflx(), "境内研究机构")).map(XmWwxmCostVO::getPayAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
- vo.setD15(d15.multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //②委托境内高等学校
|
|
|
- BigDecimal d16 = wwxmCostVOList.stream().filter(item -> Func.equals(item.getStflx(), "境内高等学校")).map(XmWwxmCostVO::getPayAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
- vo.setD16(d16.multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //③委托境内企业
|
|
|
- BigDecimal d17 = wwxmCostVOList.stream().filter(item -> Func.equals(item.getStflx(), "境内企业")).map(XmWwxmCostVO::getPayAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
- vo.setD17(d17.multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
- //④委托境外机构
|
|
|
- BigDecimal d18 = wwxmCostVOList.stream().filter(item -> Func.equals(item.getStflx(), "境外机构")).map(XmWwxmCostVO::getPayAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
- vo.setD18(d18.multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
-
|
|
|
// 三、研究开发资产情况
|
|
|
// d20 当年形成用于研发开发的固定资产
|
|
|
XmAssetQueryParam p = new XmAssetQueryParam();
|
|
|
@@ -349,7 +306,7 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
BigDecimal yiqishebeiTotal = BigDecimal.ZERO;
|
|
|
for (XmFixedAsset yiqishebei : yiqishebeiList) {
|
|
|
AssetEntity asset = yiqishebei.getAsset();
|
|
|
- if(Func.equals(DateUtil.format(asset.getKssj(), DateUtil.PATTERN_YYYY), year)){
|
|
|
+ if (Func.equals(DateUtil.format(asset.getKssj(), DateUtil.PATTERN_YYYY), year)) {
|
|
|
yiqishebeiTotal = yiqishebeiTotal.add(asset.getZcyz());
|
|
|
}
|
|
|
}
|
|
|
@@ -357,7 +314,7 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
BigDecimal fangwujianzhuwuTotal = BigDecimal.ZERO;
|
|
|
for (XmFixedAsset fangwujianzhuwu : fangwujianzhuwuList) {
|
|
|
AssetEntity asset = fangwujianzhuwu.getAsset();
|
|
|
- if(Func.equals(DateUtil.format(asset.getKssj(), DateUtil.PATTERN_YYYY), year)){
|
|
|
+ if (Func.equals(DateUtil.format(asset.getKssj(), DateUtil.PATTERN_YYYY), year)) {
|
|
|
yiqishebeiTotal = fangwujianzhuwuTotal.add(asset.getZcyz());
|
|
|
}
|
|
|
}
|
|
|
@@ -374,11 +331,43 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
}
|
|
|
vo.setD43(vo.getD43().setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
|
- //todo 五、相关政策落实情况
|
|
|
+// todo 五、相关政策落实情况
|
|
|
+ XmCostDetailsDTO costDetailsDTO = new XmCostDetailsDTO();
|
|
|
+ costDetailsDTO.setYearAndMonth(year + "12");
|
|
|
+ DeductionCostSummary summary = xmCostDetailsService.deductionCostSummary(costDetailsDTO);
|
|
|
//申报加计扣除减免税的研究开发支出
|
|
|
-// vo.setD52();
|
|
|
+ vo.setD52(Func.isNull(summary) ? BigDecimal.ZERO : summary.getYxjjkcjehj_hjje().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
//加计扣除减免税金额
|
|
|
-// vo.setD44();
|
|
|
+
|
|
|
+ A107012 a107012 = a107012Mapper.selectOne(Wrappers.<A107012>lambdaQuery().eq(A107012::getYearAndMonth, year));
|
|
|
+ BigDecimal a107012_d41 = Func.isNull(summary) ? BigDecimal.ZERO : summary.getTotal_fyh();
|
|
|
+ BigDecimal a107012_d43 = BigDecimal.ZERO;
|
|
|
+ BigDecimal a107012_d44 = BigDecimal.ZERO;
|
|
|
+ BigDecimal a107012_d46 = BigDecimal.ZERO;
|
|
|
+ BigDecimal a107012_d48 = BigDecimal.ZERO;
|
|
|
+ BigDecimal a107012_d49 = BigDecimal.ZERO;
|
|
|
+ if (Func.notNull(a107012)) {
|
|
|
+ a107012_d43 = a107012.getD43();
|
|
|
+ a107012_d44 = a107012.getD44();
|
|
|
+ a107012_d46 = a107012.getD46();
|
|
|
+ a107012_d48 = a107012.getD48();
|
|
|
+ a107012_d49 = a107012.getD49();
|
|
|
+
|
|
|
+ }
|
|
|
+ //六、允许扣除的研发费用合计(41+43+44)
|
|
|
+ BigDecimal a107012_d45 = a107012_d41.add(a107012_d43).add(a107012_d44);
|
|
|
+
|
|
|
+ //七、允许扣除的研发费用抵减特殊收入后的金额(45-46)
|
|
|
+ BigDecimal a107012_d47 = a107012_d45.subtract(a107012_d46);
|
|
|
+
|
|
|
+ //九、本年研发费用加计扣除总额(47-48-49)×50,50为固定的100%
|
|
|
+ //如果当年是高企,就税率为15%,如非高企,税率为25%
|
|
|
+ vo.setD44(a107012_d47.subtract(a107012_d48).subtract(a107012_d49));
|
|
|
+ if(enterpriseInfoMapper.selectCount(Wrappers.<EnterpriseInfoEntity>lambdaQuery().eq(EnterpriseInfoEntity::getHighTechYear, year)) > 0){
|
|
|
+ vo.setD44(vo.getD44().multiply(new BigDecimal("0.15")).multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ }else {
|
|
|
+ vo.setD44(vo.getD44().multiply(new BigDecimal("0.25")).multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ }
|
|
|
|
|
|
//六、企业办研究开发机构 (境内)情况
|
|
|
// d27 :期末仪器和设备原价
|
|
|
@@ -428,7 +417,6 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
//八、其他相关情况
|
|
|
//当年企业研发准备金合计
|
|
|
List<XmEntity> xmList = xmMapper.selectList(Wrappers.emptyWrapper());
|
|
|
- BigDecimal d59 = BigDecimal.ZERO;
|
|
|
for (XmEntity xm : xmList) {
|
|
|
String xmyszemx = xm.getXmyszemx();
|
|
|
if (Func.notNull(xmyszemx)) {
|
|
|
@@ -445,6 +433,63 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
+ private void statisticsCost(A107_2VO vo, String year){
|
|
|
+ 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.setD19(vo.getD19().add(costSummaryVO.getQtfy()));
|
|
|
+ }
|
|
|
+
|
|
|
+ //换算成千元
|
|
|
+ //1.人员人工费用
|
|
|
+ vo.setD8(vo.getD8().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //2.直接投入费用
|
|
|
+ vo.setD9(vo.getD9().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //3.折旧费用与长期待摊费用
|
|
|
+ vo.setD10(vo.getD10().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //4.无形资产摊销费用
|
|
|
+ vo.setD11(vo.getD11().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //5.设计费用
|
|
|
+ vo.setD12(vo.getD12().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //6.装备调试费用与试验费用
|
|
|
+ vo.setD13(vo.getD13().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //7.委托外部研究开发费用
|
|
|
+ vo.setD14(vo.getD14().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //8.其他费用
|
|
|
+ vo.setD19(vo.getD19().multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+
|
|
|
+ XmWwxmCostQuery wwxmCostQuery = new XmWwxmCostQuery();
|
|
|
+ wwxmCostQuery.setYearAndMonth(year);
|
|
|
+ List<XmWwxmCostVO> wwxmCostVOList = wwxmCostMapper.selectPageByYear(Condition.getPage(new Query().setCurrent(1).setSize(Integer.MAX_VALUE)), wwxmCostQuery);
|
|
|
+
|
|
|
+ //①委托境内研究机构
|
|
|
+ BigDecimal d15 = wwxmCostVOList.stream().filter(item -> Func.equals(item.getStflx(), "境内研究机构")).map(XmWwxmCostVO::getPayAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
+ vo.setD15(d15.multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //②委托境内高等学校
|
|
|
+ BigDecimal d16 = wwxmCostVOList.stream().filter(item -> Func.equals(item.getStflx(), "境内高等学校")).map(XmWwxmCostVO::getPayAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
+ vo.setD16(d16.multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //③委托境内企业
|
|
|
+ BigDecimal d17 = wwxmCostVOList.stream().filter(item -> Func.equals(item.getStflx(), "境内企业")).map(XmWwxmCostVO::getPayAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
+ vo.setD17(d17.multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ //④委托境外机构
|
|
|
+ BigDecimal d18 = wwxmCostVOList.stream().filter(item -> Func.equals(item.getStflx(), "境外机构")).map(XmWwxmCostVO::getPayAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
|
|
+ vo.setD18(d18.multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP));
|
|
|
+
|
|
|
+ vo.setD7(vo.getD8().add(vo.getD9()).add(vo.getD10()).add(vo.getD11()).add(vo.getD12()).add(vo.getD13()).add(vo.getD14()).add(vo.getD19()));
|
|
|
+
|
|
|
+ }
|
|
|
@Override
|
|
|
public boolean updateQyyjkfhdjxgfy107_2(A107_2 a1072) {
|
|
|
LambdaQueryWrapper<A107_2> eq = Wrappers.<A107_2>lambdaQuery().eq(A107_2::getYearAndMonth, a1072.getYearAndMonth());
|
|
|
@@ -863,20 +908,30 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
}
|
|
|
HighTechYBVO vo = new HighTechYBVO();
|
|
|
vo.setYearAndMonth(year);
|
|
|
+
|
|
|
+ R<Tenant> r = sysClient.getTenant(SecureUtil.getTenantId());
|
|
|
+ if (r.isSuccess()) {
|
|
|
+ Tenant tenant = r.getData();
|
|
|
+ vo.setEnterpriseName(tenant.getTenantName());
|
|
|
+ vo.setUscc(tenant.getUscc());
|
|
|
+ vo.setLinkman(tenant.getLinkman());
|
|
|
+ vo.setContactNumber(tenant.getContactNumber());
|
|
|
+ if (Func.isNotEmpty(tenant.getDistrictCode())) {
|
|
|
+ Region region = RegionCache.getByCode(tenant.getDistrictCode());
|
|
|
+ if (region != null) {
|
|
|
+ vo.setRegionName(region.getProvinceName() + "-" + region.getCityName() + "-" + region.getDistrictName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ EnterpriseInfoEntity enterpriseInfo = enterpriseInfoMapper.selectOne(Wrappers.<EnterpriseInfoEntity>lambdaQuery().eq(EnterpriseInfoEntity::getYearAndMonth, year));
|
|
|
+ if (Func.notNull(enterpriseInfo)) {
|
|
|
+ vo.setHighTechNumber(enterpriseInfo.getHighTechNumber());
|
|
|
+ vo.setHighTechYear(enterpriseInfo.getHighTechYear());
|
|
|
+ }
|
|
|
+
|
|
|
HighTechYB db = highTechYbMapper.selectOne(Wrappers.<HighTechYB>lambdaQuery().eq(HighTechYB::getYearAndMonth, year));
|
|
|
if (Func.notNull(db)) {
|
|
|
-// vo.setD13(db.getD13());
|
|
|
-// vo.setD15(db.getD15());
|
|
|
-// vo.setD16(db.getD16());
|
|
|
-// vo.setD18(db.getD18());
|
|
|
-// vo.setD20(db.getD20());
|
|
|
-// vo.setD21(db.getD21());
|
|
|
-// vo.setD22(db.getD22());
|
|
|
-// vo.setD23(db.getD23());
|
|
|
-// vo.setD24(db.getD24());
|
|
|
-// vo.setD25(db.getD25());
|
|
|
-// vo.setD30(db.getD30());
|
|
|
-// vo.setd
|
|
|
BeanUtil.copyProperties(db, vo);
|
|
|
}
|
|
|
Date dateMin = DateUtil.parse(year + "-01-01", DateUtil.PATTERN_DATE);
|
|
|
@@ -932,16 +987,47 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
vo.setD14(d14);
|
|
|
|
|
|
//销售收入
|
|
|
- EnterpriseInfoEntity enterpriseInfo = enterpriseInfoMapper.selectOne(Wrappers.<EnterpriseInfoEntity>lambdaQuery().eq(EnterpriseInfoEntity::getYearAndMonth, year));
|
|
|
- if(Func.notNull(enterpriseInfo)){
|
|
|
+ if (Func.notNull(enterpriseInfo)) {
|
|
|
vo.setD19(enterpriseInfo.getCurrentYearIncome().toPlainString());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
vo.setD19("0.00");
|
|
|
}
|
|
|
- //研究开发费用额
|
|
|
-// vo.setD26();
|
|
|
-// vo.setD28();
|
|
|
-// vo.setD29();
|
|
|
+ //todo 研究开发费用额
|
|
|
+ //取数:对外报表-107-2表-二、研究开发费用情况-研究开发费用合计
|
|
|
+ A107_2VO a107_2VO = new A107_2VO();
|
|
|
+ statisticsCost(a107_2VO, year);
|
|
|
+ vo.setD26(a107_2VO.getD7().toPlainString());
|
|
|
+
|
|
|
+ //取数:对外报表:107.2表,六、企业办研究开发机构(境内)情况,机构研究开发费用
|
|
|
+ A107_2 a1072 = a107_2Mapper.selectOne(Wrappers.<A107_2>lambdaQuery().eq(A107_2::getYearAndMonth, year));
|
|
|
+ if(Func.isNull(a1072)){
|
|
|
+ vo.setD28(a107_2VO.getD7().toPlainString());
|
|
|
+ }else {
|
|
|
+ vo.setD28(a1072.getD26().toPlainString());
|
|
|
+ }
|
|
|
+
|
|
|
+ //取数:对外报表-107-2表,三、研究开发资本情况-当年形成用于研发开发的固定资本
|
|
|
+ XmAssetQueryParam p = new XmAssetQueryParam();
|
|
|
+ p.setYearAndMonth(year);
|
|
|
+ List<XmFixedAsset> yiqishebeiList = xmFixedAssetMapper.selectXmFixedAssetPageByYear(Condition.getPage(new Query().setCurrent(1).setSize(Integer.MAX_VALUE)), p, "仪器设备");
|
|
|
+ List<XmFixedAsset> fangwujianzhuwuList = xmFixedAssetMapper.selectXmFixedAssetPageByYear(Condition.getPage(new Query().setCurrent(1).setSize(Integer.MAX_VALUE)), p, "房屋建筑物");
|
|
|
+
|
|
|
+ BigDecimal yiqishebeiTotal = BigDecimal.ZERO;
|
|
|
+ for (XmFixedAsset yiqishebei : yiqishebeiList) {
|
|
|
+ AssetEntity asset = yiqishebei.getAsset();
|
|
|
+ if (Func.equals(DateUtil.format(asset.getKssj(), DateUtil.PATTERN_YYYY), year)) {
|
|
|
+ yiqishebeiTotal = yiqishebeiTotal.add(asset.getZcyz());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal fangwujianzhuwuTotal = BigDecimal.ZERO;
|
|
|
+ for (XmFixedAsset fangwujianzhuwu : fangwujianzhuwuList) {
|
|
|
+ AssetEntity asset = fangwujianzhuwu.getAsset();
|
|
|
+ if (Func.equals(DateUtil.format(asset.getKssj(), DateUtil.PATTERN_YYYY), year)) {
|
|
|
+ yiqishebeiTotal = fangwujianzhuwuTotal.add(asset.getZcyz());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setD29(fangwujianzhuwuTotal.add(yiqishebeiTotal).multiply(new BigDecimal("0.001")).setScale(2, RoundingMode.HALF_UP).toPlainString());
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
@@ -963,22 +1049,22 @@ public class EnterpriseInfoServiceImpl extends BaseServiceImpl<EnterpriseInfoMap
|
|
|
public void exportGqnb(HttpServletResponse response, String year) {
|
|
|
HighTechYBVO techYBVO = gqnb(year);
|
|
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- BeanUtil.copyProperties(techYBVO, map);
|
|
|
- R<Tenant> tenant = sysClient.getTenant(SecureUtil.getTenantId());
|
|
|
- if(tenant.isSuccess()){
|
|
|
- Tenant data = tenant.getData();
|
|
|
- map.put("enterpriseName", Func.toStr(data.getTenantName(), ""));
|
|
|
- map.put("uscc", Func.toStr(data.getUscc(), ""));
|
|
|
- map.put("address", Func.toStr(data.getAddress(), ""));
|
|
|
- map.put("linkman", Func.toStr(data.getLinkman(), ""));
|
|
|
- map.put("contact_number", Func.toStr(data.getContactNumber(), ""));
|
|
|
- }
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
|
+// BeanUtil.copyProperties(techYBVO, map);
|
|
|
+// R<Tenant> tenant = sysClient.getTenant(SecureUtil.getTenantId());
|
|
|
+// if (tenant.isSuccess()) {
|
|
|
+// Tenant data = tenant.getData();
|
|
|
+// map.put("enterpriseName", Func.toStr(data.getTenantName(), ""));
|
|
|
+// map.put("uscc", Func.toStr(data.getUscc(), ""));
|
|
|
+// map.put("regionName", Func.toStr(data.getAddress(), ""));
|
|
|
+// map.put("linkman", Func.toStr(data.getLinkman(), ""));
|
|
|
+// map.put("contactNumber", Func.toStr(data.getContactNumber(), ""));
|
|
|
+// }
|
|
|
Template template = freeMarkerConfigurer.getConfiguration().getTemplate("年度高新技术企业发展情况报表.ftl");
|
|
|
- response.setHeader("Content-disposition",
|
|
|
+ response.setHeader("Content-disposition",
|
|
|
"attachment;filename=" + URLEncoder.encode("年度高新技术企业发展情况报表.doc", StandardCharsets.UTF_8));
|
|
|
response.setContentType("application/msword");// 定义输出类型
|
|
|
- template.process(map, new OutputStreamWriter(response.getOutputStream()));
|
|
|
+ template.process(techYBVO, new OutputStreamWriter(response.getOutputStream()));
|
|
|
}
|
|
|
|
|
|
@Override
|