zhouli 9 months ago
parent
commit
19c66c8325

BIN
doc/xls导入模板/长期待摊费用分配表-导入模板.xlsx


+ 4 - 8
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/entity/XmCqdtfyEntity.java

@@ -2,19 +2,15 @@
 package org.sky.scientific.pojo.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.sky.core.tenant.mp.TenantEntity;
-import org.sky.core.tool.utils.DateUtil;
-import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serial;
 import java.math.BigDecimal;
-import java.util.Date;
 
 /**
  * 长期待摊费用分配表 实体类
@@ -49,10 +45,10 @@ public class XmCqdtfyEntity extends TenantEntity {
 	@Schema(description = "用途")
 	private String yt;
 
-	@Schema(description = "摊销开始日期,格式:202501")
-	@DateTimeFormat(pattern = DateUtil.PATTERN_YYYYMM)
-	@JsonFormat(pattern = DateUtil.PATTERN_YYYYMM)
-	private Date txksrq;
+	@Schema(description = "摊销开始日期,格式:2025-01")
+//	@DateTimeFormat(pattern = DateUtil.PATTERN_YYYYMM)
+//	@JsonFormat(pattern = DateUtil.PATTERN_YYYYMM)
+	private String txksrq;
 
 	@Schema(description = "使用寿命(月)")
 	private Integer sysm;

+ 2 - 4
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/vo/XmVO.java

@@ -1,10 +1,8 @@
 
 package org.sky.scientific.pojo.vo;
 
-import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.sky.scientific.pojo.entity.TechnicianEntity;
 import org.sky.scientific.pojo.entity.XmEntity;
 
 import java.io.Serial;
@@ -21,8 +19,8 @@ public class XmVO extends XmEntity {
 	@Serial
 	private static final long serialVersionUID = 1L;
 
-	@Schema(description = "项目负责人信息")
-	private TechnicianEntity technicianEntity;
+//	@Schema(description = "项目负责人信息")
+//	private TechnicianEntity technicianEntity;
 
 //	@Schema(description = "立项报告")
 //	private List<String> xmlxbgEntityList;

+ 7 - 0
kd-service/kd-scientific/src/main/java/org/sky/scientific/controller/XmController.java

@@ -106,6 +106,13 @@ public class XmController extends KdController {
 		return R.status(service.updateXm(xm));
 	}
 
+	@GetMapping("/approval")
+	@ApiOperationSupport(order = 6)
+	@Operation(summary = "查询立项信息")
+	public R<XmVO> selectApprovalInfo(Long xmId){
+		return R.data(service.selectApprovalInfo(xmId));
+	}
+
 	@GetMapping("/export-xm")
 	@ApiOperationSupport(order = 9)
 	@Operation(summary = "导出数据", description  = "传入xm")

+ 3 - 7
kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/XmCqdtfyExcel.java

@@ -6,15 +6,11 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
-import org.sky.core.tool.utils.DateUtil;
-import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serial;
 import java.io.Serializable;
 import java.math.BigDecimal;
-import java.util.Date;
 
 
 /**
@@ -51,9 +47,9 @@ public class XmCqdtfyExcel implements Serializable {
 	private String yt;
 
 	@ExcelProperty("摊销开始日期")
-	@DateTimeFormat(pattern = DateUtil.PATTERN_YYYYMM)
-	@JsonFormat(pattern = DateUtil.PATTERN_YYYYMM)
-	private Date txksrq;
+//	@DateTimeFormat(pattern = DateUtil.PATTERN_YYYYMM)
+//	@JsonFormat(pattern = DateUtil.PATTERN_YYYYMM)
+	private String txksrq;
 
 	@ExcelProperty("使用寿命")
 	private Integer sysm;

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

@@ -58,7 +58,7 @@
         <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>
-        <if test="ew.txksrqStart != null and ew.txksrqEnd">and DATE_FORMAT(c.txksrq,'%Y-%m-%d')  between #{ew.txksrqStart} and #{ew.txksrqEnd}</if>
+        <if test="ew.txksrqStart != null and ew.txksrqEnd">and c.txksrq between #{ew.txksrqStart} and #{ew.txksrqEnd}</if>
         <if test="ew.ysyysStart != null and ew.ysyysEnd!= null">and c.ysyys between #{ew.ysyysStart} and #{ew.ysyysEnd}</if>
         <if test="ew.zcyzStart != null and ew.zcyzEnd!= null">and c.zcyz between #{ew.zcyzStart} and #{ew.zcyzEnd}</if>
         <if test="ew.yzjeStart != null and ew.yzjeEnd!= null">and c.yzje between #{ew.yzjeStart} and #{ew.yzjeEnd}</if>

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

@@ -84,6 +84,11 @@ public interface XmMapper extends BaseMapper<XmEntity> {
 	 */
 	XmVO selectByXmIdAndDay(Map map);
 
