| | |
| | | @ExcelProperty({"自贡市公共视频监控系统续维合同", "规则名称"}) |
| | | @ColumnWidth(130) |
| | | private String ruleName; |
| | | /** |
| | | * 细则 |
| | | */ |
| | | @ExcelProperty({"自贡市公共视频监控系统续维合同", "细则"}) |
| | | @ColumnWidth(130) |
| | | private String detailName; |
| | | |
| | | /** |
| | | * 数量 |
| | |
| | | // log.error("CLIENT_QueryDeviceTime Failed!" + ToolKits.getErrorCodePrint()); |
| | | return null; |
| | | } |
| | | log.info("OSD时间原始数据格式,{},toString格式{}",deviceTime,deviceTime.toStringTime()); |
| | | Date checkTime = new Date(); |
| | | osdResult.setCheckTime(checkTime); |
| | | String date = deviceTime.toStringTime(); |
| | |
| | | osdInfo.read(); |
| | | NET_GBMODE_CUSTOMTITLE_INFO[] stuCustomTitle = osdInfo.stuCustomTitle; |
| | | for (NET_GBMODE_CUSTOMTITLE_INFO title : stuCustomTitle) { |
| | | log.info("OSD原始数据格式{}",title); |
| | | String position = new String(title.szPositon, StandardCharsets.UTF_8).trim(); |
| | | if("LeftDown".equals(position)) { |
| | | NET_TITLE_OSD_INFO[] stuOSD = title.stuOSD; |
| | |
| | | @PostMapping("/export") |
| | | @ApiOperation(value = "导出", notes = "导出") |
| | | @PreAuthorize("@ss.hasPermi('system:calculate:report:export')") |
| | | public void export(Integer calculateId,Integer contractId, HttpServletResponse response) { |
| | | calculateReportService.export(calculateId,contractId, response); |
| | | public void export(Integer whichYear,Integer whichMonth,Integer contractId, HttpServletResponse response) { |
| | | calculateReportService.export(whichYear,whichMonth,contractId, response); |
| | | } |
| | | |
| | | } |
| | |
| | | * 导出数据 |
| | | * @return 数据 |
| | | */ |
| | | List<CalculateExport> exportData(Integer calculateId); |
| | | List<CalculateExport> exportData(Integer whichYear,Integer whichMonth,Integer contractId); |
| | | } |
| | |
| | | * 导出 |
| | | * @param response 响应 |
| | | */ |
| | | void export(Integer calculateId,Integer contractId, HttpServletResponse response); |
| | | void export(Integer whichYear,Integer whichMonth,Integer contractId, HttpServletResponse response); |
| | | } |
| | |
| | | |
| | | @Override |
| | | @SneakyThrows |
| | | public void export(Integer calculateId,Integer contractId, HttpServletResponse response) { |
| | | public void export(Integer whichYear,Integer whichMonth,Integer contractId, HttpServletResponse response) { |
| | | // 获取数据 |
| | | List<CalculateExport> list = baseMapper.exportData(calculateId); |
| | | List<CalculateExport> list = baseMapper.exportData(whichYear,whichMonth,contractId); |
| | | CalculateExport calculateExport = new CalculateExport(); |
| | | calculateExport.setRuleName("合计"); |
| | | calculateExport.setNum(list.stream().mapToInt(CalculateExport::getNum).sum()); |
| | |
| | | |
| | | |
| | | import com.mongodb.client.result.DeleteResult; |
| | | import com.ycl.api.DH.lib.NetSDKLib; |
| | | import com.ycl.api.DH.lib.structure.NET_CFG_GBMODE_INFO; |
| | | import com.ycl.api.DH.lib.structure.NET_GBMODE_CUSTOMTITLE_INFO; |
| | | import com.ycl.api.DH.lib.structure.NET_TITLE_OSD_INFO; |
| | | import com.ycl.api.DH.module.LoginModule; |
| | | import com.ycl.api.DH.utils.DHApi; |
| | | import com.ycl.api.HK.HKApi; |
| | | import com.ycl.api.YS.YSApi; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import java.util.concurrent.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.ycl.api.DH.lib.enumeration.NET_EM_CFG_OPERATE_TYPE.NET_EM_CFG_GBMODE; |
| | | |
| | | @Slf4j |
| | | @Component("OsdTask") |
| | |
| | | public String YSUserName; |
| | | @Value("${YS.password}") |
| | | public String YSPassword; |
| | | |
| | | /** |
| | | * 通过查mongoDB每日一机一档数据获取设备ip |
| | | * 筛选视频设备 |
| | |
| | | } |
| | | |
| | | |
| | | public void test() throws ExecutionException, InterruptedException { |
| | | log.info("测试获取OSD"); |
| | | OSDResult osd3 = DHApi.getOsd("51030446001320141102","51.95.68.3", DHUserName, DHPassword); |
| | | log.info("大华结果数据:{}",osd3); |
| | | } |
| | | } |
| | |
| | | AND tcr.status=#{status} |
| | | </if> |
| | | </where> |
| | | group by tcr.id |
| | | ORDER BY |
| | | tcr.create_time |
| | | </select> |
| | |
| | | </select> |
| | | |
| | | <select id="exportData" resultType="com.ycl.platform.domain.excel.CalculateExport"> |
| | | SELECT a.rule_name, |
| | | SELECT |
| | | a.rule_name as ruleName, |
| | | a.rule_condition as detailName, |
| | | COUNT(b.id) AS num, |
| | | IFNULL(-SUM(b.score), 0) AS score |
| | | FROM t_calculate_rule a |
| | | LEFT JOIN t_calculate_record tcr ON a.contract_id = tcr.contract_id And tcr.id = #{calculateId} |
| | | LEFT JOIN t_contract_score b ON b.rule_id = a.id AND auditing_status = 'PASS' AND b.deleted = 0 AND YEAR (b.create_time) = tcr.which_year |
| | | WHERE a.deleted = 0 |
| | | GROUP BY a.rule_name |
| | | LEFT JOIN t_calculate_record tcr ON a.contract_id = tcr.contract_id |
| | | LEFT JOIN t_contract_score b ON b.rule_id = a.id AND auditing_status = 'PASS' AND b.deleted = 0 |
| | | AND MONTH(b.create_time) = tcr.which_month |
| | | AND YEAR(b.create_time) = tcr.which_year |
| | | <where> |
| | | a.deleted = 0 and a.contract_id = #{contractId} |
| | | <if test="whichMonth!=null"> |
| | | and tcr.which_month = #{whichMonth} |
| | | </if> |
| | | <if test="whichYear!=null"> |
| | | and tcr.which_year = #{whichYear} |
| | | </if> |
| | | </where> |
| | | GROUP BY a.id |
| | | </select> |
| | | |
| | | </mapper> |