Browse Source

0000000335

zhoulisky 6 months ago
parent
commit
d893a64d0a
15 changed files with 21 additions and 28 deletions
  1. 1 1
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/entity/XmGoodsEntity.java
  2. 1 1
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/entity/XmLeaseEntity.java
  3. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/XmGoodsExcel.java
  4. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/XmLeaseExcel.java
  5. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/listener/XmGoodsImportListener.java
  6. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmMapper.xml
  7. 2 11
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/SettingServiceImpl.java
  8. 4 4
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmGoodsServiceImpl.java
  9. 2 2
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmLeaseServiceImpl.java
  10. 7 5
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/YsRyrgfyServiceImpl.java
  11. BIN
      kd-service/kd-scientific/src/main/resources/export-template/研发项目管理/预算编制/人员人工费用.xls
  12. BIN
      kd-service/kd-scientific/src/main/resources/export-template/研发项目管理/预算编制/折旧费用与长期待摊费用.xls
  13. BIN
      kd-service/kd-scientific/src/main/resources/export-template/研发项目管理/预算编制/无形资产摊销费用.xls
  14. BIN
      kd-service/kd-scientific/src/main/resources/export-template/研发项目管理/预算编制/研发项目经费预算表.xls
  15. 0 0
      logPath_IS_UNDEFINED/nacos/naming.log

+ 1 - 1
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/entity/XmGoodsEntity.java

