Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-system
This commit is contained in:
commit
254c983fdf
@ -1,12 +1,18 @@
|
|||||||
package cn.iocoder.yudao.module.archives.controller.admin;
|
package cn.iocoder.yudao.module.archives.controller.admin;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||||
import cn.iocoder.yudao.module.archives.service.ArchivesService;
|
import cn.iocoder.yudao.module.archives.service.ArchivesService;
|
||||||
|
import cn.iocoder.yudao.module.archives.vo.ArchivesReqVO;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 档案表 控制层
|
* 档案表 控制层
|
||||||
* @author 小李
|
* @author 小李
|
||||||
@ -19,4 +25,47 @@ public class ArchivesController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ArchivesService archivesService;
|
private ArchivesService archivesService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增或修改 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 10:42 2024/8/29
|
||||||
|
* @param archivesReqVO 请求对象
|
||||||
|
**/
|
||||||
|
@PostMapping("/update")
|
||||||
|
@Operation(summary = "新增/修改企业管理-档案表")
|
||||||
|
public CommonResult updateArchives(@RequestBody ArchivesReqVO archivesReqVO){
|
||||||
|
archivesService.updateArchives(archivesReqVO);
|
||||||
|
return CommonResult.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:08 2024/8/29
|
||||||
|
* @param archivesReqVO 查询条件
|
||||||
|
* @param pageNo 页码
|
||||||
|
* @param pageSize 条数
|
||||||
|
**/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@Operation(summary = "分页查企业管理-档案表")
|
||||||
|
public CommonResult queryArchivesPage(ArchivesReqVO archivesReqVO,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
|
||||||
|
Page<Archives> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(archivesService.queryArchivesPage(archivesReqVO, page));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 14:14 2024/8/29
|
||||||
|
* @param id 记录ID
|
||||||
|
**/
|
||||||
|
@DeleteMapping("/remove/{id}")
|
||||||
|
@Operation(summary = "删除企业管理-档案表")
|
||||||
|
public CommonResult removeArchivesById(@PathVariable String id){
|
||||||
|
archivesService.removeArchivesById(id);
|
||||||
|
return CommonResult.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,4 +74,7 @@ public class Archives extends TenantBaseDO {
|
|||||||
* 部门id(system_dept表中的id)
|
* 部门id(system_dept表中的id)
|
||||||
*/
|
*/
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
private String remark;
|
||||||
}
|
}
|
@ -53,6 +53,11 @@ public class ArchivesRole extends TenantBaseDO {
|
|||||||
*/
|
*/
|
||||||
private String deleteRoleIds;
|
private String deleteRoleIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色ID(system_role的ID,用于分辨用户是否有权限下载)
|
||||||
|
*/
|
||||||
|
private String downloadRoleIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门id
|
* 部门id
|
||||||
*/
|
*/
|
||||||
@ -73,4 +78,8 @@ public class ArchivesRole extends TenantBaseDO {
|
|||||||
/** 用户是否可以删除档案 */
|
/** 用户是否可以删除档案 */
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Boolean isDeleted;
|
private Boolean isDeleted;
|
||||||
|
|
||||||
|
/** 用户是否可以下载档案 */
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean isDownload;
|
||||||
}
|
}
|
@ -1,8 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.archives.mapper;
|
package cn.iocoder.yudao.module.archives.mapper;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||||
|
import cn.iocoder.yudao.module.archives.vo.ArchivesReqVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对表【company_archives(档案表)】的数据库操作Mapper
|
* 针对表【company_archives(档案表)】的数据库操作Mapper
|
||||||
@ -11,4 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
**/
|
**/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ArchivesMapper extends BaseMapper<Archives> {
|
public interface ArchivesMapper extends BaseMapper<Archives> {
|
||||||
|
|
||||||
|
IPage<Archives> queryArchivesPage(@Param("map") ArchivesReqVO archivesReqVO, Page<Archives> page);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package cn.iocoder.yudao.module.archives.service;
|
package cn.iocoder.yudao.module.archives.service;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||||
|
import cn.iocoder.yudao.module.archives.vo.ArchivesReqVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9,4 +12,28 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
* @date 20:13 2024/8/28
|
* @date 20:13 2024/8/28
|
||||||
**/
|
**/
|
||||||
public interface ArchivesService extends IService<Archives> {
|
public interface ArchivesService extends IService<Archives> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增或修改 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 10:42 2024/8/29
|
||||||
|
* @param archivesReqVO 请求对象
|
||||||
|
**/
|
||||||
|
void updateArchives(ArchivesReqVO archivesReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:08 2024/8/29
|
||||||
|
* @param archivesReqVO 查询条件
|
||||||
|
**/
|
||||||
|
IPage<Archives> queryArchivesPage(ArchivesReqVO archivesReqVO, Page<Archives> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 14:14 2024/8/29
|
||||||
|
* @param id 记录ID
|
||||||
|
**/
|
||||||
|
void removeArchivesById(String id);
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,8 @@ public class ArchivesRoleServiceImpl extends ServiceImpl<ArchivesRoleMapper, Arc
|
|||||||
item.setIsDeleted(checkPermission(item.getDeleteRoleIds(), roleIds));
|
item.setIsDeleted(checkPermission(item.getDeleteRoleIds(), roleIds));
|
||||||
// 修改权限
|
// 修改权限
|
||||||
item.setIsUpdated(checkPermission(item.getUpdateRoleIds(), roleIds));
|
item.setIsUpdated(checkPermission(item.getUpdateRoleIds(), roleIds));
|
||||||
|
// 下载权限
|
||||||
|
item.setIsDownload(checkPermission(item.getDownloadRoleIds(), roleIds));
|
||||||
});
|
});
|
||||||
|
|
||||||
// dictLabel赋值
|
// dictLabel赋值
|
||||||
|
@ -1,11 +1,21 @@
|
|||||||
package cn.iocoder.yudao.module.archives.service.impl;
|
package cn.iocoder.yudao.module.archives.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||||
import cn.iocoder.yudao.module.archives.mapper.ArchivesMapper;
|
import cn.iocoder.yudao.module.archives.mapper.ArchivesMapper;
|
||||||
import cn.iocoder.yudao.module.archives.service.ArchivesService;
|
import cn.iocoder.yudao.module.archives.service.ArchivesService;
|
||||||
|
import cn.iocoder.yudao.module.archives.vo.ArchivesReqVO;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 档案表 服务实现类
|
* 档案表 服务实现类
|
||||||
* @author 小李
|
* @author 小李
|
||||||
@ -13,4 +23,58 @@ import org.springframework.stereotype.Service;
|
|||||||
**/
|
**/
|
||||||
@Service
|
@Service
|
||||||
public class ArchivesServiceImpl extends ServiceImpl<ArchivesMapper, Archives> implements ArchivesService {
|
public class ArchivesServiceImpl extends ServiceImpl<ArchivesMapper, Archives> implements ArchivesService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增或修改 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 10:42 2024/8/29
|
||||||
|
* @param archivesReqVO 请求对象
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void updateArchives(ArchivesReqVO archivesReqVO){
|
||||||
|
// 新增
|
||||||
|
if (ObjectUtil.isEmpty(archivesReqVO.getId())){
|
||||||
|
// 判断档案名是否重复
|
||||||
|
List<Archives> archives = baseMapper.selectList(new LambdaQueryWrapper<Archives>().eq(Archives::getArchivesCode, archivesReqVO.getArchivesCode()));
|
||||||
|
if (CollectionUtil.isNotEmpty(archives)){
|
||||||
|
throw exception0(500, "档案名重复");
|
||||||
|
}
|
||||||
|
baseMapper.insert(archivesReqVO);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
// 判断档案名是否合法
|
||||||
|
// 如果有,判断id是否一致,不一致就是重复,其他情况皆可执行
|
||||||
|
List<Archives> archives = baseMapper.selectList(new LambdaQueryWrapper<Archives>().eq(Archives::getArchivesCode, archivesReqVO.getArchivesCode()));
|
||||||
|
// 用&&短路的特性去判断,少写点代码
|
||||||
|
// get 0有些不合理,理论上讲是不会有多条的,概率小,改一下名字就行
|
||||||
|
Boolean flag = CollectionUtil.isNotEmpty(archives) && !archives.get(0).getId().equals(archivesReqVO.getId());
|
||||||
|
if (flag){
|
||||||
|
throw exception0(500, "档案名重复");
|
||||||
|
}
|
||||||
|
baseMapper.updateById(archivesReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:08 2024/8/29
|
||||||
|
* @param archivesReqVO 查询条件
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public IPage<Archives> queryArchivesPage(ArchivesReqVO archivesReqVO, Page<Archives> page){
|
||||||
|
return baseMapper.queryArchivesPage(archivesReqVO, page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除 档案表
|
||||||
|
* @author 小李
|
||||||
|
* @date 14:14 2024/8/29
|
||||||
|
* @param id 记录ID
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void removeArchivesById(String id){
|
||||||
|
baseMapper.deleteById(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
package cn.iocoder.yudao.module.archives.vo;
|
package cn.iocoder.yudao.module.archives.vo;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.archives.entity.Archives;
|
import cn.iocoder.yudao.module.archives.entity.Archives;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 档案表 请求VO
|
* 档案表 请求VO
|
||||||
@ -10,4 +16,8 @@ import lombok.Data;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class ArchivesReqVO extends Archives {
|
public class ArchivesReqVO extends Archives {
|
||||||
|
|
||||||
|
@Schema(description = "合同日期查询范围")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private Date[] queryDateArray;
|
||||||
}
|
}
|
||||||
|
@ -15,14 +15,34 @@
|
|||||||
<result property="signTime" column="sign_time" jdbcType="TIMESTAMP"/>
|
<result property="signTime" column="sign_time" jdbcType="TIMESTAMP"/>
|
||||||
<result property="expireTime" column="expire_time" jdbcType="TIMESTAMP"/>
|
<result property="expireTime" column="expire_time" jdbcType="TIMESTAMP"/>
|
||||||
<result property="deptId" column="dept_id" jdbcType="BIGINT"/>
|
<result property="deptId" column="dept_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_SQL">
|
<sql id="Base_SQL">
|
||||||
id,data_id,archives_name,
|
select id,
|
||||||
archives_type,archives_physics_url,archives_urls,
|
data_id,
|
||||||
archives_code,sign_time,expire_time,
|
archives_name,
|
||||||
dept_id,tenant_id,deleted,
|
archives_type,
|
||||||
creator,create_time,updater,
|
archives_physics_url,
|
||||||
update_time
|
archives_urls,
|
||||||
|
archives_code,
|
||||||
|
sign_time,
|
||||||
|
expire_time,
|
||||||
|
dept_id,
|
||||||
|
remark
|
||||||
|
from company_archives ca
|
||||||
|
where deleted = '0'
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<select id="queryArchivesPage" resultMap="BaseResultMap">
|
||||||
|
<include refid="Base_SQL" />
|
||||||
|
and ca.data_id = #{map.dataId}
|
||||||
|
<if test="map.archivesName != null and map.archivesName != ''">
|
||||||
|
and (ca.archives_name like concat('%', #{map.archivesName}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="map.queryDateArray != null and map.queryDateArray.length > 0">
|
||||||
|
and (ca.sign_time >= #{map.queryDateArray[0]} and ca.expire_time <= #{map.queryDateArray[1]})
|
||||||
|
</if>
|
||||||
|
order by ca.expire_time, ca.create_time desc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -8,10 +8,12 @@
|
|||||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||||
<result property="dictType" column="dict_type" jdbcType="VARCHAR"/>
|
<result property="dictType" column="dict_type" jdbcType="VARCHAR"/>
|
||||||
<result property="dataId" column="data_id" jdbcType="BIGINT"/>
|
<result property="dataId" column="data_id" jdbcType="BIGINT"/>
|
||||||
<result property="queryRoleIds" column="query_role_ids" jdbcType="BIGINT"/>
|
<result property="queryRoleIds" column="query_role_ids" jdbcType="VARCHAR"/>
|
||||||
<result property="updateRoleIds" column="update_role_ids" jdbcType="BIGINT"/>
|
<result property="updateRoleIds" column="update_role_ids" jdbcType="VARCHAR"/>
|
||||||
<result property="createRoleIds" column="create_role_ids" jdbcType="BIGINT"/>
|
<result property="createRoleIds" column="create_role_ids" jdbcType="VARCHAR"/>
|
||||||
<result property="deleteRoleIds" column="delete_role_ids" jdbcType="BIGINT"/>
|
<result property="deleteRoleIds" column="delete_role_ids" jdbcType="VARCHAR"/>
|
||||||
|
<result property="deleteRoleIds" column="delete_role_ids" jdbcType="VARCHAR"/>
|
||||||
|
<result property="downloadRoleIds" column="download_role_ids" jdbcType="VARCHAR"/>
|
||||||
<result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
|
<result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
<mapper namespace="cn.iocoder.yudao.module.jx.mapper.LJRegionMapper">
|
<mapper namespace="cn.iocoder.yudao.module.jx.mapper.LJRegionMapper">
|
||||||
|
|
||||||
<select id="selectByMap" resultType="cn.iocoder.yudao.module.jx.domain.LJRegion">
|
<select id="selectByMap" resultType="cn.iocoder.yudao.module.jx.domain.LJRegion">
|
||||||
select * from mt_region where deleted = 0
|
select * from mt_region
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -38,7 +38,7 @@ public class SysAnnouncementController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询系统通知列表
|
* 查询系统通知列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('announcement:announcement:list')")
|
@PreAuthorize("@ss.hasPermission('announcement:announcement:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public CommonResult list(SysAnnouncement sysAnnouncement)
|
public CommonResult list(SysAnnouncement sysAnnouncement)
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ public class SysAnnouncementController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 导出系统通知列表
|
* 导出系统通知列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('announcement:announcement:export')")
|
@PreAuthorize("@ss.hasPermission('announcement:announcement:export')")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, SysAnnouncement sysAnnouncement)
|
public void export(HttpServletResponse response, SysAnnouncement sysAnnouncement)
|
||||||
{
|
{
|
||||||
@ -62,7 +62,7 @@ public class SysAnnouncementController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取系统通知详细信息
|
* 获取系统通知详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('announcement:announcement:query')")
|
@PreAuthorize("@ss.hasPermission('announcement:announcement:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public CommonResult getInfo(@PathVariable("id") Long id)
|
public CommonResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
@ -72,7 +72,7 @@ public class SysAnnouncementController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增系统通知
|
* 新增系统通知
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('announcement:announcement:add')")
|
@PreAuthorize("@ss.hasPermission('announcement:announcement:add')")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public CommonResult add(@RequestBody SysAnnouncement sysAnnouncement)
|
public CommonResult add(@RequestBody SysAnnouncement sysAnnouncement)
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ public class SysAnnouncementController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改系统通知
|
* 修改系统通知
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('announcement:announcement:edit')")
|
@PreAuthorize("@ss.hasPermission('announcement:announcement:edit')")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public CommonResult edit(@RequestBody SysAnnouncement sysAnnouncement)
|
public CommonResult edit(@RequestBody SysAnnouncement sysAnnouncement)
|
||||||
{
|
{
|
||||||
@ -92,7 +92,7 @@ public class SysAnnouncementController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除系统通知
|
* 删除系统通知
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('announcement:announcement:remove')")
|
@PreAuthorize("@ss.hasPermission('announcement:announcement:remove')")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public CommonResult remove(@PathVariable Long[] ids)
|
public CommonResult remove(@PathVariable Long[] ids)
|
||||||
{
|
{
|
||||||
|
@ -155,10 +155,9 @@ public class RescueInfoController extends BaseController {
|
|||||||
* 查询【请填写功能名称】列表
|
* 查询【请填写功能名称】列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/driverList")
|
@GetMapping("/driverList")
|
||||||
public TableDataInfo driverList(DriverInfoDto driverInfoDto) {
|
public CommonResult driverList(DriverInfoDto driverInfoDto) {
|
||||||
startPage();
|
|
||||||
List<DriverInfo2Dto> list = rescueInfoService.driverListApp(driverInfoDto);
|
List<DriverInfo2Dto> list = rescueInfoService.driverListApp(driverInfoDto);
|
||||||
return getDataTable(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +12,9 @@ import java.io.IOException;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
|
||||||
/**`1
|
/**
|
||||||
|
* `1
|
||||||
|
*
|
||||||
* @Author: chuxia0811
|
* @Author: chuxia0811
|
||||||
* @Date: 2023/7/9 10:21
|
* @Date: 2023/7/9 10:21
|
||||||
* @Description :
|
* @Description :
|
||||||
@ -25,9 +27,11 @@ public class UserAnnouncementSocket {
|
|||||||
public static ConcurrentHashMap<String, Session> sessionMap = new ConcurrentHashMap<>();
|
public static ConcurrentHashMap<String, Session> sessionMap = new ConcurrentHashMap<>();
|
||||||
//关键代码,设置一个静态上下文属性appcontext
|
//关键代码,设置一个静态上下文属性appcontext
|
||||||
private static ApplicationContext appcontext;
|
private static ApplicationContext appcontext;
|
||||||
|
|
||||||
public static void setAppcontext(ApplicationContext appcontext) {
|
public static void setAppcontext(ApplicationContext appcontext) {
|
||||||
UserAnnouncementSocket.appcontext = appcontext;
|
UserAnnouncementSocket.appcontext = appcontext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ApplicationContext getAppcontext() {
|
public static ApplicationContext getAppcontext() {
|
||||||
return appcontext;
|
return appcontext;
|
||||||
}
|
}
|
||||||
@ -36,12 +40,13 @@ public class UserAnnouncementSocket {
|
|||||||
/**
|
/**
|
||||||
* 创建连接
|
* 创建连接
|
||||||
* 用于监听建立连接,当有客户端与该服务端点建立连接时,将会自回调该注解标注的方法
|
* 用于监听建立连接,当有客户端与该服务端点建立连接时,将会自回调该注解标注的方法
|
||||||
|
*
|
||||||
* @param session
|
* @param session
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
@OnOpen
|
@OnOpen
|
||||||
public void onOpen(Session session, @PathParam(value = "userId") String userId) {
|
public void onOpen(Session session, @PathParam(value = "userId") String userId) {
|
||||||
this.sessionMap.put(userId,session);
|
this.sessionMap.put(userId, session);
|
||||||
log.info("用户{}已创建连接", userId);
|
log.info("用户{}已创建连接", userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,26 +54,28 @@ public class UserAnnouncementSocket {
|
|||||||
/**
|
/**
|
||||||
* 用于监听客户端向服务端发送消息,当客户端与服务端发送消息时,将会回调该注解标注的方法
|
* 用于监听客户端向服务端发送消息,当客户端与服务端发送消息时,将会回调该注解标注的方法
|
||||||
* {
|
* {
|
||||||
* Stringitude:124.11,
|
* Stringitude:124.11,
|
||||||
* latitude:125.33,
|
* latitude:125.33,
|
||||||
* positionInfo:"山东省济南市市中区八一立交桥"
|
* positionInfo:"山东省济南市市中区八一立交桥"
|
||||||
* }
|
* }
|
||||||
|
*
|
||||||
* @param msg
|
* @param msg
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
@OnMessage
|
@OnMessage
|
||||||
public void onMessage(String msg,@PathParam(value = "userId") String userId){
|
public void onMessage(String msg, @PathParam(value = "userId") String userId) {
|
||||||
System.out.println("消息通知+"+userId);
|
System.out.println("消息通知+" + userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于监听连接关闭,当客户端与该服务端点断开连接时,将会回调该注解标注的方法
|
* 用于监听连接关闭,当客户端与该服务端点断开连接时,将会回调该注解标注的方法
|
||||||
|
*
|
||||||
* @param session
|
* @param session
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
@OnClose
|
@OnClose
|
||||||
public void onClose(Session session,@PathParam(value = "userId") String userId){
|
public void onClose(Session session, @PathParam(value = "userId") String userId) {
|
||||||
this.sessionMap.remove(userId);
|
this.sessionMap.remove(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,24 +83,24 @@ public class UserAnnouncementSocket {
|
|||||||
/**
|
/**
|
||||||
* 用于监听该连接上的任何错误,当客户端与该服务端点的连接发生任何异常,都将回调该注解标注的方法
|
* 用于监听该连接上的任何错误,当客户端与该服务端点的连接发生任何异常,都将回调该注解标注的方法
|
||||||
* 注意该方法的参数必选Throwable,可选Sessiion以及0-n个String参数,且String参数需要使用@PathParam注解标注
|
* 注意该方法的参数必选Throwable,可选Sessiion以及0-n个String参数,且String参数需要使用@PathParam注解标注
|
||||||
|
*
|
||||||
* @param throwable
|
* @param throwable
|
||||||
* @param driverId
|
* @param driverId
|
||||||
*/
|
*/
|
||||||
@OnError
|
@OnError
|
||||||
public void onError(Throwable throwable,@PathParam(value = "driverId") String driverId){
|
public void onError(Throwable throwable, @PathParam(value = "driverId") String driverId) {
|
||||||
log.error("用户{}连接发生异常", driverId);
|
log.error("用户{}连接发生异常", driverId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送给指定的用户
|
* 发送给指定的用户
|
||||||
|
*
|
||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
public void sendMessage(String message, String userId) throws IOException {
|
public void sendMessage(String message, String userId) throws IOException {
|
||||||
if (sessionMap.containsKey(userId)){
|
if (sessionMap.containsKey(userId)) {
|
||||||
Session session = sessionMap.get(userId);
|
Session session = sessionMap.get(userId);
|
||||||
session.getAsyncRemote().sendText(message);
|
session.getAsyncRemote().sendText(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public class RescueInfo extends TenantBaseDO
|
|||||||
private String isAppointment;
|
private String isAppointment;
|
||||||
|
|
||||||
/** 救援时间 */
|
/** 救援时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone="GMT+8")
|
||||||
@Excel(name = "救援时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
|
@Excel(name = "救援时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
|
||||||
private Date rescueTime;
|
private Date rescueTime;
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ public class RescueInfo extends TenantBaseDO
|
|||||||
@Excel(name = "实付金额")
|
@Excel(name = "实付金额")
|
||||||
private Double payMoneyYuan;
|
private Double payMoneyYuan;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone="GMT+8")
|
||||||
@Excel(name = "收款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
|
@Excel(name = "收款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
|
||||||
private Date payTime;
|
private Date payTime;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@ -130,11 +130,13 @@ public class YudaoWebSecurityConfigurerAdapter {
|
|||||||
// 1.1 静态资源,可匿名访问
|
// 1.1 静态资源,可匿名访问
|
||||||
.antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll()
|
.antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll()
|
||||||
|
|
||||||
|
// 登录可以匿名访问
|
||||||
.antMatchers(HttpMethod.POST, "/admin-api/rescue/login",
|
.antMatchers(HttpMethod.POST, "/admin-api/rescue/login",
|
||||||
"/admin-api/rescue/loginApp",
|
"/admin-api/rescue/loginApp",
|
||||||
"/admin-api/rescue/wxLogin",
|
"/admin-api/rescue/wxLogin",
|
||||||
"/admin-api/system/auth/loginApp",
|
"/admin-api/system/auth/loginApp",
|
||||||
"/admin-api/rescue/driverLogin").anonymous()
|
"/admin-api/rescue/driverLogin").anonymous()
|
||||||
|
|
||||||
// 1.2 设置 @PermitAll 无需认证
|
// 1.2 设置 @PermitAll 无需认证
|
||||||
.antMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll()
|
.antMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll()
|
||||||
.antMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll()
|
.antMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll()
|
||||||
|
Loading…
Reference in New Issue
Block a user