zhouli 6 months ago
parent
commit
1446312c9c
25 changed files with 115 additions and 60 deletions
  1. 3 0
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/AttendanceDto.java
  2. 3 0
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/SalaryDTO.java
  3. 3 0
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/XmCqdtfyDTO.java
  4. 3 0
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/XmDesignCostQuery.java
  5. 4 1
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/XmOtherCostQuery.java
  6. 3 0
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/XmWwxmCostQuery.java
  7. 3 0
      kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/entity/SettingEntity.java
  8. 0 9
      kd-service/kd-scientific/src/main/java/org/sky/scientific/controller/SettingController.java
  9. 4 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/AttendanceMapper.xml
  10. 4 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/SalaryMapper.xml
  11. 3 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmBgrzMapper.xml
  12. 1 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmCqdtfyMapper.xml
  13. 2 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmDesignCostMapper.xml
  14. 1 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmDirectCostMapper.xml
  15. 1 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmFixedAssetMapper.xml
  16. 1 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmGoodsMapper.xml
  17. 1 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmLeaseMapper.xml
  18. 2 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmOtherCostMapper.xml
  19. 1 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmTechnicianHoursMapper.xml
  20. 2 0
      kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmWwxmCostMapper.xml
  21. 62 41
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/ArchiveServiceImpl.java
  22. 2 1
      kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/YsRyrgfyServiceImpl.java
  23. BIN
      kd-service/kd-scientific/src/main/resources/templates/项目结题表.doc
  24. 3 3
      kd-service/kd-scientific/src/main/resources/templates/项目结题表.ftl
  25. 3 3
      kd-service/kd-scientific/src/main/resources/templates/项目结题表.xml

+ 3 - 0
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/AttendanceDto.java

@@ -36,4 +36,7 @@ public class AttendanceDto {
 	@Schema(description = "考勤明细")
 	private List<DailyAttendance> dailyAttendances;
 
+	@Schema(description = "研发项目id")
+	private Long xmId;
+
 }

+ 3 - 0
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/SalaryDTO.java

@@ -35,4 +35,7 @@ public class SalaryDTO extends SalaryEntity {
 	@Schema(description = "人员类型")
 	private String personnelType;
 
+	@Schema(description = "研发项目id")
+	private Long xmId;
+
 }

+ 3 - 0
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/XmCqdtfyDTO.java

