zhoulisky 4 months ago
parent
commit
7651f66caa
23 changed files with 133 additions and 99 deletions
  1. 9 9
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/vo/XmYszbVO.java
  2. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/XmGoodsExcel.java
  3. 6 5
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/AssetMapper.xml
  4. 10 10
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmDirectCostMapper.xml
  5. 1 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmMapper.xml
  6. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmTechnicianMapper.xml
  7. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/IXmService.java
  8. 0 3
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/HoursSyncServiceImpl.java
  9. 6 6
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/TechnicianServiceImpl.java
  10. 3 3
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmAssetHoursServiceImpl.java
  11. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmBgrzServiceImpl.java
  12. 7 5
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmCostDetailsServiceImpl.java
  13. 3 3
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmDesignCostServiceImpl.java
  14. 3 3
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmDirectCostServiceImpl.java
  15. 5 5
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmFixedAssetServiceImpl.java
  16. 4 4
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmGoodsServiceImpl.java
  17. 6 6
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmIntangibleAssetServiceImpl.java
  18. 9 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmLeaseServiceImpl.java
  19. 3 3
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmOtherCostServiceImpl.java
  20. 47 23
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmServiceImpl.java
  21. 4 4
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmTechnicianHoursServiceImpl.java
  22. 3 3
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmWwxmCostServiceImpl.java
  23. BIN
      kd-service/kd-scientific/src/main/resources/export-template/科技人员管理/参研人员花名册.xls

+ 9 - 9
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/vo/XmYszbVO.java

@@ -60,40 +60,40 @@ public class XmYszbVO implements Serializable {
 	private String xmyszemx;
 
 	@Schema(description = "人员人工费用")
-	private Double ryrgfy;
+	private BigDecimal ryrgfy;
 	@Schema(description = "人员人工费用占比")
 	private Double ryrgfyRate;
 	@Schema(description = "直接投入费用")
-	private Double zjtrfy;
+	private BigDecimal zjtrfy;
 	@Schema(description = "直接投入费用占比")
 	private Double zjtrfyRate;
 	@Schema(description = "折旧费用与长期待摊费用")
-	private Double zjfyycqdtfy;
+	private BigDecimal zjfyycqdtfy;
 	@Schema(description = "折旧费用与长期待摊费用占比")
 	private Double zjfyycqdtfyRate;
 	@Schema(description = "无形资产摊销费用")
-	private Double wxzctxfy;
+	private BigDecimal wxzctxfy;
 	@Schema(description = "无形资产摊销费用占比")
 	private Double wxzctxfyRate;
 	@Schema(description = "设计费用")
-	private Double sjfy;
+	private BigDecimal sjfy;
 	@Schema(description = "设计费用占比")
 	private Double sjfyRate;
 	@Schema(description = "装备调试费用与试验费用")
-	private Double zbtsysyfy;
+	private BigDecimal zbtsysyfy;
 	@Schema(description = "装备调试费用与试验费用占比")
 	private Double zbtsysyfyRate;
 	@Schema(description = "委托外部研究开发费")
-	private Double wtwbyjkffy;
+	private BigDecimal wtwbyjkffy;
 	@Schema(description = "委托外部研究开发费占比")
 	private Double wtwbyjkffyRate;
 	@Schema(description = "其他费用")
-	private Double qtfy;
+	private BigDecimal qtfy;
 	@Schema(description = "其他费用占比")
 	private Double qtfyRate;
 
 	@Schema(description = "合计")
-	private Double total;
+	private BigDecimal total;
 	@Schema(description = "合计占比")
 	private Double totalRate;
 }

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

