ly %!s(int64=2) %!d(string=hai) anos
pai
achega
aae0ccfd36

+ 8 - 3
master/src/main/java/com/ruoyi/project/training/controller/TTrainingHisparticipantsController.java

@@ -19,6 +19,7 @@ import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.training.domain.TTrainingCompanylevel;
 import com.ruoyi.project.training.mapper.TTrainingCompanylevelMapper;
+import com.ruoyi.project.training.mapper.TTrainingHisparticipantsMapper;
 import com.ruoyi.project.training.service.ITTrainingCompanylevelService;
 import org.apache.poi.ss.usermodel.*;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -47,7 +48,8 @@ import javax.annotation.Resource;
 public class TTrainingHisparticipantsController extends BaseController {
     @Autowired
     private ITTrainingHisparticipantsService tTrainingHisparticipantsService;
-
+    @Resource
+    private TTrainingHisparticipantsMapper tTrainingHisparticipantsMapper;
     @Autowired
     private ISysDeptService iSysDeptService;
     @Autowired
@@ -164,6 +166,7 @@ public class TTrainingHisparticipantsController extends BaseController {
                                 entity.setEndDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
                             }
                         } else if (j == 7) {
+                            entity.setCourseCode(cellValue.trim());
                             for (TTrainingCompanylevel t : levelList
                             ) {
                                 if (t.getCourseCode().equals(cellValue.trim())) {
@@ -171,7 +174,7 @@ public class TTrainingHisparticipantsController extends BaseController {
                                 }
                             }
                         } else if (j == 8) {
-
+                            entity.setItem(cellValue);
                         } else if (j == 9) {
                             if (cellValue != "") {
                                 entity.setScore(Double.parseDouble(cellValue.trim()));
@@ -221,7 +224,7 @@ public class TTrainingHisparticipantsController extends BaseController {
                 executorService.execute(() -> {
                 //续票列表 -- 业务模块
                 try {
-                    tTrainingHisparticipantsService.insertTTrainingHisparticipants(t);
+                    tTrainingHisparticipantsMapper.insertTTrainingHisparticipants(t);
                     successNumber.getAndIncrement();
                 } catch (Exception e) {
                     logger.error(JSON.toJSONString(e));
@@ -238,6 +241,8 @@ public class TTrainingHisparticipantsController extends BaseController {
             e.printStackTrace();
         }
         executorService.shutdown();
+        //去重
+        tTrainingHisparticipantsMapper.duplicateHiParticipants();
         logger.info("list:" + list.size());
         logger.info("successNumber:" + String.valueOf(successNumber));
         logger.info("failNumber:" + String.valueOf(failNumber.get()));

+ 24 - 0
master/src/main/java/com/ruoyi/project/training/domain/TTrainingHisparticipants.java

@@ -28,6 +28,14 @@ public class TTrainingHisparticipants extends BaseEntity
     @Excel(name = "公司级培训ID")
     private Long companyId;
 
+    /** 课程代码 */
+    @Excel(name = "课程代码")
+    private String courseCode;
+
+    /** 课程名称 */
+    @Excel(name = "课程名称")
+    private String item;
+
     /** 开始日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     @Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
@@ -239,6 +247,22 @@ public class TTrainingHisparticipants extends BaseEntity
         return updatedate;
     }
 
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getItem() {
+        return item;
+    }
+
+    public void setItem(String item) {
+        this.item = item;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 10 - 8
master/src/main/java/com/ruoyi/project/training/mapper/TTrainingHisparticipantsMapper.java

@@ -6,15 +6,15 @@ import com.ruoyi.project.training.domain.TTrainingHisparticipants;
 
 /**
  * 人员-公司级培训历史Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2021-05-31
  */
-public interface TTrainingHisparticipantsMapper 
+public interface TTrainingHisparticipantsMapper
 {
     /**
      * 查询人员-公司级培训历史
-     * 
+     *
      * @param id 人员-公司级培训历史ID
      * @return 人员-公司级培训历史
      */
@@ -22,7 +22,7 @@ public interface TTrainingHisparticipantsMapper
 
     /**
      * 查询人员-公司级培训历史列表
-     * 
+     *
      * @param tTrainingHisparticipants 人员-公司级培训历史
      * @return 人员-公司级培训历史集合
      */
@@ -33,7 +33,7 @@ public interface TTrainingHisparticipantsMapper
 
     /**
      * 新增人员-公司级培训历史
-     * 
+     *
      * @param tTrainingHisparticipants 人员-公司级培训历史
      * @return 结果
      */
@@ -41,7 +41,7 @@ public interface TTrainingHisparticipantsMapper
 
     /**
      * 修改人员-公司级培训历史
-     * 
+     *
      * @param tTrainingHisparticipants 人员-公司级培训历史
      * @return 结果
      */
@@ -49,7 +49,7 @@ public interface TTrainingHisparticipantsMapper
 
     /**
      * 删除人员-公司级培训历史
-     * 
+     *
      * @param id 人员-公司级培训历史ID
      * @return 结果
      */
@@ -57,9 +57,11 @@ public interface TTrainingHisparticipantsMapper
 
     /**
      * 批量删除人员-公司级培训历史
-     * 
+     *
      * @param ids 需要删除的数据ID
      * @return 结果
      */
     public int deleteTTrainingHisparticipantsByIds(Long[] ids);
+
+    void duplicateHiParticipants();
 }

+ 3 - 1
master/src/main/java/com/ruoyi/project/training/service/impl/TTrainingHisparticipantsServiceImpl.java

@@ -7,6 +7,8 @@ import com.ruoyi.project.training.mapper.TTrainingHisparticipantsMapper;
 import com.ruoyi.project.training.domain.TTrainingHisparticipants;
 import com.ruoyi.project.training.service.ITTrainingHisparticipantsService;
 
+import javax.annotation.Resource;
+
 /**
  * 人员-公司级培训历史Service业务层处理
  *
@@ -16,7 +18,7 @@ import com.ruoyi.project.training.service.ITTrainingHisparticipantsService;
 @Service
 public class TTrainingHisparticipantsServiceImpl implements ITTrainingHisparticipantsService
 {
-    @Autowired
+    @Resource
     private TTrainingHisparticipantsMapper tTrainingHisparticipantsMapper;
 
     /**

+ 25 - 7
master/src/main/resources/mybatis/training/TTrainingHisparticipantsMapper.xml

@@ -3,11 +3,13 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.training.mapper.TTrainingHisparticipantsMapper">
-    
+
     <resultMap type="TTrainingHisparticipants" id="TTrainingHisparticipantsResult">
         <result property="id"    column="id"    />
         <result property="staffId"    column="staff_id"    />
         <result property="companyId"    column="company_id"    />
+        <result property="courseCode"    column="course_code"    />
+        <result property="item"    column="item"    />
         <result property="startDate"    column="start_date"    />
         <result property="endDate"    column="end_date"    />
         <result property="score"    column="score"    />
@@ -26,13 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTTrainingHisparticipantsVo">
-        select d.id, d.staff_id, d.company_id, d.start_date, d.end_date, d.score, d.operation_score, d.training_place, d.training_duration, d.training_cost, d.budget, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate ,s.dept_name from t_training_hisparticipants d
+        select d.id, d.staff_id, d.company_id,d.course_code, d.item,  d.start_date, d.end_date, d.score, d.operation_score, d.training_place, d.training_duration, d.training_cost, d.budget, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate ,s.dept_name from t_training_hisparticipants d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
     <select id="selectTTrainingHisparticipantsList" parameterType="TTrainingHisparticipants" resultMap="TTrainingHisparticipantsResult">
         <include refid="selectTTrainingHisparticipantsVo"/>
-        <where>  
+        <where>
             <if test="staffId != null "> and staff_id = #{staffId}</if>
             <if test="companyId != null "> and company_id = #{companyId}</if>
             <if test="startDate != null "> and start_date = #{startDate}</if>
@@ -76,12 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
             order by start_date
     </select>
-    
+
     <select id="selectTTrainingHisparticipantsById" parameterType="Long" resultMap="TTrainingHisparticipantsResult">
         <include refid="selectTTrainingHisparticipantsVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertTTrainingHisparticipants" parameterType="TTrainingHisparticipants">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_training_hisparticipants.NEXTVAL as id FROM DUAL
@@ -105,6 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">createdate,</if>
             <if test="updaterCode != null">updater_code,</if>
             <if test="updatedate != null">updatedate,</if>
+            <if test="courseCode != null">course_code,</if>
+            <if test="item != null">item,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -124,6 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">#{createdate},</if>
             <if test="updaterCode != null">#{updaterCode},</if>
             <if test="updatedate != null">#{updatedate},</if>
+            <if test="courseCode != null">#{courseCode},</if>
+            <if test="item != null">#{item},</if>
          </trim>
     </insert>
 
@@ -146,6 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">createdate = #{createdate},</if>
             <if test="updaterCode != null">updater_code = #{updaterCode},</if>
             <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="courseCode != null">course_code = #{courseCode},</if>
+            <if test="item != null">item = #{item},</if>
         </trim>
         where id = #{id}
     </update>
@@ -160,5 +168,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-    
-</mapper>
+
+    <delete id="duplicateHiParticipants">
+        DELETE
+        FROM T_TRAINING_HISPARTICIPANTS
+        where rowid !=( select max(rowid)
+        from T_TRAINING_HISPARTICIPANTS b
+        where b.STAFF_ID = T_TRAINING_HISPARTICIPANTS.STAFF_ID
+				and b.COURSE_CODE = T_TRAINING_HISPARTICIPANTS.COURSE_CODE
+				and b.START_DATE = T_TRAINING_HISPARTICIPANTS.START_DATE
+        )
+    </delete>
+</mapper>

+ 1 - 1
ui/src/views/invoice/bookingworkticket/index.vue

@@ -220,7 +220,7 @@
       <el-table-column label="续票预约" fixed="right" align="center" width="90">
         <template slot-scope="scope">
           <el-button
-            v-if="scope.row.bookingworkticket.status== 3 && scope.row.whgzxkzh"
+            v-if="scope.row.bookingworkticket.status== 3 && scope.row.whgzxkzh && !scope.row.dhzyxkzh && !scope.row.gczyxkzh && !scope.row.mbzyxkzh && !scope.row.xzkjxkzh"
             size="mini"
             type="text"
             @click="handleXp(scope.row)"