Ver Fonte

文书档案

luojun há 1 ano atrás
pai
commit
082ce0b392

+ 20 - 0
project_data/sql/0.0.3/soc/soc.sql

@@ -1449,6 +1449,26 @@ IF NOT EXISTS(SELECT *
         ADD COLUMN `join_names` varchar(255) NULL COMMENT '参与人员';
 
 END IF;
+-- 安全责任书
+IF NOT EXISTS(SELECT *
+              FROM information_schema.columns
+              WHERE table_schema = DATABASE()
+                AND table_name = 'core_safety_book_aqbwbndjh'
+                AND column_name = 'type') THEN
+    ALTER TABLE `core_safety_book_aqbwbndjh`
+        ADD COLUMN `type` varchar(255) NULL COMMENT '文件种类';
+
+END IF;
+-- 安全责任书
+IF NOT EXISTS(SELECT *
+              FROM information_schema.columns
+              WHERE table_schema = DATABASE()
+                AND table_name = 'core_safety_book_aqbwbndjh'
+                AND column_name = 'year') THEN
+    ALTER TABLE `core_safety_book_aqbwbndjh`
+        ADD COLUMN `year` int NULL COMMENT '工作年度';
+
+END IF;
 
 END ??
 DELIMITER;

+ 7 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetybook/domain/CoreSafetyBookAqbwbndjh.java

@@ -16,6 +16,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import com.xunmei.common.core.web.domain.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * 安全保卫部年度计划对象 core_safety_book_aqbwbndjh
@@ -35,7 +36,9 @@ public class CoreSafetyBookAqbwbndjh extends BaseEntity {
      * $column.columnComment
      */
     private Long id;
-
+    @TableField(exist = false)
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private List<Date> range;
     /**
      * 工作主题
      */
@@ -48,7 +51,7 @@ public class CoreSafetyBookAqbwbndjh extends BaseEntity {
     /**
      * 开会日期
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @ApiModelProperty(value = "记录日期")
     private Date date;
 
@@ -69,6 +72,8 @@ public class CoreSafetyBookAqbwbndjh extends BaseEntity {
      */
     @ApiModelProperty(value = "机构id")
     private Long orgId;
+    private String type;
+    private Long year;
     @TableField(exist = false)
     private String userNames;
     @TableField(exist = false)

+ 3 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetybook/domain/CoreSafetyBookHsggbsdj.java

@@ -35,7 +35,8 @@ public class CoreSafetyBookHsggbsdj extends BaseEntity {
      * $column.columnComment
      */
     private Long id;
-
+    @TableField(exist = false)
+    private List<Date> range;
     /**
      * 工作主题
      */
@@ -69,6 +70,7 @@ public class CoreSafetyBookHsggbsdj extends BaseEntity {
     private String joinNames;
     @TableField(exist = false)
     private List<Long> userIds;
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 9 - 9
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetybook/service/impl/CoreSafetyBookAqbwbndjhServiceImpl.java

@@ -97,10 +97,10 @@ public class CoreSafetyBookAqbwbndjhServiceImpl extends ServiceImpl<CoreSafetyBo
         coreSafetyBookAqbwbndjh.setCreateTime(DateUtils.getNowDate());
         coreSafetyBookAqbwbndjh.setCreateBy(SecurityUtils.getUserId().toString());
         coreSafetyBookAqbwbndjhMapper.insert(coreSafetyBookAqbwbndjh);
-        for (Long id :
-                coreSafetyBookAqbwbndjh.getUserIds()) {
-            coreSafetyBookAqbwbndjhUserMapper.insert(new CoreSafetyBookAqbwbndjhUser(coreSafetyBookAqbwbndjh.getId(), id));
-        }
+//        for (Long id :
+//                coreSafetyBookAqbwbndjh.getUserIds()) {
+//            coreSafetyBookAqbwbndjhUserMapper.insert(new CoreSafetyBookAqbwbndjhUser(coreSafetyBookAqbwbndjh.getId(), id));
+//        }
         return 1;
     }
 
@@ -114,11 +114,11 @@ public class CoreSafetyBookAqbwbndjhServiceImpl extends ServiceImpl<CoreSafetyBo
     public int updateCoreSafetyBookAqbwbndjh(CoreSafetyBookAqbwbndjh coreSafetyBookAqbwbndjh) {
         coreSafetyBookAqbwbndjh.setUpdateTime(DateUtils.getNowDate());
         coreSafetyBookAqbwbndjh.setUpdateBy(SecurityUtils.getUserId().toString());
-        coreSafetyBookAqbwbndjhUserMapper.delete(new LambdaQueryWrapper<CoreSafetyBookAqbwbndjhUser>().eq(CoreSafetyBookAqbwbndjhUser::getAqbwbndjhId, coreSafetyBookAqbwbndjh.getId()));
-        for (Long id :
-                coreSafetyBookAqbwbndjh.getUserIds()) {
-            coreSafetyBookAqbwbndjhUserMapper.insert(new CoreSafetyBookAqbwbndjhUser(coreSafetyBookAqbwbndjh.getId(), id));
-        }
+//        coreSafetyBookAqbwbndjhUserMapper.delete(new LambdaQueryWrapper<CoreSafetyBookAqbwbndjhUser>().eq(CoreSafetyBookAqbwbndjhUser::getAqbwbndjhId, coreSafetyBookAqbwbndjh.getId()));
+//        for (Long id :
+//                coreSafetyBookAqbwbndjh.getUserIds()) {
+//            coreSafetyBookAqbwbndjhUserMapper.insert(new CoreSafetyBookAqbwbndjhUser(coreSafetyBookAqbwbndjh.getId(), id));
+//        }
         return coreSafetyBookAqbwbndjhMapper.updateById(coreSafetyBookAqbwbndjh);
     }
 

+ 14 - 3
soc-modules/soc-modules-core/src/main/resources/mapper/safetybook/CoreSafetyBookAqbwbndjhMapper.xml

@@ -70,6 +70,8 @@
         a.update_by,
         a.images,
         a.org_id,
+        a.type,
+        a.year,
         u2.name as userName,
         o.name as orgName,
         group_concat(u.name) as userNames
@@ -80,10 +82,15 @@
         left join sys_org o on o.id=a.org_id
         <where>
 
-            <if test="aq.date != null ">
-                and a.date = #{aq.date}
+            <if test="aq.year != null ">
+                and a.year = #{aq.year}
+            </if>
+            <if test="aq.orgId != null ">
+                and a.org_id = #{aq.orgId}
+            </if>
+            <if test="aq.range.size >1">
+                and  a.date <![CDATA[>=]]>  #{aq.range[0]} and a.date  <![CDATA[<=]]> #{aq.range[1]}
             </if>
-
 
         </where>
         group by a.id,a.create_time
@@ -100,10 +107,14 @@
                a.update_by,
                a.images,
                a.org_id,
+               a.type,
+               a.year,
+               o.name as org_name,
                group_concat(u.name) as userNames
         from core_safety_book_aqbwbndjh a
                  left join core_safety_book_aqbwbndjh_user au on au.aqbwbndjh_id = a.id
                  left join sys_user u on u.id = au.user_id
+        left join sys_org o on o.id = a.org_id
         where a.id = #{id}
         group by a.id
 

+ 5 - 3
soc-modules/soc-modules-core/src/main/resources/mapper/safetybook/CoreSafetyBookHsggbsdjMapper.xml

@@ -78,10 +78,12 @@
             <if test="hs.title != null  and hs.title != ''">
                 and h.title like concat(concat('%', #{hs.title}),'%')
             </if>
-            <if test="hs.date != null ">
-                and date = #{hs.date}
+            <if test="hs.orgId != null ">
+                and h.org_id = #{hs.orgId}
+            </if>
+            <if test="hs.range.size >1">
+                and  h.date <![CDATA[>=]]>  #{hs.range[0]} and h.date  <![CDATA[<=]]> #{hs.range[1]}
             </if>
-
         </where>
         GROUP BY
         h.id