Преглед на файлове

Merge remote-tracking branch 'origin/dev_v1.0.0' into dev_v1.0.0

wangliang преди 1 година
родител
ревизия
46021c7617

+ 13 - 8
sop-business/src/main/java/com/qmth/sop/business/service/impl/SysNoticeServiceImpl.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.sop.business.bean.result.SysNoticeResult;
-import com.qmth.sop.business.entity.SysMessage;
 import com.qmth.sop.business.entity.SysNotice;
 import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.mapper.SysNoticeMapper;
@@ -21,8 +20,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
@@ -40,6 +37,7 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
 
     @Resource
     SysMessageService sysMessageService;
+
     /**
      * 查询列表
      *
@@ -48,7 +46,7 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
      */
     @Override
     public IPage<SysNoticeResult> query(IPage<Map> iPage, String query, NoticeStatusEnum status, NoticeTypeEnum type, Long startTime, Long endTime) {
-        return this.baseMapper.query(iPage,query, Objects.nonNull(status) ? status.name() : null, Objects.nonNull(type) ? type.name() : null, startTime, endTime);
+        return this.baseMapper.query(iPage, query, Objects.nonNull(status) ? status.name() : null, Objects.nonNull(type) ? type.name() : null, startTime, endTime);
     }
 
 
@@ -62,14 +60,21 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
     public Boolean saveSysNotice(SysNotice sysNotice) {
         try {
             sysNotice.setEnable(true);
-            sysNotice.setStatus(NoticeStatusEnum.UN_PUBLISH);
+            //sysNotice.setStatus(NoticeStatusEnum.UN_PUBLISH);
             SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
             if (Objects.isNull(sysNotice.getId())) {// 新增
                 sysNotice.insertInfo(sysUser.getId());
             } else { // 修改
                 sysNotice.updateInfo(sysUser.getId());
             }
-            return saveOrUpdate(sysNotice);
+            if (NoticeStatusEnum.PUBLISH == sysNotice.getStatus()) {
+                sysNotice.setEnable(true);
+                sysNotice.setStatus(NoticeStatusEnum.PUBLISH);
+                sysNotice.setPublishTime(System.currentTimeMillis());
+                //需调发布插入表SysMessage
+                sysMessageService.publishByNotice(sysNotice);
+            }
+            this.saveOrUpdate(sysNotice);
         } catch (Exception e) {
             if (e instanceof DuplicateKeyException) {
                 String errorColumn = e.getCause().toString();
@@ -103,7 +108,7 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
         for (long id : ids) {
             SysNotice sysNotice = this.getById(id);
             sysNotice.setEnable(false);
-            if(NoticeStatusEnum.PUBLISH == sysNotice.getStatus()) {
+            if (NoticeStatusEnum.PUBLISH == sysNotice.getStatus()) {
                 sysNotice.setStatus(NoticeStatusEnum.UN_PUBLISH);
                 // 需调用撤销发布SysMessage
                 sysMessageService.deleteByNoticeId(id);
@@ -123,7 +128,7 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
             sysNotice.setStatus(NoticeStatusEnum.UN_PUBLISH);
             // 需调用撤销发布删除SysMessage
             sysMessageService.deleteByNoticeId(id);
-        }else {
+        } else {
             sysNotice.setEnable(true);
             sysNotice.setStatus(NoticeStatusEnum.PUBLISH);
             sysNotice.setPublishTime(System.currentTimeMillis());

+ 10 - 0
sop-business/src/main/resources/db/log/shudonghui_update_log.sql

@@ -171,3 +171,13 @@ ALTER TABLE `t_b_ding`
 -------------------------------
 ALTER TABLE `sys_device`
     CHANGE COLUMN `supplier` `supplier_id` bigint NULL DEFAULT NULL COMMENT '供应商id' AFTER `buy_time`;
+-------------------------------
+---2023.8.14 考勤统计
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1026, '工时统计', '/api/admin/tb/ding/count', 'URL', 29, 1, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1027, '工时统计', '/api/admin/tb/ding/export', 'URL', 29, 1, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (1028, '工时统计', '/api/admin/tb/ding/query', 'URL', 29, 1, 'AUTH', NULL, 1, 1, 0);
+
+UPDATE `sys_privilege` SET `name` = '工时统计', `url` = 'hourSubmit', `type` = 'MENU', `parent_id` = 25, `sequence` = 4, `property` = NULL, `related` = NULL, `enable` = 1, `default_auth` = 0, `front_display` = 1 WHERE `id` = 29;
+UPDATE `sys_privilege` SET `name` = '导出', `url` = 'Export', `type` = 'BUTTON', `parent_id` = 29, `sequence` = 1, `property` = 'AUTH', `related` = '1027', `enable` = 1, `default_auth` = 0, `front_display` = 1 WHERE `id` = 149;
+UPDATE `sys_privilege` SET `name` = '查询', `url` = 'Select', `type` = 'BUTTON', `parent_id` = 29, `sequence` = 2, `property` = 'AUTH', `related` = '1026, 1028', `enable` = 1, `default_auth` = 0, `front_display` = 1 WHERE `id` = 151;
+-------------------------------

+ 1 - 0
sop-business/src/main/resources/mapper/SysNoticeMapper.xml

@@ -6,6 +6,7 @@
         select a.*,su.real_name as createName from sys_notice a
         left join sys_user su on su.id = a.create_id
         <where>
+            and a.enable = 1
             <if test="query != null and query != ''">
                 and a.content like concat('%', #{query} , '%')
             </if>

+ 1 - 1
sop-server/src/main/java/com/qmth/sop/server/api/SysSupplierController.java

@@ -90,7 +90,7 @@ public class SysSupplierController {
     @ApiResponses({@ApiResponse(code = 200, message = "供应商表信息", response = SysSupplier.class)})
     public Result list(@ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Boolean enable,
                        @ApiParam(value = "类型", required = false) @RequestParam(required = false) SupplierTypeEnum type) {
-        return ResultUtil.ok(sysSupplierService.list(new QueryWrapper<SysSupplier>().lambda().eq(Objects.nonNull(enable),SysSupplier::getEnable, enable).eq(Objects.nonNull(enable),SysSupplier::getType, type)));
+        return ResultUtil.ok(sysSupplierService.list(new QueryWrapper<SysSupplier>().lambda().eq(Objects.nonNull(enable),SysSupplier::getEnable, enable).eq(Objects.nonNull(type),SysSupplier::getType, type)));
     }
 
     /**