zhouli 9 months ago
parent
commit
82a8bc336b

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

@@ -46,9 +46,15 @@
      @Schema(description = "会计科目")
      private String accSubject;
 
+	 @Schema(description = "是否为高新研发费用科目,1:是,0,否")
+	 private int isRdSubject;
+
 	 @Schema(description = "高新研发费用科目")
 	 private String rdSubject;
 
+	 @Schema(description = "是否为加计扣除研发费用科目,1:是,0,否")
+	 private int isAdSubject;
+
 	 @Schema(description = "加计扣除研发费用科目")
 	 private String adSubject;
  }

+ 12 - 17
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/entity/XmJtbEntity.java

@@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.sky.core.tenant.mp.TenantEntity;
+import org.sky.core.mp.base.BaseEntity;
 import org.sky.core.tool.utils.DateUtil;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -19,36 +19,31 @@ import java.util.Date;
  * @author Kd
  * @since 2025-07-01
  */
+@EqualsAndHashCode(callSuper = true)
 @Data
 @TableName("kd_xm_jtb")
 @Schema(description = "XmJtb对象")
-@EqualsAndHashCode(callSuper = true)
-public class XmJtbEntity extends TenantEntity {
+public class XmJtbEntity extends BaseEntity {
 
 	@Serial
 	private static final long serialVersionUID = 1L;
 
+//	@TableId
+//	@Schema(description = "主键id" )
+//	private Long id;
+
 	@Schema(description = "科研项目id,kd_xm的主键")
 	private Long xmId;
 
-	@Schema(description = "验收报告")
-	private String ysbg;
-
-	@Schema(description = "技术报告")
-	private String jsbg;
-
-	@Schema(description = "成果报告")
-	private String cgbg;
-
-	@Schema(description = "效益报告")
-	private String xybg;
+	@Schema(description = "项目实施类型,关联kd_biz_dict的项目实施-阶段性报告-附件类型")
+	private String type;
 
-	@Schema(description = "验收批文")
-	private String yspw;
+	@Schema(description = "附件")
+	private String attachment;
 
 	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
 	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
 	@Schema(description = "填报时间")
-	private Date tbsj;
+	private Date fillDate;
 
 }

+ 6 - 17
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmJtbMapper.xml

@@ -5,29 +5,18 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="ResultMap" type="org.sky.scientific.pojo.entity.XmJtbEntity">
         <result column="id" property="id"/>
-        <result column="tenant_id" property="tenantId"/>
-        <result column="XM_ID" property="xmId"/>
-        <result column="YSBG" property="ysbg"/>
-        <result column="JSBG" property="jsbg"/>
-        <result column="CGBG" property="cgbg"/>
-        <result column="XYBG" property="xybg"/>
-        <result column="YSPW" property="yspw"/>
-        <result column="TBSJ" property="tbsj"/>
-        <result column="create_user" property="createUser"/>
-        <result column="create_dept" property="createDept"/>
-        <result column="create_time" property="createTime"/>
-        <result column="update_user" property="updateUser"/>
-        <result column="update_time" property="updateTime"/>
-        <result column="status" property="status"/>
-        <result column="is_deleted" property="isDeleted"/>
+         <result column="XM_ID" property="xmId"/>
+        <result column="type" property="type"/>
+        <result column="attachment" property="attachment"/>
+        <result column="fill_date" property="fillDate"/>
     </resultMap>
 
     <resultMap id="ResultVoMap" type="org.sky.scientific.pojo.vo.XmJtbVO" extends="ResultMap">
-        <association property="xmEntity" column="{param1=XM_ID,param2=yearAndMonth}" select="org.sky.scientific.mapper.XmMapper.selectByXmIdAndYearMonth"/>
+<!--        <association property="xmEntity" column="{param1=XM_ID,param2=DATE_FORMAT(fill_date, '%Y%m')}" select="org.sky.scientific.mapper.XmMapper.selectByXmIdAndYearMonth"/>-->
     </resultMap>
 
     <select id="selectByCondition" resultMap="ResultVoMap">
-        SELECT *,#{yearAndMonth} as yearAndMonth
+        SELECT *
         FROM kd_xm_jtb
         WHERE XM_ID = #{xmId}
     </select>

+ 9 - 11
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmJtbServiceImpl.java

@@ -2,10 +2,8 @@
 package org.sky.scientific.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.sky.core.log.exception.ServiceException;
 import org.sky.core.mp.base.BaseServiceImpl;
-import org.sky.core.tool.utils.DateUtil;
 import org.sky.scientific.excel.XmJtbExcel;
 import org.sky.scientific.mapper.XmJtbMapper;
 import org.sky.scientific.pojo.dto.XmJtbDTO;
@@ -14,7 +12,6 @@ import org.sky.scientific.pojo.vo.XmJtbVO;
 import org.sky.scientific.service.IXmJtbService;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 
@@ -32,9 +29,9 @@ public class XmJtbServiceImpl extends BaseServiceImpl<XmJtbMapper, XmJtbEntity>
 		if (Objects.isNull(xmJtb.getXmId())) {
 			throw new ServiceException("请选择研发项目");
 		}
-		if (null == xmJtb.getYearAndMonth()) {
-			xmJtb.setYearAndMonth(DateUtil.format(new Date(), DateUtil.PATTERN_YYYYMM));
-		}
+//		if (null == xmJtb.getYearAndMonth()) {
+//			xmJtb.setYearAndMonth(DateUtil.format(new Date(), DateUtil.PATTERN_YYYYMM));
+//		}
 		return baseMapper.selectByCondition(xmJtb);
 	}
 