@@ -61,7 +61,7 @@ public class XmGoodsEntity extends TenantEntity {
 	private BigDecimal unitPrice;
 	private BigDecimal unitPrice;
 
 
 	@Schema(description = "领用数量")
 	@Schema(description = "领用数量")
-	private Integer useQuantity;
+	private Double useQuantity;
 
 
 	@Schema(description = "金额")
 	@Schema(description = "金额")
 	private BigDecimal amount;
 	private BigDecimal amount;

+ 1 - 1
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/entity/XmLeaseEntity.java

@@ -65,7 +65,7 @@ public class XmLeaseEntity extends TenantEntity {
 
 
 	@Schema(description = "使用天数或使用量")
 	@Schema(description = "使用天数或使用量")
 	@NotNull(message = "请填写使用天数或使用量")
 	@NotNull(message = "请填写使用天数或使用量")
-	private Integer quantity;
+	private Double quantity;
 
 
 	@Schema(description = "单价(元)")
 	@Schema(description = "单价(元)")
 	@NotNull(message = "请填写单价")
 	@NotNull(message = "请填写单价")

+ 1 - 1
kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/XmGoodsExcel.java

@@ -68,7 +68,7 @@ public class XmGoodsExcel implements Serializable {
 	private BigDecimal unitPrice;
 	private BigDecimal unitPrice;
 
 
 	@ExcelProperty(index = 10, value ="领用数量")
 	@ExcelProperty(index = 10, value ="领用数量")
-	private Integer useQuantity;
+	private Double useQuantity;
 
 
 	@ExcelProperty(index = 11, value ="金额(元)")
 	@ExcelProperty(index = 11, value ="金额(元)")
 	private BigDecimal amount;
 	private BigDecimal amount;

+ 1 - 1
kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/XmLeaseExcel.java

@@ -60,7 +60,7 @@ public class XmLeaseExcel implements Serializable {
 	private String model;
 	private String model;
 
 
 	@ExcelProperty(value = "使用天数或使用量")
 	@ExcelProperty(value = "使用天数或使用量")
-	private Integer quantity = 0;
+	private Double quantity = 0.00;
 
 
 	@ExcelProperty(value =  "单价(元)")
 	@ExcelProperty(value =  "单价(元)")
 	private BigDecimal unitPrice = BigDecimal.ZERO;
 	private BigDecimal unitPrice = BigDecimal.ZERO;

+ 1 - 1
kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/listener/XmGoodsImportListener.java

@@ -51,7 +51,7 @@ public class XmGoodsImportListener extends BaseReadListener {
 		excel.setModel(data.get(7));
 		excel.setModel(data.get(7));
 		excel.setUnit(data.get(8));
 		excel.setUnit(data.get(8));
 		excel.setUnitPrice(ValidationUtils.safeParseBigDecimal(data.get(9)));
 		excel.setUnitPrice(ValidationUtils.safeParseBigDecimal(data.get(9)));
-		excel.setUseQuantity(ValidationUtils.safeParseInteger(data.get(10)));
+		excel.setUseQuantity(ValidationUtils.safeParseDouble(data.get(10)));
 		excel.setAmount(BigDecimal.valueOf(excel.getUseQuantity()).multiply(excel.getUnitPrice()));
 		excel.setAmount(BigDecimal.valueOf(excel.getUseQuantity()).multiply(excel.getUnitPrice()));
 
 
 		errors.addAll(ValidationUtils.validate(excel));
 		errors.addAll(ValidationUtils.validate(excel));

+ 1 - 1
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmMapper.xml

@@ -107,7 +107,7 @@
         WHERE xm.tenant_id = #{ew.tenantId}
         WHERE xm.tenant_id = #{ew.tenantId}
               and
               and
                 (
                 (
-                    #{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and  date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
+                    #{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
                     or (xm.XMKSSJ is null and xm.status=0 and DATE_FORMAT(xm.create_time, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth})
                     or (xm.XMKSSJ is null and xm.status=0 and DATE_FORMAT(xm.create_time, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth})
                 )
                 )
         <if test="ew.xmbh!=null and ew.xmbh!=''">and xm.XMBH like concat('%',#{ew.xmbh},'%')</if>
         <if test="ew.xmbh!=null and ew.xmbh!=''">and xm.XMBH like concat('%',#{ew.xmbh},'%')</if>

+ 2 - 11
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/SettingServiceImpl.java

@@ -13,8 +13,6 @@ import org.sky.scientific.pojo.entity.SettingEntity;
 import org.sky.scientific.service.SettingService;
 import org.sky.scientific.service.SettingService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import java.util.List;
-
 /**
 /**
  *  设置 服务实现类
  *  设置 服务实现类
  *
  *
@@ -67,11 +65,10 @@ public class SettingServiceImpl implements SettingService {
 		LambdaQueryWrapper<SettingEntity> eq = Wrappers.<SettingEntity>lambdaQuery()
 		LambdaQueryWrapper<SettingEntity> eq = Wrappers.<SettingEntity>lambdaQuery()
 			.eq(SettingEntity::getYearAndMonth, lastYear);
 			.eq(SettingEntity::getYearAndMonth, lastYear);
 		SettingEntity one = mapper.selectOne(eq);
 		SettingEntity one = mapper.selectOne(eq);
-		if (Func.isNull(one)) {
-			throw new ServiceException("上年度数据");
+		if (Func.isNull(one) || (Func.equals(settingEntity.getType(), 1) && one.getWorkHours()==null) || (Func.equals(settingEntity.getType(), 2) && Func.isBlank(one.getHighTechUrl()))) {
+			throw new ServiceException("上年度没有数据");
 		}
 		}
 		one.setYearAndMonth(settingEntity.getYearAndMonth());
 		one.setYearAndMonth(settingEntity.getYearAndMonth());
-
 		SettingEntity dbEntity = mapper.selectOne(Wrappers.<SettingEntity>lambdaQuery()
 		SettingEntity dbEntity = mapper.selectOne(Wrappers.<SettingEntity>lambdaQuery()
 			.eq(SettingEntity::getYearAndMonth, settingEntity.getYearAndMonth()));
 			.eq(SettingEntity::getYearAndMonth, settingEntity.getYearAndMonth()));
 		if(Func.isNull(dbEntity)){
 		if(Func.isNull(dbEntity)){
@@ -99,10 +96,4 @@ public class SettingServiceImpl implements SettingService {
 			return mapper.updateById(dbEntity) == 1;
 			return mapper.updateById(dbEntity) == 1;
 		}
 		}
 	}
 	}
-
-//	@Override
-//	public List<SettingEntity> torchDevList(String yearMin, String yearMax) {
-//		return mapper.selectList(Wrappers.<SettingEntity>lambdaQuery()
-//				.between(SettingEntity::getYearAndMonth, yearMin, yearMax));
-//	}
 }
 }

+ 4 - 4
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmGoodsServiceImpl.java

@@ -71,9 +71,9 @@ public class XmGoodsServiceImpl extends BaseServiceImpl<XmGoodsMapper, XmGoodsEn
 				excel.setUnitPrice(BigDecimal.ZERO);
 				excel.setUnitPrice(BigDecimal.ZERO);
 			}
 			}
 			if (excel.getUseQuantity() == null) {
 			if (excel.getUseQuantity() == null) {
-				excel.setUseQuantity(0);
+				excel.setUseQuantity(0.00);
 			}
 			}
-			excel.setAmount(excel.getUnitPrice().multiply(new BigDecimal(excel.getUseQuantity())));
+			excel.setAmount(excel.getUnitPrice().multiply(BigDecimal.valueOf(excel.getUseQuantity())));
 			excel.setUseDateStr(Func.notNull(excel.getUseDate()) ? DateUtil.format(excel.getUseDate(), DateUtil.PATTERN_DATE) : null);
 			excel.setUseDateStr(Func.notNull(excel.getUseDate()) ? DateUtil.format(excel.getUseDate(), DateUtil.PATTERN_DATE) : null);
 			resultList.add(excel);
 			resultList.add(excel);
 		}
 		}
@@ -246,7 +246,7 @@ public class XmGoodsServiceImpl extends BaseServiceImpl<XmGoodsMapper, XmGoodsEn
 			excel.setXh(index.getAndIncrement() + "");
 			excel.setXh(index.getAndIncrement() + "");
 			excel.setUseDateStr(Func.notNull(temp.getUseDate()) ? DateUtil.format(temp.getUseDate(), DateUtil.PATTERN_DATE) : null);
 			excel.setUseDateStr(Func.notNull(temp.getUseDate()) ? DateUtil.format(temp.getUseDate(), DateUtil.PATTERN_DATE) : null);
 			if (excel.getUseQuantity() == null) {
 			if (excel.getUseQuantity() == null) {
-				excel.setUseQuantity(0);
+				excel.setUseQuantity(0.0);
 			}
 			}
 			if (excel.getUnitPrice() == null) {
 			if (excel.getUnitPrice() == null) {
 				excel.setUnitPrice(BigDecimal.ZERO);
 				excel.setUnitPrice(BigDecimal.ZERO);
@@ -267,7 +267,7 @@ public class XmGoodsServiceImpl extends BaseServiceImpl<XmGoodsMapper, XmGoodsEn
 		excelWriter.fill(results, fillConfig, writeSheet);
 		excelWriter.fill(results, fillConfig, writeSheet);
 		Map<String, Object> map = new HashMap<>();
 		Map<String, Object> map = new HashMap<>();
 		map.put("amountSum", results.stream().map(XmGoodsExcel::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
 		map.put("amountSum", results.stream().map(XmGoodsExcel::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
-		map.put("useQuantitySum", results.stream().mapToInt(XmGoodsExcel::getUseQuantity).sum());
+		map.put("useQuantitySum", results.stream().mapToDouble(XmGoodsExcel::getUseQuantity).sum());
 
 
 		map.put("xmbh", Func.isNotEmpty(results) ? results.get(0).getXmbh() : "");
 		map.put("xmbh", Func.isNotEmpty(results) ? results.get(0).getXmbh() : "");
 		map.put("xmmc", Func.isNotEmpty(results) ? results.get(0).getXmmc() : "");
 		map.put("xmmc", Func.isNotEmpty(results) ? results.get(0).getXmmc() : "");

+ 2 - 2
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmLeaseServiceImpl.java

@@ -107,7 +107,7 @@ public class XmLeaseServiceImpl extends BaseServiceImpl<XmLeaseMapper, XmLeaseEn
 		//设置list集合数据
 		//设置list集合数据
 		excelWriter.fill(results, fillConfig, writeSheet);
 		excelWriter.fill(results, fillConfig, writeSheet);
 		Map<String, Object> map = new HashMap<>();
 		Map<String, Object> map = new HashMap<>();
-		map.put("quantitySum", results.stream().mapToInt(XmLeaseExcel::getQuantity).sum());
+		map.put("quantitySum", results.stream().mapToDouble(XmLeaseExcel::getQuantity).sum());
 		map.put("amountSum", results.stream().map(XmLeaseExcel::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
 		map.put("amountSum", results.stream().map(XmLeaseExcel::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
 
 
 		map.put("year", yearAndMonth.substring(0, 4));
 		map.put("year", yearAndMonth.substring(0, 4));
@@ -210,7 +210,7 @@ public class XmLeaseServiceImpl extends BaseServiceImpl<XmLeaseMapper, XmLeaseEn
 		//设置list集合数据
 		//设置list集合数据
 		excelWriter.fill(results, fillConfig, writeSheet);
 		excelWriter.fill(results, fillConfig, writeSheet);
 		Map<String, Object> map = new HashMap<>();
 		Map<String, Object> map = new HashMap<>();
-		map.put("quantitySum", results.stream().mapToInt(XmLeaseExcel::getQuantity).sum());
+		map.put("quantitySum", results.stream().mapToDouble(XmLeaseExcel::getQuantity).sum());
 		map.put("amountSum", results.stream().map(XmLeaseExcel::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
 		map.put("amountSum", results.stream().map(XmLeaseExcel::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
 
 
 		map.put("xmbh", Func.isNotEmpty(results) ? results.get(0).getXmbh() : "");
 		map.put("xmbh", Func.isNotEmpty(results) ? results.get(0).getXmbh() : "");

+ 7 - 5
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/YsRyrgfyServiceImpl.java

@@ -63,6 +63,7 @@ public class YsRyrgfyServiceImpl extends BaseServiceImpl<YsRyrgfyMapper, YsRyrgf
 			if (Func.notNull(vo.getTechnician())) {
 			if (Func.notNull(vo.getTechnician())) {
 				vo.getTechnician().setForeign(!"在职".equals(vo.getTechnician().getNature()));
 				vo.getTechnician().setForeign(!"在职".equals(vo.getTechnician().getNature()));
 			}
 			}
+			vo.setPjrgfy(vo.getPjrgfy() / 10000);
 		}
 		}
 		return page.setRecords(dataList);
 		return page.setRecords(dataList);
 	}
 	}
@@ -109,7 +110,7 @@ public class YsRyrgfyServiceImpl extends BaseServiceImpl<YsRyrgfyMapper, YsRyrgf
 //			List<Long> list = dbTechnicianList.stream()
 //			List<Long> list = dbTechnicianList.stream()
 //				.filter(technician -> Func.equals(technician.getNumber(), excel.getNumber()) || Func.equals(technician.getIdCard(), excel.getIdCard()))
 //				.filter(technician -> Func.equals(technician.getNumber(), excel.getNumber()) || Func.equals(technician.getIdCard(), excel.getIdCard()))
 //				.map(TechnicianEntity::getId).toList();
 //				.map(TechnicianEntity::getId).toList();
- 			if (technicianId == null) {
+			if (technicianId == null) {
 				throw new ServiceException("[" + excel.getName() + "]不存在");
 				throw new ServiceException("[" + excel.getName() + "]不存在");
 			}
 			}
 
 
@@ -144,11 +145,12 @@ public class YsRyrgfyServiceImpl extends BaseServiceImpl<YsRyrgfyMapper, YsRyrgf
 			TechnicianEntity technician = temp.getTechnician();
 			TechnicianEntity technician = temp.getTechnician();
 			JSONObject obj = new JSONObject();
 			JSONObject obj = new JSONObject();
 			obj.put("xh", index.getAndIncrement() + "");
 			obj.put("xh", index.getAndIncrement() + "");
-			obj.put("name", Func.notNull(technician)?technician.getName():"");
-			obj.put("number", Func.notNull(technician)?technician.getNumber():"");
-			obj.put("idCard", Func.notNull(technician)?technician.getIdCard():"");
+			obj.put("name", Func.notNull(technician) ? technician.getName() : "");
+			obj.put("number", Func.notNull(technician) ? technician.getNumber() : "");
+			obj.put("idCard", Func.notNull(technician) ? technician.getIdCard() : "");
 			obj.put("zzsc", temp.getZzsc());
 			obj.put("zzsc", temp.getZzsc());
-			obj.put("pjrgfy", temp.getPjrgfy() / 10000);
+			temp.setPjrgfy(temp.getPjrgfy() / 10000);
+			obj.put("pjrgfy", temp.getPjrgfy());
 			obj.put("total", BigDecimal.valueOf(temp.getZzsc() * temp.getPjrgfy()));
 			obj.put("total", BigDecimal.valueOf(temp.getZzsc() * temp.getPjrgfy()));
 			obj.put("foreignStr", Func.notNull(temp.getTechnician()) ? (temp.getTechnician().isForeign() ? "是" : "否") : "");
 			obj.put("foreignStr", Func.notNull(temp.getTechnician()) ? (temp.getTechnician().isForeign() ? "是" : "否") : "");
 			results.add(obj);
 			results.add(obj);

BIN
kd-service/kd-scientific/src/main/resources/export-template/研发项目管理/预算编制/人员人工费用.xls


BIN
kd-service/kd-scientific/src/main/resources/export-template/研发项目管理/预算编制/折旧费用与长期待摊费用.xls


BIN
kd-service/kd-scientific/src/main/resources/export-template/研发项目管理/预算编制/无形资产摊销费用.xls


BIN
kd-service/kd-scientific/src/main/resources/export-template/研发项目管理/预算编制/研发项目经费预算表.xls


+ 0 - 0
logPath_IS_UNDEFINED/nacos/naming.log