@@ -15,6 +15,9 @@ import java.math.BigDecimal;
 @Data
 public class XmCqdtfyDTO {
 
+	@Schema(description = "研发项目id")
+	private Long xmId;
+
 	@Schema(description = "研发项目名称")
 	private String xmmc;
 

+ 3 - 0
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/XmDesignCostQuery.java

@@ -21,6 +21,9 @@ public class XmDesignCostQuery{
 	@Schema(description = "租户id", hidden = true)
 	private String tenantId;
 
+	@Schema(description = "研发项目id")
+	private Long xmId;
+
 	@Schema(description = "研发项目名称")
 	private String xmmc;
 

+ 4 - 1
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/XmOtherCostQuery.java

@@ -25,7 +25,10 @@ public class XmOtherCostQuery implements Serializable {
 	@Schema(description = "所属年月,如:202505")
 	private String yearAndMonth;
 
-	@Schema(description ="项目名称")
+	@Schema(description ="研发项目id")
+	private Long xmId;
+
+	@Schema(description ="研发项目名称")
  	private String xmmc;
 
 	@Schema(description = "日期,小")

+ 3 - 0
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/dto/XmWwxmCostQuery.java

@@ -9,6 +9,9 @@ public class XmWwxmCostQuery {
 	@Schema(description = "所属年月")
 	private String yearAndMonth;
 
+	@Schema(description ="研发项目id")
+	private Long xmId;
+
 	@Schema(description = "研发项目名称")
 	private String xmmc;
 

+ 3 - 0
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/entity/SettingEntity.java

@@ -39,6 +39,9 @@ public class SettingEntity {
 	@Schema(description = "高企证书url")
 	private String highTechUrl;
 
+	@Schema(description = "火炬系统订制稿版")
+	private String torchDevUrl;
+
 	@Schema(description = "类型,读取上年度数据时需要传这个值,1:出勤时长,2:高企证书")
 	@TableField(exist = false)
 	private Integer type;

+ 0 - 9
kd-service/kd-scientific/src/main/java/org/sky/scientific/controller/SettingController.java

@@ -35,14 +35,6 @@ public class SettingController extends KdController {
 		return R.data(detail);
 	}
 
-//	@GetMapping("/torch-dev/list")
-//	@ApiOperationSupport(order = 1)
-//	@Operation(summary = "火炬发展年报")
-//	public R<List<SettingEntity>> torchDevList(String yearMin, String yearMax) {
-//		List<SettingEntity> list = service.torchDevList(yearMin,yearMax);
-// 		return R.data(list);
-//	}
-
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 3)
 	@Operation(summary = "新增或修改" )
@@ -57,5 +49,4 @@ public class SettingController extends KdController {
 	public R<Boolean> fetchLastYearData(SettingEntity settingEntity) {
 		return R.status(service.fetchLastYearData(settingEntity));
 	}
-
 }

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

@@ -36,7 +36,7 @@
         order by work_date asc
     </select>
 
-    <select id="selectAttendancePage" resultMap="ResultVoMap">
+    <select id="selectAttendancePage" resultMap="ResultVoMap" parameterType="org.sky.scientific.pojo.dto.AttendanceDto">
         SELECT xt.unicode, t.name, t.number, t.id_card, t.personnel_type
         FROM kd_attendance_records xt
         LEFT JOIN kd_technician t on xt.unicode = t.unicode and t.year_and_month = #{ew.yearAndMonth}
@@ -53,6 +53,9 @@
         <if test="ew.personnelType != null">
             and t.personnel_type = #{ew.personnelType}
         </if>
+        <if test="ew.xmId!=null and ew.xmId > 0">
+            and xt.unicode in (select distinct unicode from kd_xm_technician where xm_id = #{ew.xmId} and year_and_month = #{ew.yearAndMonth})
+        </if>
         group by xt.unicode
      </select>
 

+ 4 - 0
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/SalaryMapper.xml

@@ -145,6 +145,10 @@
         <if test="salary.personnelType != null">
             and t.personnel_type = #{salary.personnelType}
         </if>
+        <if test="salary.xmId!=null and salary.xmId>0">
+            and s.unicode in (select distinct unicode from kd_xm_technician where xm_id = #{salary.xmId} and year_and_month = #{salary.yearAndMonth})
+
+        </if>
     </select>
 
     <delete id="deleteSalary">

+ 3 - 0
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmBgrzMapper.xml

@@ -27,6 +27,7 @@
         <result column="xmmc" property="xmmc"/>
         <result column="xmsqdwid" property="xmsqdwid"/>
         <result column="xmsqdw" property="xmsqdw"/>
+        <result column="xmfzrxm" property="xmfzrxm"/>
         <result column="attachment" property="attachment"/>
     </resultMap>
 
@@ -41,6 +42,7 @@
             xmmc,
             xmsqdwid,
             xmfzr,
+            t.name as xmfzrxm,
             rz.ZDMC,BGQDZ,BGHDZ,BGSXSJ,BGYY,rz.attachment
         FROM kd_xm_bgrz rz
         left join
@@ -53,6 +55,7 @@
                 COALESCE(get_xm_info(m.id, 'XMSQDWID', null),m.XMSQDWID) as xmsqdwid
             FROM kd_xm m
         )xm on rz.xm_id = xm.id
+        LEFT JOIN kd_technician t on t.id = xm.xmfzr
         WHERE rz.is_deleted = 0 and rz.ZDMC != "STATUS" and rz.BGHDZ != 2
         <if test="ew.xmId!=null">and rz.XM_ID = #{ew.xmId}</if>
     </select>

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

@@ -55,6 +55,7 @@
             WHERE xm.is_deleted = 0
         ) xm on xm.id = c.xm_id
         where left(c.year_and_month,6 ) = #{ew.yearAndMonth}
+        <if test="ew.xmId != null">and c.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc != null and ew.xmmc != ''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.ctdtfymc != null and ew.ctdtfymc != ''">and c.ctdtfybm like concat('%',#{ew.ctdtfymc},'%')</if>
         <if test="ew.yt != null and ew.yt != ''">and c.yt = #{ew.yt}</if>

+ 2 - 0
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmDesignCostMapper.xml

@@ -47,6 +47,7 @@
             FROM kd_xm xm
         ) xm on xm.id = dc.xm_id
         WHERE dc.tenant_id = #{ew.tenantId} and date_format(dc.record_date, '%Y%m') = #{ew.yearAndMonth}
+        <if test="ew.xmId != null">and dc.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc != null and ew.xmmc!=''">
            and xm.XMMC like concat('%',#{ew.xmmc},'%')
         </if>
@@ -79,6 +80,7 @@
         WHERE
         dc.tenant_id = #{ew.tenantId}
         and date_format(dc.record_date, '%Y%m')  between concat(#{ew.yearAndMonth},"01") and concat(#{ew.yearAndMonth}, "12")
+        <if test="ew.xmId != null">and dc.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc != null and ew.xmmc!=''">
             and xm.XMMC like concat('%',#{ew.xmmc},'%')
         </if>

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

@@ -41,6 +41,7 @@
             FROM kd_xm m
         ) xm on xm.id = kxl.xm_id
         where kxl.is_deleted = 0 and kxl.year_and_month = #{ew.yearAndMonth}
+        <if test="ew.xmId!=null and ew.xmId>0">and kxl.xm_id =#{ew.xmId}</if>
         <if test="ew.xmmc!=null and ew.xmbh!=''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.xmbh!=null and ew.xmbh!=''">and xm.xmbh like concat('%',#{ew.xmbh},'%')</if>
         <if test="ew.type!=null and ew.type!=''">and kxl.type = #{ew.type}</if>

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

@@ -156,6 +156,7 @@
             FROM kd_xm xm
         ) xm on xm.id = xa.xm_id
         WHERE xa.tenant_id = #{ew.tenantId} AND xa.year_and_month = #{ew.yearAndMonth} and xa.type = 2
+        <if test="ew.xmId!=null">and xa.xm_id  = #{ew.xmId}</if>
         <if test="ew.xmmc!=null and ew.xmmc!=''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.zcmc!=null and ew.zcmc!=''">and asset.zcmc like concat('%',#{ew.zcmc},'%')</if>
         <if test="ew.zclb!=null and ew.zclb!=''">and asset.zclb like concat('%',#{ew.zclb},'%')</if>

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

@@ -52,6 +52,7 @@
             FROM kd_xm m
         ) xm on xm.id = kxg.xm_id
         where kxg.is_deleted = 0 and kxg.year_and_month = #{ew.yearAndMonth}
+        <if test="ew.xmId!=null">and kxg.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc!=null and ew.xmbh!=''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.xmbh!=null and ew.xmbh!=''">and xm.xmbh like concat('%',#{ew.xmbh},'%')</if>
         <if test="ew.type!=null and ew.type!=''">and kxg.type = #{ew.type}</if>

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

@@ -45,6 +45,7 @@
             FROM kd_xm temp
         ) xm on xm.id = kxl.xm_id
         where kxl.is_deleted = 0 and kxl.year_and_month = #{ew.yearAndMonth}
+        <if test="ew.xmId!=null and ew.xmId>0">and kxl.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc!=null and ew.xmbh!=''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.xmbh!=null and ew.xmbh!=''">and xm.xmbh like concat('%',#{ew.xmbh},'%')</if>
         <if test="ew.type!=null and ew.type!=''">and kxl.type = #{ew.type}</if>

+ 2 - 0
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmOtherCostMapper.xml

@@ -45,6 +45,7 @@
         where
         xoc.tenant_id = #{ew.tenantId}
         and date_format(record_date, '%Y%m') = #{ew.yearAndMonth}
+        <if test="ew.xmId != null">and xoc.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc != null and ew.xmmc!=''">and XMMC like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.subjectId!=null">and xoc.subject_id = #{ew.subjectId}</if>
         <if test="ew.recordDateMin!=null and ew.recordDateMax!=null">and date_format(xoc.record_date,'%Y-%m-%d') between #{ew.recordDateMin} and #{ew.recordDateMax}</if>
@@ -63,6 +64,7 @@
         where
         xoc.tenant_id = #{ew.tenantId}
         and date_format(record_date, '%Y%m') between concat(#{ew.yearAndMonth},'01') and concat(#{ew.yearAndMonth},'12')
+        <if test="ew.xmId != null">and xoc.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc != null and ew.xmmc!=''">and XMMC like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.subjectId!=null">and xoc.subject_id = #{ew.subjectId}</if>
         <if test="ew.recordDateMin!=null and ew.recordDateMax!=null">and date_format(xoc.record_date,'%Y-%m-%d') between #{ew.recordDateMin} and #{ew.recordDateMax}</if>

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

@@ -48,7 +48,7 @@
             FROM kd_xm temp
         ) xm ON xt.xm_id = xm.xm_id
         WHERE left(xt.work_date,6) = #{ew.yearAndMonth}
-        <if test="ew.xmId!=null">and xm.xm_id = #{ew.xmId}</if>
+        <if test="ew.xmId!=null">and xt.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc!=null and ew.xmmc!=''">and xm.XMMC like concat(concat('%', #{ew.xmmc}), '%')</if>
         <if test="ew.name!=null and ew.name!=''">and t.name like concat(concat('%', #{ew.name}), '%')</if>
         <if test="ew.number!=null and ew.number!=''">and t.number like concat(concat('%', #{ew.number}), '%')</if>

+ 2 - 0
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmWwxmCostMapper.xml

@@ -48,6 +48,7 @@
         ) xm on xm.id = m.xm_id
         where
             xa.year_and_month = #{ew.yearAndMonth}
+        <if test="ew.xmId != null">and m.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc!=null and ew.xmmc!=''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.sfwcjshtdj!=null and ew.sfwcjshtdj!=''">and m.SFWCJSHTDJ like concat('%',#{ew.sfwcjshtdj},'%')</if>
         <if test="ew.jshtdjlx!=null and ew.jshtdjlx!=''">and m.JSHTDJLX like concat('%',#{ew.jshtdjlx},'%')</if>
@@ -69,6 +70,7 @@
         ) xm on xm.id = m.xm_id
         where
             left(xa.year_and_month,4) = #{ew.yearAndMonth}
+        <if test="ew.xmId != null">and m.xm_id = #{ew.xmId}</if>
         <if test="ew.xmmc!=null and ew.xmmc!=''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.sfwcjshtdj!=null and ew.SFWCJSHTDJ!=''">and m.SFWCJSHTDJ like concat('%',#{ew.sfwcjshtdj},'%')</if>
         <if test="ew.jshtdjlx!=null and ew.JSHTDJLX!=''">and m.JSHTDJLX like concat('%',#{ew.jshtdjlx},'%')</if>

+ 62 - 41
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/ArchiveServiceImpl.java

@@ -22,6 +22,7 @@ import org.sky.core.tool.utils.Func;
 import org.sky.scientific.mapper.ArchiveAttachMapper;
 import org.sky.scientific.mapper.DownloadTaskMapper;
 import org.sky.scientific.mapper.SettingMapper;
+import org.sky.scientific.mapper.XmTechnicianMapper;
 import org.sky.scientific.pojo.dto.*;
 import org.sky.scientific.pojo.entity.*;
 import org.sky.scientific.pojo.vo.*;
@@ -133,6 +134,8 @@ public class ArchiveServiceImpl implements IArchiveService {
 	private IXmOtherCostService xmOtherCostService;
 	@Resource
 	private IXmWwxmCostService wwxmCostService;
+	@Resource
+	private XmTechnicianMapper xmTechnicianMapper;
 
 	@Override
 	public ArchiveAttachEntity fjbczl(String year) {
@@ -434,7 +437,7 @@ public class ArchiveServiceImpl implements IArchiveService {
 			try {
 				XmFinanceEntity dto2 = new XmFinanceEntity();
 				dto2.setYearAndMonth(year);
-				dto2.setType(2);
+				dto2.setType(3);
 				generateD17(path18, xmFinanceService.selectXmFinanceList(dto2), year, futureList);
 			} catch (Exception e) {
 				throw new RuntimeException(e);
@@ -446,7 +449,7 @@ public class ArchiveServiceImpl implements IArchiveService {
 			try {
 				XmFinanceEntity dto2 = new XmFinanceEntity();
 				dto2.setYearAndMonth(year);
-				dto2.setType(3);
+				dto2.setType(2);
 				generateD17(path19, xmFinanceService.selectXmFinanceList(dto2), year, futureList);
 			} catch (Exception e) {
 				throw new RuntimeException(e);
@@ -506,11 +509,11 @@ public class ArchiveServiceImpl implements IArchiveService {
 		log.info("一键导出耗时:{}", (new Date().getTime() - date.getTime()) / 1000 + "秒");
 
 
-		String zipPath = basePath+".zip";
+		String zipPath = basePath + ".zip";
 		try {
 			ZipUtil.zip(basePath.toString(), zipPath);
 		} catch (IORuntimeException e) {
-			log.error("创建zip文件失败,{}",e.getLocalizedMessage());
+			log.error("创建zip文件失败,{}", e.getLocalizedMessage());
 		}
 
 
@@ -526,6 +529,8 @@ public class ArchiveServiceImpl implements IArchiveService {
 	private void generateD17(Path path, List<XmFinanceEntity> list, String year, List<CompletableFuture<Void>> futureList) {
 		RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
 		for (XmFinanceEntity xm : list) {
+			Long xmId = xm.getXmId();
+
 			//创建项目文件夹
 			Path xmmcPath = FileUtil.mkdir(FileUtil.mkdir(Paths.get(path.toString(), xm.getXmmc())));
 
@@ -533,26 +538,26 @@ public class ArchiveServiceImpl implements IArchiveService {
 			Path path17_1 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "1.人员人工费用"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				//1-1.每月研发人员工资"
-				generateD17_1_1(path17_1, year);
+				//1-1.每月研发人员工资
+				generateD17_1_1(path17_1, year, xmId);
 			}));
 
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
 				//1-2.每月研发人员出勤
-				generateD17_1_2(path17_1, year);
+				generateD17_1_2(path17_1, year, xmId);
 			}));
 
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
 				//1-3.每月研发工时打卡
-				generateD17_1_3(path17_1, year);
+				generateD17_1_3(path17_1, year, xmId);
 			}));
 
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
 				//1-4.人工费用分配表
-				generateD17_1_4(path17_1, year);
+				generateD17_1_4(path17_1, year, xmId);
 			}));
 
 			//2.直接投入费用
@@ -565,7 +570,7 @@ public class ArchiveServiceImpl implements IArchiveService {
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
 				////2-1-1.每月领料燃料动力明细
-				generateD17_2_1_1(path17_2_1_1, year);
+				generateD17_2_1_1(path17_2_1_1, year, xmId);
 			}));
 
 			//2-1-2.研发领料单
@@ -579,14 +584,14 @@ public class ArchiveServiceImpl implements IArchiveService {
 			Path path17_2_1_3 = FileUtil.mkdir(Paths.get(path17_2_1.toString(), "3.研发燃料耗用单"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generateD17_2_1_2(year, path17_2_1_3, xm.getXmId(), "燃料");
+				generateD17_2_1_2(year, path17_2_1_3, xmId, "燃料");
 			}));
 
 			//2-1-4.研发动力耗用单
 			Path path17_2_1_4 = FileUtil.mkdir(Paths.get(path17_2_1.toString(), "4.研发动力耗用单"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generateD17_2_1_2(year, path17_2_1_4, xm.getXmId(), "动力");
+				generateD17_2_1_2(year, path17_2_1_4, xmId, "动力");
 			}));
 
 			//2-2.研发固定资产租赁费用
@@ -595,7 +600,7 @@ public class ArchiveServiceImpl implements IArchiveService {
 			Path path17_2_2_1 = FileUtil.mkdir(Paths.get(path17_2_2.toString(), "1.每月租赁资产费用明细"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generateD17_2_2_1(path17_2_2_1, year);
+				generateD17_2_2_1(path17_2_2_1, year, xmId);
 			}));
 
 			//2-2-2.研发租赁费用分配表
@@ -603,14 +608,14 @@ public class ArchiveServiceImpl implements IArchiveService {
 
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_2_2_2(year, path17_2_2_2, xm.getXmId());
+				generate17_2_2_2(year, path17_2_2_2, xmId);
 			}));
 
 			//2-3.每月直接投入费用
 			Path path17_2_3 = FileUtil.mkdir(Paths.get(path17_2.toString(), "3.每月直接投入费用"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_2_3(path17_2_3, year);
+				generate17_2_3(path17_2_3, year, xmId);
 			}));
 
 			//3.折旧费用与长期待摊费用
@@ -619,63 +624,64 @@ public class ArchiveServiceImpl implements IArchiveService {
 			Path path17_3_1 = FileUtil.mkdir(Paths.get(path17_3.toString(), "1.每月仪器设备工时打卡"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_3_1(path17_3_1, year);
+				generate17_3_1(path17_3_1, year, xmId);
 			}));
 
 			//3-2.仪器设备折旧费用分配表
 			Path path17_3_2 = FileUtil.mkdir(Paths.get(path17_3.toString(), "2.仪器设备折旧费用分配表"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_3_2(path17_3_2, year);
+				generate17_3_2(path17_3_2, year, xmId);
 			}));
 
 			//3-3.在用建筑物折旧费用分配表
 			Path path17_3_3 = FileUtil.mkdir(Paths.get(path17_3.toString(), "3.在用建筑物折旧费用分配表"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_3_3(path17_3_3, year);
+				generate17_3_3(path17_3_3, year, xmId);
 			}));
 
 			//3-4.长期待摊费用分配表
 			Path path17_3_4 = FileUtil.mkdir(Paths.get(path17_3.toString(), "4.长期待摊费用分配表"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_3_4(path17_3_4, year);
+				generate17_3_4(path17_3_4, year, xmId);
 			}));
 
 			//4.无形资产摊销费用
 			Path path17_4 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "4.无形资产摊销费用"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_4(path17_4, year);