@@ -44,11 +41,12 @@ public class XmJtbServiceImpl extends BaseServiceImpl<XmJtbMapper, XmJtbEntity>
 			throw new ServiceException("请选择科研项目");
 		}
 		boolean result = false;
-		if (this.isFieldDuplicate(XmJtbEntity::getXmId, xmJtb.getXmId())) {
-			result = this.update(xmJtb, Wrappers.<XmJtbEntity>lambdaUpdate().eq(XmJtbEntity::getXmId, xmJtb.getXmId()));
-		} else {
-			result = this.save(xmJtb);
-		}
+		this.saveOrUpdate(xmJtb);
+//		if (this.isFieldDuplicate(XmJtbEntity::getXmId, xmJtb.getXmId())) {
+//			result = this.update(xmJtb, Wrappers.<XmJtbEntity>lambdaUpdate().eq(XmJtbEntity::getXmId, xmJtb.getXmId()));
+//		} else {
+//			result = this.save(xmJtb);
+//		}
 		return result;
 	}
 

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

@@ -18,7 +18,6 @@ import org.sky.scientific.pojo.dto.XmDTO;
 import org.sky.scientific.pojo.entity.CgZlEntity;
 import org.sky.scientific.pojo.entity.XmEntity;
 import org.sky.scientific.pojo.entity.XmJdxbgEntity;
-import org.sky.scientific.pojo.entity.XmJtbEntity;
 import org.sky.scientific.pojo.vo.XmSummary;
 import org.sky.scientific.pojo.vo.XmVO;
 import org.sky.scientific.pojo.vo.XmYszbVO;
@@ -115,7 +114,7 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 			//阶段性报告
 			xmVO.setJdxbgList(jdxbgMapper.selectList(Wrappers.<XmJdxbgEntity>lambdaQuery().eq(XmJdxbgEntity::getXmId, xmVO.getId())));
 			//验收报告
-			xmVO.setYsbgList(jtbMapper.selectList(Wrappers.<XmJtbEntity>lambdaQuery().eq(XmJtbEntity::getXmId, xmVO.getId()).isNotNull(XmJtbEntity::getYsbg)));
+//			xmVO.setYsbgList(jtbMapper.selectList(Wrappers.<XmJtbEntity>lambdaQuery().eq(XmJtbEntity::getXmId, xmVO.getId()).isNotNull(XmJtbEntity::getYsbg)));
 			//发明专利
 			xmVO.setFmzlList(cgZlMapper.selectList(Wrappers.<CgZlEntity>lambdaQuery().eq(CgZlEntity::getXmbh, xmVO.getXmbh()).eq(CgZlEntity::getZllx, "发明专利")));
 			//实用新型专利