Merge branch 'master' of http://42.193.1.25:9521/r/sccg_server
| | |
| | | |
| | | 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.ycl.annotation.LogSave; |
| | | import com.ycl.api.BasePageDTO; |
| | | import com.ycl.api.BasePageVO; |
| | |
| | | |
| | | @ApiOperation("查询全部部门") |
| | | @GetMapping(value = "/page") |
| | | public CommonResult<IPage<UmsDepartVO>> page(DepartVO.PageDepartVO params) { |
| | | IPage<UmsDepartVO> page = departService.pageDepart(params); |
| | | public CommonResult<IPage<UmsDepartVO>> page(@RequestParam("currentPage") Integer currentPage, @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam(value = "departName", required = false) String departName) { |
| | | IPage<UmsDepartVO> page = new Page<>(currentPage, pageSize); |
| | | departService.pageDepart(departName, page); |
| | | return CommonResult.success(page); |
| | | } |
| | | |
| | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value = "日志查询") |
| | |
| | | Long id; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | LocalDateTime startTime; |
| | | String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | LocalDateTime endTime; |
| | | String endTime; |
| | | |
| | | @ApiModelProperty(value = "终端设备") |
| | | String portEquipment; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ycl.entity.depart.UmsDepart; |
| | | import com.ycl.vo.depart.UmsDepartVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | List<UmsDepart> selectDepartList(); |
| | | |
| | | List<UmsDepartVO> selectPageByName(@Param("departName") String departName, @Param("offset") Long offset, @Param("size") Long size); |
| | | } |
| | |
| | | package com.ycl.service.depart; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.entity.depart.UmsDepart; |
| | | import com.ycl.vo.depart.DepartVO; |
| | | import com.ycl.vo.depart.UmsDepartVO; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | */ |
| | | void delete(long id); |
| | | |
| | | /** |
| | | * 树形 |
| | | * |
| | | * @return |
| | | */ |
| | | List<UmsDepart> tree(); |
| | | |
| | | /** |
| | | * 分页 |
| | | * @param params |
| | | * |
| | | * @param page |
| | | * @return |
| | | */ |
| | | IPage<UmsDepartVO> pageDepart(DepartVO.PageDepartVO params); |
| | | IPage<UmsDepartVO> pageDepart(String departName, IPage<UmsDepartVO> page); |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * |
| | | * @param params |
| | | */ |
| | | void updateStatus(DepartVO.StatusDepartVO params); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<UmsDepartVO> pageDepart(DepartVO.PageDepartVO params) { |
| | | Page<UmsDepart> page = new Page<>(params.getCurrent(), params.getPageSize()); |
| | | LambdaQueryWrapper<UmsDepart> query = new LambdaQueryWrapper<>(); |
| | | if (StringUtils.isNotBlank(params.getDepartName())) { |
| | | query.like(UmsDepart::getDepartName, params.getDepartName()); |
| | | } |
| | | if (PojoUtils.Vo.isUsefulSearchParam(params.getDepartType())) { |
| | | query.like(UmsDepart::getDepartType, params.getDepartType()); |
| | | } |
| | | query.orderByDesc(UmsDepart::getCreateTime); |
| | | Page<UmsDepart> departPage = sccgDepartMapper.selectPage(page, query); |
| | | Page<UmsDepartVO> umsDepartVOPage = new Page<>(); |
| | | BeanUtils.copyProperties(departPage, umsDepartVOPage); |
| | | List<UmsDepartVO> umsDepartVOList = new ArrayList<>(); |
| | | //负责人 |
| | | if (CollUtil.isNotEmpty(departPage.getRecords())) { |
| | | for (UmsDepart record : departPage.getRecords()) { |
| | | UmsDepartVO umsDepartVO = new UmsDepartVO(); |
| | | BeanUtils.copyProperties(record, umsDepartVO); |
| | | umsDepartVO.setDepartType(dataDictionaryMapper |
| | | .selectOne(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getId, record.getDepartType())) |
| | | .getName()); |
| | | umsDepartVOList.add(umsDepartVO); |
| | | List<UmsDepartManage> umsAdminDeparts = umsAdminDepartService.queryByDepartId(record.getId()); |
| | | if (CollUtil.isNotEmpty(umsAdminDeparts)) { |
| | | List<AdminDepartDTO.UserInfoDTO> userInfoDTOS = umsAdminDeparts.stream().map(a -> { |
| | | AdminDepartDTO.UserInfoDTO userInfoDTO = new AdminDepartDTO.UserInfoDTO(); |
| | | userInfoDTO.setUserId(a.getUserId()); |
| | | // userInfoDTO.setUsername(umsAdminService.getById(a.getUserId()).getUsername()); |
| | | return userInfoDTO; |
| | | }).collect(Collectors.toList()); |
| | | record.setUserInfoDTOS(userInfoDTOS); |
| | | } |
| | | } |
| | | } |
| | | umsDepartVOPage.setRecords(umsDepartVOList); |
| | | return umsDepartVOPage; |
| | | public IPage<UmsDepartVO> pageDepart(String departName, IPage<UmsDepartVO> page) { |
| | | |
| | | List<UmsDepartVO> ls = sccgDepartMapper.selectPageByName(departName, page.offset(), page.getSize()); |
| | | LambdaQueryWrapper<UmsDepart> queryWrapper = new LambdaQueryWrapper<UmsDepart>() |
| | | .like(StringUtils.isNotEmpty(departName), UmsDepart::getDepartName, departName); |
| | | long total = this.count(queryWrapper); |
| | | |
| | | page.setRecords(ls); |
| | | page.setTotal(total); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ycl.api.BaseEntity; |
| | | import com.ycl.dto.user.AdminDepartDTO; |
| | | import com.ycl.entity.depart.UmsDepart; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | |
| | | @Getter |
| | | @Setter |
| | | @ApiModel(value = "umsDepartVO", description = "部门表") |
| | | public class UmsDepartVO { |
| | | |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String departName; |
| | | |
| | | @ApiModelProperty("部门描述") |
| | | private String departDes; |
| | | public class UmsDepartVO extends UmsDepart { |
| | | |
| | | @ApiModelProperty("部门类型") |
| | | private String departType; |
| | | private String departTypeName; |
| | | |
| | | @ApiModelProperty("父级id,默认0") |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty("停用状态,0->false,1->true,默认停用") |
| | | private Short status; |
| | | |
| | | /** |
| | | * 逻辑删除 0:false 1:true 默认0 |
| | | */ |
| | | @ApiModelProperty(value = "是否删除", hidden = true) |
| | | @TableField(select = false) |
| | | @TableLogic() |
| | | private byte isDeleted; |
| | | } |
| | |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <resultMap id="DepartVOMap" type="com.ycl.vo.depart.UmsDepartVO" extends="BaseResultMap"> |
| | | <result column="depart_type_name" property="departTypeName" jdbcType="VARCHAR"></result> |
| | | <collection property="userInfoDTOS" javaType="ArrayList" ofType="com.ycl.dto.user.DepartUserDTO"> |
| | | <id column="user_id" property="userId"/> |
| | | <result column="username" property="username"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <select id="selectDepartList" resultMap="UserDepartResultMap"> |
| | | SELECT |
| | | ud.*,ua.id user_id,ua.username |
| | | FROM |
| | | ums_depart ud |
| | | SELECT ud.*, |
| | | ua.id user_id, |
| | | ua.username |
| | | FROM ums_depart ud |
| | | LEFT JOIN ums_depart_manager udm ON ud.id = udm.depart_id |
| | | LEFT JOIN ums_admin ua ON udm.user_id = ua.id |
| | | </select> |
| | | <select id="selectPageByName" resultMap="DepartVOMap"> |
| | | SELECT t_0.*, |
| | | ua.id user_id, |
| | | ua.username, |
| | | dd.`name` as depart_type_name |
| | | FROM ( |
| | | SELECT ud.* |
| | | FROM ums_depart ud |
| | | WHERE is_deleted = 0 |
| | | <if test="departName!=null and departName!=''"> |
| | | and ud.name like CONCAT('%',#{departName},'%') |
| | | </if> |
| | | ORDER BY create_time desc |
| | | LIMIT #{offset}, #{size} |
| | | ) t_0 |
| | | LEFT JOIN ums_depart_manager udm ON t_0.id = udm.depart_id |
| | | LEFT JOIN ums_admin ua ON udm.user_id = ua.id |
| | | left join ums_data_dictionary as dd on t_0.depart_type = dd.id |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | baseCase.setCategory(violation); |
| | | baseCase.setCode(utilNumber.createCaseCode()); |
| | | baseCase.setState(BaseCaseStatus.PENDING); |
| | | baseCase.setAlarmTime(LocalDateTime.parse(violationParam.getAlarmTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | baseCaseService.save(baseCase); |
| | | return CommonResult.success(baseCaseService.saveViolationCase(violationParam, baseCase.getId())); |
| | | } |
| | |
| | | baseCase.setEventSource(resource); |
| | | baseCase.setCode(utilNumber.createCaseCode()); |
| | | baseCase.setState(BaseCaseStatus.PENDING); |
| | | baseCase.setAlarmTime(LocalDateTime.parse(illegalBuildingParam.getAlarmTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | baseCaseService.save(baseCase); |
| | | return CommonResult.success(baseCaseService.saveIllegalBuildingCase(illegalBuildingParam, baseCase.getId())); |
| | | } |
| | |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, investigation); |
| | | investigation.setBaseCaseId(caseId); |
| | | investigation.setCreateTime(LocalDateTime.now()); |
| | | investigation.setCreateUser(user.getUserId().longValue()); |
| | | investigation.setCreateUser(user.getUserId()); |
| | | investigation.setPartyId(partyInfo.getId()); |
| | | iInvestigationService.save(investigation); |
| | | //到达 |
| | |
| | | BeanUtils.copyProperties(uploadDisposingResultParam, arrivalSituation); |
| | | arrivalSituation.setBaseCaseId(caseId); |
| | | arrivalSituation.setCreateTime(LocalDateTime.now()); |
| | | arrivalSituation.setCreateUser(user.getUserId().longValue()); |
| | | arrivalSituation.setCreateUser(user.getUserId()); |
| | | iArrivalSituationService.save(arrivalSituation); |
| | | //文书 |
| | | Integer illegalBuildingType = 2; |
| | |
| | | writ.setBaseCaseId(caseId); |
| | | writ.setIllegalBuildingId(caseId); |
| | | writ.setCreateTime(LocalDateTime.now()); |
| | | writ.setCreateUser(user.getUserId().longValue()); |
| | | writ.setCreateUser(user.getUserId()); |
| | | iWritService.save(writ); |
| | | } |
| | | baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, caseId).set(BaseCase::getState, BaseCaseStatus.DISPOSE)); |
| | |
| | | disposeRecord.setBaseCaseId(caseId); |
| | | disposeRecord.setState(0); |
| | | disposeRecord.setCreateTime(LocalDateTime.now()); |
| | | disposeRecord.setCreateUser(user.getUserId().longValue()); |
| | | disposeRecord.setCreateUser(user.getUserId()); |
| | | disposeRecord.setStepName(stepName); |
| | | disposeRecord.setStartTime(LocalDateTime.now()); |
| | | iDisposeRecordService.addRecord(disposeRecord); |
| | |
| | | * 报警时间 |
| | | */ |
| | | @TableField("alarm_time") |
| | | private LocalDateTime alarmTime; |
| | | private String alarmTime; |
| | | |
| | | /** |
| | | * 所属社区 |
| | |
| | | * 报警时间 |
| | | */ |
| | | @TableField("alarm_time") |
| | | private LocalDateTime alarmTime; |
| | | private String alarmTime; |
| | | |
| | | /** |
| | | * 小类 |
| | |
| | | package com.ycl.entity.caseHandler; |
| | | |
| | | import cn.hutool.core.date.LocalDateTimeUtil; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | |
| | | |
| | | //修改结案记录 |
| | | DisposeRecord disposeRecord = new DisposeRecord(); |
| | | disposeRecord.setHandlerId(user.getUserId().longValue()); |
| | | disposeRecord.setHandlerId(user.getUserId()); |
| | | //结案已结束 |
| | | disposeRecord.setState(1); |
| | | disposeRecord.setEndTime(LocalDateTime.now()); |
| | | disposeRecord.setHandlerId(user.getUserId()); |
| | | disposeRecordMapper.update(disposeRecord, updateWrapper); |
| | | } |
| | | } |