zhouli 10 months ago
parent
commit
8e10d9d08e

+ 1 - 1
kd-service-api/kd-scientific-api/src/main/java/org/sky/scientific/pojo/vo/TechnicianVO.java

@@ -20,7 +20,7 @@ public class TechnicianVO extends TechnicianEntity {
 	@Serial
 	private static final long serialVersionUID = 1L;
 
-	private int serialNumber;
+	private int xh;
 
 	private String genderName;
 

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

@@ -50,7 +50,7 @@
         </foreach>
     </delete>
 
-    <select id="selectTechnicianPage" resultMap="ResultMap"
+    <select id="selectTechnicianPage" resultMap="ResultVoMap"
             parameterType="org.sky.scientific.pojo.dto.TechnicianDTO">
         select *
         from kd_technician
@@ -79,7 +79,7 @@
         order by year_and_month asc, id asc
     </select>
 
-    <select id="selectByYear" resultMap="ResultMap" parameterType="org.sky.scientific.pojo.dto.TechnicianDTO">
+    <select id="selectByYear" resultMap="ResultVoMap" parameterType="org.sky.scientific.pojo.dto.TechnicianDTO">
         select t1.*
         from kd_technician t1
         JOIN

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

@@ -39,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.io.InputStream;
 import java.net.URLEncoder;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * 技术人员花名册 服务实现类
@@ -103,15 +104,15 @@ public class TechnicianServiceImpl extends BaseServiceImpl<TechnicianMapper, Tec
 	@SneakyThrows
 	@Override
 	public void exportTechnician(HttpServletResponse response, TechnicianDTO technician) {
-
-
 		Query query = new Query().setCurrent(1).setSize(Integer.MAX_VALUE);
 		List<TechnicianVO> technicianList = this.selectTechnicianPage(Condition.getPage(query), technician).getRecords();
 		if(CollectionUtil.isEmpty(technicianList)){
 			throw new ServiceException("花名册无数据!");
 		}
+		AtomicInteger i= new AtomicInteger(1);
 		technicianList.forEach(temp -> {
 			temp.setGenderName(DictCache.getValue(DictEnum.SEX, temp.getGender()));
+			temp.setXh(i.getAndIncrement());
 		});
 
 		InputStream templateFileName = this.getClass().getClassLoader().getResourceAsStream("export-template/技术人员花名册.xls");

BIN
kd-service/kd-scientific/src/main/resources/export-template/技术人员花名册.xls