@@ -44,7 +44,7 @@ public class XmGoodsExcel implements Serializable {
 	private String xmbh;
 
 	@ExcelProperty(index = 3, value ="研发项目名称")
-	@NotBlank(message = "研发项目名称不能为空")
+//	@NotBlank(message = "研发项目名称不能为空")
 	private String xmmc;
 
  	@ExcelProperty(index = 4, value ="类型")

+ 6 - 5
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/AssetMapper.xml

@@ -175,15 +175,16 @@
     <select id="costSummary" resultType="org.sky.scientific.pojo.vo.CostSummaryVO" parameterType="org.sky.scientific.pojo.dto.CostSummaryDTO">
         SELECT
             m.month AS yearAndMonth,
-            (select ROUND(IFNULL(sum(IFNULL(average_monthly_salary,0)) + sum(IFNULL(pension_insurance,0)) + sum(IFNULL(medical_insurance,0)) + sum(IFNULL(unemployment_insurance,0)) + sum(IFNULL(injury_insurance,0)) + sum(IFNULL(maternity_insurance,0)),0), 2) from kd_salary where tenant_id = #{tenantId} and year_and_month = m.month ) as ryrgfy,
-            (SELECT ROUND(IFNULL(sum(unit_price*quantity),0),2)
+            (select ROUND(sum(averageMonthlySalary)+sum(totalInsurance)
+                          +sum(providentFund)+sum(bonus)+sum(benefit)+sum(pensionInsuranceBc)+sum(medicalInsuranceBc), 2) from ryrgfyhz_view where tenant_id = #{tenantId} and year_and_month = m.month ) as ryrgfy,
+            (SELECT ROUND(IFNULL(sum(amount),0),2)
             from
             (
-                SELECT xm_id, unit_price, use_quantity as quantity ,year_and_month from kd_xm_goods where tenant_id = #{tenantId}
+                SELECT xm_id, amount ,year_and_month from kd_xm_goods where tenant_id = #{tenantId}
                 union all
-                SELECT xm_id, unit_price, quantity ,year_and_month from kd_xm_lease where tenant_id = #{tenantId}
+                SELECT xm_id, amount,year_and_month from kd_xm_lease where tenant_id = #{tenantId}
                 union all
-                select xm_id, amount as unit_price, 1 as quantity ,year_and_month from kd_xm_direct_cost where tenant_id = #{tenantId}
+                select xm_id, amount ,year_and_month from kd_xm_direct_cost where tenant_id = #{tenantId}
             )cost where cost.year_and_month = m.month) as zjtrfy,
             (ROUND((SELECT IFNULL(sum(yanfa_tan_xiao),0) FROM yiqishebeiassetcostview WHERE  tenant_id = #{tenantId} and year_and_month = m.month ) + (SELECT IFNULL(sum(yanfa_fen_tan),0) FROM fangwujianzhuwuAssetCostView WHERE  tenant_id = #{tenantId} and year_and_month = m.month ) + (SELECT IFNULL(sum(ytxe*syzb),0) FROM kd_xm_cqdtfy WHERE  tenant_id = #{tenantId} and year_and_month = m.month),2)) as zjfyycqdtfy,
             (SELECT ROUND(IFNULL(sum(amount),0),2) FROM kd_xm_design_cost WHERE tenant_id = #{tenantId} and cost_type='设计费用' and year_and_month = m.month) as sjfy,

+ 10 - 10
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmDirectCostMapper.xml

@@ -54,11 +54,11 @@
         COALESCE(get_xm_info(xm.id, 'XMMC', #{yearAndMonth}),XMMC) AS XMMC,
         xm.XMKSSJ,
         COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{yearAndMonth}),XMJSSJ) AS XMJSSJ,
-        (SELECT IFNULL(sum(unit_price*use_quantity),0) FROM kd_xm_goods g WHERE xm_id=xm.id and g.year_and_month=#{yearAndMonth} and g.type ='材料') as cailiaofy,
-        (SELECT IFNULL(sum(unit_price*use_quantity),0) FROM kd_xm_goods g WHERE xm_id=xm.id and g.year_and_month=#{yearAndMonth} and g.type ='燃料') as ranliaofy,
-        (SELECT IFNULL(sum(unit_price*use_quantity),0) FROM kd_xm_goods g WHERE xm_id=xm.id and g.year_and_month=#{yearAndMonth} and g.type ='动力') as donglify,
-        (SELECT IFNULL(sum(unit_price*quantity),0) FROM kd_xm_lease xl WHERE xm_id=xm.id and xl.year_and_month=#{yearAndMonth} and xl.type ='仪器设备') as yiqishebeify,
-        (SELECT IFNULL(sum(unit_price*quantity),0) FROM kd_xm_lease xl WHERE xm_id=xm.id and xl.year_and_month=#{yearAndMonth} and xl.type ='房屋建筑物') as fawuzulinfy,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_goods g WHERE xm_id=xm.id and g.year_and_month=#{yearAndMonth} and g.type ='材料') as cailiaofy,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_goods g WHERE xm_id=xm.id and g.year_and_month=#{yearAndMonth} and g.type ='燃料') as ranliaofy,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_goods g WHERE xm_id=xm.id and g.year_and_month=#{yearAndMonth} and g.type ='动力') as donglify,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_lease xl WHERE xm_id=xm.id and xl.year_and_month=#{yearAndMonth} and xl.type ='仪器设备') as yiqishebeify,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_lease xl WHERE xm_id=xm.id and xl.year_and_month=#{yearAndMonth} and xl.type ='房屋建筑物') as fawuzulinfy,
         (SELECT IFNULL(sum(amount),0) FROM kd_xm_direct_cost xdc WHERE xm_id=xm.id and xdc.year_and_month=#{yearAndMonth} and xdc.type ='1') as fy6,
         (SELECT IFNULL(sum(amount),0) FROM kd_xm_direct_cost xdc WHERE xm_id=xm.id and xdc.year_and_month=#{yearAndMonth} and xdc.type ='2') as fy7,
         (SELECT IFNULL(sum(amount),0) FROM kd_xm_direct_cost xdc WHERE xm_id=xm.id and xdc.year_and_month=#{yearAndMonth} and xdc.type ='3') as fy8
@@ -74,11 +74,11 @@
         COALESCE(get_xm_info(xm.id, 'XMMC', #{yearAndMonth}),XMMC) AS XMMC,
         xm.XMKSSJ,
         COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{yearAndMonth}),XMJSSJ) AS XMJSSJ,
-        (SELECT IFNULL(sum(unit_price*use_quantity),0) FROM kd_xm_goods g WHERE xm_id=xm.id and left(g.year_and_month,4)=#{yearAndMonth} and g.type ='材料') as cailiaofy,
-        (SELECT IFNULL(sum(unit_price*use_quantity),0) FROM kd_xm_goods g WHERE xm_id=xm.id and left(g.year_and_month,4)=#{yearAndMonth} and g.type ='燃料') as ranliaofy,
-        (SELECT IFNULL(sum(unit_price*use_quantity),0) FROM kd_xm_goods g WHERE xm_id=xm.id and left(g.year_and_month,4)=#{yearAndMonth} and g.type ='动力') as donglify,
-        (SELECT IFNULL(sum(unit_price*quantity),0) FROM kd_xm_lease xl WHERE xm_id=xm.id and left(xl.year_and_month,4)=#{yearAndMonth} and xl.type ='仪器设备') as yiqishebeify,
-        (SELECT IFNULL(sum(unit_price*quantity),0) FROM kd_xm_lease xl WHERE xm_id=xm.id and left(xl.year_and_month,4)=#{yearAndMonth} and xl.type ='房屋建筑物') as fawuzulinfy,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_goods g WHERE xm_id=xm.id and left(g.year_and_month,4)=#{yearAndMonth} and g.type ='材料') as cailiaofy,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_goods g WHERE xm_id=xm.id and left(g.year_and_month,4)=#{yearAndMonth} and g.type ='燃料') as ranliaofy,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_goods g WHERE xm_id=xm.id and left(g.year_and_month,4)=#{yearAndMonth} and g.type ='动力') as donglify,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_lease xl WHERE xm_id=xm.id and left(xl.year_and_month,4)=#{yearAndMonth} and xl.type ='仪器设备') as yiqishebeify,
+        (SELECT IFNULL(sum(amount),0) FROM kd_xm_lease xl WHERE xm_id=xm.id and left(xl.year_and_month,4)=#{yearAndMonth} and xl.type ='房屋建筑物') as fawuzulinfy,
         (SELECT IFNULL(sum(amount),0) FROM kd_xm_direct_cost xdc WHERE xm_id=xm.id and left(xdc.year_and_month,4)=#{yearAndMonth} and xdc.type ='1') as fy6,
         (SELECT IFNULL(sum(amount),0) FROM kd_xm_direct_cost xdc WHERE xm_id=xm.id and left(xdc.year_and_month,4)=#{yearAndMonth} and xdc.type ='2') as fy7,
         (SELECT IFNULL(sum(amount),0) FROM kd_xm_direct_cost xdc WHERE xm_id=xm.id and left(xdc.year_and_month,4)=#{yearAndMonth} and xdc.type ='3') as fy8

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

@@ -177,6 +177,7 @@
 
     <select id="getXmStatusByXmId" parameterType="java.lang.Long" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
+            xmbh,
             COALESCE(get_xm_info(id,'STATUS', null),STATUS) as status,
             COALESCE(get_xm_info(id,'XMJSSJ', null),XMJSSJ) as xmjssj
         FROM kd_xm where id = #{xmId}

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

@@ -267,7 +267,7 @@
             m.xm_id,xm.XMBH,xm.XMMC,
             m.unicode,t.name, t.number,t.id_card, t.personnel_type,t.year_and_month,
             (SELECT IFNULL(SUM(work_hours),0) FROM kd_attendance_records kar WHERE kar.unicode= m.unicode AND LEFT ( work_date, 4 ) = LEFT(m.year_and_month,4)) AS attendanceHours,
-            (SELECT IFNULL(SUM(work_hours),0) FROM kd_xm_technician_hours kxth WHERE kxth.xm_id = kxth.xm_id AND kxth.unicode = m.unicode AND LEFT ( work_date, 4 ) = LEFT(m.year_and_month,4)) AS workHours,
+            (SELECT IFNULL(SUM(work_hours),0) FROM kd_xm_technician_hours kxth WHERE kxth.xm_id = m.xm_id AND kxth.unicode = m.unicode AND LEFT ( work_date, 4 ) = LEFT(m.year_and_month,4)) AS workHours,
             (SELECT IFNULL( sum( s.average_monthly_salary ), 0 ) FROM kd_salary s WHERE s.unicode = m.unicode AND LEFT ( s.year_and_month, 4 ) = LEFT(m.year_and_month,4)) AS average_monthly_salary,
             (SELECT IFNULL( sum( s.pension_insurance ), 0 ) FROM kd_salary s WHERE s.unicode = m.unicode AND LEFT ( s.year_and_month, 4 ) = LEFT(m.year_and_month,4)) AS pension_insurance,
             (SELECT IFNULL( sum( s.medical_insurance ), 0 ) FROM kd_salary s WHERE s.unicode = m.unicode AND LEFT ( s.year_and_month, 4 ) = LEFT(m.year_and_month,4)) AS medical_insurance,

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

@@ -42,7 +42,7 @@ public interface IXmService extends BaseService<XmEntity> {
 	 * 判断项目是否已结题
 	 * @param xmId
 	 */
-	boolean judgeXmIsOver(Long xmId, boolean isThrowEx);
+	boolean judgeXmIsOver(Long xmId, String dateStr, boolean isThrowEx);
 
 	/**
 	 * 立项

+ 0 - 3
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/HoursSyncServiceImpl.java

@@ -233,9 +233,6 @@ public class HoursSyncServiceImpl implements IHoursSyncService {
 						if (xmId <= 0L) {
 							continue;
 						}
-//						if (xmService.judgeXmIsOver(xmId, false)) {
-//							continue;
-//						}
 
 						String identifier = SecureUtil.getTenantId() + ":" + xmId + ":" + unicode + ":" + recordTime;
 

+ 6 - 6
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/TechnicianServiceImpl.java

@@ -406,7 +406,7 @@ public class TechnicianServiceImpl extends BaseServiceImpl<TechnicianMapper, Tec
 
 	@Override
 	public boolean submitXmTechnicianMonthly(XmTechnicianEntity entity) {
-		xmService.judgeXmIsOver(entity.getXmId(), true);
+		xmService.judgeXmIsOver(entity.getXmId(), entity.getYearAndMonth(), true);
 
  		entity.setId(null);
 		entity.setYearAndMonth(entity.getYearAndMonth());
@@ -434,7 +434,7 @@ public class TechnicianServiceImpl extends BaseServiceImpl<TechnicianMapper, Tec
 			throw new ServiceException("数据不存在");
 		}
 
-		xmService.judgeXmIsOver(dbXmTechnician.getXmId(), true);
+		xmService.judgeXmIsOver(dbXmTechnician.getXmId(), null,true);
 
 		//每月研发人员工资
 		if (salaryMapper.selectCount(Wrappers.<SalaryEntity>lambdaQuery().eq(SalaryEntity::getYearAndMonth, dbXmTechnician.getYearAndMonth()).eq(SalaryEntity::getUnicode, dbXmTechnician.getUnicode())) > 0) {
@@ -688,12 +688,12 @@ public class TechnicianServiceImpl extends BaseServiceImpl<TechnicianMapper, Tec
 
 			List<BigDecimal> hours1 = new ArrayList<>(temp.getHoursList().stream().map(x -> BigDecimal.valueOf(x.getWorkHours())).toList());
 			Map<String, Object> map = BeanUtil.beanToMap(temp);
-			for (int k = 0; k < 12; k++) {
-				String month = k < 10 ? "0" + (k + 1) : (k + 1) + "";
+			for (int k = 1; k <= 12; k++) {
+				String month = String.valueOf(k < 10 ? "0" + k : k);
 				if (temp.getHoursList().stream().noneMatch(a -> Func.equals(a.getWorkDate(), year + month))) {
 					hours1.add(k, new BigDecimal(0));
 				}
-				map.put("month" + (k + 1), hours1.get(k));
+				map.put("month" + month, hours1.get(k-1));
 			}
 			map.put("hoursByMonth", hours1.stream().reduce(BigDecimal.ZERO, BigDecimal::add));
 			resultList.add(map);
@@ -845,7 +845,7 @@ public class TechnicianServiceImpl extends BaseServiceImpl<TechnicianMapper, Tec
 			if (Func.isNull(xmId)) {
 				throw new ServiceException("项目不存在,请检查数据");
 			}
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 
 			LambdaQueryWrapper<XmTechnicianEntity> wrapper = Wrappers.<XmTechnicianEntity>lambdaQuery().
 				eq(XmTechnicianEntity::getYearAndMonth, yearAndMonth).

+ 3 - 3
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmAssetHoursServiceImpl.java

@@ -90,7 +90,7 @@ public class XmAssetHoursServiceImpl extends BaseServiceImpl<XmAssetHoursMapper,
 			if (xmId == null) {
 				throw new ServiceException("序号为[" + record.getSerialNumber() + "]的研发项目不存在");
 			}
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 
 			if (StringUtil.isBlank(record.getZcbm())) {
 				throw new ServiceException("序号为[" + record.getSerialNumber() + "]的资产编码为空");
@@ -209,7 +209,7 @@ public class XmAssetHoursServiceImpl extends BaseServiceImpl<XmAssetHoursMapper,
 		if (dto.getXmId() == null) {
 			throw new ServiceException("参数xmId不能为空");
 		}
-		xmService.judgeXmIsOver(dto.getXmId(), true);
+		xmService.judgeXmIsOver(dto.getXmId(), null,true);
 		if (dto.getAssetId() == null) {
 			throw new ServiceException("参数assetId不能为空");
 		}
@@ -286,7 +286,7 @@ public class XmAssetHoursServiceImpl extends BaseServiceImpl<XmAssetHoursMapper,
 		for (int i = 0; i < xmAndAssetIdList.size(); i++) {
 			JSONObject object = xmAndAssetIdList.getJSONObject(i);
 			Long xmId = object.getLong("xmId");
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 			Long assetId = object.getLong("assetId");
 			String yearAndMonth = dto.getString("yearAndMonth");
 			baseMapper.clearXmAssetHours(yearAndMonth, xmId, assetId);

+ 1 - 1
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmBgrzServiceImpl.java

@@ -61,7 +61,7 @@ public class XmBgrzServiceImpl extends BaseServiceImpl<XmBgrzMapper, XmBgrzEntit
 		if (xmBgrz.getXmId() == null) {
 			throw new ServiceException("请选择需要变更的项目");
 		}
-		xmService.judgeXmIsOver(xmBgrz.getXmId(), true);
+		xmService.judgeXmIsOver(xmBgrz.getXmId(), null,true);
 		xmBgrz.setBghdz(StringUtil.trimAllWhitespace(xmBgrz.getBghdz()));
 		return this.save(xmBgrz);
 	}

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

@@ -92,7 +92,7 @@ public class XmCostDetailsServiceImpl extends BaseServiceImpl<XmCostDetailsMappe
 		if (Func.isNull(xmCostDetails.getXmId())) {
 			throw new ServiceException("参数xmId不能为空");
 		}
-		xmService.judgeXmIsOver(xmCostDetails.getXmId(), true);
+		xmService.judgeXmIsOver(xmCostDetails.getXmId(), null,true);
 
 		if (Func.isEmpty(xmCostDetails.getId())) {
 			//新增
@@ -110,7 +110,7 @@ public class XmCostDetailsServiceImpl extends BaseServiceImpl<XmCostDetailsMappe
 		for (Long id : ids) {
 			XmCostDetailsEntity entity = baseMapper.selectById(id);
 			if (Func.notNull(entity)) {
-				xmService.judgeXmIsOver(entity.getXmId(), true);
+				xmService.judgeXmIsOver(entity.getXmId(), null,true);
 			}
 		}
 		return baseMapper.physicalDeleteByIds(ids) > 0;
@@ -151,7 +151,7 @@ public class XmCostDetailsServiceImpl extends BaseServiceImpl<XmCostDetailsMappe
 			if (xmId == null) {
 				throw new ServiceException("研发项目编号[" + excel.getXmbh() + "]不存在,请检查模板数据");
 			}
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 
 			entity.setXmId(xmId);
 
@@ -891,8 +891,8 @@ public class XmCostDetailsServiceImpl extends BaseServiceImpl<XmCostDetailsMappe
 			fyhSummary.setTotal(fyhSummary.getRyrgTotal().add(fyhSummary.getZjtrTotal()).add(fyhSummary.getZjfyTotal()).add(fyhSummary.getWxzctxTotal()).add(fyhSummary.getXcpsjfd()));
 			zbhSummary.setTotal(zbhSummary.getRyrgTotal().add(zbhSummary.getZjtrTotal()).add(zbhSummary.getZjfyTotal()).add(zbhSummary.getWxzctxTotal()).add(zbhSummary.getXcpsjfd()));
 
-			zbhSummary.setWtjnfyAdjust(zbhSummary.getWtjnfyAdjust().multiply(new BigDecimal("0.8")));
-			fyhSummary.setWtjnfyAdjust(fyhSummary.getWtjnfyAdjust().multiply(new BigDecimal("0.8")));
+			zbhSummary.setWtjnfyAdjust(zbhSummary.getWtjnfy().multiply(new BigDecimal("0.8")));
+			fyhSummary.setWtjnfyAdjust(fyhSummary.getWtjnfy().multiply(new BigDecimal("0.8")));
 
 
 			//资本化金额小计----------------begin
@@ -948,8 +948,10 @@ public class XmCostDetailsServiceImpl extends BaseServiceImpl<XmCostDetailsMappe
 
 			//资本化金额小计-委托境内机构或个人进行研发活动所发生的费用
 			summary.setWtjnjgfy_zbh(summary.getWtjnjgfy_zbh().add(zbhSummary.getWtjnfy()));
+			summary.setYxwtjnjgfy_zbh(summary.getWtjnjgfy_zbh().multiply(BigDecimal.valueOf(0.8)));
 			//费用化金额小计-委托境内机构或个人进行研发活动所发生的费用
 			summary.setWtjnjgfy_fyh(summary.getWtjnjgfy_fyh().add(fyhSummary.getWtjnfy()));
+			summary.setYxwtjnjgfy_fyh(summary.getWtjnjgfy_fyh().multiply(BigDecimal.valueOf(0.8)));
 			//金额合计-委托境内机构或个人进行研发活动所发生的费用
 			summary.setWtjnjgfy_hjje(summary.getWtjnjgfy_hjje().add(summary.getWtjnjgfy_zbh()).add(summary.getWtjnjgfy_fyh()));
 

+ 3 - 3
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmDesignCostServiceImpl.java

@@ -90,7 +90,7 @@ public class XmDesignCostServiceImpl extends BaseServiceImpl<XmDesignCostMapper,
 				throw new ServiceException("序号[" + data.getXh() + "]的研发项目不存在,请检查模板数据");
 			}
 
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 
 			XmDesignCostEntity entity = Objects.requireNonNull(BeanUtil.copyProperties(data, XmDesignCostEntity.class));
 			entity.setXmId(xmId);
@@ -108,7 +108,7 @@ public class XmDesignCostServiceImpl extends BaseServiceImpl<XmDesignCostMapper,
 		for (Long id : ids) {
 			XmDesignCostEntity entity = baseMapper.selectById(id);
 			if(Func.notNull(entity)){
-				xmService.judgeXmIsOver(entity.getXmId(), true);
+				xmService.judgeXmIsOver(entity.getXmId(), null,true);
 			}
 		}
 		return baseMapper.physicalDeleteByIds(ids) > 0;
@@ -149,7 +149,7 @@ public class XmDesignCostServiceImpl extends BaseServiceImpl<XmDesignCostMapper,
 		if (judged != null) {
 			throw new ServiceException(judged);
 		}
-		xmService.judgeXmIsOver(xmDesignCost.getXmId(), true);
+		xmService.judgeXmIsOver(xmDesignCost.getXmId(), null,true);
 		return this.saveOrUpdate(xmDesignCost);
 	}
 

+ 3 - 3
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmDirectCostServiceImpl.java

@@ -107,7 +107,7 @@ public class XmDirectCostServiceImpl extends BaseServiceImpl<XmDirectCostMapper,
 				if (xmId == null) {
 					throw new ServiceException("研发项目[" + excel.getXmbh() + "]不存在,请检查模板数据");
 				}
-				xmService.judgeXmIsOver(xmId, true);
+				xmService.judgeXmIsOver(xmId, null,true);
 				entity.setXmId(xmId);
 			}
 
@@ -128,7 +128,7 @@ public class XmDirectCostServiceImpl extends BaseServiceImpl<XmDirectCostMapper,
 		for (Long id : ids) {
 			XmDirectCostEntity entity = baseMapper.selectById(id);
 			if(Func.notNull(entity)){
-				xmService.judgeXmIsOver(entity.getXmId(), true);
+				xmService.judgeXmIsOver(entity.getXmId(), null,true);
 			}
 		}
 		return baseMapper.physicalDeleteByIds(ids) > 0;
@@ -139,7 +139,7 @@ public class XmDirectCostServiceImpl extends BaseServiceImpl<XmDirectCostMapper,
 		if (StringUtil.isBlank(xmDirectCost.getYearAndMonth())) {
 			throw new ServiceException("参数yearAndMonth不能为空");
 		}
-		xmService.judgeXmIsOver(xmDirectCost.getXmId(), true);
+		xmService.judgeXmIsOver(xmDirectCost.getXmId(), null,true);
 		String judged = DateUtil.judgeDate(xmDirectCost.getUseDate(), xmDirectCost.getYearAndMonth());
 		if (judged != null) {
 			throw new ServiceException(judged);

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

@@ -102,7 +102,7 @@ public class XmFixedAssetServiceImpl extends BaseServiceImpl<XmFixedAssetMapper,
 				if (jtXmIdList.contains(dbAsset.getXmId())) {
 					continue;
 				}
-				if (xmService.judgeXmIsOver(dbAsset.getXmId(), false)) {
+				if (xmService.judgeXmIsOver(dbAsset.getXmId(), null,false)) {
 					jtXmIdList.add(dbAsset.getXmId());
 					continue;
 				}
@@ -139,7 +139,7 @@ public class XmFixedAssetServiceImpl extends BaseServiceImpl<XmFixedAssetMapper,
 				if (jtXmIdList.contains(ys.getXmId())) {
 					continue;
 				}
-				if (xmService.judgeXmIsOver(ys.getXmId(), false)) {
+				if (xmService.judgeXmIsOver(ys.getXmId(), null,false)) {
 					jtXmIdList.add(ys.getXmId());
 					continue;
 				}
@@ -201,7 +201,7 @@ public class XmFixedAssetServiceImpl extends BaseServiceImpl<XmFixedAssetMapper,
 					throw new ServiceException("序号为[" + excel.getXh() + "]的项目不存在");
 				}
 
-				xmService.judgeXmIsOver(xmId, true);
+				xmService.judgeXmIsOver(xmId, null,true);
 			}
 
 			xmIdMap.put(xmkey, xmId);
@@ -253,7 +253,7 @@ public class XmFixedAssetServiceImpl extends BaseServiceImpl<XmFixedAssetMapper,
 	public boolean physicalDeleteByIds(List<Long> ids) {
 		for (Long id : ids) {
 			XmFixedAsset fixedAsset = baseMapper.selectById(id);
-			xmService.judgeXmIsOver(fixedAsset.getXmId(), true);
+			xmService.judgeXmIsOver(fixedAsset.getXmId(), null, true);
 		}
 		return baseMapper.physicalDeleteByIds(ids);
 	}
@@ -264,7 +264,7 @@ public class XmFixedAssetServiceImpl extends BaseServiceImpl<XmFixedAssetMapper,
 			throw new ServiceException("参数yearAndMonth不能为空");
 		}
 
-		xmService.judgeXmIsOver(xmAsset.getXmId(), true);
+		xmService.judgeXmIsOver(xmAsset.getXmId(), null,true);
 		//获取本月数据
 		List<XmFixedAsset> thisMonthList = baseMapper.selectXmFixedAssetByYearAndMonth(xmAsset.getYearAndMonth(), xmAsset.getType());
 

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

@@ -125,7 +125,7 @@ public class XmGoodsServiceImpl extends BaseServiceImpl<XmGoodsMapper, XmGoodsEn
 				if (xmId == null) {
 					throw new ServiceException("研发项目[" + excel.getXmbh() + "]不存在,请检查模板数据");
 				}
-				xmService.judgeXmIsOver(xmId, true);
+				xmService.judgeXmIsOver(xmId, null,true);
 				entity.setXmId(xmId);
 			}
 			entity.setYearAndMonth(yearAndMonth);
@@ -140,7 +140,7 @@ public class XmGoodsServiceImpl extends BaseServiceImpl<XmGoodsMapper, XmGoodsEn
 		for (Long id : ids) {
 			XmGoodsEntity entity = baseMapper.selectById(id);
 			if (Func.notNull(entity)) {
-				xmService.judgeXmIsOver(entity.getXmId(), true);
+				xmService.judgeXmIsOver(entity.getXmId(), null,true);
 			}
 		}
 		return baseMapper.physicalDeleteByIds(ids) > 0;
@@ -152,10 +152,10 @@ public class XmGoodsServiceImpl extends BaseServiceImpl<XmGoodsMapper, XmGoodsEn
 			throw new ServiceException("参数yearAndMonth不能为空");
 		}
 
-		xmService.judgeXmIsOver(xmGoods.getXmId(), true);
+		xmService.judgeXmIsOver(xmGoods.getXmId(), null,true);
 
 		if (Func.notNull(xmGoods.getUseQuantity()) && Func.notNull(xmGoods.getUnitPrice())) {
-			xmGoods.setAmount(xmGoods.getUnitPrice().multiply(new BigDecimal(xmGoods.getUseQuantity())));
+			xmGoods.setAmount(xmGoods.getUnitPrice().multiply(BigDecimal.valueOf(xmGoods.getUseQuantity())));
 		}
 
 		//判断日期是否为当月日期

+ 6 - 6
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmIntangibleAssetServiceImpl.java

@@ -105,7 +105,7 @@ public class XmIntangibleAssetServiceImpl extends BaseServiceImpl<XmIntangibleAs
 				if (jtXmIdList.contains(dbAsset.getXmId())) {
 					continue;
 				}
-				if (xmService.judgeXmIsOver(dbAsset.getXmId(), false)) {
+				if (xmService.judgeXmIsOver(dbAsset.getXmId(), null, false)) {
 					jtXmIdList.add(dbAsset.getXmId());
 					continue;
 				}
@@ -132,7 +132,7 @@ public class XmIntangibleAssetServiceImpl extends BaseServiceImpl<XmIntangibleAs
 				if (jtXmIdList.contains(ys.getXmId())) {
 					continue;
 				}
-				if (xmService.judgeXmIsOver(ys.getXmId(), false)) {
+				if (xmService.judgeXmIsOver(ys.getXmId(), null,false)) {
 					jtXmIdList.add(ys.getXmId());
 					continue;
 				}
@@ -182,7 +182,7 @@ public class XmIntangibleAssetServiceImpl extends BaseServiceImpl<XmIntangibleAs
 				if (xmId == null) {
 					throw new ServiceException("序号为[" + excel.getXh() + "]的项目不存在");
 				}
-				xmService.judgeXmIsOver(xmId, true);
+				xmService.judgeXmIsOver(xmId, null,true);
 			}
 			xmIdMap.put(xmkey, xmId);
 
@@ -228,7 +228,7 @@ public class XmIntangibleAssetServiceImpl extends BaseServiceImpl<XmIntangibleAs
 	public boolean physicalDeleteByIds(List<Long> ids) {
 		for (Long id : ids) {
 			XmIntangibleAsset intangibleAsset = baseMapper.selectById(id);
-			xmService.judgeXmIsOver(intangibleAsset.getXmId(), true);
+			xmService.judgeXmIsOver(intangibleAsset.getXmId(), null,true);
 		}
 		return baseMapper.physicalDeleteByIds(ids);
 	}
@@ -238,7 +238,7 @@ public class XmIntangibleAssetServiceImpl extends BaseServiceImpl<XmIntangibleAs
 		if (StringUtil.isBlank(xmAsset.getYearAndMonth())) {
 			throw new ServiceException("参数yearAndMonth不能为空");
 		}
-		xmService.judgeXmIsOver(xmAsset.getXmId(), true);
+		xmService.judgeXmIsOver(xmAsset.getXmId(), null,true);
 
 		//获取本月数据
 		List<XmIntangibleAsset> thisMonthList = baseMapper.selectListByYearAndMonth(xmAsset.getYearAndMonth());
@@ -256,7 +256,7 @@ public class XmIntangibleAssetServiceImpl extends BaseServiceImpl<XmIntangibleAs
 		if (null == xmAsset.getId()) {
 			throw new ServiceException("参数id不能为空");
 		}
-		xmService.judgeXmIsOver(xmAsset.getId(), true);
+		xmService.judgeXmIsOver(xmAsset.getId(), null,true);
 		return this.updateById(xmAsset);
 	}
 

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

@@ -77,6 +77,15 @@ public class XmLeaseServiceImpl extends BaseServiceImpl<XmLeaseMapper, XmLeaseEn
 				entity.setXmId(xmId);
 			}
 
+			if(BigDecimal.ZERO.compareTo(entity.getUnitPrice()) == 0){
+				entity.setUnitPrice(BigDecimal.ZERO);
+			}
+			if(entity.getQuantity()==null){
+				entity.setQuantity(0.0);
+			}
+
+			entity.setAmount(entity.getUnitPrice().multiply(BigDecimal.valueOf(entity.getQuantity())));
+
 			entity.setYearAndMonth(yearAndMonth);
 			insertList.add(entity);
 		}

+ 3 - 3
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmOtherCostServiceImpl.java

@@ -104,7 +104,7 @@ public class XmOtherCostServiceImpl extends BaseServiceImpl<XmOtherCostMapper, X
 				throw new ServiceException("序号[" + data.getXh() + "]的研发项目不存在,请检查模板数据");
 			}
 
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 
 			entity.setXmId(xmId);
 			entity.setYearAndMonth(yearAndMonth);
@@ -123,7 +123,7 @@ public class XmOtherCostServiceImpl extends BaseServiceImpl<XmOtherCostMapper, X
 		if (Func.isNull(entity.getXmId())) {
 			throw new ServiceException("参数xmId不能为空");
 		}
-		xmService.judgeXmIsOver(entity.getXmId(), true);
+		xmService.judgeXmIsOver(entity.getXmId(), null,true);
 
 		String judged = DateUtil.judgeDate(entity.getRecordDate(), entity.getYearAndMonth());
 		if (judged != null) {
@@ -138,7 +138,7 @@ public class XmOtherCostServiceImpl extends BaseServiceImpl<XmOtherCostMapper, X
 		for (Long id : ids) {
 			XmOtherCostEntity entity = baseMapper.selectById(id);
 			if (Func.notNull(entity)) {
-				xmService.judgeXmIsOver(entity.getXmId(), true);
+				xmService.judgeXmIsOver(entity.getXmId(), null,true);
 			}
 		}
 		return baseMapper.physicalDeleteByIds(ids);

+ 47 - 23
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmServiceImpl.java

@@ -86,17 +86,29 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 	 *
 	 * @param xmId
 	 */
-	public boolean judgeXmIsOver(Long xmId, boolean isThrowEx) {
+	public boolean judgeXmIsOver(Long xmId, String dateStr, boolean isThrowEx) {
 		JSONObject byXmId = baseMapper.getXmStatusByXmId(xmId);
 		if (Func.isNull(byXmId)) {
 			return false;
 		}
+		Date selDate = null;
+		if (dateStr == null) {
+			selDate = new Date();
+		} else {
+			//年月日
+			if (dateStr.length() == 8) {
+				selDate = DateUtil.parse(dateStr, DateUtil.PATTERN_YYYYMMDD);
+			} else if (dateStr.length() == 6) {
+
+//				selDate = DateUtil.parse(DateUtil.PATTERN_YYYYMM);
+			}
+		}
 		Integer status = byXmId.getInteger("status");
-//		Date xmjssj = byXmId.getDate("xmjssj");
-//		if (Func.equals(status, XmStatusEnum.已结题.getCode()) || xmjssj.compareTo(new Date()) < 0) {
-		if (Func.equals(status, XmStatusEnum.已结题.getCode())) {
+		Date xmjssj = byXmId.getDate("xmjssj");
+		if (Func.equals(status, XmStatusEnum.已结题.getCode()) || xmjssj.compareTo(selDate) < 0) {
 			if (isThrowEx) {
-				throw new ServiceException("项目已结题,不可操作");
+				String xmbh = byXmId.getString("xmbh");
+				throw new ServiceException("项目【" + xmbh + "】已结题/已结束,不可操作");
 			} else {
 				return true;
 			}
@@ -106,14 +118,14 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 
 	private void judgeXmmcAndXmbhUnique(XmDTO xm) {
 		//检查项目名称是否重复(xm);
-		if(Func.isNotBlank(xm.getXmmc())){
+		if (Func.isNotBlank(xm.getXmmc())) {
 			Long xmIdByXmmc = baseMapper.getXmIdByXmmcOrXmbh(null, xm.getXmmc(), null);
 			if (xmIdByXmmc != null && !xmIdByXmmc.equals(xm.getId())) {
 				throw new ServiceException("研发项目名称已存在");
 			}
 		}
 
-		if(Func.isNotBlank(xm.getXmbh())){
+		if (Func.isNotBlank(xm.getXmbh())) {
 			Long xmIdByXmbh = baseMapper.getXmIdByXmmcOrXmbh(null, null, xm.getXmbh());
 			if (xmIdByXmbh != null && !xmIdByXmbh.equals(xm.getId())) {
 				throw new ServiceException("研发项目编号已存在");
@@ -128,15 +140,15 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 		//判断项目名称和编号是否已存在
 		judgeXmmcAndXmbhUnique(xm);
 		if (Func.equals(xm.getStatus(), XmStatusEnum.暂存.getCode())) {
-			if(Func.isBlank(xm.getXmbh())){
+			if (Func.isBlank(xm.getXmbh())) {
 				throw new ServiceException("请填写项目编号");
 			}
-		}else {
+		} else {
 			List<String> validate = ValidationUtils.validate(xm);
 			if (Func.isNotEmpty(validate)) {
 				throw new ServiceException(String.join("\n", validate));
 			}
-			judgeXmIsOver(xm.getId(), true);
+			judgeXmIsOver(xm.getId(), null, true);
 			if (xm.getXmyszemx() != null) {
 				List<JSONObject> list = JSONObject.parseArray(xm.getXmyszemx(), JSONObject.class);
 				BigDecimal total = list.stream().map(item -> item.getBigDecimal("amount")).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.UP);
@@ -162,15 +174,15 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 		xm.setStatus(baseMapper.getXmStatusByXmId(xmId).getInteger("status"));
 		if (xm.getXmfzr() != null) {
 			xm.setXmfzrxm(Func.toStr(technicianMapper.getNameById(xm.getXmfzr()), ""));
-		}else{
+		} else {
 			xm.setXmfzrxm("");
 		}
 		if (xm.getXmsqdwid() != null) {
 			xm.setXmsqdw(Func.toStr(departmentMapper.getFullNameById(xm.getXmsqdwid()), ""));
-		}else {
+		} else {
 			xm.setXmsqdw("");
 		}
-  		return cn.hutool.core.bean.BeanUtil.copyProperties(xm, XmVO.class);
+		return cn.hutool.core.bean.BeanUtil.copyProperties(xm, XmVO.class);
 	}
 
 	@SneakyThrows
@@ -318,8 +330,9 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 			throw new ServiceException("请选择研发项目");
 		}
 		XmYszbVO vo = baseMapper.selectYszb(xmId);
-		vo.setTotal(vo.getRyrgfy() + vo.getZjtrfy() + vo.getZjfyycqdtfy() + vo.getWxzctxfy() + vo.getSjfy() + vo.getZbtsysyfy() + vo.getWtwbyjkffy() + vo.getQtfy());
-		if (vo.getTotal() == 0) {
+
+		vo.setTotal(vo.getRyrgfy().add(vo.getZjtrfy()).add(vo.getZjfyycqdtfy()).add(vo.getWxzctxfy()).add(vo.getSjfy()).add(vo.getZbtsysyfy()).add(vo.getWtwbyjkffy()).add(vo.getQtfy()));
+		if (BigDecimal.ZERO.compareTo(vo.getTotal()) <= 0) {
 			vo.setRyrgfyRate(0.00);
 			vo.setZjtrfyRate(0.00);
 			vo.setZjfyycqdtfyRate(0.00);
@@ -329,14 +342,14 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 			vo.setWtwbyjkffyRate(0.00);
 			vo.setQtfyRate(0.00);
 		} else {
-			vo.setRyrgfyRate(BigDecimal.valueOf(vo.getRyrgfy() / vo.getTotal()).setScale(4, RoundingMode.HALF_UP).doubleValue());
-			vo.setZjtrfyRate(BigDecimal.valueOf(vo.getZjtrfy() / vo.getTotal()).setScale(4, RoundingMode.HALF_UP).doubleValue());
-			vo.setZjfyycqdtfyRate(BigDecimal.valueOf(vo.getZjfyycqdtfy() / vo.getTotal()).setScale(4, RoundingMode.HALF_UP).doubleValue());
-			vo.setWxzctxfyRate(BigDecimal.valueOf(vo.getWxzctxfy() / vo.getTotal()).setScale(4, RoundingMode.HALF_UP).doubleValue());
-			vo.setSjfyRate(BigDecimal.valueOf(vo.getSjfy() / vo.getTotal()).setScale(4, RoundingMode.HALF_UP).doubleValue());
-			vo.setZbtsysyfyRate(BigDecimal.valueOf(vo.getZbtsysyfy() / vo.getTotal()).setScale(2, RoundingMode.HALF_UP).doubleValue());
-			vo.setWtwbyjkffyRate(BigDecimal.valueOf(vo.getWtwbyjkffy() / vo.getTotal()).setScale(2, RoundingMode.HALF_UP).doubleValue());
-			vo.setQtfyRate(BigDecimal.valueOf(vo.getQtfy() / vo.getTotal()).setScale(2, RoundingMode.HALF_UP).doubleValue());
+			vo.setRyrgfyRate(vo.getRyrgfy().divide(vo.getTotal(),4, RoundingMode.HALF_UP).doubleValue());
+			vo.setZjtrfyRate(vo.getZjtrfy().divide(vo.getTotal(),4, RoundingMode.HALF_UP).doubleValue());
+			vo.setZjfyycqdtfyRate(vo.getZjfyycqdtfy().divide(vo.getTotal(),4, RoundingMode.HALF_UP).doubleValue());
+			vo.setWxzctxfyRate(vo.getWxzctxfy().divide(vo.getTotal(),4, RoundingMode.HALF_UP).doubleValue());
+			vo.setSjfyRate(vo.getSjfy().divide(vo.getTotal(),4, RoundingMode.HALF_UP).doubleValue());
+			vo.setZbtsysyfyRate(vo.getZbtsysyfy().divide(vo.getTotal(),2, RoundingMode.HALF_UP).doubleValue());
+			vo.setWtwbyjkffyRate(vo.getWtwbyjkffy().divide(vo.getTotal(),2, RoundingMode.HALF_UP).doubleValue());
+			vo.setQtfyRate(vo.getQtfy().divide(vo.getTotal(),2, RoundingMode.HALF_UP).doubleValue());
 		}
 
 		vo.setTotalRate(1.00);
@@ -348,6 +361,17 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 	@Override
 	public void exportYszb(OutputStream os, Long xmId) {
 		XmYszbVO vo = this.selectYszb(xmId);
+
+		vo.setRyrgfy(vo.getRyrgfy().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+		vo.setZjtrfy(vo.getZjtrfy().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+		vo.setZjfyycqdtfy(vo.getZjfyycqdtfy().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+		vo.setWxzctxfy(vo.getWxzctxfy().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+		vo.setSjfy(vo.getSjfy().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+		vo.setZbtsysyfy(vo.getZbtsysyfy().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+		vo.setWtwbyjkffy(vo.getWtwbyjkffy().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+		vo.setQtfy(vo.getQtfy().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+		vo.setTotal(vo.getTotal().divide(BigDecimal.valueOf(10000L), 4, RoundingMode.UP));
+
 		vo.setXmkssjStr(Func.notNull(vo.getXmkssj()) ? DateUtil.format(vo.getXmkssj(), "yyyy年MM月dd日") : null);
 		vo.setXmjssjStr(Func.notNull(vo.getXmjssj()) ? DateUtil.format(vo.getXmjssj(), "yyyy年MM月dd日") : null);
 

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

@@ -235,7 +235,7 @@ public class XmTechnicianHoursServiceImpl extends BaseServiceImpl<XmTechnicianHo
 			throw new ServiceException("参数unicode不能为空");
 		}
 
-		xmService.judgeXmIsOver(dto.getXmId(), true);
+		xmService.judgeXmIsOver(dto.getXmId(), null,true);
 
 		//获取考勤数据,具体人员在某个月的考勤明细
 		List<DailyAttendance> dailyAttendanceList = attendanceMapper.selectDailyAttendanceByUnicodeAndMonth(dto.getUnicode(), dto.getYearAndMonth());
@@ -315,7 +315,7 @@ public class XmTechnicianHoursServiceImpl extends BaseServiceImpl<XmTechnicianHo
 		for (int i = 0; i < xmAndUnicodeList.size(); i++) {
 			JSONObject object = xmAndUnicodeList.getJSONObject(i);
 			Long xmId = object.getLong("xmId");
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 			String unicode = object.getString("unicode");
 			String yearAndMonth = dto.getString("yearAndMonth");
 			baseMapper.clearByXmUnicodeMonth(yearAndMonth, xmId, unicode);
@@ -332,7 +332,7 @@ public class XmTechnicianHoursServiceImpl extends BaseServiceImpl<XmTechnicianHo
 		for (int i = 0; i < xmAndUnicodeList.size(); i++) {
 			JSONObject object = xmAndUnicodeList.getJSONObject(i);
 			Long xmId = object.getLong("xmId");
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 			String unicode = object.getString("unicode");
 			String yearAndMonth = dto.getString("yearAndMonth");
 			baseMapper.deleteByXmUnicodeMonth(yearAndMonth, xmId, unicode);
@@ -578,7 +578,7 @@ public class XmTechnicianHoursServiceImpl extends BaseServiceImpl<XmTechnicianHo
 		//过滤掉已结题项目
 		List<Long> jtXmIdList = new ArrayList<>();
 		for (XmTechnicianEntity entity : list) {
-			if (xmService.judgeXmIsOver(entity.getXmId(), false)) {
+			if (xmService.judgeXmIsOver(entity.getXmId(), null,false)) {
 				jtXmIdList.add(entity.getXmId());
 			}
 		}

+ 3 - 3
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmWwxmCostServiceImpl.java

@@ -63,7 +63,7 @@ public class XmWwxmCostServiceImpl extends BaseServiceImpl<XmWwxmCostMapper, XmW
 		}
 		XmWwxmEntity wwxm = wwxmMapper.selectById(cost.getWwId());
 		if (Func.notNull(wwxm)) {
-			xmService.judgeXmIsOver(wwxm.getXmId(), true);
+			xmService.judgeXmIsOver(wwxm.getXmId(), null,true);
 		}
 		boolean result = false;
 		if (Func.isNull(cost.getId())) {
@@ -95,7 +95,7 @@ public class XmWwxmCostServiceImpl extends BaseServiceImpl<XmWwxmCostMapper, XmW
 			if (xmId == null) {
 				throw new ServiceException("序号为[" + data.getSerialNumber() + "]的项目不存在");
 			}
-			xmService.judgeXmIsOver(xmId, true);
+			xmService.judgeXmIsOver(xmId, null,true);
 
 			LambdaQueryWrapper<XmWwxmEntity> eq = Wrappers.<XmWwxmEntity>lambdaQuery()
 				.eq(XmWwxmEntity::getXmId, xmId)
@@ -130,7 +130,7 @@ public class XmWwxmCostServiceImpl extends BaseServiceImpl<XmWwxmCostMapper, XmW
 			if (Func.notNull(cost)) {
 				XmWwxmEntity wwxm = wwxmMapper.selectById(cost.getWwId());
 				if (Func.notNull(wwxm)) {
-					xmService.judgeXmIsOver(wwxm.getXmId(), true);
+					xmService.judgeXmIsOver(wwxm.getXmId(), null,true);
 				}
 			}
 		}

BIN
kd-service/kd-scientific/src/main/resources/export-template/科技人员管理/参研人员花名册.xls