Kaynağa Gözat

培训增加地点

jingyuanchao 1 yıl önce
ebeveyn
işleme
9c3a2c1e3f

+ 10 - 0
project_data/sql/0.1.0/soc/soc.sql

@@ -86,6 +86,16 @@ BEGIN
         ADD COLUMN `sort` int DEFAULT NULL COMMENT '排序号' AFTER `update_by`;
     END IF;
 
+    -- 培训任务表增加地点字段
+    IF NOT EXISTS(SELECT *
+                  FROM information_schema.columns
+                  WHERE table_schema = DATABASE()
+                    AND table_name = 'core_edu_training_task'
+                    AND column_name = 'site') THEN
+        alter table core_edu_training_task
+            add site varchar(225) null comment '地点' after status;
+    END IF;
+
 
 
 

+ 4 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/domain/CoreEduTrainingTask.java

@@ -109,6 +109,10 @@ public class CoreEduTrainingTask extends BaseEntity {
     @ApiModelProperty(value = "状态")
     private Integer status;
 
+    @TableField("site")
+    @ApiModelProperty(value = "地点")
+    private String site;
+
 
     @TableField("content")
     @ApiModelProperty(value = "内容")

+ 2 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/dto/CoreEduTrainingTaskEditDto.java

@@ -61,6 +61,8 @@ public class CoreEduTrainingTaskEditDto {
     private List<CoreEduTrainingTaskToUser> absentList;
 
     private String title;
+    @ApiModelProperty("地点")
+    private String site;
 
     @ApiModelProperty("主持人名称")
     private String hostName;

+ 2 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/vo/CoreEduTrainingTaskDetailVo.java

@@ -100,7 +100,8 @@ public class CoreEduTrainingTaskDetailVo {
     private String pdfUrl;
 
     private Integer status;
-
+    @ApiModelProperty("地点")
+    private String site;
 
     private String statusText;
 

+ 5 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingTaskServiceImpl.java

@@ -158,7 +158,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
 
         }
         if (ObjectUtil.equal(1, request.getIsAppSelect())) {
-            request.setCheckSub(true);
+            request.setCheckSub(false);
         }
         //App 默认下穿
         if (Boolean.TRUE.equals(request.getCheckSub())) {
@@ -332,6 +332,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
             coreEduTrainingTask.setOrgName(sysOrg.getShortName());
             coreEduTrainingTask.setOrgPath(sysOrg.getPath());
             coreEduTrainingTask.setTitle(request.getTitle());
+            coreEduTrainingTask.setSite(request.getSite());
             coreEduTrainingTask.setStartDate(DateUtil.beginOfDay(new Date()));
             // 临时添加的任务 特殊把任务的开始结束时间设置为当前时间的一周,否则待办查询不到
             Long endTime = coreEduTrainingTask.getStartDate().getTime();
@@ -352,6 +353,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         coreEduTrainingTask.setTrainingEndDateTime(request.getTrainingEndDateTime());
         coreEduTrainingTask.setContent(request.getContent());
         coreEduTrainingTask.setNote(request.getNote());
+        coreEduTrainingTask.setSite(request.getSite());
         coreEduTrainingTask.setRecorderId(SecurityUtils.getUserId());
         coreEduTrainingTask.setImageList(request.getImageList());
         if (ObjectUtil.isNotEmpty(request.getFileList())) {
@@ -873,6 +875,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         String startTime = DateUtil.format(task.getTrainingStartDateTime(), "yyyy年MM月dd日HH时mm分");
         String endTime = DateUtil.format(task.getTrainingEndDateTime(), "yyyy年MM月dd日HH时mm分");
         String address = task.getOrgName();
+        String site = task.getSite();
         String hostName = task.getHostName() == null ? StringUtil.EMPTY_STRING : task.getHostName();
         String recorderName = task.getRecorderName() == null ? StringUtil.EMPTY_STRING : task.getRecorderName();
         String content = task.getContent();
@@ -881,6 +884,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         String staticsPath = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.getStaticPathPrefix(), ErrorMsgConstants.QUERY_FILE_PATH_ERROR).getData();
         data.put("time", startTime + " - " + endTime);
         data.put("address", StringUtils.isNotEmpty(address) ? address : StringUtil.EMPTY_STRING);
+        data.put("site", StringUtils.isNotEmpty(site) ? site : StringUtil.EMPTY_STRING);
         data.put("hostName", StringUtils.isNotEmpty(hostName) ? hostName : StringUtil.EMPTY_STRING);
         data.put("recorderName", StringUtils.isNotEmpty(recorderName) ? recorderName : StringUtil.EMPTY_STRING);
         data.put("content", StringUtils.isNotEmpty(content) ? content : StringUtil.EMPTY_STRING);

+ 9 - 7
soc-modules/soc-modules-core/src/main/resources/mapper/edu/CoreEduTrainingTaskMapper.xml

@@ -13,6 +13,7 @@
         <result property="title" column="title"/>
         <result property="type" column="type"/>
         <result property="status" column="status"/>
+        <result property="site" column="site"/>
         <result property="content" column="content"/>
         <result property="note" column="note"/>
         <result property="hostId" column="host_id"/>
@@ -117,20 +118,21 @@
                t.org_name,
                t.content,
                t.note,
+               t.site,
                title,
                type,
-               start_date  as startDate,
-               end_date    as endDate,
+               start_date                  as startDate,
+               end_date                    as endDate,
                training_start_date_time,
                training_end_date_time,
                image_list,
                t.host_id,
                t.recorder_id,
-               ifnull(t.host_name,u.name)      as hostName,
-               u2.name     as recorderName,
-               t.pdf_url   as pdfUrl,
-               t.file_list as file,
-               t.status    as status
+               ifnull(t.host_name, u.name) as hostName,
+               u2.name                     as recorderName,
+               t.pdf_url                   as pdfUrl,
+               t.file_list                 as file,
+               t.status                    as status
         from core_edu_training_task t
                  left join sys_user u on u.id = t.host_id
                  left join sys_user u2 on u2.id = t.recorder_id

+ 6 - 3
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -185,15 +185,18 @@ public class PdfUtil {
     public static void dealEduBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
         //第一行
         createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 1, 1);
-        createPDFCell(tableFont, table, data.get("time").toString(), Element.ALIGN_LEFT, 5, 1);
-        createPDFCell(tableFont, table, "地点", Element.ALIGN_MIDDLE, 1, 1);
-        createPDFCell(tableFont, table, data.get("address").toString(), Element.ALIGN_MIDDLE, 5, 1);
+        createPDFCell(tableFont, table, data.get("time").toString(), Element.ALIGN_LEFT, 2, 1);
+        createPDFCell(tableFont, table, "单位名称", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("address").toString(), Element.ALIGN_MIDDLE, 2, 1);
         //第二行
         createPDFCell(tableFont, table, "主持人", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_MIDDLE, 2, 1);
         createPDFCell(tableFont, table, "记录人", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_MIDDLE, 2, 1);
 
+        createPDFCell(tableFont, table, "地点", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("site").toString(), Element.ALIGN_LEFT, 5, 1);
+
         //内容
         createPDFCell(tableFont, table, "内容", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("content").toString(), Element.ALIGN_LEFT, 5, 1);