| | |
| | | package com.fzzy.igds; |
| | | |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.bstek.dorado.data.provider.Page; |
| | | import com.fzzy.common.constant.BizTypeEnum; |
| | | import com.fzzy.igds.data.BaseResp; |
| | | import com.fzzy.igds.data.IgdsBaseParam; |
| | | import com.fzzy.igds.data.NoticeParam; |
| | | import com.fzzy.igds.data.PatrolSuperData; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.domain.InoutNoticeIn; |
| | | import com.fzzy.igds.domain.Patrol; |
| | | import com.fzzy.igds.domain.*; |
| | | import com.fzzy.igds.service.CoreDeptService; |
| | | import com.fzzy.igds.service.PatrolService; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | |
| | | @Resource |
| | | private CoreDeptService coreDeptService; |
| | | |
| | | /*-------------------巡检监管统计信息--------------------*/ |
| | | /** |
| | | * patrolPR#getData 巡检监管统计 |
| | | * |
| | |
| | | //库区转换 |
| | | Map<String, PatrolSuperData> map = new HashMap<>(); |
| | | for (Dept dept : deptList) { |
| | | map.put(dept.getId(), new PatrolSuperData(dept.getCompanyId(), dept.getId())); |
| | | map.put(dept.getId(), new PatrolSuperData(dept.getId().substring(0,(dept.getId().length()-3)), dept.getId())); |
| | | } |
| | | |
| | | List<Patrol> weekList = patrolService.getWeekList(); |
| | |
| | | for (Patrol patrol : weekList) { |
| | | patrolSuperData = map.get(patrol.getDeptId()); |
| | | |
| | | //7天内统计 |
| | | patrolSuperData.setWeekNum(patrolSuperData.getWeekNum() + 1); |
| | | |
| | | //当天统计 |
| | | if(patrol.getCreateTime().after(end)){ |
| | | patrolSuperData.setCurNum(patrolSuperData.getCurNum() + 1); |
| | | patrolSuperData.setIsPatrol("Y"); |
| | | } |
| | | |
| | | //昨天统计 |
| | | if(patrol.getCreateTime().after(start) && patrol.getCreateTime().before(end)){ |
| | | patrolSuperData.setWeekNum(patrolSuperData.getWeekNum() + 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return new ArrayList<>(map.values()); |
| | | ArrayList<PatrolSuperData> list = new ArrayList<>(map.values()); |
| | | Collections.sort(list, new Comparator<PatrolSuperData>() { |
| | | @Override |
| | | public int compare(PatrolSuperData o1, PatrolSuperData o2) { |
| | | return o1.getDeptId().compareTo(o2.getDeptId()); |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | /*-------------------电子巡更记录主表信息--------------------*/ |
| | | /** |
| | | * patrolPR#pagePatrolData 获取巡检记录信息 |
| | | * |
| | |
| | | page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal()))); |
| | | } |
| | | |
| | | |
| | | |
| | | /*-------------------电子巡更配置信息--------------------*/ |
| | | |
| | | /** |
| | | * patrolPR#listPatrolConf |
| | | * 银行列表 |
| | | */ |
| | | @DataProvider |
| | | public List<PatrolConf> listPatrolConf(IgdsBaseParam param) { |
| | | return patrolService.listPatrolConf(param); |
| | | } |
| | | |
| | | /** |
| | | * 保存/更新 |
| | | * patrolPR#saveUpdateConf |
| | | * @param bank |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | @DataResolver |
| | | public BaseResp saveUpdateConf(PatrolConf bank){ |
| | | |
| | | if(StringUtils.isEmpty(bank.getId())){ |
| | | return patrolService.addPatrolConf(bank); |
| | | }else { |
| | | return patrolService.updatePatrolConf(bank); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * patrolPR#deletePatrolConf |
| | | * @param bank |
| | | * @return |
| | | */ |
| | | @Expose |
| | | @Log(title = "巡检配置", businessType = BusinessType.DELETE,bizType = BizTypeEnum.SECURITY) |
| | | public BaseResp deletePatrolConf(PatrolConf bank){ |
| | | if(StringUtils.isNotEmpty(bank.getId())) return patrolService.deletePatrolConf(bank); |
| | | return BaseResp.success(); |
| | | } |
| | | |
| | | } |