+				generate17_4(path17_4, year, xmId);
 			}));
 
 			//5和6.设计费用、装备调试费用与试验费用
 			Path path17_5 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "5和6.设计费用、装备调试费用与试验费用"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_5(path17_5, year);
+				generate17_5(path17_5, year, xmId);
 			}));
 
 			//7.其他费用
 			Path path17_7 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "7.其他费用"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_7(path17_7, year);
+				generate17_7(path17_7, year, xmId);
 			}));
 
 			//8.委托外部研究开发费用
 			Path path17_8 = FileUtil.mkdir(Paths.get(xmmcPath.toString(), "8.委托外部研究开发费用"));
 			futureList.add(CompletableFuture.runAsync(() -> {
 				RequestContextHolder.setRequestAttributes(requestAttributes);
-				generate17_8(path17_8, year);
+				generate17_8(path17_8, year, xmId);
 			}));
 		}
 	}
 
 	@SneakyThrows
-	private void generate17_8(Path path, String year) {
+	private void generate17_8(Path path, String year, Long xmId) {
 		XmWwxmCostQuery wwxmCost = new XmWwxmCostQuery();
+		wwxmCost.setXmId(xmId);
 		wwxmCost.setYearAndMonth(year);
 		List<XmWwxmCostVO> wwxmCostList = wwxmCostService.selectPage(Condition.getPage(new Query().setCurrent(1).setSize(Integer.MAX_VALUE)), wwxmCost).getRecords();
 		if (Func.isNotEmpty(wwxmCostList)) {
@@ -684,8 +690,9 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generate17_7(Path path, String year) {
+	private void generate17_7(Path path, String year, Long xmId) {
 		XmOtherCostQuery otherCost = new XmOtherCostQuery();
+		otherCost.setXmId(xmId);
 		otherCost.setYearAndMonth(year);
 		List<XmOtherCostEntity> otherCostList = xmOtherCostService.selectPageByCondition(Condition.getPage(new Query().setCurrent(1).setSize(Integer.MAX_VALUE)), otherCost).getRecords();
 		if (Func.isNotEmpty(otherCostList)) {
@@ -694,8 +701,9 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generate17_5(Path path, String year) {
+	private void generate17_5(Path path, String year, Long xmId) {
 		XmDesignCostQuery designCost = new XmDesignCostQuery();
+		designCost.setXmId(xmId);
 		designCost.setYearAndMonth(year);
 		List<XmDesignCostVO> designCostList = xmDesignCostService.selectXmDesignCostPage(Condition.getPage(new Query().setCurrent(1).setSize(Integer.MAX_VALUE)), designCost).getRecords();
 		if (Func.isNotEmpty(designCostList)) {
@@ -704,8 +712,9 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generate17_4(Path path, String year) {
+	private void generate17_4(Path path, String year, Long xmId) {
 		XmAssetQueryParam wxzctxCost = new XmAssetQueryParam();
+		wxzctxCost.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			wxzctxCost.setYearAndMonth(year + month);
@@ -717,8 +726,9 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generate17_3_4(Path path, String year) {
+	private void generate17_3_4(Path path, String year, Long xmId) {
 		XmCqdtfyDTO xmCqdtfyDTO = new XmCqdtfyDTO();
+		xmCqdtfyDTO.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			xmCqdtfyDTO.setYearAndMonth(year + month);
@@ -730,8 +740,9 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generate17_3_3(Path path, String year) {
+	private void generate17_3_3(Path path, String year, Long xmId) {
 		XmAssetQueryParam jzwCost = new XmAssetQueryParam();
+		jzwCost.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			jzwCost.setYearAndMonth(year + month);
@@ -743,8 +754,9 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generate17_3_2(Path path, String year) {
+	private void generate17_3_2(Path path, String year, Long xmId) {
 		XmAssetQueryParam yqsbCost = new XmAssetQueryParam();
+		yqsbCost.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			yqsbCost.setYearAndMonth(year + month);
@@ -756,8 +768,9 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generate17_3_1(Path path, String year) {
+	private void generate17_3_1(Path path, String year, Long xmId) {
 		XmAssetHoursDto assetHoursDto = new XmAssetHoursDto();
+		assetHoursDto.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			assetHoursDto.setYearAndMonth(year + month);
@@ -769,8 +782,9 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generate17_2_3(Path path, String year) {
+	private void generate17_2_3(Path path, String year, Long xmId) {
 		XmDirectCostEntity xmDirectCost = new XmDirectCostEntity();
+		xmDirectCost.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			xmDirectCost.setYearAndMonth(year + month);
@@ -1281,14 +1295,17 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generateD17_1_1(Path path, String year) {
+	private void generateD17_1_1(Path path, String year, Long xmId) {
 		//1-1.每月研发人员工资
 		Path path1_1 = FileUtil.mkdir(Paths.get(path.toString(), "1.每月研发人员工资"));
 		SalaryDTO salaryDTO = new SalaryDTO();
+		salaryDTO.setXmId(xmId);
 		String month = null;
 		for (int i = 1; i <= 12; i++) {
 			month = (i < 10 ? "0" + i : i + "");
-			salaryDTO.setYearAndMonth(year + month);
+			String yearAndMonth = year + month;
+			salaryDTO.setYearAndMonth(yearAndMonth);
+			//查询项目参研人员的工资数据
 			List<SalaryVO> salaryList = salaryService.selectSalaryPage(Condition.getPage(new Query().setCurrent(1).setSize(Integer.MAX_VALUE)), salaryDTO).getRecords();
 			if (Func.isNotEmpty(salaryList)) {
 				salaryService.exportSalary(new FileOutputStream(path1_1 + "/" + year + "年" + month + "月研发人员工资.xlsx"), salaryList, salaryDTO.getYearAndMonth());
@@ -1297,10 +1314,11 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generateD17_1_2(Path path, String year) {
+	private void generateD17_1_2(Path path, String year, Long xmId) {
 		//1-2.每月研发人员出勤
 		Path path1_2 = FileUtil.mkdir(Paths.get(path.toString(), "2.每月研发人员出勤"));
 		AttendanceDto attendanceDto = new AttendanceDto();
+		attendanceDto.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			attendanceDto.setYearAndMonth(year + month);
@@ -1312,10 +1330,11 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generateD17_1_3(Path path, String year) {
+	private void generateD17_1_3(Path path, String year, Long xmId) {
 		//1-3.每月研发工时打卡
 		Path path1_3 = FileUtil.mkdir(Paths.get(path.toString(), "3.每月研发工时打卡"));
 		XmTechnicianHoursVO xmtechnicianHoursVO = new XmTechnicianHoursVO();
+		xmtechnicianHoursVO.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			xmtechnicianHoursVO.setYearAndMonth(year + month);
@@ -1327,10 +1346,11 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generateD17_1_4(Path path, String year) {
+	private void generateD17_1_4(Path path, String year, Long xmId) {
 		//1-4.人工费用分配表
 		Path path1_4 = FileUtil.mkdir(Paths.get(path.toString(), "4.人工费用分配表"));
 		XmTechnicianDto xmTechnicianDto = new XmTechnicianDto();
+		xmTechnicianDto.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			xmTechnicianDto.setYearAndMonth(year + month);
@@ -1342,9 +1362,10 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generateD17_2_1_1(Path path, String year) {
+	private void generateD17_2_1_1(Path path, String year, Long xmId) {
 		//2-1-1.每月领料燃料动力明细
 		XmGoodsDTO dto = new XmGoodsDTO();
+		dto.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			dto.setYearAndMonth(year + month);
@@ -1356,9 +1377,10 @@ public class ArchiveServiceImpl implements IArchiveService {
 	}
 
 	@SneakyThrows
-	private void generateD17_2_2_1(Path path, String year) {
+	private void generateD17_2_2_1(Path path, String year, Long xmId) {
 		//2-2-1.每月租赁资产费用明细
 		XmLeaseEntity xmLease = new XmLeaseEntity();
+		xmLease.setXmId(xmId);
 		for (int i = 1; i <= 12; i++) {
 			String month = (i < 10 ? "0" + i : i + "");
 			xmLease.setYearAndMonth(year + month);
@@ -1374,8 +1396,7 @@ public class ArchiveServiceImpl implements IArchiveService {
 		for (int i = 1; i <= 12; i++) {
 			String yearAndMonth = year + (i < 10 ? "0" + i : i);
 			XmLeaseEntity param = new XmLeaseEntity();
-//			param.setType("仪器设备");
-			param.setYearAndMonth(yearAndMonth);
+ 			param.setYearAndMonth(yearAndMonth);
 			param.setXmId(xmId);
 			List<JSONObject> leaseList = xmLeaseService.yanfazulinzichanfeiyongfenpeibiao(param);
 			if (Func.isEmpty(leaseList)) {

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

@@ -96,8 +96,9 @@ public class YsRyrgfyServiceImpl extends BaseServiceImpl<YsRyrgfyMapper, YsRyrgf
 
 			excel.setNumber(Func.isBlank(excel.getNumber()) ? null : excel.getNumber().trim());
 			excel.setIdCard(Func.isBlank(excel.getIdCard()) ? null : excel.getIdCard().trim());
+//			technicianMapper.getUnicodeByNumberAndIdentityCard(excel.getNumber(), excel.getIdCard());
 			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();
 			if (Func.isEmpty(list)) {
 				throw new ServiceException("工号[" + excel.getNumber() + "]身份证[" + excel.getIdCard() + "]不存在");

BIN
kd-service/kd-scientific/src/main/resources/templates/项目结题表.doc


File diff suppressed because it is too large
+ 3 - 3
kd-service/kd-scientific/src/main/resources/templates/项目结题表.ftl


File diff suppressed because it is too large
+ 3 - 3
kd-service/kd-scientific/src/main/resources/templates/项目结题表.xml