已重命名1个文件
已修改30个文件
已添加14个文件
已删除24个文件
| | |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.EmergencyDrillExecuteReqDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecuteCountRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecuteDetailRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecutePageRespDTO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteQuery; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteRPCQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyDrillExecuteService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.Authentication; |
| | |
| | | public ResultVO batchDeleteEmergencyDrillExecute(@RequestBody Long[] ids){ |
| | | return emergencyDrillExecuteService.batchDeleteEmergencyDrillExecute(ids); |
| | | } |
| | | |
| | | /** |
| | | * 应急演练统计的rpc接口 |
| | | */ |
| | | @RequestMapping(value = "/count",method = RequestMethod.POST) |
| | | public ResultVO<EmergencyDrillExecuteCountRespDTO> countEmergencyDrillExecute(@RequestBody EmergencyDrillExecuteRPCQuery query){ |
| | | return emergencyDrillExecuteService.countEmergencyDrillExecute(query); |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.entity; |
| | | |
| | | |
| | | public class EmergencyDrillExecuteCountData { |
| | | |
| | | private Integer num ; |
| | | |
| | | private String name ; |
| | | |
| | | public Integer getNum() { |
| | | return num; |
| | | } |
| | | |
| | | public void setNum(Integer num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.model.dto.resp; |
| | | |
| | | |
| | | public class EmergencyDrillExecuteCountDataRespDTO { |
| | | |
| | | private Integer num ; |
| | | |
| | | private String name ; |
| | | |
| | | public Integer getNum() { |
| | | return num; |
| | | } |
| | | |
| | | public void setNum(Integer num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.model.dto.resp; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | public class EmergencyDrillExecuteCountRespDTO { |
| | | |
| | | private Integer days; |
| | | |
| | | private List<EmergencyDrillExecuteCountDataRespDTO> dataList; |
| | | |
| | | public Integer getDays() { |
| | | return days; |
| | | } |
| | | |
| | | public void setDays(Integer days) { |
| | | this.days = days; |
| | | } |
| | | |
| | | public List<EmergencyDrillExecuteCountDataRespDTO> getDataList() { |
| | | return dataList; |
| | | } |
| | | |
| | | public void setDataList(List<EmergencyDrillExecuteCountDataRespDTO> dataList) { |
| | | this.dataList = dataList; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.query; |
| | | |
| | | public class EmergencyDrillExecuteRPCQuery { |
| | | |
| | | private String level; |
| | | |
| | | // type=1:月 type=2:年 |
| | | private Integer type; |
| | | |
| | | private int year; |
| | | |
| | | private int month; |
| | | |
| | | public String getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(String level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getYear() { |
| | | return year; |
| | | } |
| | | |
| | | public void setYear(int year) { |
| | | this.year = year; |
| | | } |
| | | |
| | | public int getMonth() { |
| | | return month; |
| | | } |
| | | |
| | | public void setMonth(int month) { |
| | | this.month = month; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.query.db; |
| | | |
| | | |
| | | |
| | | public class EmergencyDrillExecuteRPCDBQuery { |
| | | |
| | | private String level; |
| | | |
| | | private String startTime; |
| | | |
| | | private String endTime; |
| | | |
| | | public String getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(String level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteCountData; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencyDrillExecuteDBQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencyDrillExecuteRPCDBQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | void deleteEmergencyDrillExecute(@Param("id") Long id); |
| | | |
| | | void updateStatusById(@Param("drillExecuteId")Long drillExecuteId); |
| | | |
| | | Integer selectEmergencyDrillExecuteIntervalTime(); |
| | | |
| | | List<EmergencyDrillExecuteCountData> selectByMouthTimeAndType(@Param("query")EmergencyDrillExecuteRPCDBQuery dbQuery); |
| | | |
| | | List<EmergencyDrillExecuteCountData> selectByYearTimeAndType(@Param("query")EmergencyDrillExecuteRPCDBQuery dbQuery); |
| | | } |
| | |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.EmergencyDrillExecuteReqDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecuteCountRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecuteDetailRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecutePageRespDTO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteQuery; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteRPCQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | ResultVO updateEmergencyDrillExecute(Long uid, EmergencyDrillExecuteReqDTO emergencyDrillExecuteReqDTO); |
| | | |
| | | ResultVO batchDeleteEmergencyDrillExecute(Long[] ids); |
| | | |
| | | ResultVO<EmergencyDrillExecuteCountRespDTO> countEmergencyDrillExecute(EmergencyDrillExecuteRPCQuery query); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteCountData; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencyDrillExecuteDBQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencyDrillExecuteRPCDBQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | void deleteEmergencyDrillExecute(Long DrillExecuteId); |
| | | |
| | | void updateStatusById(Long drillExecuteId); |
| | | |
| | | Integer selectEmergencyDrillExecuteIntervalTime(); |
| | | |
| | | List<EmergencyDrillExecuteCountData> selectByMouthTimeAndType(EmergencyDrillExecuteRPCDBQuery dbQuery); |
| | | |
| | | List<EmergencyDrillExecuteCountData> selectByYearTimeAndType(EmergencyDrillExecuteRPCDBQuery dbQuery); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteCountData; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencyDrillExecuteDBQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencyDrillExecuteRPCDBQuery; |
| | | import com.gkhy.safePlatform.emergency.repository.EmergencyDrillExecuteInfoRepository; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencyDrillExecuteInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | emergencyDrillExecuteInfoRepository.updateStatusById(drillExecuteId); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectEmergencyDrillExecuteIntervalTime() { |
| | | return emergencyDrillExecuteInfoRepository.selectEmergencyDrillExecuteIntervalTime(); |
| | | } |
| | | |
| | | @Override |
| | | public List<EmergencyDrillExecuteCountData> selectByMouthTimeAndType(EmergencyDrillExecuteRPCDBQuery dbQuery) { |
| | | return emergencyDrillExecuteInfoRepository.selectByMouthTimeAndType(dbQuery); |
| | | } |
| | | |
| | | @Override |
| | | public List<EmergencyDrillExecuteCountData> selectByYearTimeAndType(EmergencyDrillExecuteRPCDBQuery dbQuery) { |
| | | return emergencyDrillExecuteInfoRepository.selectByYearTimeAndType(dbQuery); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.gkhy.safePlatform.emergency.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.commons.enums.E; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.commons.utils.StringUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.emergency.entity.*; |
| | |
| | | import com.gkhy.safePlatform.emergency.excepiton.EmergencyException; |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.EmergencyDrillExecuteReqDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.EmergencyDrillExecuteUserReqDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecuteDetailRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecutePageRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecuteUserRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.*; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteQuery; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteRPCQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencyDrillExecuteDBQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencyDrillExecuteRPCDBQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyDrillExecuteService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencyDrillEvaluationInfoService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencyDrillExecuteInfoService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencyDrillExecuteUserInfoService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencyDrillPlanInfoService; |
| | | import com.gkhy.safePlatform.emergency.utils.TimeUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | emergencyDrillExecuteUserInfoService.deleteEmergencyDrillExecuteUserByDrillExecuteId(DrillExecuteId); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<EmergencyDrillExecuteCountRespDTO> countEmergencyDrillExecute(EmergencyDrillExecuteRPCQuery query) { |
| | | |
| | | EmergencyDrillExecuteCountRespDTO emergencyDrillExecuteCountRespDTO = new EmergencyDrillExecuteCountRespDTO(); |
| | | |
| | | // 根据应急演练实施的创建时间与当前时间 获取间隔天数 |
| | | Integer days = emergencyDrillExecuteInfoService.selectEmergencyDrillExecuteIntervalTime(); |
| | | emergencyDrillExecuteCountRespDTO.setDays(days); |
| | | |
| | | // 根据时间、级别获取统计 |
| | | List<EmergencyDrillExecuteCountData> list = new ArrayList<>(); |
| | | EmergencyDrillExecuteRPCDBQuery dbQuery = new EmergencyDrillExecuteRPCDBQuery(); |
| | | dbQuery.setLevel(query.getLevel()); |
| | | if (query.getType()==1){ |
| | | // 月 |
| | | int year = query.getYear(); |
| | | int month = query.getMonth(); |
| | | dbQuery.setStartTime(TimeUtils.getMonthFirst(year,month)); |
| | | dbQuery.setEndTime(TimeUtils.getMonthLast(year,month)); |
| | | list = emergencyDrillExecuteInfoService.selectByMouthTimeAndType(dbQuery); |
| | | } |
| | | if (query.getType()==2){ |
| | | // 年 |
| | | int year = query.getYear(); |
| | | dbQuery.setStartTime(TimeUtils.getYearFirst(year)); |
| | | dbQuery.setEndTime(TimeUtils.getYearLast(year)); |
| | | list = emergencyDrillExecuteInfoService.selectByYearTimeAndType(dbQuery); |
| | | } |
| | | |
| | | if (!CollectionUtils.isEmpty(list)){ |
| | | List<EmergencyDrillExecuteCountDataRespDTO> dataList = BeanCopyUtils.copyBeanList(list,EmergencyDrillExecuteCountDataRespDTO.class); |
| | | emergencyDrillExecuteCountRespDTO.setDataList(dataList); |
| | | }else{ |
| | | emergencyDrillExecuteCountRespDTO.setDataList(new ArrayList<>()); |
| | | } |
| | | |
| | | return new ResultVO<>(ResultCodes.OK,emergencyDrillExecuteCountRespDTO); |
| | | } |
| | | } |
| | |
| | | emergencyPlanInfo.setDelFlag(false); |
| | | emergencyPlanInfo.setCreateUid(uid); |
| | | emergencyPlanInfo.setGmtCreate(nowDate); |
| | | emergencyPlanInfo.setAbolishStatus(false); |
| | | emergencyPlanInfoService.addEmergencyPlan(emergencyPlanInfo); |
| | | // 新增应急预案区域表 |
| | | if (!CollectionUtils.isEmpty(emergencyPlanReqDTO.getAreaList())) { |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.utils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | public class TimeUtils { |
| | | |
| | | public static String formatDate(Date date){ |
| | | SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String sDate = f.format(date); |
| | | return sDate; |
| | | } |
| | | |
| | | /** |
| | | * 获取某年第一天日期 |
| | | * @param year 年份 |
| | | * @return Date |
| | | */ |
| | | public static String getYearFirst(int year){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.clear(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | Date currYearFirst = calendar.getTime(); |
| | | return formatDate(currYearFirst); |
| | | } |
| | | |
| | | /** |
| | | * 获取某年最后一天日期 |
| | | * @param year 年份 |
| | | * @return Date |
| | | */ |
| | | public static String getYearLast(int year){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.clear(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | calendar.roll(Calendar.DAY_OF_YEAR, -1); |
| | | Date currYearLast = calendar.getTime(); |
| | | |
| | | return formatDate(currYearLast); |
| | | } |
| | | |
| | | /** |
| | | * 获取某月第一天日期 |
| | | * @param month 年份 |
| | | * @return Date |
| | | */ |
| | | public static String getMonthFirst(int year ,int month){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.clear(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | calendar.set(Calendar.MONTH, month-1); |
| | | Date currYearFirst = calendar.getTime(); |
| | | return formatDate(currYearFirst); |
| | | } |
| | | |
| | | /** |
| | | * 获取某月最后一天日期 |
| | | * @param month 年份 |
| | | * @return Date |
| | | */ |
| | | public static String getMonthLast(int year ,int month){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.clear(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | calendar.set(Calendar.MONTH, month-1); |
| | | calendar.roll(Calendar.DAY_OF_MONTH, -1); |
| | | Date currYearLast = calendar.getTime(); |
| | | |
| | | return formatDate(currYearLast); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | Calendar date = Calendar.getInstance(); |
| | | int year = date.get(Calendar.YEAR); |
| | | int month = date.get(Calendar.MONTH); |
| | | System.out.println(getMonthLast(year,2)); |
| | | } |
| | | } |
| | |
| | | <update id="updateStatusById"> |
| | | update emergency_drill_execute set status = 1 where id = #{drillExecuteId} |
| | | </update> |
| | | |
| | | <select id="selectEmergencyDrillExecuteIntervalTime" resultType="java.lang.Integer"> |
| | | SELECT datediff( now( ), ( SELECT max( gmt_create ) FROM `emergency_drill_execute` ) ) |
| | | </select> |
| | | |
| | | <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteCountData" |
| | | id="emergencyDrillExecuteCountChart"> |
| | | <result column="num" property="num"/> |
| | | <result column="name" property="name"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectByMouthTimeAndType" resultMap="emergencyDrillExecuteCountChart"> |
| | | SELECT |
| | | count( 0 ) AS num, |
| | | DATE_FORMAT( a.gmt_create, '%Y-%m-%d' ) AS `name` |
| | | FROM |
| | | `emergency_drill_execute` a |
| | | LEFT JOIN emergency_drill_plan b ON a.drill_plan_id = b.id |
| | | WHERE |
| | | a.del_flag = 0 |
| | | AND a.gmt_create <![CDATA[ >= ]]> #{query.startTime} |
| | | AND a.gmt_create <![CDATA[ <= ]]> #{query.endTime} |
| | | <if test="query.level != null and query.level != ''" >and b.drill_level = #{query.level}</if> |
| | | GROUP BY |
| | | DATE_FORMAT( a.gmt_create, '%Y-%m-%d' ) |
| | | </select> |
| | | |
| | | <select id="selectByYearTimeAndType" resultMap="emergencyDrillExecuteCountChart"> |
| | | SELECT |
| | | count( 0 ) AS num, |
| | | DATE_FORMAT( a.gmt_create, '%Y-%m' ) AS `name` |
| | | FROM |
| | | `emergency_drill_execute` a |
| | | LEFT JOIN emergency_drill_plan b ON a.drill_plan_id = b.id |
| | | WHERE |
| | | a.del_flag = 0 |
| | | AND a.gmt_create <![CDATA[ >= ]]> #{query.startTime} |
| | | AND a.gmt_create <![CDATA[ <= ]]> #{query.endTime} |
| | | <if test="query.level != null and query.level != ''" >and b.drill_level = #{query.level}</if> |
| | | GROUP BY |
| | | DATE_FORMAT( a.gmt_create, '%Y-%m' ) |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.gkhy.safePlatform.equipment.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.equipment.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | this.setPart = setPart; |
| | | } |
| | | //生产日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp produceTime; |
| | | |
| | | public Timestamp getProduceTime() { |
| | |
| | | this.lifeCycle = lifeCycle; |
| | | } |
| | | //投用日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp useDate; |
| | | |
| | | public Timestamp getUseDate() { |
| | |
| | | this.stopStatus = stopStatus; |
| | | } |
| | | //上次检查日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp previousCheckDate; |
| | | |
| | | public Timestamp getPreviousCheckDate() { |
| | |
| | | this.previousCheckDate = previousCheckDate; |
| | | } |
| | | //上次检测日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp previousTestDate; |
| | | |
| | | public Timestamp getPreviousTestDate() { |
| | |
| | | this.previousTestDate = previousTestDate; |
| | | } |
| | | //上次保养日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp previousTakecareDate; |
| | | |
| | | public Timestamp getPreviousTakecareDate() { |
| | |
| | | this.previousTakecareDate = previousTakecareDate; |
| | | } |
| | | //下次检查日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp nextCheckDate; |
| | | |
| | | public Timestamp getNextCheckDate() { |
| | |
| | | this.nextCheckDate = nextCheckDate; |
| | | } |
| | | //下次检测日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp nextTestDate; |
| | | |
| | | public Timestamp getNextTestDate() { |
| | |
| | | this.nextTestDate = nextTestDate; |
| | | } |
| | | //下次保养日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp nextTakecareDate; |
| | | |
| | | public Timestamp getNextTakecareDate() { |
| | |
| | | this.afterStopStep = afterStopStep; |
| | | } |
| | | //实际停用日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp actualStopDate; |
| | | |
| | | public Timestamp getActualStopDate() { |
| | |
| | | this.stopSubmitPersonName = stopSubmitPersonName; |
| | | } |
| | | //停用提交日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp stopSubmitDate; |
| | | |
| | | public Timestamp getStopSubmitDate() { |
| | |
| | | this.recoveryReason = recoveryReason; |
| | | } |
| | | //恢复填报日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp recoverySubmitDate; |
| | | |
| | | public Timestamp getRecoverySubmitDate() { |
| | |
| | | this.recoverySubmitDate = recoverySubmitDate; |
| | | } |
| | | //实际恢复日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp actualRecoveryDate; |
| | | |
| | | public Timestamp getActualRecoveryDate() { |
| | |
| | | this.destoryReason = destoryReason; |
| | | } |
| | | //报废填报日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp destorySubmitDate; |
| | | |
| | | public Timestamp getDestorySubmitDate() { |
| | |
| | | this.destorySubmitDate = destorySubmitDate; |
| | | } |
| | | //实际报废日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp actualDestoryDate; |
| | | |
| | | public Timestamp getActualDestoryDate() { |
| | |
| | | package com.gkhy.safePlatform.equipment.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.equipment.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | this.repairPersonName = repairPersonName; |
| | | } |
| | | //维修开始日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp repairStartDate; |
| | | |
| | | public Timestamp getRepairStartDate() { |
| | |
| | | this.repairStartDate = repairStartDate; |
| | | } |
| | | //维修结束日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp repairEndDate; |
| | | |
| | | public Timestamp getRepairEndDate() { |
| | |
| | | package com.gkhy.safePlatform.equipment.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.equipment.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | this.leadingPersonName = leadingPersonName; |
| | | } |
| | | //保养日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp takecareDate; |
| | | |
| | | public Timestamp getTakecareDate() { |
| | |
| | | package com.gkhy.safePlatform.equipment.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.equipment.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | this.testPersonName = testPersonName; |
| | | } |
| | | //检测日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp testDate; |
| | | |
| | | public Timestamp getTestDate() { |
| | |
| | | * 重点监管装置/设备 详细信息(KeypointEquipmentInfo)表实体类 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-07-19 13:36:27 |
| | | * @since 2022-08-09 09:39:39 |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | @TableName("keypoint_equipment_info") |
| | | public class KeypointEquipmentInfo extends BaseDomain { |
| | | |
| | | |
| | | |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | public Long getId() { |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | //类型/类别外键 |
| | | //类型/类别外键 |
| | | private Long equipmentTypeId; |
| | | |
| | | |
| | | public Long getEquipmentTypeId() { |
| | | return equipmentTypeId; |
| | | } |
| | |
| | | public void setEquipmentTypeId(Long equipmentTypeId) { |
| | | this.equipmentTypeId = equipmentTypeId; |
| | | } |
| | | //名称 |
| | | //名称 |
| | | private String name; |
| | | |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | //单位部门外键 |
| | | //单位部门外键 |
| | | private Long departmentId; |
| | | |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | //具体位置 |
| | | //具体位置 |
| | | private String position; |
| | | |
| | | |
| | | public String getPosition() { |
| | | return position; |
| | | } |
| | |
| | | public void setPosition(String position) { |
| | | this.position = position; |
| | | } |
| | | //负责人姓名 |
| | | //负责人姓名 |
| | | private String leadingPersonName; |
| | | |
| | | |
| | | public String getLeadingPersonName() { |
| | | return leadingPersonName; |
| | | } |
| | |
| | | public void setLeadingPersonName(String leadingPersonName) { |
| | | this.leadingPersonName = leadingPersonName; |
| | | } |
| | | //联系人/外键 |
| | | //联系人/外键 |
| | | private Long connectPersonId; |
| | | |
| | | |
| | | public Long getConnectPersonId() { |
| | | return connectPersonId; |
| | | } |
| | |
| | | public void setConnectPersonId(Long connectPersonId) { |
| | | this.connectPersonId = connectPersonId; |
| | | } |
| | | //录入人/外键 |
| | | //联系人名称 |
| | | private String connectPersonName; |
| | | |
| | | public String getConnectPersonName() { |
| | | return connectPersonName; |
| | | } |
| | | |
| | | public void setConnectPersonName(String connectPersonName) { |
| | | this.connectPersonName = connectPersonName; |
| | | } |
| | | //录入人/外键 |
| | | private Long inputPersonId; |
| | | |
| | | |
| | | public Long getInputPersonId() { |
| | | return inputPersonId; |
| | | } |
| | |
| | | public void setInputPersonId(Long inputPersonId) { |
| | | this.inputPersonId = inputPersonId; |
| | | } |
| | | //责任人/外键 |
| | | //录入人名称 |
| | | private String inputPersonName; |
| | | |
| | | public String getInputPersonName() { |
| | | return inputPersonName; |
| | | } |
| | | |
| | | public void setInputPersonName(String inputPersonName) { |
| | | this.inputPersonName = inputPersonName; |
| | | } |
| | | //责任人/外键 |
| | | private Long responsibilityPersonId; |
| | | |
| | | |
| | | public Long getResponsibilityPersonId() { |
| | | return responsibilityPersonId; |
| | | } |
| | |
| | | public void setResponsibilityPersonId(Long responsibilityPersonId) { |
| | | this.responsibilityPersonId = responsibilityPersonId; |
| | | } |
| | | //装置部位分类 1:关键装置 2:重点部位 |
| | | //责任人名称 |
| | | private String responsibilityPersonName; |
| | | |
| | | public String getResponsibilityPersonName() { |
| | | return responsibilityPersonName; |
| | | } |
| | | |
| | | public void setResponsibilityPersonName(String responsibilityPersonName) { |
| | | this.responsibilityPersonName = responsibilityPersonName; |
| | | } |
| | | //装置部位分类 1:关键装置 2:重点部位 |
| | | private Integer partType; |
| | | |
| | | |
| | | public Integer getPartType() { |
| | | return partType; |
| | | } |
| | |
| | | public void setPartType(Integer partType) { |
| | | this.partType = partType; |
| | | } |
| | | //检查周期 |
| | | //检查周期 |
| | | private String checkCycle; |
| | | |
| | | |
| | | public String getCheckCycle() { |
| | | return checkCycle; |
| | | } |
| | |
| | | public void setCheckCycle(String checkCycle) { |
| | | this.checkCycle = checkCycle; |
| | | } |
| | | //应急预案/外键 |
| | | //应急预案/外键 |
| | | private Long emergencePlanId; |
| | | |
| | | |
| | | public Long getEmergencePlanId() { |
| | | return emergencePlanId; |
| | | } |
| | |
| | | public void setEmergencePlanId(Long emergencePlanId) { |
| | | this.emergencePlanId = emergencePlanId; |
| | | } |
| | | //主要危险有害因素 |
| | | //主要危险有害因素 |
| | | private String dangerousElement; |
| | | |
| | | |
| | | public String getDangerousElement() { |
| | | return dangerousElement; |
| | | } |
| | |
| | | public void setDangerousElement(String dangerousElement) { |
| | | this.dangerousElement = dangerousElement; |
| | | } |
| | | //易导致风险 |
| | | //易导致风险 |
| | | private String toDangerous; |
| | | |
| | | |
| | | public String getToDangerous() { |
| | | return toDangerous; |
| | | } |
| | |
| | | public void setToDangerous(String toDangerous) { |
| | | this.toDangerous = toDangerous; |
| | | } |
| | | //应急处置措施 |
| | | //应急处置措施 |
| | | private String treatment; |
| | | |
| | | |
| | | public String getTreatment() { |
| | | return treatment; |
| | | } |
| | |
| | | public void setTreatment(String treatment) { |
| | | this.treatment = treatment; |
| | | } |
| | | //现场图片 |
| | | //现场图片 |
| | | private String scenePic; |
| | | |
| | | |
| | | public String getScenePic() { |
| | | return scenePic; |
| | | } |
| | |
| | | public void setScenePic(String scenePic) { |
| | | this.scenePic = scenePic; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private Timestamp nextTakecareDate; |
| | | //负责人ID外键 |
| | | private Long leadingPersonId; |
| | | //负责人姓名 |
| | | private String leadingPersonName; |
| | | //负责人部门外键 |
| | | private Long leadingPersonDepartmentId; |
| | | //负责人部门名称 |
| | |
| | | private Timestamp actualStopDate; |
| | | //停用提交人/外键 |
| | | private Long stopSubmitPersonId; |
| | | //停用提交日期 |
| | | //停用提交人名称 |
| | | private String stopSubmitPersonName; |
| | | //停用提交日期 |
| | | private Timestamp stopSubmitDate; |
| | | //恢复理由 |
| | | private String recoveryReason; |
| | |
| | | this.takecareDetailList = takecareDetailList; |
| | | } |
| | | |
| | | public String getLeadingPersonName() { |
| | | return leadingPersonName; |
| | | } |
| | | |
| | | public void setLeadingPersonName(String leadingPersonName) { |
| | | this.leadingPersonName = leadingPersonName; |
| | | } |
| | | |
| | | |
| | | public String getStopSubmitPersonName() { |
| | | return stopSubmitPersonName; |
| | | } |
| | | |
| | | public void setStopSubmitPersonName(String stopSubmitPersonName) { |
| | | this.stopSubmitPersonName = stopSubmitPersonName; |
| | | } |
| | | //ID |
| | | public Long getId() { |
| | | return id; |
| | |
| | | private Long id; |
| | | //类型/类别外键 |
| | | private Long equipmentTypeId; |
| | | //类型名称 |
| | | private String equipmentTypeName; |
| | | //名称 |
| | | private String name; |
| | | //单位部门外键 |
| | |
| | | private String position; |
| | | //负责人姓名 |
| | | private String leadingPersonName; |
| | | //联系人/外键 |
| | | //联系人/外键 |
| | | private Long connectPersonId; |
| | | //录入人/外键 |
| | | //联系人名称 |
| | | private String connectPersonName; |
| | | |
| | | public String getConnectPersonName() { |
| | | return connectPersonName; |
| | | } |
| | | |
| | | public void setConnectPersonName(String connectPersonName) { |
| | | this.connectPersonName = connectPersonName; |
| | | } |
| | | //录入人/外键 |
| | | private Long inputPersonId; |
| | | //责任人/外键 |
| | | //录入人名称 |
| | | private String inputPersonName; |
| | | |
| | | public String getInputPersonName() { |
| | | return inputPersonName; |
| | | } |
| | | |
| | | public void setInputPersonName(String inputPersonName) { |
| | | this.inputPersonName = inputPersonName; |
| | | } |
| | | //责任人/外键 |
| | | private Long responsibilityPersonId; |
| | | |
| | | //责任人名称 |
| | | private String responsibilityPersonName; |
| | | |
| | | public String getResponsibilityPersonName() { |
| | | return responsibilityPersonName; |
| | | } |
| | | |
| | | public void setResponsibilityPersonName(String responsibilityPersonName) { |
| | | this.responsibilityPersonName = responsibilityPersonName; |
| | | } |
| | | //装置部位分类 1:关键装置 2:重点部位 |
| | | private Integer partType; |
| | | //检查周期 |
| | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getEquipmentTypeName() { |
| | | return equipmentTypeName; |
| | | } |
| | | |
| | | public void setEquipmentTypeName(String equipmentTypeName) { |
| | | this.equipmentTypeName = equipmentTypeName; |
| | | } |
| | | } |
| | |
| | | EquipmentTestDetailQueryCriteria criteria1 = new EquipmentTestDetailQueryCriteria(); |
| | | criteria1.setEquipmentId(f.getId()); |
| | | criteria1.setInfoTpe(pageQuery.getSearchParams().getInfoType()); |
| | | List<EquipmentTestDetail> checkDetailList = equipmentTestDetailService.queryAll(criteria1); |
| | | f.setCheckDetailList(checkDetailList); |
| | | List<EquipmentTestDetail> testDetailList = equipmentTestDetailService.queryAll(criteria1); |
| | | f.setTestDetailList(testDetailList); |
| | | |
| | | //设备检查 TODO |
| | | |
| | |
| | | collectDepIdSet.add(f.getLeadingDepartmentId()); |
| | | collectDepIdSet.add(f.getLeadingPersonDepartmentId()); |
| | | takecareDetailList.forEach(info->{collectDepIdSet.add(info.getLeadingPersonDepartmentId());}); |
| | | checkDetailList.forEach(info->{collectDepIdSet.add(info.getTestPersonDepartmentId());}); |
| | | testDetailList.forEach(info->{collectDepIdSet.add(info.getTestPersonDepartmentId());}); |
| | | repairDetailList.forEach(info->{collectDepIdSet.add(info.getRepairPersonDepartmentId());}); |
| | | |
| | | //获取部门名集合 |
| | |
| | | f.setLeadingDepartmentName(depNameMap.get(f.getLeadingDepartmentId())); |
| | | f.setLeadingPersonDepartmentName(depNameMap.get(f.getLeadingPersonDepartmentId())); |
| | | takecareDetailList.forEach(info->{info.setLeadingPersonDepartmentName(depNameMap.get(info.getLeadingPersonDepartmentId()));}); |
| | | checkDetailList.forEach(info->{info.setTestPersonDepartmentName(depNameMap.get(info.getTestPersonDepartmentId()));}); |
| | | testDetailList.forEach(info->{info.setTestPersonDepartmentName(depNameMap.get(info.getTestPersonDepartmentId()));}); |
| | | repairDetailList.forEach(info->{info.setRepairPersonDepartmentName(depNameMap.get(info.getRepairPersonDepartmentId()));}); |
| | | |
| | | }); |
| | |
| | | EquipmentTestDetailQueryCriteria criteria1 = new EquipmentTestDetailQueryCriteria(); |
| | | criteria1.setEquipmentId(infoDto.getId()); |
| | | criteria1.setInfoTpe(infoDto.getInfoType()); |
| | | List<EquipmentTestDetail> checkDetailList = equipmentTestDetailService.queryAll(criteria1); |
| | | infoDto.setCheckDetailList(checkDetailList); |
| | | List<EquipmentTestDetail> testDetailList = equipmentTestDetailService.queryAll(criteria1); |
| | | infoDto.setTestDetailList(testDetailList); |
| | | |
| | | //设备检查 TODO |
| | | |
| | |
| | | collectDepIdSet.add(infoDto.getLeadingDepartmentId()); |
| | | collectDepIdSet.add(infoDto.getLeadingPersonDepartmentId()); |
| | | takecareDetailList.forEach(info->{collectDepIdSet.add(info.getLeadingPersonDepartmentId());}); |
| | | checkDetailList.forEach(info->{collectDepIdSet.add(info.getTestPersonDepartmentId());}); |
| | | testDetailList.forEach(info->{collectDepIdSet.add(info.getTestPersonDepartmentId());}); |
| | | repairDetailList.forEach(info->{collectDepIdSet.add(info.getRepairPersonDepartmentId());}); |
| | | |
| | | //获取部门名集合 |
| | |
| | | infoDto.setLeadingDepartmentName(depNameMap.get(infoDto.getLeadingDepartmentId())); |
| | | infoDto.setLeadingPersonDepartmentName(depNameMap.get(infoDto.getLeadingPersonDepartmentId())); |
| | | takecareDetailList.forEach(info->{info.setLeadingPersonDepartmentName(depNameMap.get(info.getLeadingPersonDepartmentId()));}); |
| | | checkDetailList.forEach(info->{info.setTestPersonDepartmentName(depNameMap.get(info.getTestPersonDepartmentId()));}); |
| | | testDetailList.forEach(info->{info.setTestPersonDepartmentName(depNameMap.get(info.getTestPersonDepartmentId()));}); |
| | | repairDetailList.forEach(info->{info.setRepairPersonDepartmentName(depNameMap.get(info.getRepairPersonDepartmentId()));}); |
| | | return infoDto; |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.*; |
| | | import com.gkhy.safePlatform.equipment.repository.EquipmentTypeMngRepository; |
| | | import com.gkhy.safePlatform.equipment.repository.KeypointEquipmentInfoRepository; |
| | | import com.gkhy.safePlatform.equipment.service.*; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | |
| | | |
| | | @Autowired |
| | | private EquipmentInfoService equipmentInfoService; |
| | | |
| | | @Autowired |
| | | private EquipmentTypeMngRepository equipmentTypeMngRepository; |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<KeypointEquipmentInfoQueryCriteria> pageQuery) { |
| | |
| | | QueryHelpPlus.getPredicate(KeypointEquipmentInfo.class, pageQuery.getSearchParams())); |
| | | List<KeypointEquipmentInfoDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), KeypointEquipmentInfoDto.class); |
| | | |
| | | Set<Long> collectTypeIdSet = new HashSet(); |
| | | //获取额外信息 |
| | | respList.forEach(f->{ |
| | | //设备保养 |
| | |
| | | List<EquipmentRepairDetail> repairDetailList = equipmentRepairDetailService.queryAll(criteria2); |
| | | f.setRepaireDetailList(repairDetailList); |
| | | |
| | | // --------------------------- 获取设备设施类型管理ID----------------------- |
| | | collectTypeIdSet.add(f.getEquipmentTypeId()); |
| | | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | |
| | | checkDetailList.forEach(info->{info.setTestPersonDepartmentName(depNameMap.get(info.getTestPersonDepartmentId()));}); |
| | | repairDetailList.forEach(info->{info.setRepairPersonDepartmentName(depNameMap.get(info.getRepairPersonDepartmentId()));}); |
| | | }); |
| | | |
| | | |
| | | //获取设备设施类型名称 |
| | | if(!collectTypeIdSet.isEmpty()){ |
| | | List<EquipmentTypeMng> typeMngList = equipmentTypeMngRepository.selectList(new QueryWrapper<EquipmentTypeMng>().in("id",collectTypeIdSet)); |
| | | Map<Long, String> typePool = new HashMap<>(); |
| | | typeMngList.forEach(f->{ |
| | | typePool.put(f.getId(),f.getTypeName()); |
| | | }); |
| | | respList.forEach(f->{ |
| | | f.setEquipmentTypeName(typePool.get(f.getEquipmentTypeId())); |
| | | }); |
| | | } |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | |
| | | checkDetailList.forEach(info->{info.setTestPersonDepartmentName(depNameMap.get(info.getTestPersonDepartmentId()));}); |
| | | repairDetailList.forEach(info->{info.setRepairPersonDepartmentName(depNameMap.get(info.getRepairPersonDepartmentId()));}); |
| | | |
| | | EquipmentTypeMng typeMng = equipmentTypeMngRepository.selectOne(new QueryWrapper<EquipmentTypeMng>().eq("id",infoDto.getEquipmentTypeId())); |
| | | if(typeMng != null){ |
| | | infoDto.setEquipmentTypeName(typeMng.getTypeName()); |
| | | } |
| | | return infoDto; |
| | | } |
| | | |
| | |
| | | package com.gkhy.safePlatform.targetDuty.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.targetDuty.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | this.itemDetail = itemDetail; |
| | | } |
| | | //考核日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp examineDate; |
| | | |
| | | public Timestamp getExamineDate() { |
| | |
| | | package com.gkhy.safePlatform.targetDuty.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.targetDuty.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | public void setSetPersonDepartmentId(Long setPersonDepartmentId) { |
| | | this.setPersonDepartmentId = setPersonDepartmentId; |
| | | } |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp setTimem; |
| | | |
| | | public Timestamp getSetTimem() { |
| | |
| | | package com.gkhy.safePlatform.targetDuty.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.targetDuty.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | this.value = value; |
| | | } |
| | | //制定日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp makeDate; |
| | | |
| | | public Timestamp getMakeDate() { |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * 目标责任书(TargetDutyfileInfo)表实体类 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-07-21 10:07:54 |
| | | * @since 2022-08-09 11:07:00 |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | @TableName("target_dutyfile_info") |
| | |
| | | } |
| | | |
| | | //序号 |
| | | private String indexNum; |
| | | private String indexNum; |
| | | |
| | | public String getIndexNum() { |
| | | return indexNum; |
| | |
| | | this.indexNum = indexNum; |
| | | } |
| | | //岗位号/外键 |
| | | private Long jobId; |
| | | private Long jobId; |
| | | |
| | | public Long getJobId() { |
| | | return jobId; |
| | |
| | | this.jobId = jobId; |
| | | } |
| | | //责任书签订日期 |
| | | private Timestamp signDate; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp signDate; |
| | | |
| | | public Timestamp getSignDate() { |
| | | return signDate; |
| | |
| | | this.signDate = signDate; |
| | | } |
| | | //备注信息 |
| | | private String memo; |
| | | private String memo; |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | |
| | | this.memo = memo; |
| | | } |
| | | //责任书附件,多个附件用逗号隔开 |
| | | private String extraFile; |
| | | private String extraFile; |
| | | |
| | | public String getExtraFile() { |
| | | return extraFile; |
| | |
| | | package com.gkhy.safePlatform.targetDuty.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.targetDuty.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | this.makerDepartmentId = makerDepartmentId; |
| | | } |
| | | //制定日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp makeDate; |
| | | |
| | | public Timestamp getMakeDate() { |
| | |
| | | this.uploadValue = uploadValue; |
| | | } |
| | | //上报时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp uploadDate; |
| | | |
| | | public Timestamp getUploadDate() { |
| | |
| | | this.examinePersonId = examinePersonId; |
| | | } |
| | | //考核时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp examineDate; |
| | | |
| | | public Timestamp getExamineDate() { |
| | |
| | | package com.gkhy.safePlatform.targetDuty.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.targetDuty.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | this.level = level; |
| | | } |
| | | //完成期限 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp completeDate; |
| | | |
| | | public Timestamp getCompleteDate() { |
| | |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentReportReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportCountRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportDetailRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportPageRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportRPCQuery; |
| | | import com.gkhy.safePlatform.incidentManage.service.AccidentReportService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.Authentication; |
| | |
| | | return accidentReportService.batchDeleteAccidentReport(ids); |
| | | } |
| | | |
| | | /** |
| | | * 事故报告统计的rpc接口 |
| | | */ |
| | | @RequestMapping(value = "/count",method = RequestMethod.POST) |
| | | public ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(@RequestBody AccidentReportRPCQuery query){ |
| | | return accidentReportService.countAccidentReport(query); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.entity; |
| | | |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class AccidentReportCount { |
| | | |
| | | private String name ; |
| | | |
| | | private Integer num ; |
| | | |
| | | private int minorInjuryNum; |
| | | |
| | | private int seriousInjuryNum; |
| | | |
| | | private int deathNum; |
| | | |
| | | private BigDecimal economicLoss; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getNum() { |
| | | return num; |
| | | } |
| | | |
| | | public void setNum(Integer num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public int getMinorInjuryNum() { |
| | | return minorInjuryNum; |
| | | } |
| | | |
| | | public void setMinorInjuryNum(int minorInjuryNum) { |
| | | this.minorInjuryNum = minorInjuryNum; |
| | | } |
| | | |
| | | public int getSeriousInjuryNum() { |
| | | return seriousInjuryNum; |
| | | } |
| | | |
| | | public void setSeriousInjuryNum(int seriousInjuryNum) { |
| | | this.seriousInjuryNum = seriousInjuryNum; |
| | | } |
| | | |
| | | public int getDeathNum() { |
| | | return deathNum; |
| | | } |
| | | |
| | | public void setDeathNum(int deathNum) { |
| | | this.deathNum = deathNum; |
| | | } |
| | | |
| | | public BigDecimal getEconomicLoss() { |
| | | return economicLoss; |
| | | } |
| | | |
| | | public void setEconomicLoss(BigDecimal economicLoss) { |
| | | this.economicLoss = economicLoss; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.model.dto.resp; |
| | | |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class AccidentReportCountRespDTO { |
| | | |
| | | private String name ; |
| | | |
| | | private Integer num ; |
| | | |
| | | private int minorInjuryNum; |
| | | |
| | | private int seriousInjuryNum; |
| | | |
| | | private int deathNum; |
| | | |
| | | private BigDecimal economicLoss; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getNum() { |
| | | return num; |
| | | } |
| | | |
| | | public void setNum(Integer num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public int getMinorInjuryNum() { |
| | | return minorInjuryNum; |
| | | } |
| | | |
| | | public void setMinorInjuryNum(int minorInjuryNum) { |
| | | this.minorInjuryNum = minorInjuryNum; |
| | | } |
| | | |
| | | public int getSeriousInjuryNum() { |
| | | return seriousInjuryNum; |
| | | } |
| | | |
| | | public void setSeriousInjuryNum(int seriousInjuryNum) { |
| | | this.seriousInjuryNum = seriousInjuryNum; |
| | | } |
| | | |
| | | public int getDeathNum() { |
| | | return deathNum; |
| | | } |
| | | |
| | | public void setDeathNum(int deathNum) { |
| | | this.deathNum = deathNum; |
| | | } |
| | | |
| | | public BigDecimal getEconomicLoss() { |
| | | return economicLoss; |
| | | } |
| | | |
| | | public void setEconomicLoss(BigDecimal economicLoss) { |
| | | this.economicLoss = economicLoss; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.query; |
| | | |
| | | public class AccidentReportRPCQuery { |
| | | |
| | | private String level; |
| | | |
| | | // type=1:月 type=2:年 |
| | | private Integer type; |
| | | |
| | | private int year; |
| | | |
| | | private int month; |
| | | |
| | | public String getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(String level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getYear() { |
| | | return year; |
| | | } |
| | | |
| | | public void setYear(int year) { |
| | | this.year = year; |
| | | } |
| | | |
| | | public int getMonth() { |
| | | return month; |
| | | } |
| | | |
| | | public void setMonth(int month) { |
| | | this.month = month; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.query.db; |
| | | |
| | | public class AccidentReportRPCDBQuery { |
| | | |
| | | private String level; |
| | | |
| | | private String startTime; |
| | | |
| | | private String endTime; |
| | | |
| | | public String getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(String level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportCount; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfo; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | void updateAccidentReport(AccidentReportInfo accidentReportInfo); |
| | | |
| | | void deleteAccidentReportById(@Param("id") Long id); |
| | | |
| | | List<AccidentReportCount> selectByTimeAndType(@Param("query")AccidentReportRPCDBQuery dbQuery); |
| | | } |
| | |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentReportReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportCountRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportDetailRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportPageRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportRPCQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | ResultVO updateAccidentReport(Long uid, AccidentReportReqDTO AccidentReportReqDTO); |
| | | |
| | | ResultVO batchDeleteAccidentReport(Long[] ids); |
| | | |
| | | ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(AccidentReportRPCQuery query); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportCount; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfo; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | void updateAccidentReport(AccidentReportInfo AccidentReportInfo); |
| | | |
| | | void deleteAccidentReportById(Long teamId); |
| | | |
| | | List<AccidentReportCount> selectByTimeAndType(AccidentReportRPCDBQuery dbQuery); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportCount; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfo; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.repository.AccidentReportInfoRepository; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentReportInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | accidentReportInfoRepository.deleteAccidentReportById(teamId); |
| | | } |
| | | |
| | | @Override |
| | | public List<AccidentReportCount> selectByTimeAndType(AccidentReportRPCDBQuery dbQuery) { |
| | | return accidentReportInfoRepository.selectByTimeAndType(dbQuery); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.incidentManage.exception.AccidentException; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentReportFileReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentReportReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportCountRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportDetailRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportFileRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportPageRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportRPCQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.service.AccidentReportService; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressInfoService; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentReportFileInfoService; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentReportInfoService; |
| | | import com.gkhy.safePlatform.incidentManage.utils.TimeUtils; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private void deleteAccidentReport(Long id) { |
| | | //查询是否存在 |
| | | AccidentReportInfoDetailDO AccidentReportInfoDetailDO = accidentReportInfoService.selectAccidentReportById(id); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(AccidentReportRPCQuery query) { |
| | | |
| | | List<AccidentReportCount> list = new ArrayList<>(); |
| | | AccidentReportRPCDBQuery dbQuery = new AccidentReportRPCDBQuery(); |
| | | if (query.getType()==1){ |
| | | // 月 |
| | | int year = query.getYear(); |
| | | int month = query.getMonth(); |
| | | dbQuery.setStartTime(TimeUtils.getMonthFirst(year,month)); |
| | | dbQuery.setEndTime(TimeUtils.getMonthLast(year,month)); |
| | | list = accidentReportInfoService.selectByTimeAndType(dbQuery); |
| | | } |
| | | if (query.getType()==2){ |
| | | // 年 |
| | | int year = query.getYear(); |
| | | dbQuery.setStartTime(TimeUtils.getYearFirst(year)); |
| | | dbQuery.setEndTime(TimeUtils.getYearLast(year)); |
| | | list = accidentReportInfoService.selectByTimeAndType(dbQuery); |
| | | } |
| | | |
| | | List<AccidentReportCountRespDTO> accidentReportCountRespDTOList = BeanCopyUtils.copyBeanList(list,AccidentReportCountRespDTO.class); |
| | | return new ResultVO<>(ResultCodes.OK,accidentReportCountRespDTOList); |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.utils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | public class TimeUtils { |
| | | |
| | | public static String formatDate(Date date){ |
| | | SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String sDate = f.format(date); |
| | | return sDate; |
| | | } |
| | | |
| | | /** |
| | | * 获取某年第一天日期 |
| | | * @param year 年份 |
| | | * @return Date |
| | | */ |
| | | public static String getYearFirst(int year){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.clear(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | Date currYearFirst = calendar.getTime(); |
| | | return formatDate(currYearFirst); |
| | | } |
| | | |
| | | /** |
| | | * 获取某年最后一天日期 |
| | | * @param year 年份 |
| | | * @return Date |
| | | */ |
| | | public static String getYearLast(int year){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.clear(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | calendar.roll(Calendar.DAY_OF_YEAR, -1); |
| | | Date currYearLast = calendar.getTime(); |
| | | |
| | | return formatDate(currYearLast); |
| | | } |
| | | |
| | | /** |
| | | * 获取某月第一天日期 |
| | | * @param month 年份 |
| | | * @return Date |
| | | */ |
| | | public static String getMonthFirst(int year ,int month){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.clear(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | calendar.set(Calendar.MONTH, month-1); |
| | | Date currYearFirst = calendar.getTime(); |
| | | return formatDate(currYearFirst); |
| | | } |
| | | |
| | | /** |
| | | * 获取某月最后一天日期 |
| | | * @param month 年份 |
| | | * @return Date |
| | | */ |
| | | public static String getMonthLast(int year ,int month){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.clear(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | calendar.set(Calendar.MONTH, month-1); |
| | | calendar.roll(Calendar.DAY_OF_MONTH, -1); |
| | | Date currYearLast = calendar.getTime(); |
| | | |
| | | return formatDate(currYearLast); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | Calendar date = Calendar.getInstance(); |
| | | int year = date.get(Calendar.YEAR); |
| | | int month = date.get(Calendar.MONTH); |
| | | System.out.println(getMonthLast(year,2)); |
| | | } |
| | | } |
| | |
| | | <update id="deleteAccidentReportById"> |
| | | update accident_report set del_flag = 1 where id = #{id} |
| | | </update> |
| | | |
| | | |
| | | <resultMap type="com.gkhy.safePlatform.incidentManage.entity.AccidentReportCount" |
| | | id="emergencyDrillExecuteCountChart"> |
| | | <result column="num" property="num"/> |
| | | <result column="name" property="name"/> |
| | | <result column="minorInjuryNum" property="minorInjuryNum"/> |
| | | <result column="seriousInjuryNum" property="seriousInjuryNum"/> |
| | | <result column="deathNum" property="deathNum"/> |
| | | <result column="economicLoss" property="economicLoss"/> |
| | | </resultMap> |
| | | <select id="selectByTimeAndType" resultMap="emergencyDrillExecuteCountChart"> |
| | | SELECT |
| | | a.accident_level AS `name`, |
| | | count( 0 ) AS num, |
| | | sum( economic_loss ) AS economicLoss, |
| | | sum( minor_injury_num ) AS minorInjuryNum, |
| | | sum( serious_injury_num ) AS seriousInjuryNum, |
| | | sum( death_num ) AS deathNum |
| | | FROM |
| | | `accident_report` a |
| | | WHERE |
| | | del_flag = 0 |
| | | AND a.gmt_create <![CDATA[ >= ]]> #{query.startTime} |
| | | AND a.gmt_create <![CDATA[ <= ]]> #{query.endTime} |
| | | <if test="query.level != null and query.level != ''" >and b.drill_level = #{query.level}</if> |
| | | GROUP BY |
| | | accident_level |
| | | </select> |
| | | </mapper> |
文件名从 safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioDemo/config/MinioConfig.java 修改 |
| | |
| | | package com.gkhy.safePlatform.minioDemo.config; |
| | | package com.gkhy.safePlatform.minioFile.config; |
| | | |
| | | import io.minio.MinioClient; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.minioFile.controller; |
| | | |
| | | import com.gkhy.safePlatform.minioFile.service.MinioAccessService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/minio/file") |
| | | public class MinioController { |
| | | |
| | | @Autowired |
| | | private MinioAccessService minioAccessService; |
| | | |
| | | @RequestMapping(value = "/view",method = RequestMethod.GET) |
| | | public Object viewFile(String obj){ |
| | | return minioAccessService.viewFile(obj); |
| | | } |
| | | |
| | | @RequestMapping(value = "/presign",method = RequestMethod.GET) |
| | | public Object getPresignUrl(String prefixName,String suffixName){ |
| | | return minioAccessService.getPresignUrl(prefixName,suffixName); |
| | | } |
| | | } |
| | | |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.minioFile.service; |
| | | |
| | | import com.gkhy.safePlatform.minioFile.config.MinioConfig; |
| | | import com.gkhy.safePlatform.minioFile.utils.UUIDUtil; |
| | | import io.minio.GetPresignedObjectUrlArgs; |
| | | import io.minio.MinioClient; |
| | | import io.minio.errors.*; |
| | | import io.minio.http.Method; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | @Service |
| | | public class MinioAccessService { |
| | | |
| | | @Resource |
| | | private MinioConfig minioConfig; |
| | | |
| | | @Autowired |
| | | private MinioClient minioClient; |
| | | |
| | | public String viewFile(String objectName){ |
| | | String url = null; |
| | | try { |
| | | url = minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder() |
| | | .method(Method.GET) |
| | | .bucket(minioConfig.getBucketName()) |
| | | .object(objectName) |
| | | .expiry(60).build()); |
| | | } catch (ErrorResponseException e) { |
| | | e.printStackTrace(); |
| | | } catch (InsufficientDataException e) { |
| | | e.printStackTrace(); |
| | | } catch (InternalException e) { |
| | | e.printStackTrace(); |
| | | } catch (InvalidKeyException e) { |
| | | e.printStackTrace(); |
| | | } catch (InvalidResponseException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | } catch (XmlParserException e) { |
| | | e.printStackTrace(); |
| | | } catch (ServerException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return url; |
| | | } |
| | | |
| | | public String getPresignUrl(String prefixName ,String suffixName){ |
| | | String uuid= UUIDUtil.initUUID(); |
| | | String objName = prefixName+uuid+suffixName; |
| | | String url = null; |
| | | try { |
| | | Map<String, String> reqParams = new HashMap<>(); |
| | | reqParams.put("response-content-type", "application/json"); |
| | | url = minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder() |
| | | .method(Method.PUT) |
| | | .bucket(minioConfig.getBucketName()) |
| | | .object(objName) |
| | | .expiry(60*2) |
| | | .extraQueryParams(reqParams) |
| | | .build()); |
| | | } catch (ErrorResponseException e) { |
| | | e.printStackTrace(); |
| | | } catch (InsufficientDataException e) { |
| | | e.printStackTrace(); |
| | | } catch (InternalException e) { |
| | | e.printStackTrace(); |
| | | } catch (InvalidKeyException e) { |
| | | e.printStackTrace(); |
| | | } catch (InvalidResponseException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | } catch (XmlParserException e) { |
| | | e.printStackTrace(); |
| | | } catch (ServerException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return url; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.minioFile.utils; |
| | | |
| | | import java.util.UUID; |
| | | |
| | | public class UUIDUtil { |
| | | /** |
| | | * 生成8位UUID |
| | | */ |
| | | public static String initUUID() { |
| | | String[] chars = new String[]{"a", "b", "c", "d", "e", "f", |
| | | "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", |
| | | "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", |
| | | "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", |
| | | "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", |
| | | "W", "X", "Y", "Z"}; |
| | | StringBuffer shortBuffer = new StringBuffer(); |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | for (int i = 0; i < 8; i++) { |
| | | String str = uuid.substring(i * 4, i * 4 + 4); |
| | | int x = Integer.parseInt(str, 16); |
| | | shortBuffer.append(chars[x % 0x3E]); |
| | | } |
| | | return shortBuffer.toString(); |
| | | } |
| | | } |