+	/**
+	 * 查询项目信息,结合变更
+	 * @param xmId
+	 * @return
+	 */
 	XmVO selectByXmId(Long xmId);
 
 	Long getXmIdByXmmcOrXmbh(@Param("yearAndMonth") String yearAndMonth,@Param("xmmc") String xmmc, @Param("xmbh") String xmbh);
@@ -98,4 +103,6 @@ public interface XmMapper extends BaseMapper<XmEntity> {
 	List<JSONObject> selectAssistList(IPage<JSONObject> page, @Param("ew") XmDTO xm);
 
 	boolean updateXm(XmUpdateDto dto);
+
+
 }

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

@@ -33,7 +33,7 @@
     </resultMap>
 
     <resultMap id="ResultVoMap" type="org.sky.scientific.pojo.vo.XmVO" extends="ResultMap">
-        <association property="technicianEntity" column="XMFZR" select="org.sky.scientific.mapper.TechnicianMapper.selectById"/>
+<!--        <association property="technicianEntity" column="XMFZR" select="org.sky.scientific.mapper.TechnicianMapper.selectById"/>-->
     </resultMap>
 
     <update id="updateXm" parameterType="org.sky.scientific.pojo.dto.XmUpdateDto">
@@ -167,6 +167,7 @@
         FROM kd_xm xm
         where id = #{xmId}
     </select>
+
     <select id="getXmIdByXmmcOrXmbh" resultType="java.lang.Long">
         SELECT id
         FROM kd_xm xm
@@ -198,4 +199,5 @@
             <if test="ew.xmmc != null and ew.xmmc != ''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
             <if test="ew.xmbh!=null and ew.xmbh!=''">and xm.xmbh like concat('%',#{ew.xmbh},'%')</if>
      </select>
+
 </mapper>

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

@@ -52,7 +52,7 @@
         <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>
         <if test="ew.idCard!=null and ew.idCard!=''">and t.id_card like concat(concat('%', #{ew.idCard}), '%')</if>
-        <if test="ew.personnelType!=null and ew.personnelType!=''">and t.personnel_type =#{personnelType})</if>
+        <if test="ew.personnelType!=null and ew.personnelType!=''">and t.personnel_type =#{personnelType}</if>
     </select>
 
     <update id="batchUpdate" parameterType="java.util.List">

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

@@ -29,7 +29,6 @@
         <foreach item="id" collection="list" separator="," close=")" open="(" index="">
             #{id}
         </foreach>
-        />
     </delete>
 
 

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

@@ -86,4 +86,10 @@ public interface IXmService extends BaseService<XmEntity> {
 	IPage<JSONObject> selectAssistList(IPage<JSONObject> page, XmDTO xm);
 
 
+	/**
+	 * 查询项目立项信息
+	 * @param xmId
+	 * @return
+	 */
+	XmVO selectApprovalInfo(Long xmId);
 }

+ 9 - 8
kd-service/kd-scientific/src/main/java/org/sky/scientific/service/impl/XmServiceImpl.java

@@ -11,10 +11,7 @@ import lombok.AllArgsConstructor;
 import org.sky.core.log.exception.ServiceException;
 import org.sky.core.mp.base.BaseServiceImpl;
 import org.sky.core.secure.utils.SecureUtil;
-import org.sky.core.tool.utils.CollectionUtil;
-import org.sky.core.tool.utils.DateUtil;
-import org.sky.core.tool.utils.Func;
-import org.sky.core.tool.utils.StringUtil;
+import org.sky.core.tool.utils.*;
 import org.sky.scientific.excel.XmExcel;
 import org.sky.scientific.mapper.DepartmentMapper;
 import org.sky.scientific.mapper.TechnicianMapper;
@@ -45,9 +42,6 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 	private final TechnicianMapper technicianMapper;
 	private final DepartmentMapper departmentMapper;
 
-
-
-
 	@Override
 	public IPage<XmEntity> selectXmList(IPage<XmEntity> page, XmDTO xm) {
 		if (StringUtil.isBlank(xm.getYearAndMonth())) {
@@ -104,6 +98,14 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 	}
 
 	@Override
+	public XmVO selectApprovalInfo(Long xmId) {
+		XmEntity xm = baseMapper.selectById(xmId);
+		xm.setXmfzrxm(technicianMapper.getNameById(xm.getXmfzr()));
+		xm.setXmsqdw(departmentMapper.getFullNameById(xm.getXmsqdwid()));
+		return BeanUtil.copyProperties(xm, XmVO.class);
+	}
+
+	@Override
 	public boolean updateXm(XmUpdateDto dto) {
 		return baseMapper.updateXm(dto);
 	}
@@ -169,7 +171,6 @@ public class XmServiceImpl extends BaseServiceImpl<XmMapper, XmEntity> implement
 	}
 
 
-
 	/**
 	 * 判断项目名称是否有效
 	 *