Merge branches 'genchuang' and 'master' of https://sinanoaq.cn:8888/r/safePlatform-out into master
已重命名1个文件
已修改50个文件
已添加19个文件
已删除2个文件
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.controller; |
| | | |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecuteCountRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesCountRespDTO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteCountQuery; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyCountService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/emergencyCount") |
| | | public class EmergencyCountController { |
| | | |
| | | @Autowired |
| | | private EmergencyCountService emergencyCountService; |
| | | |
| | | /** |
| | | * 应急演练次数统计图 |
| | | */ |
| | | @RequestMapping(value = "/emergencyDrillExecute/count",method = RequestMethod.POST) |
| | | public ResultVO<EmergencyDrillExecuteCountRespDTO> countEmergencyDrillExecute(@RequestBody EmergencyDrillExecuteCountQuery query){ |
| | | return emergencyCountService.countEmergencyDrillExecute(query); |
| | | } |
| | | |
| | | /** |
| | | * 应急物资统计图 |
| | | */ |
| | | @RequestMapping(value = "/emergencySupplies/count" ,method = RequestMethod.POST) |
| | | private ResultVO<List<EmergencySuppliesCountRespDTO>> list (@RequestBody PageQuery<EmergencySuppliesCountQuery> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery); |
| | | return emergencyCountService.countEmergencySupplies(pageQuery); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.security.Principal; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) |
| | | 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.model.dto.resp; |
| | | |
| | | |
| | | public class EmergencySuppliesCountRespDTO { |
| | | |
| | | private String name; |
| | | |
| | | private Integer totalNum; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getTotalNum() { |
| | | return totalNum; |
| | | } |
| | | |
| | | public void setTotalNum(Integer totalNum) { |
| | | this.totalNum = totalNum; |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.query; |
| | | |
| | | |
| | | public class EmergencyDrillExecuteCountQuery { |
| | | |
| | | // type=1:月 type=2:年 |
| | | private Integer type; |
| | | |
| | | // 部门id |
| | | private Long deptId; |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.query; |
| | | |
| | | public class EmergencySuppliesCountQuery { |
| | | |
| | | private String classification ; |
| | | |
| | | public String getClassification() { |
| | | return classification; |
| | | } |
| | | |
| | | public void setClassification(String classification) { |
| | | this.classification = classification; |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | |
| | | Integer selectEmergencyDrillExecuteIntervalTime(); |
| | | |
| | | List<EmergencyDrillExecuteCountData> selectByMouthTimeAndType(@Param("query")EmergencyDrillExecuteRPCDBQuery dbQuery); |
| | | List<EmergencyDrillExecuteCountData> selectByMonthAndDept(@Param("startTime") String startTime ,@Param("endTime")String endTime ,@Param("deptIds")List<Long> deptIds); |
| | | |
| | | List<EmergencyDrillExecuteCountData> selectByYearTimeAndType(@Param("query")EmergencyDrillExecuteRPCDBQuery dbQuery); |
| | | List<EmergencyDrillExecuteCountData> selectByYearAndDept(@Param("startTime") String startTime ,@Param("endTime")String endTime ,@Param("deptIds")List<Long> deptIds); |
| | | } |
| | |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | void updateEmergencySupplies(EmergencySuppliesInfo emergencySuppliesInfo); |
| | | |
| | | void deleteEmergencySupplies(@Param("id") Long id); |
| | | |
| | | List<EmergencySuppliesInfoDetailDO> countEmergencySupplies(Page<EmergencySuppliesInfoDetailDO> page, EmergencySuppliesCountQuery query); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.service; |
| | | |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencyDrillExecuteCountRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesCountRespDTO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteCountQuery; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface EmergencyCountService { |
| | | |
| | | ResultVO<EmergencyDrillExecuteCountRespDTO> countEmergencyDrillExecute(EmergencyDrillExecuteCountQuery query); |
| | | |
| | | ResultVO<List<EmergencySuppliesCountRespDTO>> countEmergencySupplies(PageQuery<EmergencySuppliesCountQuery> pageQuery); |
| | | } |
| | |
| | | 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.query.EmergencyDrillExecuteCountQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | ResultVO batchDeleteEmergencyDrillExecute(Long[] ids); |
| | | |
| | | ResultVO<EmergencyDrillExecuteCountRespDTO> countEmergencyDrillExecute(EmergencyDrillExecuteRPCQuery query); |
| | | } |
| | |
| | | ResultVO updateEmergencySupplies(Long uid, EmergencySuppliesReqDTO emergencySuppliesReqDTO); |
| | | |
| | | ResultVO batchDeleteEmergencySupplies( Long[] ids); |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | |
| | | Integer selectEmergencyDrillExecuteIntervalTime(); |
| | | |
| | | List<EmergencyDrillExecuteCountData> selectByMouthTimeAndType(EmergencyDrillExecuteRPCDBQuery dbQuery); |
| | | List<EmergencyDrillExecuteCountData> selectByMonthAndDept(String startTime ,String endTime ,List<Long> deptIds); |
| | | |
| | | List<EmergencyDrillExecuteCountData> selectByYearTimeAndType(EmergencyDrillExecuteRPCDBQuery dbQuery); |
| | | List<EmergencyDrillExecuteCountData> selectByYearAndDept(String startTime ,String endTime ,List<Long> deptIds); |
| | | } |
| | |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | |
| | | import java.util.List; |
| | |
| | | void updateEmergencySupplies(EmergencySuppliesInfo emergencySuppliesInfo); |
| | | |
| | | void deleteEmergencySupplies(Long SuppliesId); |
| | | |
| | | List<EmergencySuppliesInfoDetailDO> countEmergencySupplies(Page<EmergencySuppliesInfoDetailDO> page,EmergencySuppliesCountQuery query); |
| | | } |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<EmergencyDrillExecuteCountData> selectByMouthTimeAndType(EmergencyDrillExecuteRPCDBQuery dbQuery) { |
| | | return emergencyDrillExecuteInfoRepository.selectByMouthTimeAndType(dbQuery); |
| | | public List<EmergencyDrillExecuteCountData> selectByMonthAndDept(String startTime ,String endTime ,List<Long> deptIds) { |
| | | return emergencyDrillExecuteInfoRepository.selectByMonthAndDept(startTime,endTime,deptIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<EmergencyDrillExecuteCountData> selectByYearTimeAndType(EmergencyDrillExecuteRPCDBQuery dbQuery) { |
| | | return emergencyDrillExecuteInfoRepository.selectByYearTimeAndType(dbQuery); |
| | | public List<EmergencyDrillExecuteCountData> selectByYearAndDept(String startTime ,String endTime ,List<Long> deptIds) { |
| | | return emergencyDrillExecuteInfoRepository.selectByYearAndDept(startTime,endTime,deptIds); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | import com.gkhy.safePlatform.emergency.repository.EmergencySuppliesInfoRepository; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencySuppliesInfoService; |
| | |
| | | emergencySuppliesInfoRepository.deleteEmergencySupplies(SuppliesId); |
| | | } |
| | | |
| | | @Override |
| | | public List<EmergencySuppliesInfoDetailDO> countEmergencySupplies(Page<EmergencySuppliesInfoDetailDO> page,EmergencySuppliesCountQuery query){ |
| | | return emergencySuppliesInfoRepository.countEmergencySupplies(page,query); |
| | | } |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.emergency.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.commons.enums.E; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.exception.BusinessException; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | 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.model.dto.resp.*; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteCountQuery; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyCountService; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencySuppliesService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencyDrillExecuteInfoService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.EmergencySuppliesInfoService; |
| | | import com.gkhy.safePlatform.emergency.utils.TimeUtils; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Service("emergencyCountService") |
| | | public class EmergencyCountServiceImpl implements EmergencyCountService { |
| | | |
| | | @Autowired |
| | | private EmergencyDrillExecuteInfoService emergencyDrillExecuteInfoService; |
| | | |
| | | @DubboReference(check = false) |
| | | private AccountDepartmentService accountDepartmentService; |
| | | |
| | | @Autowired |
| | | private EmergencySuppliesInfoService emergencySuppliesInfoService; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ResultVO<EmergencyDrillExecuteCountRespDTO> countEmergencyDrillExecute(EmergencyDrillExecuteCountQuery query) { |
| | | |
| | | EmergencyDrillExecuteCountRespDTO emergencyDrillExecuteCountRespDTO = new EmergencyDrillExecuteCountRespDTO(); |
| | | |
| | | // 根据最新的应急演练实施的创建时间与当前时间 获取间隔天数 |
| | | Integer days = emergencyDrillExecuteInfoService.selectEmergencyDrillExecuteIntervalTime(); |
| | | emergencyDrillExecuteCountRespDTO.setDays(days); |
| | | |
| | | // 根据时间类型(年/月),部门id 获取统计结果 |
| | | List<EmergencyDrillExecuteCountData> list = new ArrayList<>(); |
| | | // 获取部门id集合 |
| | | List<Long> deptIds = new ArrayList<>(); |
| | | |
| | | ResultVO<List<Long>> rpcResult = accountDepartmentService.listDepAndSubDepIds(query.getDeptId()); |
| | | if (rpcResult != null && rpcResult.getCode().equals(ResultCodes.OK.getCode())) { |
| | | if (rpcResult.getData() != null) { |
| | | deptIds = (List<Long>) rpcResult.getData(); |
| | | } |
| | | }else{ |
| | | throw new BusinessException(ResultCodes.CLIENT_DEP_NOT_EXIST); |
| | | } |
| | | // 获取时间 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | Date date = new Date(); |
| | | int year = Integer.parseInt(sdf.format(date)); |
| | | if (query.getType()==1){ |
| | | // 月 |
| | | String startTime = TimeUtils.getYearFirst(year); |
| | | String endTime = TimeUtils.getYearLast(year); |
| | | list = emergencyDrillExecuteInfoService.selectByMonthAndDept(startTime,endTime,deptIds); |
| | | } |
| | | if (query.getType()==2){ |
| | | // 年 |
| | | String startTime = TimeUtils.getYearFirst(year-10); |
| | | String endTime = TimeUtils.getYearLast(year); |
| | | list = emergencyDrillExecuteInfoService.selectByYearAndDept(startTime,endTime,deptIds); |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<List<EmergencySuppliesCountRespDTO>> countEmergencySupplies(PageQuery<EmergencySuppliesCountQuery> pageQuery) { |
| | | List<EmergencySuppliesCountRespDTO> respList = new ArrayList<>(); |
| | | |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | | Long pageSize = pageQuery.getPageSize(); |
| | | Page<EmergencySuppliesInfoDetailDO> page = new Page<>(pageIndex,pageSize); |
| | | List<EmergencySuppliesInfoDetailDO> emergencySuppliesInfoDetailDOList = emergencySuppliesInfoService.countEmergencySupplies(page,pageQuery.getSearchParams()); |
| | | |
| | | if (!CollectionUtils.isEmpty(emergencySuppliesInfoDetailDOList)){ |
| | | for (EmergencySuppliesInfoDetailDO emergencySuppliesInfoDetailDO :emergencySuppliesInfoDetailDOList){ |
| | | EmergencySuppliesCountRespDTO emergencySuppliesCountRespDTO = new EmergencySuppliesCountRespDTO(); |
| | | // 名称+数量 |
| | | emergencySuppliesCountRespDTO.setName(emergencySuppliesInfoDetailDO.getName()); |
| | | emergencySuppliesCountRespDTO.setTotalNum(emergencySuppliesInfoDetailDO.getCount()); |
| | | // // 保质期内数量 |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//格式化一下 |
| | | // Date produceDate = emergencySuppliesInfoDetailDO.getProductionDate(); |
| | | // Integer usePeriod = emergencySuppliesInfoDetailDO.getUsePeriod(); |
| | | // |
| | | // String[] arr = sdf.format(produceDate).split("-"); |
| | | // |
| | | // Calendar calendar = Calendar.getInstance();//获取对日期操作的类对象 |
| | | // calendar.clear(); |
| | | // calendar.set(Calendar.YEAR, Integer.parseInt(arr[0])); |
| | | // calendar.set(Calendar.MONTH, Integer.parseInt(arr[1])); |
| | | // calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(arr[2])); |
| | | // |
| | | // calendar.set(Calendar.DAY_OF_YEAR,calendar.get(Calendar.DAY_OF_YEAR) +usePeriod); |
| | | // |
| | | // Date qualityD = calendar.getTime(); |
| | | // String time= sdf.format(calendar.getTime()); |
| | | // System.out.println(time); |
| | | |
| | | respList.add(emergencySuppliesCountRespDTO); |
| | | } |
| | | } |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize,page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | | ); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Date date = new Date();//获取当前日期 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//格式化一下 |
| | | Calendar calendar1 = Calendar.getInstance();//获取对日期操作的类对象 |
| | | //两种写法都可以获取到前三天的日期 |
| | | calendar1.set(Calendar.DAY_OF_YEAR,calendar1.get(Calendar.DAY_OF_YEAR) -40); |
| | | //在当前时间的基础上获取前三天的日期 |
| | | // calendar1.add(Calendar.DATE, -40); |
| | | //add方法 参数也可传入 月份,获取的是前几月或后几月的日期 |
| | | //calendar1.add(Calendar.MONTH, -3); |
| | | Date today = calendar1.getTime(); |
| | | String time= sdf.format(today); |
| | | System.out.println(time); |
| | | } |
| | | } |
| | |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.EmergencyDrillExecuteUserReqDTO; |
| | | 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.EmergencyDrillExecuteCountQuery; |
| | | 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; |
| | |
| | | } |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | } |
| | |
| | | import com.gkhy.safePlatform.emergency.excepiton.EmergencyException; |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.*; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.*; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencySuppliesMaintainService; |
| | |
| | | <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 id="selectByMonthAndDept" resultMap="emergencyDrillExecuteCountChart"> |
| | | SELECT |
| | | count( 0 ) AS num, |
| | | DATE_FORMAT( a.gmt_create, '%Y-%m' ) AS `name` |
| | |
| | | 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> |
| | | AND a.gmt_create <![CDATA[ >= ]]> #{startTime} |
| | | AND a.gmt_create <![CDATA[ <= ]]> #{endTime} |
| | | <if test="deptIds != null " > |
| | | and b.department_id in |
| | | <foreach item="id" collection="deptIds" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | DATE_FORMAT( a.gmt_create, '%Y-%m' ) |
| | | </select> |
| | | |
| | | <select id="selectByYearAndDept" resultMap="emergencyDrillExecuteCountChart"> |
| | | SELECT |
| | | count( 0 ) AS num, |
| | | DATE_FORMAT( a.gmt_create, '%Y' ) 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[ >= ]]> #{startTime} |
| | | AND a.gmt_create <![CDATA[ <= ]]> #{endTime} |
| | | <if test="deptIds != null " > |
| | | and b.department_id in |
| | | <foreach item="id" collection="deptIds" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | DATE_FORMAT( a.gmt_create, '%Y' ) |
| | | </select> |
| | | </mapper> |
| | |
| | | from emergency_supplies where del_flag = 0 and id = #{id} |
| | | </select> |
| | | |
| | | <select id="countEmergencySupplies" resultMap="emergencySuppliesInfoDetailDOResult"> |
| | | select id,`name`,`count`,`production_date`,`use_period`,classification from emergency_supplies where del_flag = 0 |
| | | <if test="query.classification != null and query.classification != ''">and `classification` = #{query.classification}</if> |
| | | </select> |
| | | |
| | | <update id="updateEmergencySupplies" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo"> |
| | | update emergency_supplies |
| | | <trim prefix="SET" suffixOverrides=","> |
| | |
| | | map.put("45", "报废理由"); |
| | | map.put("46", "报废填报日期(yyyy-MM-dd HH:mm:ss)"); |
| | | map.put("47", "实际报废日期(yyyy-MM-dd HH:mm:ss)"); |
| | | map.put("48", "保养周期"); |
| | | String fileName = URLEncoder.encode("设备设施管理数据导入模板.xls", "UTF-8"); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | |
| | | map.put("45", "报废理由"); |
| | | map.put("46", "报废填报日期(yyyy-MM-dd HH:mm:ss)"); |
| | | map.put("47", "实际报废日期(yyyy-MM-dd HH:mm:ss)"); |
| | | map.put("48", "保养周期"); |
| | | |
| | | String key = DateUtils.date2String(new Date(), DateUtils.PATTERN_ALLTIME_NOSIGN) ; |
| | | String fileName = URLEncoder.encode("设备设施管理"+key+".xls", "UTF-8"); |
| | |
| | | public void setAreaName(String areaName) { |
| | | this.areaName = areaName; |
| | | } |
| | | |
| | | //保养周期 |
| | | private String takecareCycle; |
| | | |
| | | public String getTakecareCycle() { |
| | | return takecareCycle; |
| | | } |
| | | |
| | | public void setTakecareCycle(String takecareCycle) { |
| | | this.takecareCycle = takecareCycle; |
| | | } |
| | | } |
| | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | } |
| | |
| | | //实际报废日期 |
| | | @ExcelCell(index = 47) |
| | | private Timestamp actualDestoryDate; |
| | | |
| | | |
| | | //保养周期 |
| | | @ExcelCell(index = 48) |
| | | private String takecareCycle; |
| | | |
| | | public String getTakecareCycle() { |
| | | return takecareCycle; |
| | | } |
| | | |
| | | public void setTakecareCycle(String takecareCycle) { |
| | | this.takecareCycle = takecareCycle; |
| | | } |
| | | |
| | | //类型/类别外键 |
| | | public Long getEquipmentTypeId() { |
| | |
| | | public void setPositionNum(String positionNum) { |
| | | this.positionNum = positionNum; |
| | | } |
| | | } |
| | | } |
| | |
| | | //要删除的检查标准 |
| | | private String delCheckStandardeDetails; |
| | | |
| | | |
| | | //保养周期 |
| | | private String takecareCycle; |
| | | |
| | | public String getTakecareCycle() { |
| | | return takecareCycle; |
| | | } |
| | | |
| | | public void setTakecareCycle(String takecareCycle) { |
| | | this.takecareCycle = takecareCycle; |
| | | } |
| | | |
| | | public String getLeadingPersonName() { |
| | | return leadingPersonName; |
| | | } |
| | |
| | | public void setEquipmentTypeId(Integer equipmentTypeId) { |
| | | this.equipmentTypeId = equipmentTypeId; |
| | | } |
| | | } |
| | | } |
| | |
| | | //区域名称 |
| | | private String areaName; |
| | | |
| | | |
| | | //保养周期 |
| | | private String takecareCycle; |
| | | |
| | | public String getTakecareCycle() { |
| | | return takecareCycle; |
| | | } |
| | | |
| | | public void setTakecareCycle(String takecareCycle) { |
| | | this.takecareCycle = takecareCycle; |
| | | } |
| | | |
| | | public Long getAreaId() { |
| | | return areaId; |
| | | } |
| | |
| | | //实际报废日期 |
| | | @ExcelCell(index = 47) |
| | | private Timestamp actualDestoryDate; |
| | | |
| | | |
| | | //保养周期 |
| | | @ExcelCell(index = 48) |
| | | private String takecareCycle; |
| | | |
| | | public String getTakecareCycle() { |
| | | return takecareCycle; |
| | | } |
| | | |
| | | public void setTakecareCycle(String takecareCycle) { |
| | | this.takecareCycle = takecareCycle; |
| | | } |
| | | |
| | | //ID |
| | | public Long getId() { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.gkhy.safePlatform.equipment.entity.EquipmentInfo; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | /** |
| | |
| | | @Repository |
| | | public interface EquipmentInfoRepository extends BaseMapper<EquipmentInfo> { |
| | | |
| | | @Select("<script> select count(1) from equipment_info m INNER JOIN \n" + |
| | | "(select a.id,max(b.takecare_date) mdate from equipment_info a INNER JOIN equipment_takecare_detail b on a.id = b.equipment_id GROUP BY b.equipment_id) n \n" + |
| | | "on m.id = n.id where DATEDIFF(NOW(),n.mdate) >m.takecare_cycle</script> ") |
| | | Object countOverTime(); |
| | | } |
| | |
| | | .select("stop_status as stopStatus,count(0) as count") |
| | | .groupBy("stop_status"); |
| | | |
| | | return this.listMaps(wrapper); |
| | | List<Map<String, Object>> list = this.listMaps(wrapper); |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("-1",equipmentInfoRepository.countOverTime());//超时未保养 |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.targetDuty.entity.ExamineMng; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDutyWorkApprove; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetDutyWorkApproveDto; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDutyWorkApproveService; |
| | | import com.gkhy.safePlatform.targetDuty.utils.DateUtils; |
| | | import org.springframework.security.core.Authentication; |
| | |
| | | */ |
| | | @GetMapping(value = "/selectOne/{id}") |
| | | public ResultVO selectOne(@PathVariable Serializable id) { |
| | | return new ResultVO<>(ResultCodes.OK,this.targetDutyWorkApproveService.getById(id)); |
| | | TargetDutyWorkApproveDto dto = this.targetDutyWorkApproveService.selectOne(id); |
| | | return new ResultVO<>(ResultCodes.OK,dto); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.gkhy.safePlatform.targetDuty.controller; |
| | | import java.util.*; |
| | | import java.sql.Timestamp; |
| | | |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.targetDuty.entity.ExamineItem; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetExamine; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.ExamineTemplateSaveOrUpdate; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetExamineSaveOrUpdate; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineTemplateDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetExamineDivideDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetExamineDto; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetExamineService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetMngService; |
| | | import com.google.common.collect.Lists; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetExamine; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetExamineQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetExamineService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetMngService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (TargetExamine)表控制层 |
| | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | // /** |
| | | // * 通过主键查询单条数据 |
| | | // * |
| | | // * @param targetId 主键 |
| | | // * @return 单条数据 |
| | | // */ |
| | | // @GetMapping(value = "/selectOne/{targetId}") |
| | | // public ResultVO selectOne(@PathVariable Long targetId) { |
| | | // TargetExamineDto dto = new TargetExamineDto(); |
| | | // TargetMng targetMng = targetMngService.getById(targetId); |
| | | // if(targetMng == null) { |
| | | // return new ResultVO<>(ResultCodes.CLIENT_PROJECT_NOT_EXIST); |
| | | // } |
| | | // |
| | | // TargetExamineQueryCriteria criteria = new TargetExamineQueryCriteria(); |
| | | // criteria.setTargetId(targetId); |
| | | // |
| | | // List<TargetExamineDivideDto> respList = BeanCopyUtils.copyBeanList(this.targetExamineService.queryAll(criteria), TargetExamineDivideDto.class); |
| | | // |
| | | // |
| | | // // --------------------------- 获取部门信息----------------------- |
| | | // //收集所用到的部门ID |
| | | // Set<Long> collectDepIdSet = new HashSet(); |
| | | // respList.forEach(f->{ |
| | | // collectDepIdSet.add(f.getDutyDepartmentId()); |
| | | // collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | // }); |
| | | // //获取部门名集合 |
| | | // Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | // |
| | | // respList.forEach(f->{ |
| | | // f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | | // f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | // }); |
| | | // |
| | | // dto.setExamineList(respList); |
| | | // dto.setId(targetMng.getId()); |
| | | // dto.setIndexNum(targetMng.getIndexNum()); |
| | | // dto.setqName(targetMng.getqName()); |
| | | // dto.setValue(targetMng.getValue()); |
| | | // dto.setYear(targetMng.getYear()); |
| | | // return new ResultVO<>(ResultCodes.OK,dto); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param pageQuery 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping(value = "/page/list") |
| | | public ResultVO selectAll(@RequestBody PageQuery<TargetExamineQueryCriteria> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery); |
| | | return this.targetExamineService.queryAll(pageQuery); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param targetId 主键 |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping(value = "/selectOne/{targetId}") |
| | | public ResultVO selectOne(@PathVariable Long targetId) { |
| | | TargetExamineDto dto = new TargetExamineDto(); |
| | | TargetMng targetMng = targetMngService.getById(targetId); |
| | | if(targetMng == null) { |
| | | return new ResultVO<>(ResultCodes.CLIENT_PROJECT_NOT_EXIST); |
| | | } |
| | | |
| | | TargetExamineQueryCriteria criteria = new TargetExamineQueryCriteria(); |
| | | criteria.setTargetId(targetId); |
| | | |
| | | List<TargetExamineDivideDto> respList = BeanCopyUtils.copyBeanList(this.targetExamineService.queryAll(criteria), TargetExamineDivideDto.class); |
| | | |
| | | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | respList.forEach(f->{ |
| | | collectDepIdSet.add(f.getDutyDepartmentId()); |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList.forEach(f->{ |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | | f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | }); |
| | | |
| | | dto.setExamineList(respList); |
| | | dto.setId(targetMng.getId()); |
| | | dto.setIndexNum(targetMng.getIndexNum()); |
| | | dto.setqName(targetMng.getqName()); |
| | | dto.setValue(targetMng.getValue()); |
| | | dto.setYear(targetMng.getYear()); |
| | | return new ResultVO<>(ResultCodes.OK,dto); |
| | | @GetMapping(value = "/selectOne/{id}") |
| | | public ResultVO selectOne(@PathVariable Serializable id) { |
| | | return new ResultVO<>(ResultCodes.OK,this.targetExamineService.getById(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增或者修改数据 |
| | |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping(value = "/addOrUpdate") |
| | | public ResultVO update(@RequestBody TargetExamineSaveOrUpdate infoDto) { |
| | | if(infoDto.getId() == null) { |
| | | return new ResultVO<>(ResultCodes.CLIENT_PARAM_ERROR); |
| | | public ResultVO update(@RequestBody TargetExamine infoDto) { |
| | | infoDto.setExamineDate(new Timestamp(new Date().getTime())); |
| | | if (infoDto.getId() == null) { |
| | | return new ResultVO<>(ResultCodes.OK,targetExamineService.save(infoDto)); |
| | | } else { |
| | | targetExamineService.update(infoDto,new UpdateWrapper<TargetExamine>().eq("id",infoDto.getId())); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | TargetMng targetMng = targetMngService.getById(infoDto.getId()); |
| | | if(targetMng == null) { |
| | | return new ResultVO<>(ResultCodes.CLIENT_PROJECT_NOT_EXIST); |
| | | } |
| | | |
| | | targetExamineService.addOrUpdate(infoDto); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | TargetExamineSaveOrUpdate saveOrUpdate = new TargetExamineSaveOrUpdate(); |
| | | saveOrUpdate.setDelIds("1,2"); |
| | | |
| | | |
| | | List<TargetExamine> examineList = Lists.newArrayList(); |
| | | TargetExamine item = new TargetExamine(); |
| | | item.setDutyDepartmentId(12L); |
| | | item.setExamineValue("3"); |
| | | item.setMakerDepartmentId(4L); |
| | | item.setMakeDate(new Timestamp(new java.util.Date().getTime())); |
| | | item.setUploadValue("2"); |
| | | item.setUploadDate(new Timestamp(new java.util.Date().getTime())); |
| | | item.setExamineResult(1); |
| | | item.setExaminePersonId(0L); |
| | | item.setExamineDate(new Timestamp(new java.util.Date().getTime())); |
| | | examineList.add(item); |
| | | saveOrUpdate.setExamineList(examineList); |
| | | System.out.println(JSONObject.toJSONString(saveOrUpdate)); |
| | | // TargetExamineSaveOrUpdate saveOrUpdate = new TargetExamineSaveOrUpdate(); |
| | | // saveOrUpdate.setDelIds("1,2"); |
| | | // |
| | | // |
| | | // List<TargetExamine> examineList = Lists.newArrayList(); |
| | | // TargetExamine item = new TargetExamine(); |
| | | // item.setTargetDivideDetailId(1L); |
| | | // item.setUploadValue("2"); |
| | | // item.setUploadDate(new Timestamp(new java.util.Date().getTime())); |
| | | // item.setExamineResult(1); |
| | | // item.setExaminePersonId(0L); |
| | | // item.setExamineDate(new Timestamp(new java.util.Date().getTime())); |
| | | // examineList.add(item); |
| | | // saveOrUpdate.setExamineList(examineList); |
| | | // System.out.println(JSONObject.toJSONString(saveOrUpdate)); |
| | | } |
| | | } |
| | |
| | | PageUtils.checkCheck(pageQuery); |
| | | return this.targetMngService.queryAll(pageQuery); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | |
| | | Map<String,String> map = new LinkedHashMap<>(); |
| | | map.put("1","安全目标指标"); |
| | | map.put("2","目标指标编号"); |
| | | map.put("3","指标类型 1:年指标 2:月指标"); |
| | | map.put("3","指标类型 1:年指标 2:月指标 3:半年 4:季度"); |
| | | map.put("4","年度"); |
| | | map.put("5","指标值"); |
| | | map.put("6","指标级别 1:公司级 2:部门分厂级 3:工段班组级"); |
| | |
| | | */ |
| | | @PostMapping(value = "/checkAndSubimt/list") |
| | | public ResultVO list(Authentication authentication, @RequestBody PageQuery<TargetCheckAndSubmitQueryCriteria> pageQuery){ |
| | | if(pageQuery.getSearchParams().getTargetType() == null){ |
| | | if(pageQuery.getSearchParams().getRelateType() == null){ |
| | | return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"缺少targetType"); |
| | | } |
| | | PageUtils.checkCheck(pageQuery); |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return this.targetMngService.queryAll(currentUser.getUid(),pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 统计 |
| | | * |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping(value = "/statistics") |
| | | public ResultVO statistics(TargetMngQueryCriteria criteria) { |
| | | return new ResultVO<>(ResultCodes.OK,this.targetMngService.statistics(criteria)); |
| | | } |
| | | |
| | | |
| | |
| | | System.out.println(JSONObject.toJSONString(mng)); |
| | | |
| | | } |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.controller; |
| | | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetType; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetTypeService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetTypeQueryCriteria; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 目标分类(TargetType)表控制层 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-08-17 10:20:01 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("targetType") |
| | | public class TargetTypeController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private TargetTypeService targetTypeService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param pageQuery 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping(value = "/page/list") |
| | | public ResultVO selectAll(@RequestBody PageQuery<TargetTypeQueryCriteria> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery); |
| | | return this.targetTypeService.queryAll(pageQuery); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询所有数据 |
| | | * |
| | | * @param criteria 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping(value = "/page/listAll") |
| | | public ResultVO listAll(@RequestBody TargetTypeQueryCriteria criteria){ |
| | | return new ResultVO<>(ResultCodes.OK,this.targetTypeService.queryAll(criteria)); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping(value = "/selectOne/{id}") |
| | | public ResultVO selectOne(@PathVariable Serializable id) { |
| | | return new ResultVO<>(ResultCodes.OK,this.targetTypeService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或者修改数据 |
| | | * |
| | | * @param targetType 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping(value = "/addOrUpdate") |
| | | public ResultVO update(@RequestBody TargetType targetType) { |
| | | if (targetType.getId() == null) { |
| | | return new ResultVO<>(ResultCodes.OK,targetTypeService.save(targetType)); |
| | | } else { |
| | | targetTypeService.update(targetType,new UpdateWrapper<TargetType>().eq("id",targetType.getId())); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param ids 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @RequestMapping(value = "/delete",method = RequestMethod.POST) |
| | | public ResultVO delete(@RequestBody Long[] ids) { |
| | | if(ids == null){ |
| | | return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL); |
| | | } |
| | | List<Long> idList = Arrays.asList(ids); |
| | | this.targetTypeService.removeByIds(idList); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * 目标指标分解详情(TargetDivideDetail)表实体类 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-08-03 09:25:40 |
| | | * @since 2022-08-17 11:22:35 |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | @TableName("target_divide_detail") |
| | |
| | | } |
| | | |
| | | //关联的目标指标/外键 |
| | | private Long targetId; |
| | | private Long targetId; |
| | | |
| | | public Long getTargetId() { |
| | | return targetId; |
| | |
| | | this.targetId = targetId; |
| | | } |
| | | //考核指标值 |
| | | private String value; |
| | | private String value; |
| | | |
| | | public String getValue() { |
| | | return value; |
| | |
| | | this.value = value; |
| | | } |
| | | //制定日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp makeDate; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp makeDate; |
| | | |
| | | public Timestamp getMakeDate() { |
| | | return makeDate; |
| | |
| | | this.makeDate = makeDate; |
| | | } |
| | | //责任部门/外键 |
| | | private Long dutyDepartmentId; |
| | | private Long dutyDepartmentId; |
| | | |
| | | public Long getDutyDepartmentId() { |
| | | return dutyDepartmentId; |
| | |
| | | this.dutyDepartmentId = dutyDepartmentId; |
| | | } |
| | | //制定人部门/外键 |
| | | private Long makerDepartmentId; |
| | | private Long makerDepartmentId; |
| | | |
| | | public Long getMakerDepartmentId() { |
| | | return makerDepartmentId; |
| | |
| | | this.makerDepartmentId = makerDepartmentId; |
| | | } |
| | | //上报人/外键 |
| | | private Long commitPersonId; |
| | | private Long commitPersonId; |
| | | |
| | | public Long getCommitPersonId() { |
| | | return commitPersonId; |
| | |
| | | this.commitPersonId = commitPersonId; |
| | | } |
| | | //上报人名称 |
| | | private String commitPersonName; |
| | | private String commitPersonName; |
| | | |
| | | public String getCommitPersonName() { |
| | | return commitPersonName; |
| | |
| | | public void setCommitPersonName(String commitPersonName) { |
| | | this.commitPersonName = commitPersonName; |
| | | } |
| | | //目标分类/外键 |
| | | private Long targetTypeId; |
| | | |
| | | public Long getTargetTypeId() { |
| | | return targetTypeId; |
| | | } |
| | | |
| | | public void setTargetTypeId(Long targetTypeId) { |
| | | this.targetTypeId = targetTypeId; |
| | | } |
| | | //责任人/外键 |
| | | private Long dutyPersonId; |
| | | |
| | | public Long getDutyPersonId() { |
| | | return dutyPersonId; |
| | | } |
| | | |
| | | public void setDutyPersonId(Long dutyPersonId) { |
| | | this.dutyPersonId = dutyPersonId; |
| | | } |
| | | //责任人名称 |
| | | private String dutyPersonName; |
| | | |
| | | public String getDutyPersonName() { |
| | | return dutyPersonName; |
| | | } |
| | | |
| | | public void setDutyPersonName(String dutyPersonName) { |
| | | this.dutyPersonName = dutyPersonName; |
| | | } |
| | | //计划措施 |
| | | private String planDesc; |
| | | |
| | | public String getPlanDesc() { |
| | | return planDesc; |
| | | } |
| | | |
| | | public void setPlanDesc(String planDesc) { |
| | | this.planDesc = planDesc; |
| | | } |
| | | |
| | | } |
| | |
| | | * 安全目标考核(TargetExamine)表实体类 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-08-12 08:07:53 |
| | | * @since 2022-08-18 16:27:12 |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | @TableName("target_examine") |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | //关联的目标指标/外键 |
| | | private Long targetId; |
| | | //关联的目标分解/外键 |
| | | private Long targetDivideDetailId; |
| | | |
| | | public Long getTargetId() { |
| | | return targetId; |
| | | public Long getTargetDivideDetailId() { |
| | | return targetDivideDetailId; |
| | | } |
| | | |
| | | public void setTargetId(Long targetId) { |
| | | this.targetId = targetId; |
| | | } |
| | | //责任部门id/外键 |
| | | private Long dutyDepartmentId; |
| | | |
| | | public Long getDutyDepartmentId() { |
| | | return dutyDepartmentId; |
| | | } |
| | | |
| | | public void setDutyDepartmentId(Long dutyDepartmentId) { |
| | | this.dutyDepartmentId = dutyDepartmentId; |
| | | } |
| | | //考核指标 |
| | | private String examineValue; |
| | | |
| | | public String getExamineValue() { |
| | | return examineValue; |
| | | } |
| | | |
| | | public void setExamineValue(String examineValue) { |
| | | this.examineValue = examineValue; |
| | | } |
| | | //制定部门id/外键 |
| | | private Long makerDepartmentId; |
| | | |
| | | public Long getMakerDepartmentId() { |
| | | return makerDepartmentId; |
| | | } |
| | | |
| | | public void setMakerDepartmentId(Long makerDepartmentId) { |
| | | this.makerDepartmentId = makerDepartmentId; |
| | | } |
| | | //制定日期 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp makeDate; |
| | | |
| | | public Timestamp getMakeDate() { |
| | | return makeDate; |
| | | } |
| | | |
| | | public void setMakeDate(Timestamp makeDate) { |
| | | this.makeDate = makeDate; |
| | | public void setTargetDivideDetailId(Long targetDivideDetailId) { |
| | | this.targetDivideDetailId = targetDivideDetailId; |
| | | } |
| | | //上报值 |
| | | private String uploadValue; |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | import com.gkhy.safePlatform.targetDuty.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * 目标分类(TargetType)表实体类 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-08-17 10:26:39 |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | @TableName("target_type") |
| | | public class TargetType extends BaseDomain { |
| | | |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | //分类名称 |
| | | private String typeName; |
| | | |
| | | public String getTypeName() { |
| | | return typeName; |
| | | } |
| | | |
| | | public void setTypeName(String typeName) { |
| | | this.typeName = typeName; |
| | | } |
| | | //说明 |
| | | private String memo; |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | } |
| | |
| | | APPROVE_STATUS_NULL("A1004","审批状态不可为空"), |
| | | |
| | | APPROVE_NOT_EXIST("A1005" , "审批记录不存在"), |
| | | |
| | | ERROR("A3000", "未知错误"); |
| | | |
| | | private String code; |
| | |
| | | this.message = error.getDesc(); |
| | | } |
| | | |
| | | public TargetDutyException(String message) { |
| | | super(message); |
| | | this.code = "A3000"; |
| | | } |
| | | |
| | | public TargetDutyException(String code, String message) { |
| | | super(message); |
| | | this.code = code; |
| | |
| | | import com.gkhy.safePlatform.targetDuty.annotation.Query; |
| | | |
| | | public class TargetExamineQueryCriteria { |
| | | //关联的目标指标/外键 |
| | | //安全目标指标 |
| | | @Query(type = Query.Type.INNER_LIKE) |
| | | private String qName; |
| | | //目标指标编号 |
| | | @Query(type = Query.Type.INNER_LIKE) |
| | | private String indexNum; |
| | | //指标类型 1:年指标 2:月指标 3:半年 4:季度 |
| | | @Query() |
| | | private Long targetId; |
| | | //关联的目标指标/外键 |
| | | public Long getTargetId() { |
| | | return targetId; |
| | | private Integer targetType; |
| | | //分解状态 1:已分解 2:未分解 |
| | | @Query() |
| | | private Integer divideStatus; |
| | | |
| | | public Integer getDivideStatus() { |
| | | return divideStatus; |
| | | } |
| | | |
| | | public void setTargetId(Long targetId) { |
| | | this.targetId = targetId; |
| | | public void setDivideStatus(Integer divideStatus) { |
| | | this.divideStatus = divideStatus; |
| | | } |
| | | |
| | | //安全目标指标 |
| | | |
| | | public String getqName() { |
| | | return qName; |
| | | } |
| | | |
| | | public void setqName(String qName) { |
| | | this.qName = qName; |
| | | } |
| | | |
| | | //目标指标编号 |
| | | public String getIndexNum() { |
| | | return indexNum; |
| | | } |
| | | |
| | | public void setIndexNum(String indexNum) { |
| | | this.indexNum = indexNum; |
| | | } |
| | | //指标类型 1:年指标 2:月指标 |
| | | public Integer getTargetType() { |
| | | return targetType; |
| | | } |
| | | |
| | | public void setTargetType(Integer targetType) { |
| | | this.targetType = targetType; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.targetDuty.entity.ExamineItem; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetExamine; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class TargetExamineSaveOrUpdate implements Serializable { |
| | | |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | public Long getId() { |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | //关联的考核数据列表 |
| | | private List<TargetExamine> examineList = new ArrayList<>(); |
| | | //关联的目标分解/外键 |
| | | private Long targetDivideDetailId; |
| | | |
| | | public List<TargetExamine> getExamineList() { |
| | | return examineList; |
| | | public Long getTargetDivideDetailId() { |
| | | return targetDivideDetailId; |
| | | } |
| | | |
| | | public void setExamineList(List<TargetExamine> examineList) { |
| | | this.examineList = examineList; |
| | | public void setTargetDivideDetailId(Long targetDivideDetailId) { |
| | | this.targetDivideDetailId = targetDivideDetailId; |
| | | } |
| | | //上报值 |
| | | private String uploadValue; |
| | | |
| | | public String getUploadValue() { |
| | | return uploadValue; |
| | | } |
| | | |
| | | //要删除的id集合,多个用逗号隔开 |
| | | private String delIds; |
| | | public void setUploadValue(String uploadValue) { |
| | | this.uploadValue = uploadValue; |
| | | } |
| | | //上报时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp uploadDate; |
| | | |
| | | public String getDelIds() { |
| | | return delIds; |
| | | public Timestamp getUploadDate() { |
| | | return uploadDate; |
| | | } |
| | | |
| | | public void setDelIds(String delIds) { |
| | | this.delIds = delIds; |
| | | public void setUploadDate(Timestamp uploadDate) { |
| | | this.uploadDate = uploadDate; |
| | | } |
| | | //考核结果 1:合格 2:不合格 |
| | | private Integer examineResult; |
| | | |
| | | public Integer getExamineResult() { |
| | | return examineResult; |
| | | } |
| | | |
| | | public void setExamineResult(Integer examineResult) { |
| | | this.examineResult = examineResult; |
| | | } |
| | | //考核人ID/外键 |
| | | private Long examinePersonId; |
| | | |
| | | public Long getExaminePersonId() { |
| | | return examinePersonId; |
| | | } |
| | | |
| | | public void setExaminePersonId(Long examinePersonId) { |
| | | this.examinePersonId = examinePersonId; |
| | | } |
| | | //考核人名称 |
| | | private String examinePersonName; |
| | | |
| | | public String getExaminePersonName() { |
| | | return examinePersonName; |
| | | } |
| | | |
| | | public void setExaminePersonName(String examinePersonName) { |
| | | this.examinePersonName = examinePersonName; |
| | | } |
| | | //考核时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp examineDate; |
| | | |
| | | public Timestamp getExamineDate() { |
| | | return examineDate; |
| | | } |
| | | |
| | | public void setExamineDate(Timestamp examineDate) { |
| | | this.examineDate = examineDate; |
| | | } |
| | | |
| | | |
| | | // |
| | | // @TableId(type = IdType.AUTO) |
| | | // private Long id; |
| | | // public Long getId() { |
| | | // return id; |
| | | // } |
| | | // |
| | | // public void setId(Long id) { |
| | | // this.id = id; |
| | | // } |
| | | // |
| | | // //关联的考核数据列表 |
| | | // private List<TargetExamine> examineList = new ArrayList<>(); |
| | | // |
| | | // public List<TargetExamine> getExamineList() { |
| | | // return examineList; |
| | | // } |
| | | // |
| | | // public void setExamineList(List<TargetExamine> examineList) { |
| | | // this.examineList = examineList; |
| | | // } |
| | | // |
| | | // //要删除的id集合,多个用逗号隔开 |
| | | // private String delIds; |
| | | // |
| | | // public String getDelIds() { |
| | | // return delIds; |
| | | // } |
| | | // |
| | | // public void setDelIds(String delIds) { |
| | | // this.delIds = delIds; |
| | | // } |
| | | } |
| | |
| | | //目标指标编号 |
| | | @Query(type = Query.Type.INNER_LIKE) |
| | | private String indexNum; |
| | | //指标类型 1:年指标 2:月指标 |
| | | //指标类型 1:年指标 2:月指标 3:半年 4:季度 |
| | | @Query() |
| | | private Integer targetType; |
| | | //分解状态 1:已分解 2:未分解 |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.model.dto.req; |
| | | |
| | | import java.sql.Timestamp; |
| | | import com.gkhy.safePlatform.targetDuty.annotation.Query; |
| | | |
| | | public class TargetTypeQueryCriteria { |
| | | |
| | | @Query() |
| | | private Long id; |
| | | //分类名称 |
| | | @Query(type = Query.Type.INNER_LIKE) |
| | | private String typeName; |
| | | //说明 |
| | | @Query() |
| | | private String memo; |
| | | |
| | | @Query() |
| | | private Timestamp createTime; |
| | | |
| | | @Query() |
| | | private Timestamp updateTime; |
| | | |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | //分类名称 |
| | | public String getTypeName() { |
| | | return typeName; |
| | | } |
| | | |
| | | public void setTypeName(String typeName) { |
| | | this.typeName = typeName; |
| | | } |
| | | //说明 |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.model.dto.resp; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | public class TargetApproveDivideDetailDto implements Serializable { |
| | | |
| | | private Long id; |
| | | //关联的目标指标/外键 |
| | | private Long targetId; |
| | | //考核指标值 |
| | | private String value; |
| | | //制定日期 |
| | | private Timestamp makeDate; |
| | | //责任部门/外键 |
| | | private Long dutyDepartmentId; |
| | | //制定人部门/外键 |
| | | private Long makerDepartmentId; |
| | | //上报人/外键 |
| | | private Long commitPersonId; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | //上报人名称 |
| | | private String commitPersonName; |
| | | |
| | | //责任部门名称 |
| | | private String dutyDepartmentName; |
| | | //制定人部门名称 |
| | | private String makerDepartmentName; |
| | | |
| | | private String personId; |
| | | |
| | | private String personName; |
| | | |
| | | //上报值 |
| | | private String commitValue; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getTargetId() { |
| | | return targetId; |
| | | } |
| | | |
| | | public void setTargetId(Long targetId) { |
| | | this.targetId = targetId; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public Timestamp getMakeDate() { |
| | | return makeDate; |
| | | } |
| | | |
| | | public void setMakeDate(Timestamp makeDate) { |
| | | this.makeDate = makeDate; |
| | | } |
| | | |
| | | public Long getDutyDepartmentId() { |
| | | return dutyDepartmentId; |
| | | } |
| | | |
| | | public void setDutyDepartmentId(Long dutyDepartmentId) { |
| | | this.dutyDepartmentId = dutyDepartmentId; |
| | | } |
| | | |
| | | public Long getMakerDepartmentId() { |
| | | return makerDepartmentId; |
| | | } |
| | | |
| | | public void setMakerDepartmentId(Long makerDepartmentId) { |
| | | this.makerDepartmentId = makerDepartmentId; |
| | | } |
| | | |
| | | public Long getCommitPersonId() { |
| | | return commitPersonId; |
| | | } |
| | | |
| | | public void setCommitPersonId(Long commitPersonId) { |
| | | this.commitPersonId = commitPersonId; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getCommitPersonName() { |
| | | return commitPersonName; |
| | | } |
| | | |
| | | public void setCommitPersonName(String commitPersonName) { |
| | | this.commitPersonName = commitPersonName; |
| | | } |
| | | |
| | | public String getDutyDepartmentName() { |
| | | return dutyDepartmentName; |
| | | } |
| | | |
| | | public void setDutyDepartmentName(String dutyDepartmentName) { |
| | | this.dutyDepartmentName = dutyDepartmentName; |
| | | } |
| | | |
| | | public String getMakerDepartmentName() { |
| | | return makerDepartmentName; |
| | | } |
| | | |
| | | public void setMakerDepartmentName(String makerDepartmentName) { |
| | | this.makerDepartmentName = makerDepartmentName; |
| | | } |
| | | |
| | | public String getPersonId() { |
| | | return personId; |
| | | } |
| | | |
| | | public void setPersonId(String personId) { |
| | | this.personId = personId; |
| | | } |
| | | |
| | | public String getPersonName() { |
| | | return personName; |
| | | } |
| | | |
| | | public void setPersonName(String personName) { |
| | | this.personName = personName; |
| | | } |
| | | |
| | | public String getCommitValue() { |
| | | return commitValue; |
| | | } |
| | | |
| | | public void setCommitValue(String commitValue) { |
| | | this.commitValue = commitValue; |
| | | } |
| | | } |
| | |
| | | package com.gkhy.safePlatform.targetDuty.model.dto.resp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.io.Serializable; |
| | | |
| | |
| | | private String dutyDepartmentName; |
| | | //制定人部门名称 |
| | | private String makerDepartmentName; |
| | | |
| | | //目标分类/外键 |
| | | private Long targetTypeId; |
| | | |
| | | public Long getTargetTypeId() { |
| | | return targetTypeId; |
| | | } |
| | | |
| | | public void setTargetTypeId(Long targetTypeId) { |
| | | this.targetTypeId = targetTypeId; |
| | | } |
| | | |
| | | //目标分类名称 |
| | | private String targetTypeName; |
| | | |
| | | public String getTargetTypeName() { |
| | | return targetTypeName; |
| | | } |
| | | |
| | | public void setTargetTypeName(String targetTypeName) { |
| | | this.targetTypeName = targetTypeName; |
| | | } |
| | | |
| | | //责任人/外键 |
| | | private Long dutyPersonId; |
| | | |
| | | public Long getDutyPersonId() { |
| | | return dutyPersonId; |
| | | } |
| | | |
| | | public void setDutyPersonId(Long dutyPersonId) { |
| | | this.dutyPersonId = dutyPersonId; |
| | | } |
| | | //责任人名称 |
| | | private String dutyPersonName; |
| | | |
| | | public String getDutyPersonName() { |
| | | return dutyPersonName; |
| | | } |
| | | |
| | | public void setDutyPersonName(String dutyPersonName) { |
| | | this.dutyPersonName = dutyPersonName; |
| | | } |
| | | //计划措施 |
| | | private String planDesc; |
| | | |
| | | public String getPlanDesc() { |
| | | return planDesc; |
| | | } |
| | | |
| | | public void setPlanDesc(String planDesc) { |
| | | this.planDesc = planDesc; |
| | | } |
| | | |
| | | |
| | | public String getDutyDepartmentName() { |
| | | return dutyDepartmentName; |
| | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | //考核结果 1:合格 2:不合格 |
| | | private Integer examineResult; |
| | | |
| | | public Integer getExamineResult() { |
| | | return examineResult; |
| | | } |
| | | |
| | | public void setExamineResult(Integer examineResult) { |
| | | this.examineResult = examineResult; |
| | | } |
| | | |
| | | //考核人ID/外键 |
| | | private Long examinePersonId; |
| | | |
| | | public Long getExaminePersonId() { |
| | | return examinePersonId; |
| | | } |
| | | |
| | | public void setExaminePersonId(Long examinePersonId) { |
| | | this.examinePersonId = examinePersonId; |
| | | } |
| | | //考核人名称 |
| | | private String examinePersonName; |
| | | |
| | | public String getExaminePersonName() { |
| | | return examinePersonName; |
| | | } |
| | | |
| | | public void setExaminePersonName(String examinePersonName) { |
| | | this.examinePersonName = examinePersonName; |
| | | } |
| | | //考核时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp examineDate; |
| | | |
| | | public Timestamp getExamineDate() { |
| | | return examineDate; |
| | | } |
| | | |
| | | public void setExamineDate(Timestamp examineDate) { |
| | | this.examineDate = examineDate; |
| | | } |
| | | } |
| | |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class TargetDutyWorkApproveDto implements Serializable { |
| | | |
| | |
| | | //排序 |
| | | private Integer sort; |
| | | |
| | | |
| | | //目标指标分解列表 |
| | | private List<TargetApproveDivideDetailDto> targetDivideDetailList = new ArrayList<>(); |
| | | |
| | | public List<TargetApproveDivideDetailDto> getTargetDivideDetailList() { |
| | | return targetDivideDetailList; |
| | | } |
| | | |
| | | public void setTargetDivideDetailList(List<TargetApproveDivideDetailDto> targetDivideDetailList) { |
| | | this.targetDivideDetailList = targetDivideDetailList; |
| | | } |
| | | |
| | | |
| | | |
| | | public Long getId() { |
| | | return id; |
| | |
| | | package com.gkhy.safePlatform.targetDuty.model.dto.resp; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetExamine; |
| | | |
| | | import java.sql.Timestamp; |
| | |
| | | import java.util.List; |
| | | |
| | | public class TargetExamineDto implements Serializable { |
| | | |
| | | private Long id; |
| | | //安全目标指标 |
| | | private String qName; |
| | |
| | | private String year; |
| | | //指标值 |
| | | private String value; |
| | | //关联的考核数据列表 |
| | | private List<TargetExamineDivideDto> examineList = new ArrayList<>(); |
| | | //指标级别 1:公司级 2:部门分厂级 3:工段班组级 |
| | | private Integer level; |
| | | //完成期限 |
| | | private Timestamp completeDate; |
| | | //备注信息 |
| | | private String memo; |
| | | //指标类型 1:年指标 2:月指标 |
| | | private Integer targetType; |
| | | //分解状态 1:已分解 2:未分解 |
| | | private Integer divideStatus; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | //目标指标分解列表 |
| | | private List<TargetDivideDetailDto> targetDivideDetailList = new ArrayList<>(); |
| | | |
| | | public List<TargetDivideDetailDto> getTargetDivideDetailList() { |
| | | return targetDivideDetailList; |
| | | } |
| | | |
| | | public void setTargetDivideDetailList(List<TargetDivideDetailDto> targetDivideDetailList) { |
| | | this.targetDivideDetailList = targetDivideDetailList; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | |
| | | this.qName = qName; |
| | | } |
| | | |
| | | //目标指标编号 |
| | | public String getIndexNum() { |
| | | return indexNum; |
| | | } |
| | |
| | | public void setIndexNum(String indexNum) { |
| | | this.indexNum = indexNum; |
| | | } |
| | | |
| | | //年度 |
| | | public String getYear() { |
| | | return year; |
| | | } |
| | |
| | | public void setYear(String year) { |
| | | this.year = year; |
| | | } |
| | | |
| | | //指标值 |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public List<TargetExamineDivideDto> getExamineList() { |
| | | return examineList; |
| | | //指标级别 1:公司级 2:部门分厂级 3:工段班组级 |
| | | public Integer getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setExamineList(List<TargetExamineDivideDto> examineList) { |
| | | this.examineList = examineList; |
| | | public void setLevel(Integer level) { |
| | | this.level = level; |
| | | } |
| | | //完成期限 |
| | | public Timestamp getCompleteDate() { |
| | | return completeDate; |
| | | } |
| | | |
| | | public void setCompleteDate(Timestamp completeDate) { |
| | | this.completeDate = completeDate; |
| | | } |
| | | //备注信息 |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | //指标类型 1:年指标 2:月指标 |
| | | public Integer getTargetType() { |
| | | return targetType; |
| | | } |
| | | |
| | | public void setTargetType(Integer targetType) { |
| | | this.targetType = targetType; |
| | | } |
| | | //分解状态 1:已分解 2:未分解 |
| | | public Integer getDivideStatus() { |
| | | return divideStatus; |
| | | } |
| | | |
| | | public void setDivideStatus(Integer divideStatus) { |
| | | this.divideStatus = divideStatus; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.model.dto.resp; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | public class TargetTypeDto implements Serializable { |
| | | |
| | | private Long id; |
| | | //分类名称 |
| | | private String typeName; |
| | | //说明 |
| | | private String memo; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp createTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp updateTime; |
| | | |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | //分类名称 |
| | | public String getTypeName() { |
| | | return typeName; |
| | | } |
| | | |
| | | public void setTypeName(String typeName) { |
| | | this.typeName = typeName; |
| | | } |
| | | //说明 |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.model.dto.resp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class WorkApproveRelateDesc implements Serializable { |
| | | |
| | | private Long id; |
| | | |
| | | private String personId; |
| | | |
| | | private String personName; |
| | | |
| | | //上报值 |
| | | private String value; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getPersonId() { |
| | | return personId; |
| | | } |
| | | |
| | | public void setPersonId(String personId) { |
| | | this.personId = personId; |
| | | } |
| | | |
| | | public String getPersonName() { |
| | | return personName; |
| | | } |
| | | |
| | | public void setPersonName(String personName) { |
| | | this.personName = personName; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 目标指标(TargetMng)表数据库访问层 |
| | |
| | | */ |
| | | @Repository |
| | | public interface TargetMngRepository extends BaseMapper<TargetMng> { |
| | | @Select("<script>select COUNT(1) from target_mng where 1=1 " + |
| | | "<if test =\"divideStatus !='' and divideStatus !=null\">and divide_status = #{divideStatus}</if> " + |
| | | "<if test =\"targetType !='' and targetType !=null\">and target_type = #{targetType}</if>" + |
| | | "<if test =\"qName !='' and qName !=null\">and q_name = #{qName}</if>" + |
| | | "<if test =\"indexNum !='' and indexNum !=null\">and index_num = #{indexNum}</if>" + |
| | | "</script> ") |
| | | Integer selectTotal(Map<String, Object> beanToMap); |
| | | |
| | | @Select("<script>select COUNT(target_id) from target_divide_detail a INNER JOIN target_mng b on a.target_id = b.id \n" + |
| | | "WHERE a.id not in (select target_divide_detail_id from target_examine where examine_result = 1)\n" + |
| | | "<if test =\"divideStatus !='' and divideStatus !=null\">and b.divide_status = #{divideStatus}</if> " + |
| | | "<if test =\"targetType !='' and targetType !=null\">and b.target_type = #{targetType}</if>" + |
| | | "<if test =\"qName !='' and qName !=null\">and b.q_name = #{qName}</if>" + |
| | | "<if test =\"indexNum !='' and indexNum !=null\">and b.index_num = #{indexNum}</if>" + |
| | | "GROUP BY a.target_id</script> ") |
| | | Integer selectNoComplete(Map<String, Object> beanToMap); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.repository; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetType; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | /** |
| | | * 目标分类(TargetType)表数据库访问层 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-08-17 10:26:39 |
| | | */ |
| | | @Repository |
| | | public interface TargetTypeRepository extends BaseMapper<TargetType> { |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetDutyWorkApproveQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetDutyWorkApproveDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | void addInfo(ContextCacheUser currentUser, TargetDutyWorkApprove targetDutyWorkApprove); |
| | | |
| | | ResultVO listCheckData(PageQuery<TargetDutyWorkApproveQueryCriteria> pageQuery); |
| | | |
| | | TargetDutyWorkApproveDto selectOne(Serializable id); |
| | | } |
| | |
| | | |
| | | List<TargetExamine> queryAll(TargetExamineQueryCriteria criteria); |
| | | |
| | | void addOrUpdate(TargetExamineSaveOrUpdate infoDto); |
| | | // void addOrUpdate(TargetExamineSaveOrUpdate infoDto); |
| | | } |
| | |
| | | Object selectOne(Serializable id); |
| | | |
| | | ResultVO queryAll(Long uid, PageQuery<TargetCheckAndSubmitQueryCriteria> pageQuery); |
| | | |
| | | Object statistics(TargetMngQueryCriteria criteria); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetType; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetTypeQueryCriteria; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 目标分类(TargetType)表服务接口 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-08-17 10:20:01 |
| | | */ |
| | | public interface TargetTypeService extends IService<TargetType> { |
| | | ResultVO queryAll(PageQuery<TargetTypeQueryCriteria> pageQuery); |
| | | |
| | | List<TargetType> queryAll(TargetTypeQueryCriteria criteria); |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.ExamineMngService; |
| | | import com.gkhy.safePlatform.targetDuty.service.ExamineTemplateService; |
| | | import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<ExamineMngQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | |
| | | List<CurrentExamineDto> list = JSONObject.parseArray( dto.getNumberDetailJson(), CurrentExamineDto.class); |
| | | List<Long> idList = list.stream().map(CurrentExamineDto::getId).collect(Collectors.toList()); |
| | | |
| | | List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList); |
| | | Map<Long,ExamineItem> itemMap = itemList.stream().collect( |
| | | Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1)); |
| | | if (!idList.isEmpty()){ |
| | | List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList); |
| | | Map<Long,ExamineItem> itemMap = itemList.stream().collect( |
| | | Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1)); |
| | | |
| | | if(itemMap != null){ |
| | | list.forEach(f->{ |
| | | ExamineItem item = itemMap.get(f.getId()); |
| | | if(item != null){ |
| | | f.setItemDetail(item.getItemDetail()); |
| | | f.setContent(item.getContent()); |
| | | f.setJudgeStandard(item.getJudgeStandard()); |
| | | } |
| | | }); |
| | | if(itemMap != null){ |
| | | list.forEach(f->{ |
| | | ExamineItem item = itemMap.get(f.getId()); |
| | | if(item != null){ |
| | | f.setItemDetail(item.getItemDetail()); |
| | | f.setContent(item.getContent()); |
| | | f.setJudgeStandard(item.getJudgeStandard()); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | dto.setCurrentExamineDtoList(list); |
| | | }); |
| | |
| | | |
| | | return dto; |
| | | } |
| | | } |
| | | } |
| | |
| | | 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.gkhy.safePlatform.targetDuty.entity.ExamineItem; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.enums.TargetDutyResultCodes; |
| | | import com.gkhy.safePlatform.targetDuty.excepiton.TargetDutyException; |
| | |
| | | list.forEach(f->{f.setTargetId(infoDto.getTargetId());}); |
| | | this.saveOrUpdateBatch(list); |
| | | |
| | | //设置状态为 《已分解》 |
| | | targetMng.setDivideStatus(1); |
| | | //查询最新的分解数量,如果>0,设置状态为 《已分解》,否则设置为未分解 |
| | | int divideStatus = 2; |
| | | if(infoDto.getTargetId() != null){ |
| | | long number = this.count(new QueryWrapper<TargetDivideDetail>().eq("target_id",infoDto.getTargetId())); |
| | | if(number > 0){ |
| | | divideStatus = 1; |
| | | } |
| | | } |
| | | targetMng.setDivideStatus(divideStatus); |
| | | targetMngRepository.update(targetMng,new UpdateWrapper<TargetMng>().eq("id",targetMng.getId())); |
| | | |
| | | |
| | |
| | | package com.gkhy.safePlatform.targetDuty.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.targetDuty.entity.ExamineItem; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDivideDetail; |
| | | import com.gkhy.safePlatform.targetDuty.enums.TargetDutyResultCodes; |
| | | import com.gkhy.safePlatform.targetDuty.excepiton.TargetDutyException; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.ListCheckDataDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetApproveDivideDetailDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.WorkApproveRelateDesc; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetDivideDetailRepository; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetDutyWorkApproveRepository; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDutyWorkApprove; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetDutyWorkApproveDto; |
| | | import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 目标责任管理工作流审批表(TargetDutyWorkApprove)表服务实现类 |
| | |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | @Autowired |
| | | private TargetDivideDetailRepository targetDivideDetailRepository; |
| | | |
| | | |
| | | @Override |
| | |
| | | if (targetDutyWorkApprove.getRelateId()==null){ |
| | | throw new TargetDutyException(TargetDutyResultCodes.APPROVE_RELATE_TYPE_NULL); |
| | | } |
| | | // 关联业务json |
| | | if (!StringUtils.hasText(targetDutyWorkApprove.getRelateDesc())){ |
| | | throw new TargetDutyException("参数错误"); |
| | | } |
| | | // 审批人 |
| | | if (targetDutyWorkApprove.getApprovePersonId()==null){ |
| | | throw new TargetDutyException(TargetDutyResultCodes.APPROVE_PERSON_NULL); |
| | |
| | | ResultCodes.OK |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public TargetDutyWorkApproveDto selectOne(Serializable id) { |
| | | TargetDutyWorkApprove targetDutyWorkApprove = this.getById(id); |
| | | if(targetDutyWorkApprove == null){ |
| | | return new TargetDutyWorkApproveDto(); |
| | | } |
| | | |
| | | TargetDutyWorkApproveDto dto = BeanCopyUtils.copyBean(targetDutyWorkApprove, TargetDutyWorkApproveDto.class); |
| | | |
| | | List<WorkApproveRelateDesc> relateDescList = JSONObject.parseArray(targetDutyWorkApprove.getRelateDesc(),WorkApproveRelateDesc.class); |
| | | Map<Long,WorkApproveRelateDesc> relateDescMap = relateDescList.stream() |
| | | .collect(Collectors.toMap(WorkApproveRelateDesc::getId, Function.identity(),(k1, k2)->k1)); |
| | | |
| | | // |
| | | List<TargetDivideDetail> dList = targetDivideDetailRepository.selectBatchIds(relateDescMap.keySet()); |
| | | List<TargetApproveDivideDetailDto> divideDetailList = BeanCopyUtils.copyBeanList(dList, TargetApproveDivideDetailDto.class); |
| | | |
| | | divideDetailList.forEach(f->{ |
| | | WorkApproveRelateDesc relateDesc = relateDescMap.get(f.getId()); |
| | | if(relateDesc != null){ |
| | | f.setPersonId(relateDesc.getPersonId()); |
| | | f.setPersonName(relateDesc.getPersonName()); |
| | | f.setCommitValue(relateDesc.getValue()); |
| | | } |
| | | }); |
| | | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | divideDetailList.forEach(f->{ |
| | | collectDepIdSet.add(f.getDutyDepartmentId()); |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | divideDetailList.forEach(f->{ |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | | f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | }); |
| | | |
| | | dto.setTargetDivideDetailList(divideDetailList); |
| | | return dto; |
| | | } |
| | | } |
| | |
| | | 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.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetType; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetDivideDetailQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetExamineSaveOrUpdate; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetDivideDetailDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetMngDto; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetExamineRepository; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetExamine; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetMngRepository; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetTypeRepository; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDivideDetailService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetExamineService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private TargetExamineRepository targetExamineRepository; |
| | | |
| | | |
| | | |
| | | @Override |
| | | |
| | | @Autowired |
| | | private TargetMngRepository targetMngRepository; |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | @Resource |
| | | private TargetDivideDetailService targetDivideDetailService; |
| | | |
| | | @Autowired |
| | | private TargetTypeRepository targetTypeRepository; |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<TargetExamineQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | | Long pageSize = pageQuery.getPageSize(); |
| | | IPage<TargetExamine> page = new Page<>(pageIndex, pageSize); |
| | | IPage<TargetMng> page = new Page<>(pageIndex, pageSize); |
| | | |
| | | page = baseMapper.selectPage(page, |
| | | QueryHelpPlus.getPredicate(TargetExamine.class, pageQuery.getSearchParams())); |
| | | page = targetMngRepository.selectPage(page, |
| | | QueryHelpPlus.getPredicate(TargetMng.class, pageQuery.getSearchParams())); |
| | | List<TargetExamineDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), TargetExamineDto.class); |
| | | respList.forEach(dto->{ |
| | | //查询关联分解信息 |
| | | TargetDivideDetailQueryCriteria criteria = new TargetDivideDetailQueryCriteria(); |
| | | criteria.setTargetId(dto.getId()); |
| | | List<TargetDivideDetailDto> respList1 = BeanCopyUtils.copyBeanList(targetDivideDetailService.queryAll(criteria), TargetDivideDetailDto.class); |
| | | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | collectDepIdSet.add(f.getDutyDepartmentId()); |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList1.forEach(f->{ |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | | f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | }); |
| | | |
| | | |
| | | // --------------------------- 获取目标分类名称----------------------- |
| | | //收集所用到的目标分类ID |
| | | Set<Long> collectTypeSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | collectTypeSet.add(f.getTargetTypeId()); |
| | | }); |
| | | //获取目标分类名集合 |
| | | if(!collectTypeSet.isEmpty()){ |
| | | List<TargetType> typeList = targetTypeRepository.selectBatchIds(collectTypeSet); // TODO |
| | | Map<Long,String> typeNameMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetType::getId, TargetType::getTypeName,(k1, k2)->k1)); |
| | | |
| | | respList1.forEach(f->{ |
| | | f.setTargetTypeName(typeNameMap.get(f.getTargetTypeId())); |
| | | }); |
| | | } |
| | | |
| | | |
| | | // --------------------------- 获取考核结果----------------------- |
| | | //收集所用到的分解详情ID |
| | | Set<Long> collectExamResultSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | collectExamResultSet.add(f.getId()); |
| | | }); |
| | | //获取核结果集合 |
| | | if(!collectTypeSet.isEmpty()){ |
| | | List<TargetExamine> typeList = targetExamineRepository.selectBatchIds(collectTypeSet); |
| | | Map<Long,Integer> examResultMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetExamine::getId, TargetExamine::getExamineResult,(k1, k2)->k1)); |
| | | |
| | | respList1.forEach(f->{ |
| | | f.setExamineResult(examResultMap.get(f.getId())); |
| | | }); |
| | | } |
| | | |
| | | |
| | | dto.setTargetDivideDetailList(respList1); |
| | | }); |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | |
| | | return baseMapper.selectList(QueryHelpPlus.getPredicate(TargetExamine.class, criteria)); |
| | | } |
| | | |
| | | @Override |
| | | public void addOrUpdate(TargetExamineSaveOrUpdate infoDto) { |
| | | |
| | | |
| | | if(StringUtils.hasText(infoDto.getDelIds())) { |
| | | List<Long> idList = Arrays.stream(infoDto.getDelIds().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | this.removeByIds(idList); |
| | | } |
| | | |
| | | infoDto.getExamineList().forEach(f->{ |
| | | f.setTargetId(infoDto.getId()); |
| | | }); |
| | | this.saveOrUpdateBatch(infoDto.getExamineList()); |
| | | } |
| | | // @Override |
| | | // public void addOrUpdate(TargetExamineSaveOrUpdate infoDto) { |
| | | // |
| | | // |
| | | // if(StringUtils.hasText(infoDto.getDelIds())) { |
| | | // List<Long> idList = Arrays.stream(infoDto.getDelIds().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | // .collect(Collectors.toList()); |
| | | // this.removeByIds(idList); |
| | | // } |
| | | // |
| | | // infoDto.getExamineList().forEach(f->{ |
| | | // f.setTargetId(infoDto.getId()); |
| | | // }); |
| | | // this.saveOrUpdateBatch(infoDto.getExamineList()); |
| | | // } |
| | | } |
| | |
| | | package com.gkhy.safePlatform.targetDuty.service.impl; |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.core.toolkit.BeanUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepInfoRPCRespDTO; |
| | | import com.gkhy.safePlatform.targetDuty.entity.ExamineItem; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDutyWorkApprove; |
| | | 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.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.targetDuty.entity.*; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetCheckAndSubmitQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetDivideDetailQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetMngQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetCheckAndSubmitDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetDivideDetailDto; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetDutyWorkApproveRepository; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetMngRepository; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetMngDto; |
| | | import com.gkhy.safePlatform.targetDuty.repository.*; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDivideDetailService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetMngService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetMngQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetMngDto; |
| | | import com.gkhy.safePlatform.targetDuty.utils.BeanToMapUtil; |
| | | import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.beans.IntrospectionException; |
| | | import java.io.Serializable; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 目标指标(TargetMng)表服务实现类 |
| | |
| | | @Resource |
| | | private TargetDivideDetailService targetDivideDetailService; |
| | | |
| | | @Autowired |
| | | private TargetDivideDetailRepository targetDivideDetailRepository; |
| | | |
| | | @Resource |
| | | private TargetDutyWorkApproveRepository targetDutyWorkApproveRepository; |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | @Override |
| | | @Autowired |
| | | private TargetTypeRepository targetTypeRepository; |
| | | |
| | | @Autowired |
| | | private TargetExamineRepository targetExamineRepository; |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<TargetMngQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | | Long pageSize = pageQuery.getPageSize(); |
| | |
| | | f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | }); |
| | | |
| | | |
| | | // --------------------------- 获取目标分类名称----------------------- |
| | | //收集所用到的目标分类ID |
| | | Set<Long> collectTypeSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | collectTypeSet.add(f.getTargetTypeId()); |
| | | }); |
| | | //获取目标分类名集合 |
| | | if(!collectTypeSet.isEmpty()){ |
| | | List<TargetType> typeList = targetTypeRepository.selectBatchIds(collectTypeSet); // TODO |
| | | Map<Long,String> typeNameMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetType::getId, TargetType::getTypeName,(k1, k2)->k1)); |
| | | |
| | | respList1.forEach(f->{ |
| | | f.setTargetTypeName(typeNameMap.get(f.getDutyDepartmentId())); |
| | | }); |
| | | } |
| | | |
| | | dto.setTargetDivideDetailList(respList1); |
| | | }); |
| | |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | // --------------------------- 获取考核结果----------------------- |
| | | //收集所用到的分解详情ID |
| | | Set<Long> collectExamResultSet = new HashSet(); |
| | | respList.forEach(f->{ |
| | | collectExamResultSet.add(f.getId()); |
| | | }); |
| | | //获取核结果集合 |
| | | if(!collectExamResultSet.isEmpty()){ |
| | | List<TargetExamine> typeList = targetExamineRepository.selectList(new QueryWrapper<TargetExamine>().in("target_divide_detail_id",collectExamResultSet)); |
| | | Map<Long,TargetExamine> examResultMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetExamine::getTargetDivideDetailId, Function.identity(),(k1, k2)->k1)); |
| | | |
| | | respList.forEach(f->{ |
| | | TargetExamine targetExamine = examResultMap.get(f.getId()); |
| | | if(targetExamine != null){ |
| | | f.setExamineResult(targetExamine.getExamineResult()); |
| | | f.setExamineDate(targetExamine.getExamineDate()); |
| | | f.setExaminePersonId(targetExamine.getExaminePersonId()); |
| | | f.setExaminePersonName(targetExamine.getExaminePersonName()); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | targetMngDto.setTargetDivideDetailList(respList); |
| | | return targetMngDto; |
| | | } |
| | |
| | | respList.forEach(dto->{ |
| | | List<TargetDutyWorkApprove> list = targetDutyWorkApproveRepository.selectList( |
| | | new QueryWrapper<TargetDutyWorkApprove>().eq("del_flag",0) |
| | | .eq("relate_type",pageQuery.getSearchParams().getTargetType()) |
| | | .eq("relate_type",pageQuery.getSearchParams().getRelateType()) |
| | | .eq("relate_id",dto.getId()) |
| | | .orderByDesc("sort")); |
| | | |
| | |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public Object statistics(TargetMngQueryCriteria criteria) { |
| | | Map<String,String> map = new HashMap<>(); |
| | | // 查询总数 |
| | | Integer total = 0; |
| | | // 完成数量 |
| | | Integer complete=0; |
| | | |
| | | // 查询目标已分解且事件类型对一个的目标 |
| | | List<TargetMng> targetMngList = targetMngRepository.selectList( |
| | | new QueryWrapper<TargetMng>() |
| | | .eq("target_type",criteria.getTargetType()) |
| | | .eq("divide_status",1) |
| | | ); |
| | | if (!targetMngList.isEmpty()){ |
| | | total = targetMngList.size(); |
| | | // 查询目标下的所有分解项 |
| | | for (TargetMng targetMng : targetMngList){ |
| | | Boolean completeFlag = true; |
| | | List<TargetDivideDetail> targetDivideDetailList = targetDivideDetailRepository.selectList( |
| | | new QueryWrapper<TargetDivideDetail>() |
| | | .eq("target_id",targetMng.getId()) |
| | | ); |
| | | if (!targetDivideDetailList.isEmpty()){ |
| | | // 查询分解项 是否已经审核通过 |
| | | for (TargetDivideDetail targetDivideDetail :targetDivideDetailList){ |
| | | List<TargetExamine> targetExamineList = targetExamineRepository.selectList( |
| | | new QueryWrapper<TargetExamine>() |
| | | .eq("target_divide_detail_id",targetDivideDetail.getId()) |
| | | .eq("examine_result",1) |
| | | ); |
| | | if (targetExamineList.isEmpty()){ |
| | | completeFlag=false; |
| | | } |
| | | } |
| | | } |
| | | // 该目标中有未评价的或者不合格的 |
| | | if (completeFlag){ |
| | | complete++; |
| | | } |
| | | } |
| | | } |
| | | //未完成数 |
| | | int noComplete = total-complete; |
| | | map.put("total",total+""); |
| | | map.put("noComplete",noComplete+""); |
| | | map.put("complete",complete+""); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.service.impl; |
| | | |
| | | 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.gkhy.safePlatform.targetDuty.repository.TargetTypeRepository; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetType; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetTypeService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetTypeQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetTypeDto; |
| | | import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 目标分类(TargetType)表服务实现类 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-08-17 10:20:01 |
| | | */ |
| | | @Service("targetTypeService") |
| | | public class TargetTypeServiceImpl extends ServiceImpl<TargetTypeRepository, TargetType> implements TargetTypeService { |
| | | |
| | | @Autowired |
| | | private TargetTypeRepository targetTypeRepository; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<TargetTypeQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | | Long pageSize = pageQuery.getPageSize(); |
| | | IPage<TargetType> page = new Page<>(pageIndex, pageSize); |
| | | |
| | | page = baseMapper.selectPage(page, |
| | | QueryHelpPlus.getPredicate(TargetType.class, pageQuery.getSearchParams())); |
| | | List<TargetTypeDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), TargetTypeDto.class); |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize,page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | | ); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<TargetType> queryAll(TargetTypeQueryCriteria criteria) { |
| | | return baseMapper.selectList(QueryHelpPlus.getPredicate(TargetType.class, criteria)); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.utils; |
| | | |
| | | /** |
| | | */ |
| | | import java.beans.BeanInfo; |
| | | import java.beans.IntrospectionException; |
| | | import java.beans.Introspector; |
| | | import java.beans.PropertyDescriptor; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class BeanToMapUtil { |
| | | |
| | | /** |
| | | * 将一个 Map 对象转化为一个 JavaBean |
| | | * @param type 要转化的类型 |
| | | * @param map 包含属性值的 map |
| | | * @return 转化出来的 JavaBean 对象 |
| | | * @throws IntrospectionException |
| | | * 如果分析类属性失败 |
| | | * @throws IllegalAccessException |
| | | * 如果实例化 JavaBean 失败 |
| | | * @throws InstantiationException |
| | | * 如果实例化 JavaBean 失败 |
| | | * @throws InvocationTargetException |
| | | * 如果调用属性的 setter 方法失败 |
| | | */ |
| | | public static Object convertMap(Class type, Map map) |
| | | throws IntrospectionException, IllegalAccessException, |
| | | InstantiationException, InvocationTargetException { |
| | | BeanInfo beanInfo = Introspector.getBeanInfo(type); // 获取类属性 |
| | | Object obj = type.newInstance(); // 创建 JavaBean 对象 |
| | | |
| | | // 给 JavaBean 对象的属性赋值 |
| | | PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); |
| | | for (int i = 0; i< propertyDescriptors.length; i++) { |
| | | PropertyDescriptor descriptor = propertyDescriptors[i]; |
| | | String propertyName = descriptor.getName(); |
| | | |
| | | if (map.containsKey(propertyName)) { |
| | | // 下面一句可以 try 起来,这样当一个属性赋值失败的时候就不会影响其他属性赋值。 |
| | | Object value = map.get(propertyName); |
| | | |
| | | Object[] args = new Object[1]; |
| | | args[0] = value; |
| | | |
| | | descriptor.getWriteMethod().invoke(obj, args); |
| | | } |
| | | } |
| | | return obj; |
| | | } |
| | | |
| | | /** |
| | | * 将一个 JavaBean 对象转化为一个 Map |
| | | * @param bean 要转化的JavaBean 对象 |
| | | * @return 转化出来的 Map 对象 |
| | | * @throws IntrospectionException 如果分析类属性失败 |
| | | * @throws IllegalAccessException 如果实例化 JavaBean 失败 |
| | | * @throws InvocationTargetException 如果调用属性的 setter 方法失败 |
| | | */ |
| | | public static Map convertBean(Object bean) |
| | | throws IntrospectionException, IllegalAccessException, InvocationTargetException { |
| | | Class type = bean.getClass(); |
| | | Map returnMap = new HashMap(); |
| | | BeanInfo beanInfo = Introspector.getBeanInfo(type); |
| | | |
| | | PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); |
| | | for (int i = 0; i< propertyDescriptors.length; i++) { |
| | | PropertyDescriptor descriptor = propertyDescriptors[i]; |
| | | String propertyName = descriptor.getName(); |
| | | if (!propertyName.equals("class")) { |
| | | Method readMethod = descriptor.getReadMethod(); |
| | | Object result = readMethod.invoke(bean, new Object[0]); |
| | | if (result != null) { |
| | | returnMap.put(propertyName, result); |
| | | } else { |
| | | returnMap.put(propertyName, ""); |
| | | } |
| | | } |
| | | } |
| | | return returnMap; |
| | | } |
| | | |
| | | |
| | | public static Map convertHaveDataBean(Object bean) |
| | | throws IntrospectionException, IllegalAccessException, InvocationTargetException { |
| | | Class type = bean.getClass(); |
| | | Map returnMap = new HashMap(); |
| | | BeanInfo beanInfo = Introspector.getBeanInfo(type); |
| | | |
| | | PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); |
| | | for (int i = 0; i< propertyDescriptors.length; i++) { |
| | | PropertyDescriptor descriptor = propertyDescriptors[i]; |
| | | String propertyName = descriptor.getName(); |
| | | if (!propertyName.equals("class")) { |
| | | Method readMethod = descriptor.getReadMethod(); |
| | | Object result = readMethod.invoke(bean, new Object[0]); |
| | | if (result != null) { //有值得字段放入map中,其他的不要 |
| | | returnMap.put(propertyName, result); |
| | | } |
| | | } |
| | | } |
| | | return returnMap; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.controller; |
| | | |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportCountRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportCountQuery; |
| | | import com.gkhy.safePlatform.incidentManage.service.AccidentCountService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/accidentCount") |
| | | public class AccidentCountController { |
| | | |
| | | @Autowired |
| | | private AccidentCountService accidentCountService; |
| | | |
| | | |
| | | /** |
| | | * 事故报告统计的rpc接口 |
| | | */ |
| | | @RequestMapping(value = "/accidentReport/count",method = RequestMethod.POST) |
| | | public ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(@RequestBody AccidentReportCountQuery query){ |
| | | return accidentCountService.countAccidentReport(query); |
| | | } |
| | | |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |
文件名从 incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/query/AccidentReportRPCQuery.java 修改 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.query; |
| | | |
| | | public class AccidentReportRPCQuery { |
| | | public class AccidentReportCountQuery { |
| | | |
| | | private String level; |
| | | |
| | |
| | | |
| | | private int month; |
| | | |
| | | private String realMonth; |
| | | |
| | | public String getRealMonth() { |
| | | return realMonth; |
| | | } |
| | | |
| | | public void setRealMonth(String realMonth) { |
| | | this.realMonth = realMonth; |
| | | } |
| | | |
| | | public String getLevel() { |
| | | return level; |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.service; |
| | | |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportCountRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportCountQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface AccidentCountService { |
| | | |
| | | ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(AccidentReportCountQuery query); |
| | | } |
| | |
| | | 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 batchDeleteAccidentReport(Long[] ids); |
| | | |
| | | ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(AccidentReportRPCQuery query); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.service.impl; |
| | | |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.*; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.*; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportCountQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.service.AccidentCountService; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentReportInfoService; |
| | | import com.gkhy.safePlatform.incidentManage.utils.TimeUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Service("accidentCountService") |
| | | public class AccidentCountServiceImpl implements AccidentCountService { |
| | | |
| | | @Autowired |
| | | private AccidentReportInfoService accidentReportInfoService; |
| | | |
| | | |
| | | @Override |
| | | public ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(AccidentReportCountQuery query) { |
| | | |
| | | List<AccidentReportCount> list = new ArrayList<>(); |
| | | AccidentReportRPCDBQuery dbQuery = new AccidentReportRPCDBQuery(); |
| | | if (query.getType() == 1) { |
| | | // 月 |
| | | int year = query.getYear(); |
| | | int month; |
| | | if (query.getMonth() == 0) { |
| | | Calendar date = Calendar.getInstance(); |
| | | month = date.get(Calendar.MONTH) + 1; |
| | | } else { |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentReportReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.*; |
| | | 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.AccidentExpressFileInfoService; |
| | | 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; |
| | |
| | | if (AccidentReportReqDTO.getFillInTime() == null) { |
| | | throw new AccidentException(AccidentResultCodes.REPORT_FILL_IN_TIME_NULL); |
| | | } |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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)); |
| | | int month = date.get(Calendar.MONTH) + 1; |
| | | System.out.println(month); |
| | | } |
| | | } |