Merge remote-tracking branch 'origin/master'
正在显示
37 个修改的文件
包含
341 行增加
和
160 行删除
... | @@ -194,8 +194,8 @@ public class PgServiceImpl implements IPgService { | ... | @@ -194,8 +194,8 @@ public class PgServiceImpl implements IPgService { |
194 | } | 194 | } |
195 | } | 195 | } |
196 | str.append("''"); | 196 | str.append("''"); |
197 | String sql = "SELECT nm,v FROM "+deviceId+"_count WHERE nm IN ( "+str.toString()+" ) " + | 197 | String sql = "SELECT nm,ROUND(AVG(CAST(v AS NUMERIC)),2) AS v FROM "+deviceId+"_count WHERE nm IN ( "+str.toString()+" ) " + |
198 | " AND ts = ( SELECT max( ts ) FROM "+deviceId+"_count WHERE ts >= '"+start+"' AND ts <= '"+end+"' )"; | 198 | " AND ts >= '"+start+"' AND ts <= '"+end+"' GROUP BY nm"; |
199 | list = pgDb.queryForList(sql); | 199 | list = pgDb.queryForList(sql); |
200 | }catch (Exception e){ | 200 | }catch (Exception e){ |
201 | log.error("查询计算表出错"); | 201 | log.error("查询计算表出错"); | ... | ... |
... | @@ -67,7 +67,6 @@ public class AjhMeetingController { | ... | @@ -67,7 +67,6 @@ public class AjhMeetingController { |
67 | * @author 开发者姓名, 开发时间 | 67 | * @author 开发者姓名, 开发时间 |
68 | * @Description: TODO(这里描述这个方法的需求变更情况) | 68 | * @Description: TODO(这里描述这个方法的需求变更情况) |
69 | */ | 69 | */ |
70 | |||
71 | @AutoLog(value = "会议通知-分页列表查询") | 70 | @AutoLog(value = "会议通知-分页列表查询") |
72 | @ApiOperation(value="会议通知-分页列表查询", notes="会议通知-分页列表查询") | 71 | @ApiOperation(value="会议通知-分页列表查询", notes="会议通知-分页列表查询") |
73 | @GetMapping(value = "/list") | 72 | @GetMapping(value = "/list") |
... | @@ -83,6 +82,28 @@ public class AjhMeetingController { | ... | @@ -83,6 +82,28 @@ public class AjhMeetingController { |
83 | return result; | 82 | return result; |
84 | } | 83 | } |
85 | 84 | ||
85 | @AutoLog(value = "会议通知-撤回") | ||
86 | @ApiOperation(value="会议通知-撤回", notes="会议通知-撤回") | ||
87 | @GetMapping(value = "/revoke") | ||
88 | public Result<AjhMeeting> revokeRecord(String id) { | ||
89 | Result<AjhMeeting> result = new Result<AjhMeeting>(); | ||
90 | boolean ok = false; | ||
91 | AjhMeeting ajhMeeting = ajhMeetingService.getById(id); | ||
92 | if(ConvertUtils.isNotEmpty(ajhMeeting)){ | ||
93 | ok = ajhMeetingService.revoke(ajhMeeting); | ||
94 | if(ok){ | ||
95 | result.success("撤回成功!"); | ||
96 | }else{ | ||
97 | result.error500("撤回失败!已有机构发布通知!"); | ||
98 | } | ||
99 | }else{ | ||
100 | result.error500("撤回失败!通知不存在!"); | ||
101 | } | ||
102 | result.setSuccess(ok); | ||
103 | result.setResult(ajhMeeting); | ||
104 | return result; | ||
105 | } | ||
106 | |||
86 | /** | 107 | /** |
87 | * <pre> | 108 | * <pre> |
88 | * 添加 | 109 | * 添加 |
... | @@ -119,8 +140,8 @@ public class AjhMeetingController { | ... | @@ -119,8 +140,8 @@ public class AjhMeetingController { |
119 | @PostMapping(value = "/release") | 140 | @PostMapping(value = "/release") |
120 | public Result<AjhMeeting> release(@RequestBody AjhMeeting ajhMeeting) { | 141 | public Result<AjhMeeting> release(@RequestBody AjhMeeting ajhMeeting) { |
121 | Result<AjhMeeting> result = new Result<AjhMeeting>(); | 142 | Result<AjhMeeting> result = new Result<AjhMeeting>(); |
122 | try { | ||
123 | boolean ok = false; | 143 | boolean ok = false; |
144 | try { | ||
124 | ajhMeeting.setSender(BaseContextHandler.getUserId()); | 145 | ajhMeeting.setSender(BaseContextHandler.getUserId()); |
125 | ajhMeeting.setSendTime(new Date()); | 146 | ajhMeeting.setSendTime(new Date()); |
126 | ajhMeeting.setSendStatus("1");//状态修改为已发布 | 147 | ajhMeeting.setSendStatus("1");//状态修改为已发布 | ... | ... |
... | @@ -349,12 +349,15 @@ public class AjhMeetingSendController { | ... | @@ -349,12 +349,15 @@ public class AjhMeetingSendController { |
349 | if(ajhMeetingSend != null ){ | 349 | if(ajhMeetingSend != null ){ |
350 | if(StringUtils.isNotEmpty(ajhMeetingSend.getMeetCompere())){ | 350 | if(StringUtils.isNotEmpty(ajhMeetingSend.getMeetCompere())){ |
351 | SysUser sysUser = userService.getById(ajhMeetingSend.getMeetCompere()); | 351 | SysUser sysUser = userService.getById(ajhMeetingSend.getMeetCompere()); |
352 | ajhMeetingSend.setMeetCompereName( sysUser.getRealname()); | 352 | if(sysUser != null){ |
353 | ajhMeetingSend.setMeetCompereName(sysUser.getRealname()); | ||
354 | } | ||
353 | } | 355 | } |
354 | |||
355 | if(StringUtils.isNotEmpty(ajhMeetingSend.getDepartId()) && StringUtils.isEmpty(ajhMeetingSend.getDepartName())){ | 356 | if(StringUtils.isNotEmpty(ajhMeetingSend.getDepartId()) && StringUtils.isEmpty(ajhMeetingSend.getDepartName())){ |
356 | SysDepart depart = departService.getById(ajhMeetingSend.getDepartId()); | 357 | SysDepart depart = departService.getById(ajhMeetingSend.getDepartId()); |
357 | ajhMeetingSend.setDepartName( depart.getDepartName()); | 358 | if(depart != null){ |
359 | ajhMeetingSend.setDepartName(depart.getDepartName()); | ||
360 | } | ||
358 | } | 361 | } |
359 | } | 362 | } |
360 | if(ajhMeetingSend==null) { | 363 | if(ajhMeetingSend==null) { | ... | ... |
... | @@ -18,4 +18,6 @@ public interface IAjhMeetingService extends IService<AjhMeeting> { | ... | @@ -18,4 +18,6 @@ public interface IAjhMeetingService extends IService<AjhMeeting> { |
18 | IPage<AjhMeeting> queryPageList(Page<AjhMeeting> page, AjhMeeting ajhMeeting); | 18 | IPage<AjhMeeting> queryPageList(Page<AjhMeeting> page, AjhMeeting ajhMeeting); |
19 | 19 | ||
20 | AjhMeetingVO getDataById(String id); | 20 | AjhMeetingVO getDataById(String id); |
21 | |||
22 | boolean revoke(AjhMeeting ajhMeeting); | ||
21 | } | 23 | } | ... | ... |
1 | package com.skua.modules.ajh.service.impl; | 1 | package com.skua.modules.ajh.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
6 | import com.skua.core.util.ConvertUtils; | ||
5 | import com.skua.modules.ajh.entity.AjhMeeting; | 7 | import com.skua.modules.ajh.entity.AjhMeeting; |
6 | import com.skua.modules.ajh.entity.AjhMeetingSend; | 8 | import com.skua.modules.ajh.entity.AjhMeetingSend; |
7 | import com.skua.modules.ajh.mapper.AjhMeetingMapper; | 9 | import com.skua.modules.ajh.mapper.AjhMeetingMapper; |
... | @@ -40,6 +42,16 @@ public class AjhMeetingServiceImpl extends ServiceImpl<AjhMeetingMapper, AjhMeet | ... | @@ -40,6 +42,16 @@ public class AjhMeetingServiceImpl extends ServiceImpl<AjhMeetingMapper, AjhMeet |
40 | 42 | ||
41 | @Override | 43 | @Override |
42 | public void sendMeettingNotice(AjhMeeting ajhMeeting) { | 44 | public void sendMeettingNotice(AjhMeeting ajhMeeting) { |
45 | //判断是否已经创建完通知 | ||
46 | QueryWrapper<AjhMeetingSend> queryWrapper = new QueryWrapper<>(); | ||
47 | queryWrapper.eq("meet_id",ajhMeeting.getId()); | ||
48 | List<AjhMeetingSend> list = ajhMeetingSendService.getList(queryWrapper); | ||
49 | if(list.size() > 0){ | ||
50 | for (AjhMeetingSend ajhMeetingSend : list) { | ||
51 | ajhMeetingSend.setSendStatus("0"); | ||
52 | } | ||
53 | ajhMeetingSendService.saveOrUpdateBatch(list); | ||
54 | }else{ | ||
43 | //获取所有的有会议权限的用户 | 55 | //获取所有的有会议权限的用户 |
44 | List<Map<String,String>> userList = ajhMeetingMapper.getMeetUsers(MEET_NOTICE_ROLE_CODE); | 56 | List<Map<String,String>> userList = ajhMeetingMapper.getMeetUsers(MEET_NOTICE_ROLE_CODE); |
45 | if(userList.size() > 0){ | 57 | if(userList.size() > 0){ |
... | @@ -82,9 +94,8 @@ public class AjhMeetingServiceImpl extends ServiceImpl<AjhMeetingMapper, AjhMeet | ... | @@ -82,9 +94,8 @@ public class AjhMeetingServiceImpl extends ServiceImpl<AjhMeetingMapper, AjhMeet |
82 | } | 94 | } |
83 | } | 95 | } |
84 | } | 96 | } |
85 | |||
86 | } | 97 | } |
87 | 98 | } | |
88 | } | 99 | } |
89 | 100 | ||
90 | @Override | 101 | @Override |
... | @@ -99,4 +110,20 @@ public class AjhMeetingServiceImpl extends ServiceImpl<AjhMeetingMapper, AjhMeet | ... | @@ -99,4 +110,20 @@ public class AjhMeetingServiceImpl extends ServiceImpl<AjhMeetingMapper, AjhMeet |
99 | AjhMeetingVO ajhMeeting = ajhMeetingMapper.getDataById(id); | 110 | AjhMeetingVO ajhMeeting = ajhMeetingMapper.getDataById(id); |
100 | return ajhMeeting; | 111 | return ajhMeeting; |
101 | } | 112 | } |
113 | |||
114 | @Override | ||
115 | public boolean revoke(AjhMeeting ajhMeeting) { | ||
116 | QueryWrapper<AjhMeetingSend> queryWrapper = new QueryWrapper<>(); | ||
117 | queryWrapper.eq("meet_id",ajhMeeting.getId()); | ||
118 | List<AjhMeetingSend> list = ajhMeetingSendService.getList(queryWrapper); | ||
119 | for (AjhMeetingSend ajhMeetingSend : list) { | ||
120 | ajhMeetingSend.setSendStatus("2"); | ||
121 | } | ||
122 | boolean ok = ajhMeetingSendService.saveOrUpdateBatch(list); | ||
123 | if(ok){ | ||
124 | ajhMeeting.setSendStatus("0");//状态修改为未发布 | ||
125 | ajhMeetingMapper.updateById(ajhMeeting); | ||
126 | } | ||
127 | return ok; | ||
128 | } | ||
102 | } | 129 | } | ... | ... |
sk-module-biz/src/main/java/com/skua/modules/algorithm/controller/SysAlgorithmLibraryController.java
... | @@ -60,11 +60,7 @@ public class SysAlgorithmLibraryController { | ... | @@ -60,11 +60,7 @@ public class SysAlgorithmLibraryController { |
60 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 60 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
61 | HttpServletRequest req) { | 61 | HttpServletRequest req) { |
62 | Result<IPage<SysAlgorithmLibrary>> result = new Result<IPage<SysAlgorithmLibrary>>(); | 62 | Result<IPage<SysAlgorithmLibrary>> result = new Result<IPage<SysAlgorithmLibrary>>(); |
63 | Map<String, String[]> paramMap = req.getParameterMap(); | ||
64 | |||
65 | |||
66 | QueryWrapper<SysAlgorithmLibrary> queryWrapper = QueryGenerator.initQueryWrapper(sysAlgorithmLibrary, req.getParameterMap()); | 63 | QueryWrapper<SysAlgorithmLibrary> queryWrapper = QueryGenerator.initQueryWrapper(sysAlgorithmLibrary, req.getParameterMap()); |
67 | |||
68 | Page<SysAlgorithmLibrary> page = new Page<>(pageNo, pageSize); | 64 | Page<SysAlgorithmLibrary> page = new Page<>(pageNo, pageSize); |
69 | IPage<SysAlgorithmLibrary> pageList = sysAlgorithmLibraryService.page(page, queryWrapper); | 65 | IPage<SysAlgorithmLibrary> pageList = sysAlgorithmLibraryService.page(page, queryWrapper); |
70 | List<SysAlgorithmLibrary> sysAlgorithmLibraryList = pageList.getRecords(); | 66 | List<SysAlgorithmLibrary> sysAlgorithmLibraryList = pageList.getRecords(); | ... | ... |
... | @@ -99,30 +99,6 @@ public class SysAlgorithmStatisticsLibraryController { | ... | @@ -99,30 +99,6 @@ public class SysAlgorithmStatisticsLibraryController { |
99 | return result; | 99 | return result; |
100 | } | 100 | } |
101 | 101 | ||
102 | @AutoLog(value = "统计功能配置表-统计计算") | ||
103 | @ApiOperation(value="统计功能配置表-统计计算", notes="统计功能配置表-统计计算") | ||
104 | @PostMapping(value = "/statistics/waterData") | ||
105 | public Result<SysAlgorithmStatisticsResultVO> statisticsByWaterData(@RequestBody JSONObject jsonObject, | ||
106 | HttpServletRequest req) throws Exception { | ||
107 | Result<SysAlgorithmStatisticsResultVO> result = new Result<>(); | ||
108 | //将jsonObject转sysAlgorithmStatisticsLibraryVO对象 | ||
109 | SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class); | ||
110 | //将jsonObject转Map对象 | ||
111 | Map<String,Object> paramMap = JSONObject.toJavaObject(jsonObject,Map.class); | ||
112 | //将paramMap集合去掉SysAlgorithmStatisticsLibraryVO对象内容 | ||
113 | Map<String,Object> sysAlgorithmStatisticsLibraryVOMap = JSON.parseObject(JSON.toJSONString(sysAlgorithmStatisticsLibraryVO), new TypeReference<Map<String, Object>>() {}); | ||
114 | //Maps.difference(Map, Map)用来比较两个Map以获取所有不同点 | ||
115 | MapDifference<String, Object> difference = Maps.difference(paramMap, sysAlgorithmStatisticsLibraryVOMap); | ||
116 | // 键只存在于左边Map的映射项 | ||
117 | paramMap = difference.entriesOnlyOnLeft(); | ||
118 | SysAlgorithmStatisticsResultVO vo = sysAlgorithmStatisticsLibraryService.statistics(sysAlgorithmStatisticsLibraryVO,paramMap); | ||
119 | //todo 演示暂时注释 | ||
120 | result.setSuccess(true); | ||
121 | result.setResult(vo); | ||
122 | return result; | ||
123 | } | ||
124 | |||
125 | |||
126 | /** | 102 | /** |
127 | * 添加 | 103 | * 添加 |
128 | * @param sysAlgorithmStatisticsLibrary | 104 | * @param sysAlgorithmStatisticsLibrary | ... | ... |
... | @@ -28,21 +28,21 @@ public class SysAlgorithmDatabaseInfo { | ... | @@ -28,21 +28,21 @@ public class SysAlgorithmDatabaseInfo { |
28 | /**主键*/ | 28 | /**主键*/ |
29 | @TableId(type = IdType.ID_WORKER_STR) | 29 | @TableId(type = IdType.ID_WORKER_STR) |
30 | @ApiModelProperty(value = "主键") | 30 | @ApiModelProperty(value = "主键") |
31 | private java.lang.String id; | 31 | private String id; |
32 | /**项目名称*/ | 32 | /**项目名称*/ |
33 | @Excel(name = "项目名称", width = 15) | 33 | @Excel(name = "项目名称", width = 15) |
34 | @ApiModelProperty(value = "项目名称") | 34 | @ApiModelProperty(value = "项目名称") |
35 | private java.lang.String projectName; | 35 | private String projectName; |
36 | /**数据库连接地址*/ | 36 | /**数据库连接地址*/ |
37 | @Excel(name = "数据库连接地址", width = 15) | 37 | @Excel(name = "数据库连接地址", width = 15) |
38 | @ApiModelProperty(value = "数据库连接地址") | 38 | @ApiModelProperty(value = "数据库连接地址") |
39 | private java.lang.String url; | 39 | private String url; |
40 | /**数据库用户名*/ | 40 | /**数据库用户名*/ |
41 | @Excel(name = "数据库用户名", width = 15) | 41 | @Excel(name = "数据库用户名", width = 15) |
42 | @ApiModelProperty(value = "数据库用户名") | 42 | @ApiModelProperty(value = "数据库用户名") |
43 | private java.lang.String username; | 43 | private String username; |
44 | /**数据库密码*/ | 44 | /**数据库密码*/ |
45 | @Excel(name = "数据库密码", width = 15) | 45 | @Excel(name = "数据库密码", width = 15) |
46 | @ApiModelProperty(value = "数据库密码") | 46 | @ApiModelProperty(value = "数据库密码") |
47 | private java.lang.String pwd; | 47 | private String pwd; |
48 | } | 48 | } | ... | ... |
... | @@ -23,17 +23,17 @@ public class SysAlgorithmInterfaceService { | ... | @@ -23,17 +23,17 @@ public class SysAlgorithmInterfaceService { |
23 | /**主键*/ | 23 | /**主键*/ |
24 | @TableId(type = IdType.ID_WORKER_STR) | 24 | @TableId(type = IdType.ID_WORKER_STR) |
25 | @ApiModelProperty(value = "主键") | 25 | @ApiModelProperty(value = "主键") |
26 | private java.lang.String id; | 26 | private String id; |
27 | /**服务名称*/ | 27 | /**服务名称*/ |
28 | @Excel(name = "服务名称", width = 15) | 28 | @Excel(name = "服务名称", width = 15) |
29 | @ApiModelProperty(value = "服务名称") | 29 | @ApiModelProperty(value = "服务名称") |
30 | private java.lang.String serviceName; | 30 | private String serviceName; |
31 | /**服务编码*/ | 31 | /**服务编码*/ |
32 | @Excel(name = "服务编码", width = 15) | 32 | @Excel(name = "服务编码", width = 15) |
33 | @ApiModelProperty(value = "服务编码") | 33 | @ApiModelProperty(value = "服务编码") |
34 | private java.lang.String serviceCode; | 34 | private String serviceCode; |
35 | /**服务bean对象*/ | 35 | /**服务bean对象*/ |
36 | @Excel(name = "服务bean对象", width = 15) | 36 | @Excel(name = "服务bean对象", width = 15) |
37 | @ApiModelProperty(value = "服务bean对象") | 37 | @ApiModelProperty(value = "服务bean对象") |
38 | private java.lang.String serviceBean; | 38 | private String serviceBean; |
39 | } | 39 | } | ... | ... |
... | @@ -4,15 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType; | ... | @@ -4,15 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType; |
4 | import com.baomidou.mybatisplus.annotation.TableField; | 4 | import com.baomidou.mybatisplus.annotation.TableField; |
5 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
7 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
8 | |||
9 | import io.swagger.annotations.ApiModel; | 7 | import io.swagger.annotations.ApiModel; |
10 | import io.swagger.annotations.ApiModelProperty; | 8 | import io.swagger.annotations.ApiModelProperty; |
11 | import lombok.Data; | 9 | import lombok.Data; |
12 | import lombok.EqualsAndHashCode; | 10 | import lombok.EqualsAndHashCode; |
13 | import lombok.experimental.Accessors; | 11 | import lombok.experimental.Accessors; |
14 | import org.jeecgframework.poi.excel.annotation.Excel; | 12 | import org.jeecgframework.poi.excel.annotation.Excel; |
15 | import org.springframework.format.annotation.DateTimeFormat; | ||
16 | 13 | ||
17 | import java.util.List; | 14 | import java.util.List; |
18 | 15 | ||
... | @@ -29,72 +26,51 @@ public class SysAlgorithmLibrary { | ... | @@ -29,72 +26,51 @@ public class SysAlgorithmLibrary { |
29 | /**主键*/ | 26 | /**主键*/ |
30 | @TableId(type = IdType.ID_WORKER_STR) | 27 | @TableId(type = IdType.ID_WORKER_STR) |
31 | @ApiModelProperty(value = "主键") | 28 | @ApiModelProperty(value = "主键") |
32 | private java.lang.String id; | 29 | private String id; |
33 | /**厂站id*/ | 30 | /**厂站id*/ |
34 | @Excel(name = "厂站id", width = 15) | 31 | @Excel(name = "厂站id", width = 15) |
35 | @ApiModelProperty(value = "厂站id") | 32 | @ApiModelProperty(value = "厂站id") |
36 | private java.lang.String departId; | 33 | private String departId; |
37 | /**算法名称*/ | 34 | /**算法名称*/ |
38 | @Excel(name = "算法名称", width = 15) | 35 | @Excel(name = "算法名称", width = 15) |
39 | @ApiModelProperty(value = "算法名称") | 36 | @ApiModelProperty(value = "算法名称") |
40 | private java.lang.String algorithmName; | 37 | private String algorithmName; |
41 | /**算法编码*/ | 38 | /**算法编码*/ |
42 | @Excel(name = "算法编码", width = 15) | 39 | @Excel(name = "算法编码", width = 15) |
43 | @ApiModelProperty(value = "算法编码") | 40 | @ApiModelProperty(value = "算法编码") |
44 | private java.lang.String algorithmCode; | 41 | private String algorithmCode; |
45 | /**算法描述*/ | 42 | /**算法描述*/ |
46 | @Excel(name = "算法描述", width = 15) | 43 | @Excel(name = "算法描述", width = 15) |
47 | @ApiModelProperty(value = "算法描述") | 44 | @ApiModelProperty(value = "算法描述") |
48 | private java.lang.String algorithmDesc; | 45 | private String algorithmDesc; |
49 | /**算法公式*/ | 46 | /**算法公式*/ |
50 | @Excel(name = "算法公式", width = 15) | 47 | @Excel(name = "算法公式", width = 15) |
51 | @ApiModelProperty(value = "算法公式") | 48 | @ApiModelProperty(value = "算法公式") |
52 | private java.lang.String algorithmFormula; | 49 | private String algorithmFormula; |
53 | /**算法公式*/ | 50 | /**算法公式*/ |
54 | @Excel(name = "算法公式说明", width = 15) | 51 | @Excel(name = "算法公式说明", width = 15) |
55 | @ApiModelProperty(value = "算法公式说明") | 52 | @ApiModelProperty(value = "算法公式说明") |
56 | private java.lang.String algorithmFormulaName; | 53 | private String algorithmFormulaName; |
57 | /**算法级别*/ | 54 | /**算法级别*/ |
58 | @Excel(name = "算法级别", width = 15) | 55 | @Excel(name = "算法级别", width = 15) |
59 | @ApiModelProperty(value = "算法级别") | 56 | @ApiModelProperty(value = "算法级别") |
60 | private java.lang.String algorithmLevel; | 57 | private String algorithmLevel; |
61 | /**计算方式1求和4平均*/ | 58 | /**计算方式1求和4平均*/ |
62 | @Excel(name = "计算方式1求和4平均", width = 15) | 59 | @Excel(name = "计算方式1求和4平均", width = 15) |
63 | @ApiModelProperty(value = "计算方式1求和4平均") | 60 | @ApiModelProperty(value = "计算方式1求和4平均") |
64 | private java.lang.String calculationType; | 61 | private String calculationType; |
65 | /**单位*/ | 62 | /**单位*/ |
66 | @Excel(name = "单位", width = 15) | 63 | @Excel(name = "单位", width = 15) |
67 | @ApiModelProperty(value = "单位") | 64 | @ApiModelProperty(value = "单位") |
68 | private java.lang.String unit; | 65 | private String unit; |
69 | /**小数保留位数*/ | 66 | /**小数保留位数*/ |
70 | @Excel(name = "小数保留位数", width = 15) | 67 | @Excel(name = "小数保留位数", width = 15) |
71 | @ApiModelProperty(value = "小数保留位数") | 68 | @ApiModelProperty(value = "小数保留位数") |
72 | private java.lang.String scale; | 69 | private String scale; |
73 | /**系统内置标记*/ | 70 | /**系统内置标记*/ |
74 | @Excel(name = "系统内置标记", width = 15) | 71 | @Excel(name = "系统内置标记", width = 15) |
75 | @ApiModelProperty(value = "系统内置标记【1系统/0项目】") | 72 | @ApiModelProperty(value = "系统内置标记【1系统/0项目】") |
76 | private java.lang.String systemTag; | 73 | private String systemTag; |
77 | |||
78 | //@Excel(name = "创建人Id", width = 15) | ||
79 | @ApiModelProperty(value = "创建人Id") | ||
80 | private java.lang.String createBy; | ||
81 | /**创建时间*/ | ||
82 | //@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
83 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
84 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
85 | @ApiModelProperty(value = "创建时间") | ||
86 | private java.util.Date createTime; | ||
87 | /**修改人Id*/ | ||
88 | //@Excel(name = "修改人Id", width = 15) | ||
89 | @ApiModelProperty(value = "修改人Id") | ||
90 | private java.lang.String updateBy; | ||
91 | /**修改时间*/ | ||
92 | //@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
93 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
94 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
95 | @ApiModelProperty(value = "修改时间") | ||
96 | private java.util.Date updateTime; | ||
97 | |||
98 | /**计算项配置*/ | 74 | /**计算项配置*/ |
99 | @Excel(name = "计算项配置", width = 15) | 75 | @Excel(name = "计算项配置", width = 15) |
100 | @ApiModelProperty(value = "计算项配置") | 76 | @ApiModelProperty(value = "计算项配置") | ... | ... |
... | @@ -24,58 +24,58 @@ public class SysAlgorithmStatisticsLibrary { | ... | @@ -24,58 +24,58 @@ public class SysAlgorithmStatisticsLibrary { |
24 | /**主键*/ | 24 | /**主键*/ |
25 | @TableId(type = IdType.ID_WORKER_STR) | 25 | @TableId(type = IdType.ID_WORKER_STR) |
26 | @ApiModelProperty(value = "主键") | 26 | @ApiModelProperty(value = "主键") |
27 | private java.lang.String id; | 27 | private String id; |
28 | /**统计编码*/ | 28 | /**统计编码*/ |
29 | @Excel(name = "统计编码", width = 15) | 29 | @Excel(name = "统计编码", width = 15) |
30 | @ApiModelProperty(value = "统计编码") | 30 | @ApiModelProperty(value = "统计编码") |
31 | private java.lang.String statisticsCode; | 31 | private String statisticsCode; |
32 | /**统计名称*/ | 32 | /**统计名称*/ |
33 | @Excel(name = "统计名称", width = 15) | 33 | @Excel(name = "统计名称", width = 15) |
34 | @ApiModelProperty(value = "统计名称") | 34 | @ApiModelProperty(value = "统计名称") |
35 | private java.lang.String statisticsName; | 35 | private String statisticsName; |
36 | /**统计类型0数字、1统计图、2数字列表*/ | 36 | /**统计类型0数字、1统计图、2数字列表*/ |
37 | @Excel(name = "统计类型0数字、1统计图、2数字列表", width = 15) | 37 | @Excel(name = "统计类型0数字、1统计图、2数字列表", width = 15) |
38 | @ApiModelProperty(value = "统计类型0数字、1统计图、2数字列表") | 38 | @ApiModelProperty(value = "统计类型0数字、1统计图、2数字列表") |
39 | @Dict(dicCode = "cheAlasType") | 39 | @Dict(dicCode = "cheAlasType") |
40 | private java.lang.String statisticsType; | 40 | private String statisticsType; |
41 | /**同比0不启用、1启用*/ | 41 | /**同比0不启用、1启用*/ |
42 | @Excel(name = "同比0不启用、1启用", width = 15) | 42 | @Excel(name = "同比0不启用、1启用", width = 15) |
43 | @ApiModelProperty(value = "同比0不启用、1启用") | 43 | @ApiModelProperty(value = "同比0不启用、1启用") |
44 | private java.lang.String statisticsTb; | 44 | private String statisticsTb; |
45 | /**环比0不启用、1启用*/ | 45 | /**环比0不启用、1启用*/ |
46 | @Excel(name = "环比0不启用、1启用", width = 15) | 46 | @Excel(name = "环比0不启用、1启用", width = 15) |
47 | @ApiModelProperty(value = "环比0不启用、1启用") | 47 | @ApiModelProperty(value = "环比0不启用、1启用") |
48 | private java.lang.String statisticsHb; | 48 | private String statisticsHb; |
49 | /**上期0不启用、1启用*/ | 49 | /**上期0不启用、1启用*/ |
50 | @Excel(name = "上期0不启用、1启用", width = 15) | 50 | @Excel(name = "上期0不启用、1启用", width = 15) |
51 | @ApiModelProperty(value = "上期0不启用、1启用") | 51 | @ApiModelProperty(value = "上期0不启用、1启用") |
52 | private java.lang.String statisticsPre; | 52 | private String statisticsPre; |
53 | /**公式id*/ | 53 | /**公式id*/ |
54 | @Excel(name = "公式id", width = 15) | 54 | @Excel(name = "公式id", width = 15) |
55 | @ApiModelProperty(value = "公式id") | 55 | @ApiModelProperty(value = "公式id") |
56 | private java.lang.String algorithmId; | 56 | private String algorithmId; |
57 | /**统计粒度day、month、year*/ | 57 | /**统计粒度day、month、year*/ |
58 | @Excel(name = "统计粒度day、month、year", width = 15) | 58 | @Excel(name = "统计粒度day、month、year", width = 15) |
59 | @ApiModelProperty(value = "统计粒度day、month、year") | 59 | @ApiModelProperty(value = "统计粒度day、month、year") |
60 | private java.lang.String statisticsGranularity; | 60 | private String statisticsGranularity; |
61 | /**分组字段factory、time*/ | 61 | /**分组字段factory、time*/ |
62 | @Excel(name = "分组字段factory、time", width = 15) | 62 | @Excel(name = "分组字段factory、time", width = 15) |
63 | @ApiModelProperty(value = "分组字段factory、time") | 63 | @ApiModelProperty(value = "分组字段factory、time") |
64 | private java.lang.String groupField; | 64 | private String groupField; |
65 | /**自定义逻辑类*/ | 65 | /**自定义逻辑类*/ |
66 | @Excel(name = "自定义逻辑类", width = 15) | 66 | @Excel(name = "自定义逻辑类", width = 15) |
67 | @ApiModelProperty(value = "自定义逻辑类") | 67 | @ApiModelProperty(value = "自定义逻辑类") |
68 | private java.lang.String customService; | 68 | private String customService; |
69 | /**数据类型(0:日表和填报,1:小时表,2:实时表)*/ | 69 | /**数据类型(0:日表和填报,1:小时表,2:实时表)*/ |
70 | @Excel(name = "数据类型(0:日表和填报,1:小时表,2:实时表)", width = 15) | 70 | @Excel(name = "数据类型(0:日表和填报,1:小时表,2:实时表)", width = 15) |
71 | @ApiModelProperty(value = "数据类型(0:日表和填报,1:小时表,2:实时表)") | 71 | @ApiModelProperty(value = "数据类型(0:日表和填报,1:小时表,2:实时表)") |
72 | private java.lang.String dataType; | 72 | private String dataType; |
73 | /**机构类型*/ | 73 | /**机构类型*/ |
74 | @Excel(name = "机构类型", width = 15) | 74 | @Excel(name = "机构类型", width = 15) |
75 | @ApiModelProperty(value = "机构类型") | 75 | @ApiModelProperty(value = "机构类型") |
76 | private java.lang.String departType; | 76 | private String departType; |
77 | /**是否查询子机构(0:不是,1:是)*/ | 77 | /**是否查询子机构(0:不是,1:是)*/ |
78 | @Excel(name = "是否查询子机构(0:不是,1:是)", width = 15) | 78 | @Excel(name = "是否查询子机构(0:不是,1:是)", width = 15) |
79 | @ApiModelProperty(value = "是否查询子机构(0:不是,1:是)") | 79 | @ApiModelProperty(value = "是否查询子机构(0:不是,1:是)") |
80 | private java.lang.String isChildDepart; | 80 | private String isChildDepart; |
81 | } | 81 | } | ... | ... |
... | @@ -26,21 +26,21 @@ public class SysDataCalculationParam { | ... | @@ -26,21 +26,21 @@ public class SysDataCalculationParam { |
26 | /**主键*/ | 26 | /**主键*/ |
27 | @TableId(type = IdType.ID_WORKER_STR) | 27 | @TableId(type = IdType.ID_WORKER_STR) |
28 | @ApiModelProperty(value = "主键") | 28 | @ApiModelProperty(value = "主键") |
29 | private java.lang.String id; | 29 | private String id; |
30 | /**标签*/ | 30 | /**标签*/ |
31 | @Excel(name = "标签", width = 15) | 31 | @Excel(name = "标签", width = 15) |
32 | @ApiModelProperty(value = "标签") | 32 | @ApiModelProperty(value = "标签") |
33 | private java.lang.String metricTag; | 33 | private String metricTag; |
34 | /**计算类型(1:求和;4:平均)*/ | 34 | /**计算类型(1:求和;4:平均)*/ |
35 | @Excel(name = "计算类型(1:求和;4:平均)", width = 15) | 35 | @Excel(name = "计算类型(1:求和;4:平均)", width = 15) |
36 | @ApiModelProperty(value = "计算类型(1:求和;4:平均)") | 36 | @ApiModelProperty(value = "计算类型(1:求和;4:平均)") |
37 | private java.lang.String calculationType; | 37 | private String calculationType; |
38 | /**时间粒度*/ | 38 | /**时间粒度*/ |
39 | @Excel(name = "时间粒度", width = 15) | 39 | @Excel(name = "时间粒度", width = 15) |
40 | @ApiModelProperty(value = "时间粒度") | 40 | @ApiModelProperty(value = "时间粒度") |
41 | private java.lang.String timePeriod; | 41 | private String timePeriod; |
42 | /**单位*/ | 42 | /**单位*/ |
43 | @Excel(name = "单位", width = 15) | 43 | @Excel(name = "单位", width = 15) |
44 | @ApiModelProperty(value = "单位") | 44 | @ApiModelProperty(value = "单位") |
45 | private java.lang.String unit; | 45 | private String unit; |
46 | } | 46 | } | ... | ... |
... | @@ -5,5 +5,17 @@ import java.util.Map; | ... | @@ -5,5 +5,17 @@ import java.util.Map; |
5 | 5 | ||
6 | public interface IAlarmLimitCustomService { | 6 | public interface IAlarmLimitCustomService { |
7 | 7 | ||
8 | |||
9 | /** | ||
10 | * <pre> | ||
11 | * <请输入描述信息> 指标值报警预警上下限信息 | ||
12 | * </pre> | ||
13 | * @param departIds 厂站ids | ||
14 | * @param | ||
15 | * @author Gao Ran, | ||
16 | * @Description: stringIntegerMap key->factoryId+_+code val->报警上下限值 | ||
17 | */ | ||
18 | |||
8 | Map<String, Map<String,Double>> getAlarmLimitData(String departIds); | 19 | Map<String, Map<String,Double>> getAlarmLimitData(String departIds); |
20 | |||
9 | } | 21 | } | ... | ... |
1 | package com.skua.modules.algorithm.handle.impl; | 1 | package com.skua.modules.algorithm.handle.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | import com.skua.core.util.ConvertUtils; | ||
4 | import com.skua.core.util.DateUtils; | 5 | import com.skua.core.util.DateUtils; |
5 | import com.skua.modules.algorithm.entity.InterfaceData; | 6 | import com.skua.modules.algorithm.entity.InterfaceData; |
6 | import com.skua.modules.algorithm.handle.IInterfaceDataCustomService; | 7 | import com.skua.modules.algorithm.handle.IInterfaceDataCustomService; |
... | @@ -40,7 +41,7 @@ public class DesignScaleInterfaceDataServiceImpl implements IInterfaceDataCustom | ... | @@ -40,7 +41,7 @@ public class DesignScaleInterfaceDataServiceImpl implements IInterfaceDataCustom |
40 | interfaceData = new InterfaceData(); | 41 | interfaceData = new InterfaceData(); |
41 | interfaceData.setDepartId(sysFactoryInfo.getDepartId()); | 42 | interfaceData.setDepartId(sysFactoryInfo.getDepartId()); |
42 | interfaceData.setDataTime(day); | 43 | interfaceData.setDataTime(day); |
43 | interfaceData.setDataVal(Double.parseDouble(sysFactoryInfo.getProScale())); | 44 | interfaceData.setDataVal(ConvertUtils.getDouble(sysFactoryInfo.getProScale(),0)); |
44 | interfaceDataList.add(interfaceData); | 45 | interfaceDataList.add(interfaceData); |
45 | } | 46 | } |
46 | } | 47 | } | ... | ... |
1 | package com.skua.modules.algorithm.handle.impl; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
4 | import com.skua.core.util.DateUtils; | ||
5 | import com.skua.modules.algorithm.entity.InterfaceData; | ||
6 | import com.skua.modules.algorithm.handle.IInterfaceDataCustomService; | ||
7 | import com.skua.modules.system.entity.SysFactoryInfo; | ||
8 | import com.skua.modules.system.service.ISysFactoryInfoService; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | ||
10 | import org.springframework.stereotype.Component; | ||
11 | |||
12 | import java.util.ArrayList; | ||
13 | import java.util.List; | ||
14 | |||
15 | /** | ||
16 | * <pre> | ||
17 | * 获取稳定运行天数,算法:水厂档案投产运营时间到当前时间 | ||
18 | * </pre> | ||
19 | * @author Li Yuanyuan | ||
20 | * @version V1.0, 2024年12月20日 下午1:55:44 | ||
21 | */ | ||
22 | @Component("safeOperationInterfaceDataServiceImpl") | ||
23 | public class SafeOperationInterfaceDataServiceImpl implements IInterfaceDataCustomService { | ||
24 | |||
25 | @Autowired | ||
26 | private ISysFactoryInfoService sysFactoryInfoService; | ||
27 | |||
28 | @Override | ||
29 | public List<InterfaceData> getInterfaceDataList(String departIds, String startDate, String endDate) { | ||
30 | List<InterfaceData> interfaceDataList = new ArrayList<>(); | ||
31 | QueryWrapper<SysFactoryInfo> sysFactoryInfoQueryWrapper = new QueryWrapper<>(); | ||
32 | sysFactoryInfoQueryWrapper.select("built_time","depart_id"); | ||
33 | sysFactoryInfoQueryWrapper.in("depart_id",departIds.split(",")); | ||
34 | List<SysFactoryInfo> sysFactoryInfoList = sysFactoryInfoService.list(sysFactoryInfoQueryWrapper); | ||
35 | List<String> dayList = DateUtils.sliceUpDateRange(startDate, endDate, "month"); | ||
36 | InterfaceData interfaceData; | ||
37 | for (SysFactoryInfo sysFactoryInfo : sysFactoryInfoList) { | ||
38 | for (String day : dayList) { | ||
39 | interfaceData = new InterfaceData(); | ||
40 | interfaceData.setDepartId(sysFactoryInfo.getDepartId()); | ||
41 | interfaceData.setDataTime(day); | ||
42 | interfaceData.setDataVal(Double.valueOf(DateUtils.dayDiff(sysFactoryInfo.getBuiltTime(), DateUtils.now()))); | ||
43 | interfaceDataList.add(interfaceData); | ||
44 | } | ||
45 | } | ||
46 | return interfaceDataList; | ||
47 | } | ||
48 | } |
... | @@ -13,8 +13,7 @@ import java.util.Map; | ... | @@ -13,8 +13,7 @@ import java.util.Map; |
13 | */ | 13 | */ |
14 | public interface SysAlgorithmLibraryMapper extends BaseMapper<SysAlgorithmLibrary> { | 14 | public interface SysAlgorithmLibraryMapper extends BaseMapper<SysAlgorithmLibrary> { |
15 | 15 | ||
16 | @Select("SELECT group_concat(id) id FROM sys_depart,(select getDepartTree (#{departId}) departIds) t WHERE FIND_IN_SET(id,departIds) and depart_type = #{departType} " + | 16 | |
17 | " and del_flag='0' order by depart_order") | ||
18 | Map<String,Object> getChildDepartIds(@Param(value = "departId")String departId, @Param(value = "departType")String departType); | 17 | Map<String,Object> getChildDepartIds(@Param(value = "departId")String departId, @Param(value = "departType")String departType); |
19 | 18 | ||
20 | @Select("select a.time as data_time,a.depart_id,${dataFillCodes} from ${tablename} a") | 19 | @Select("select a.time as data_time,a.depart_id,${dataFillCodes} from ${tablename} a") | ... | ... |
... | @@ -2,4 +2,13 @@ | ... | @@ -2,4 +2,13 @@ |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | <mapper namespace="com.skua.modules.algorithm.mapper.SysAlgorithmLibraryMapper"> | 3 | <mapper namespace="com.skua.modules.algorithm.mapper.SysAlgorithmLibraryMapper"> |
4 | 4 | ||
5 | <select id="getChildDepartIds" resultType="java.util.Map"> | ||
6 | SELECT group_concat(id) id FROM sys_depart, | ||
7 | (SELECT getDepartTree(#{departId}) departIds)t | ||
8 | WHERE FIND_IN_SET(id, departIds) | ||
9 | <if test='departType != null'> | ||
10 | AND depart_type IN (${departType}) | ||
11 | </if> | ||
12 | AND del_flag = '0' ORDER BY depart_order | ||
13 | </select> | ||
5 | </mapper> | 14 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -38,7 +38,19 @@ public class CalculationServiceImpl implements ICalculationService { | ... | @@ -38,7 +38,19 @@ public class CalculationServiceImpl implements ICalculationService { |
38 | System.out.println("***************计算逻辑开始***************"); | 38 | System.out.println("***************计算逻辑开始***************"); |
39 | try { | 39 | try { |
40 | List<String> dateList = DateUtils.sliceUpDateRange(startDate, endEnd, "month"); | 40 | List<String> dateList = DateUtils.sliceUpDateRange(startDate, endEnd, "month"); |
41 | List<SysDataCalculationParam> sysDataCalculationParamList = sysDataCalculationParamService.list(); | 41 | QueryWrapper<SysDataCalculationParam> qw = new QueryWrapper<SysDataCalculationParam>(); |
42 | //List<String> tagList = new ArrayList<String>(); | ||
43 | //tagList.add("PAC1HHNCTJLLLJ");tagList.add("PAC2HHNCTJLLLJ");tagList.add("PAC1CDCTJLLLJ");tagList.add("PAC2CDCTJLLLJ"); | ||
44 | //tagList.add("PAC3CDCTJLLLJ"); | ||
45 | |||
46 | //tagList.add("XTJSLJLL1"); | ||
47 | //tagList.add("XTJSLJLL2"); | ||
48 | |||
49 | //tagList.add("YSN1TJLJLL");tagList.add("YSN2TJLJLL");tagList.add("YSN3TJLJLL");tagList.add("YSN4TJLJLL"); | ||
50 | //tagList.add("YSN5TJLJLL");tagList.add("YSN6TJLJLL");tagList.add("YSN7TJLJLL");tagList.add("YSN8TJLJLL"); | ||
51 | //tagList.add("YSN9TJLJLL");tagList.add("YSN10TJLJLL"); | ||
52 | //qw.in("metric_tag", tagList); | ||
53 | List<SysDataCalculationParam> sysDataCalculationParamList = sysDataCalculationParamService.list(qw); | ||
42 | //删除符合条件的历史数据 | 54 | //删除符合条件的历史数据 |
43 | for (SysDataCalculationParam sysDataCalculationParam : sysDataCalculationParamList) { | 55 | for (SysDataCalculationParam sysDataCalculationParam : sysDataCalculationParamList) { |
44 | UpdateWrapper<SysDataCalculation> sysDataCalculationUpdateWrapper = new UpdateWrapper<>(); | 56 | UpdateWrapper<SysDataCalculation> sysDataCalculationUpdateWrapper = new UpdateWrapper<>(); |
... | @@ -57,13 +69,13 @@ public class CalculationServiceImpl implements ICalculationService { | ... | @@ -57,13 +69,13 @@ public class CalculationServiceImpl implements ICalculationService { |
57 | String unit = sysDataCalculationParam.getUnit(); | 69 | String unit = sysDataCalculationParam.getUnit(); |
58 | //根据字典获取真实指标编码 | 70 | //根据字典获取真实指标编码 |
59 | QueryWrapper<SysMonitorMetricInfo> sysMonitorMetricInfoQueryWrapper = new QueryWrapper<>(); | 71 | QueryWrapper<SysMonitorMetricInfo> sysMonitorMetricInfoQueryWrapper = new QueryWrapper<>(); |
60 | sysMonitorMetricInfoQueryWrapper.select("id", "fac_code"); | 72 | sysMonitorMetricInfoQueryWrapper.select("id", "depart_id"); |
61 | sysMonitorMetricInfoQueryWrapper.eq("metric_uid_tag", metricTag); | 73 | sysMonitorMetricInfoQueryWrapper.eq("metric_uid_tag", metricTag); |
62 | List<Map<String, Object>> metricInfoList = sysMonitorMetricInfoService.listMaps(sysMonitorMetricInfoQueryWrapper); | 74 | List<Map<String, Object>> metricInfoList = sysMonitorMetricInfoService.listMaps(sysMonitorMetricInfoQueryWrapper); |
63 | SysDataCalculation sysDataCalculation; | 75 | SysDataCalculation sysDataCalculation; |
64 | for (Map<String, Object> map : metricInfoList) { | 76 | for (Map<String, Object> map : metricInfoList) { |
65 | String id = ConvertUtils.getString(map.get("id")); | 77 | String id = ConvertUtils.getString(map.get("id")); |
66 | String departId = ConvertUtils.getString(map.get("fac_code")); | 78 | String departId = ConvertUtils.getString(map.get("depart_id")); |
67 | //获取小时数据,按要求计算 | 79 | //获取小时数据,按要求计算 |
68 | List<Map<String, Object>> dataList; | 80 | List<Map<String, Object>> dataList; |
69 | try { | 81 | try { | ... | ... |
此文件的差异被折叠,
点击展开。
此文件的差异被折叠,
点击展开。
... | @@ -18,30 +18,30 @@ public class SysAlgorithmLibraryVO { | ... | @@ -18,30 +18,30 @@ public class SysAlgorithmLibraryVO { |
18 | /**厂站id*/ | 18 | /**厂站id*/ |
19 | @Excel(name = "厂站id", width = 15) | 19 | @Excel(name = "厂站id", width = 15) |
20 | @ApiModelProperty(value = "厂站id") | 20 | @ApiModelProperty(value = "厂站id") |
21 | private java.lang.String departId; | 21 | private String departId; |
22 | /**算法名称*/ | 22 | /**算法名称*/ |
23 | @Excel(name = "算法名称", width = 15) | 23 | @Excel(name = "算法名称", width = 15) |
24 | @ApiModelProperty(value = "算法名称") | 24 | @ApiModelProperty(value = "算法名称") |
25 | private java.lang.String algorithmName; | 25 | private String algorithmName; |
26 | /**算法编码*/ | 26 | /**算法编码*/ |
27 | @Excel(name = "算法编码", width = 15) | 27 | @Excel(name = "算法编码", width = 15) |
28 | @ApiModelProperty(value = "算法编码") | 28 | @ApiModelProperty(value = "算法编码") |
29 | private java.lang.String algorithmCode; | 29 | private String algorithmCode; |
30 | /**算法计算结果*/ | 30 | /**算法计算结果*/ |
31 | @ApiModelProperty(value = "算法计算结果") | 31 | @ApiModelProperty(value = "算法计算结果") |
32 | private Map<String, List<Map<String, Object>>> map = new HashMap<String, List<Map<String, Object>>>(); | 32 | private Map<String, List<Map<String, Object>>> map = new HashMap<String, List<Map<String, Object>>>(); |
33 | /**开始时间*/ | 33 | /**开始时间*/ |
34 | @Excel(name = "开始时间", width = 15) | 34 | @Excel(name = "开始时间", width = 15) |
35 | @ApiModelProperty(value = "开始时间") | 35 | @ApiModelProperty(value = "开始时间") |
36 | private java.lang.String startDate; | 36 | private String startDate; |
37 | @Excel(name = "结束时间", width = 15) | 37 | @Excel(name = "结束时间", width = 15) |
38 | @ApiModelProperty(value = "结束时间") | 38 | @ApiModelProperty(value = "结束时间") |
39 | private java.lang.String endDate; | 39 | private String endDate; |
40 | @Excel(name = "时间粒度", width = 15) | 40 | @Excel(name = "时间粒度", width = 15) |
41 | @ApiModelProperty(value = "聚合时间粒度,day天、month月") | 41 | @ApiModelProperty(value = "聚合时间粒度,day天、month月") |
42 | private java.lang.String timePeriod; | 42 | private String timePeriod; |
43 | /**系统内置标记*/ | 43 | /**系统内置标记*/ |
44 | @Excel(name = "系统内置标记", width = 15) | 44 | @Excel(name = "系统内置标记", width = 15) |
45 | @ApiModelProperty(value = "系统内置标记【0系统/1项目】") | 45 | @ApiModelProperty(value = "系统内置标记【0系统/1项目】") |
46 | private java.lang.String systemTag; | 46 | private String systemTag; |
47 | } | 47 | } | ... | ... |
... | @@ -17,54 +17,54 @@ public class SysAlgorithmStatisticsLibraryVO { | ... | @@ -17,54 +17,54 @@ public class SysAlgorithmStatisticsLibraryVO { |
17 | /**主键*/ | 17 | /**主键*/ |
18 | @TableId(type = IdType.UUID) | 18 | @TableId(type = IdType.UUID) |
19 | @ApiModelProperty(value = "主键") | 19 | @ApiModelProperty(value = "主键") |
20 | private java.lang.String id; | 20 | private String id; |
21 | /**统计编码*/ | 21 | /**统计编码*/ |
22 | @Excel(name = "统计编码", width = 15) | 22 | @Excel(name = "统计编码", width = 15) |
23 | @ApiModelProperty(value = "统计编码") | 23 | @ApiModelProperty(value = "统计编码") |
24 | private java.lang.String statisticsCode; | 24 | private String statisticsCode; |
25 | /**统计名称*/ | 25 | /**统计名称*/ |
26 | @Excel(name = "统计名称", width = 15) | 26 | @Excel(name = "统计名称", width = 15) |
27 | @ApiModelProperty(value = "统计名称") | 27 | @ApiModelProperty(value = "统计名称") |
28 | private java.lang.String statisticsName; | 28 | private String statisticsName; |
29 | /**公式id*/ | 29 | /**公式id*/ |
30 | @Excel(name = "公式id", width = 15) | 30 | @Excel(name = "公式id", width = 15) |
31 | @ApiModelProperty(value = "公式id") | 31 | @ApiModelProperty(value = "公式id") |
32 | private java.lang.String algorithmId; | 32 | private String algorithmId; |
33 | /**统计粒度day、month、year*/ | 33 | /**统计粒度day、month、year*/ |
34 | @Excel(name = "统计粒度day、month、year", width = 15) | 34 | @Excel(name = "统计粒度day、month、year", width = 15) |
35 | @ApiModelProperty(value = "统计粒度day、month、year") | 35 | @ApiModelProperty(value = "统计粒度day、month、year") |
36 | private java.lang.String statisticsGranularity; | 36 | private String statisticsGranularity; |
37 | /**计算方式1求和4平均*/ | 37 | /**计算方式1求和4平均*/ |
38 | @Excel(name = "计算方式1求和4平均", width = 15) | 38 | @Excel(name = "计算方式1求和4平均", width = 15) |
39 | @ApiModelProperty(value = "计算方式1求和4平均") | 39 | @ApiModelProperty(value = "计算方式1求和4平均") |
40 | private java.lang.String calculationType; | 40 | private String calculationType; |
41 | /**分组字段factory、time*/ | 41 | /**分组字段factory、time*/ |
42 | @Excel(name = "分组字段factory、time", width = 15) | 42 | @Excel(name = "分组字段factory、time", width = 15) |
43 | @ApiModelProperty(value = "分组字段factory、time") | 43 | @ApiModelProperty(value = "分组字段factory、time") |
44 | private java.lang.String groupField; | 44 | private String groupField; |
45 | /**自定义逻辑类*/ | 45 | /**自定义逻辑类*/ |
46 | @Excel(name = "自定义逻辑类", width = 15) | 46 | @Excel(name = "自定义逻辑类", width = 15) |
47 | @ApiModelProperty(value = "自定义逻辑类") | 47 | @ApiModelProperty(value = "自定义逻辑类") |
48 | private java.lang.String customService; | 48 | private String customService; |
49 | /**开始时间*/ | 49 | /**开始时间*/ |
50 | @Excel(name = "开始时间", width = 15) | 50 | @Excel(name = "开始时间", width = 15) |
51 | @ApiModelProperty(value = "开始时间") | 51 | @ApiModelProperty(value = "开始时间") |
52 | private java.lang.String startDate; | 52 | private String startDate; |
53 | @Excel(name = "结束时间", width = 15) | 53 | @Excel(name = "结束时间", width = 15) |
54 | @ApiModelProperty(value = "结束时间") | 54 | @ApiModelProperty(value = "结束时间") |
55 | private java.lang.String endDate; | 55 | private String endDate; |
56 | @ApiModelProperty(value = "厂站id") | 56 | @ApiModelProperty(value = "厂站id") |
57 | private java.lang.String departIds; | 57 | private String departIds; |
58 | @ApiModelProperty(value = "类型0数据型,1图表型") | 58 | @ApiModelProperty(value = "类型0数据型,1图表型") |
59 | private java.lang.String statisticsType; | 59 | private String statisticsType; |
60 | /**机构类型*/ | 60 | /**机构类型*/ |
61 | @Excel(name = "机构类型", width = 15) | 61 | @Excel(name = "机构类型", width = 15) |
62 | @ApiModelProperty(value = "机构类型") | 62 | @ApiModelProperty(value = "机构类型") |
63 | private java.lang.String departType; | 63 | private String departType; |
64 | /**是否查询子机构(0:不是,1:是)*/ | 64 | /**是否查询子机构(0:不是,1:是)*/ |
65 | @Excel(name = "是否查询子机构(0:不是,1:是)", width = 15) | 65 | @Excel(name = "是否查询子机构(0:不是,1:是)", width = 15) |
66 | @ApiModelProperty(value = "是否查询子机构(0:不是,1:是)") | 66 | @ApiModelProperty(value = "是否查询子机构(0:不是,1:是)") |
67 | private java.lang.String isChildDepart; | 67 | private String isChildDepart; |
68 | 68 | ||
69 | /**报表选项code*/ | 69 | /**报表选项code*/ |
70 | @ApiModelProperty(value = "报表Itme选项code") | 70 | @ApiModelProperty(value = "报表Itme选项code") |
... | @@ -75,5 +75,4 @@ public class SysAlgorithmStatisticsLibraryVO { | ... | @@ -75,5 +75,4 @@ public class SysAlgorithmStatisticsLibraryVO { |
75 | 75 | ||
76 | @ApiModelProperty(value = "负载率类型") | 76 | @ApiModelProperty(value = "负载率类型") |
77 | private Integer loadRateType; | 77 | private Integer loadRateType; |
78 | |||
79 | } | 78 | } | ... | ... |
... | @@ -11,6 +11,7 @@ import com.skua.core.util.ConvertUtils; | ... | @@ -11,6 +11,7 @@ import com.skua.core.util.ConvertUtils; |
11 | import com.skua.modules.assessment.entity.DataAssessmentSocreMaster; | 11 | import com.skua.modules.assessment.entity.DataAssessmentSocreMaster; |
12 | import com.skua.modules.assessment.service.IDataAssessmentSocreMasterService; | 12 | import com.skua.modules.assessment.service.IDataAssessmentSocreMasterService; |
13 | import com.skua.modules.assessment.vo.DataAssessmentSocreMasterVO; | 13 | import com.skua.modules.assessment.vo.DataAssessmentSocreMasterVO; |
14 | import com.skua.modules.emergency.entity.DangerousOperation; | ||
14 | import io.swagger.annotations.Api; | 15 | import io.swagger.annotations.Api; |
15 | import io.swagger.annotations.ApiOperation; | 16 | import io.swagger.annotations.ApiOperation; |
16 | import lombok.extern.slf4j.Slf4j; | 17 | import lombok.extern.slf4j.Slf4j; |
... | @@ -93,7 +94,8 @@ public class DataAssessmentSocreMasterController { | ... | @@ -93,7 +94,8 @@ public class DataAssessmentSocreMasterController { |
93 | QueryWrapper<DataAssessmentSocreMaster> query = new QueryWrapper<DataAssessmentSocreMaster>(); | 94 | QueryWrapper<DataAssessmentSocreMaster> query = new QueryWrapper<DataAssessmentSocreMaster>(); |
94 | query.eq("report_id",dataAssessmentSocreMaster.getReportId()); | 95 | query.eq("report_id",dataAssessmentSocreMaster.getReportId()); |
95 | query.eq("assessment_date",dataAssessmentSocreMaster.getAssessmentDate()); | 96 | query.eq("assessment_date",dataAssessmentSocreMaster.getAssessmentDate()); |
96 | query.eq("assessment_user",dataAssessmentSocreMaster.getAssessmentUser()); | 97 | query.eq(ConvertUtils.isNotEmpty(dataAssessmentSocreMaster.getAssessmentUser()),"assessment_user",dataAssessmentSocreMaster.getAssessmentUser()); |
98 | query.eq("depart_id",dataAssessmentSocreMaster.getDepartId()); | ||
97 | List<DataAssessmentSocreMaster> list = dataAssessmentSocreMasterService.list(query); | 99 | List<DataAssessmentSocreMaster> list = dataAssessmentSocreMasterService.list(query); |
98 | if(list!=null&&list.size()>0) { | 100 | if(list!=null&&list.size()>0) { |
99 | result.setResult("yes"); | 101 | result.setResult("yes"); |
... | @@ -185,6 +187,25 @@ public class DataAssessmentSocreMasterController { | ... | @@ -185,6 +187,25 @@ public class DataAssessmentSocreMasterController { |
185 | return result; | 187 | return result; |
186 | } | 188 | } |
187 | 189 | ||
190 | @AutoLog(value = "绩效考核基础信息-办结流程") | ||
191 | @ApiOperation(value = "绩效考核基础信息-办结流程", notes = "绩效考核基础信息-办结流程") | ||
192 | @PostMapping(value = "/complete-process") | ||
193 | public Result<DangerousOperation> completeProcess(@RequestBody DataAssessmentSocreMaster purchaseInfo) { | ||
194 | Result<DangerousOperation> result = new Result<>(); | ||
195 | try { | ||
196 | boolean flag = dataAssessmentSocreMasterService.completeProcess(purchaseInfo); | ||
197 | if (flag) { | ||
198 | result.success("办结成功!"); | ||
199 | } else { | ||
200 | result.error500("办结失败!"); | ||
201 | } | ||
202 | } catch (Exception e) { | ||
203 | log.error(e.getMessage(), e); | ||
204 | result.error500("办结失败"); | ||
205 | } | ||
206 | return result; | ||
207 | } | ||
208 | |||
188 | @AutoLog(value = "绩效考核基础信息-修改业务数据及流程数据") | 209 | @AutoLog(value = "绩效考核基础信息-修改业务数据及流程数据") |
189 | @ApiOperation(value="绩效考核基础信息-修改业务数据及流程数据", notes="绩效考核基础信息-修改业务数据及流程数据") | 210 | @ApiOperation(value="绩效考核基础信息-修改业务数据及流程数据", notes="绩效考核基础信息-修改业务数据及流程数据") |
190 | @PostMapping(value = "/editAndModifyProcess") | 211 | @PostMapping(value = "/editAndModifyProcess") |
... | @@ -202,7 +223,7 @@ public class DataAssessmentSocreMasterController { | ... | @@ -202,7 +223,7 @@ public class DataAssessmentSocreMasterController { |
202 | 223 | ||
203 | /** | 224 | /** |
204 | * 通过id查询 | 225 | * 通过id查询 |
205 | * @param id | 226 | * @param businessId |
206 | * @return | 227 | * @return |
207 | */ | 228 | */ |
208 | @AutoLog(value = "绩效考核基础信息-通过id查询") | 229 | @AutoLog(value = "绩效考核基础信息-通过id查询") | ... | ... |
... | @@ -49,4 +49,5 @@ public interface IDataAssessmentSocreMasterService extends IService<DataAssessme | ... | @@ -49,4 +49,5 @@ public interface IDataAssessmentSocreMasterService extends IService<DataAssessme |
49 | 49 | ||
50 | List<DataAssessmentSocreMasterVO> getAllData(DataAssessmentSocreMasterVO dataAssessmentSocreMasterVO); | 50 | List<DataAssessmentSocreMasterVO> getAllData(DataAssessmentSocreMasterVO dataAssessmentSocreMasterVO); |
51 | 51 | ||
52 | boolean completeProcess(DataAssessmentSocreMaster purchaseInfo); | ||
52 | } | 53 | } | ... | ... |
... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
5 | import com.google.common.collect.Lists; | 5 | import com.google.common.collect.Lists; |
6 | import com.google.common.collect.Maps; | 6 | import com.google.common.collect.Maps; |
7 | import com.skua.core.context.BaseContextHandler; | 7 | import com.skua.core.context.BaseContextHandler; |
8 | import com.skua.core.util.ConvertUtils; | ||
8 | import com.skua.core.util.UUIDGenerator; | 9 | import com.skua.core.util.UUIDGenerator; |
9 | import com.skua.modules.assessment.entity.DataAssessmentItem; | 10 | import com.skua.modules.assessment.entity.DataAssessmentItem; |
10 | import com.skua.modules.assessment.entity.DataAssessmentMessage; | 11 | import com.skua.modules.assessment.entity.DataAssessmentMessage; |
... | @@ -223,8 +224,11 @@ public class DataAssessmentItemServiceImpl extends ServiceImpl<DataAssessmentIte | ... | @@ -223,8 +224,11 @@ public class DataAssessmentItemServiceImpl extends ServiceImpl<DataAssessmentIte |
223 | QueryWrapper<DataAssessmentSocreMaster> dataAssessmentSocreMasterQueryWrapper = new QueryWrapper<>(); | 224 | QueryWrapper<DataAssessmentSocreMaster> dataAssessmentSocreMasterQueryWrapper = new QueryWrapper<>(); |
224 | dataAssessmentSocreMasterQueryWrapper.eq("report_id",reportId); | 225 | dataAssessmentSocreMasterQueryWrapper.eq("report_id",reportId); |
225 | dataAssessmentSocreMasterQueryWrapper.eq("assessment_date",dataMonth); | 226 | dataAssessmentSocreMasterQueryWrapper.eq("assessment_date",dataMonth); |
226 | dataAssessmentSocreMasterQueryWrapper.eq("assessment_user",userId); | 227 | dataAssessmentSocreMasterQueryWrapper.eq(ConvertUtils.isNotEmpty(factoryId),"depart_id",factoryId); |
227 | DataAssessmentSocreMaster assessmentSocreMaster = dataAssessmentSocreMasterService.getOne(dataAssessmentSocreMasterQueryWrapper); | 228 | dataAssessmentSocreMasterQueryWrapper.eq(ConvertUtils.isNotEmpty(userId),"assessment_user",userId); |
229 | List<DataAssessmentSocreMaster> masterList = dataAssessmentSocreMasterService.list(dataAssessmentSocreMasterQueryWrapper); | ||
230 | if(masterList.size()>0){ | ||
231 | DataAssessmentSocreMaster assessmentSocreMaster = masterList.get(0); | ||
228 | assessmentSocreMaster.setAssessmentScore(totalScore); | 232 | assessmentSocreMaster.setAssessmentScore(totalScore); |
229 | assessmentSocreMaster.setLeaderScore(dataAssessmentItemSubmitVO.getLeaderScore()); | 233 | assessmentSocreMaster.setLeaderScore(dataAssessmentItemSubmitVO.getLeaderScore()); |
230 | assessmentSocreMaster.setSelfScore(dataAssessmentItemSubmitVO.getSelfScore()); | 234 | assessmentSocreMaster.setSelfScore(dataAssessmentItemSubmitVO.getSelfScore()); |
... | @@ -232,4 +236,5 @@ public class DataAssessmentItemServiceImpl extends ServiceImpl<DataAssessmentIte | ... | @@ -232,4 +236,5 @@ public class DataAssessmentItemServiceImpl extends ServiceImpl<DataAssessmentIte |
232 | } | 236 | } |
233 | } | 237 | } |
234 | } | 238 | } |
239 | } | ||
235 | } | 240 | } | ... | ... |
... | @@ -6,6 +6,8 @@ import com.skua.modules.assessment.entity.DataAssessmentSocreMaster; | ... | @@ -6,6 +6,8 @@ import com.skua.modules.assessment.entity.DataAssessmentSocreMaster; |
6 | import com.skua.modules.assessment.mapper.DataAssessmentSocreMasterMapper; | 6 | import com.skua.modules.assessment.mapper.DataAssessmentSocreMasterMapper; |
7 | import com.skua.modules.assessment.service.IDataAssessmentSocreMasterService; | 7 | import com.skua.modules.assessment.service.IDataAssessmentSocreMasterService; |
8 | import com.skua.modules.assessment.vo.DataAssessmentSocreMasterVO; | 8 | import com.skua.modules.assessment.vo.DataAssessmentSocreMasterVO; |
9 | import com.skua.modules.emergency.entity.DangerousOperation; | ||
10 | import com.skua.modules.flow.business.service.FlowBusinessService; | ||
9 | import com.skua.modules.flow.business.service.IFlowService; | 11 | import com.skua.modules.flow.business.service.IFlowService; |
10 | import com.skua.modules.flow.core.constant.ProcessConstant; | 12 | import com.skua.modules.flow.core.constant.ProcessConstant; |
11 | import com.skua.modules.flow.core.entity.BladeFlow; | 13 | import com.skua.modules.flow.core.entity.BladeFlow; |
... | @@ -13,22 +15,31 @@ import com.skua.modules.flow.core.utils.FlowUtil; | ... | @@ -13,22 +15,31 @@ import com.skua.modules.flow.core.utils.FlowUtil; |
13 | import com.skua.modules.flow.support.Kv; | 15 | import com.skua.modules.flow.support.Kv; |
14 | import com.skua.modules.flow.utils.Func; | 16 | import com.skua.modules.flow.utils.Func; |
15 | 17 | ||
18 | import java.text.SimpleDateFormat; | ||
19 | import java.util.Date; | ||
16 | import java.util.List; | 20 | import java.util.List; |
17 | import java.util.Map; | 21 | import java.util.Map; |
18 | 22 | ||
23 | import com.skua.modules.safe.service.IEnvironmentTargetService; | ||
19 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
20 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
21 | 26 | ||
22 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 27 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
23 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 28 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
29 | import org.springframework.transaction.annotation.Transactional; | ||
24 | 30 | ||
25 | /** | 31 | /** |
26 | * 绩效考核评分基础信息 | 32 | * 绩效考核评分基础信息 |
27 | */ | 33 | */ |
28 | @Service | 34 | @Service |
29 | public class DataAssessmentSocreMasterServiceImpl extends ServiceImpl<DataAssessmentSocreMasterMapper, DataAssessmentSocreMaster> implements IDataAssessmentSocreMasterService { | 35 | public class DataAssessmentSocreMasterServiceImpl extends ServiceImpl<DataAssessmentSocreMasterMapper, DataAssessmentSocreMaster> implements IDataAssessmentSocreMasterService { |
36 | |||
30 | @Autowired | 37 | @Autowired |
31 | private IFlowService flowService; | 38 | private IFlowService flowService; |
39 | @Autowired | ||
40 | private FlowBusinessService flowBusinessService; | ||
41 | @Autowired | ||
42 | private IEnvironmentTargetService environmentTargetService; | ||
32 | 43 | ||
33 | @Override | 44 | @Override |
34 | public Page<DataAssessmentSocreMasterVO> queryCustomPageList(Page<DataAssessmentSocreMasterVO> pageList, | 45 | public Page<DataAssessmentSocreMasterVO> queryCustomPageList(Page<DataAssessmentSocreMasterVO> pageList, |
... | @@ -79,5 +90,22 @@ public class DataAssessmentSocreMasterServiceImpl extends ServiceImpl<DataAssess | ... | @@ -79,5 +90,22 @@ public class DataAssessmentSocreMasterServiceImpl extends ServiceImpl<DataAssess |
79 | return baseMapper.getAllData(dataAssessmentSocreMasterVO); | 90 | return baseMapper.getAllData(dataAssessmentSocreMasterVO); |
80 | } | 91 | } |
81 | 92 | ||
93 | @Override | ||
94 | @Transactional(rollbackFor = Exception.class) | ||
95 | public boolean completeProcess(DataAssessmentSocreMaster assessmentSocreMaster) { | ||
96 | boolean flag = false;//返回结果 | ||
97 | DataAssessmentSocreMaster dataAssessmentSocreMaster = baseMapper.selectById(assessmentSocreMaster.getId()); | ||
98 | if(dataAssessmentSocreMaster!=null){ | ||
99 | this.updateById(dataAssessmentSocreMaster); | ||
100 | //调用同意接口 | ||
101 | flag = flowBusinessService.completeTask(ProcessConstant.PASS_KEY, assessmentSocreMaster.getFlow()); | ||
102 | //同步分数入环保目标表 写死 安全环保责任状ID | ||
103 | if("1859413989066813442".equals(dataAssessmentSocreMaster.getReportId())|| | ||
104 | "1872156241933414401".equals(dataAssessmentSocreMaster.getReportId())){ | ||
105 | environmentTargetService.addOrEdit(dataAssessmentSocreMaster); | ||
106 | } | ||
107 | } | ||
108 | return flag; | ||
109 | } | ||
82 | 110 | ||
83 | } | 111 | } | ... | ... |
1 | package com.skua.modules.algorithm.controller; | 1 | package com.skua.modules.dataAnalysis.controller; |
2 | 2 | ||
3 | 3 | ||
4 | import com.skua.common.constant.ReportConstant; | 4 | import com.skua.common.constant.ReportConstant; |
5 | import com.skua.common.report.ReportViewUtil; | ||
6 | import com.skua.core.api.vo.Result; | 5 | import com.skua.core.api.vo.Result; |
7 | import com.skua.core.aspect.annotation.AutoLog; | 6 | import com.skua.core.aspect.annotation.AutoLog; |
8 | import com.skua.core.context.BaseContextHandler; | 7 | import com.skua.core.context.BaseContextHandler; |
9 | import com.skua.core.context.SpringContextUtils; | ||
10 | import com.skua.core.util.ConvertUtils; | 8 | import com.skua.core.util.ConvertUtils; |
11 | import com.skua.modules.algorithm.service.ICommandCentreService; | 9 | import com.skua.modules.dataAnalysis.service.ICommandCentreService; |
12 | import com.skua.modules.algorithm.service.impl.ReportItemvService; | 10 | import com.skua.modules.algorithm.service.impl.ReportItemvService; |
13 | import com.skua.modules.algorithm.vo.*; | 11 | import com.skua.modules.algorithm.vo.DepartLoadRateResultVO; |
12 | import com.skua.modules.algorithm.vo.ReportItemVO; | ||
13 | import com.skua.modules.algorithm.vo.StackedAreaChartDataVO; | ||
14 | import com.skua.modules.algorithm.vo.WaterTreatmentVO; | ||
14 | import com.skua.modules.common.vo.DateVO; | 15 | import com.skua.modules.common.vo.DateVO; |
15 | import com.skua.modules.guest.util.DateUtil; | 16 | import com.skua.modules.guest.util.DateUtil; |
16 | import com.skua.modules.report.entity.FReportItemv; | 17 | import com.skua.modules.report.vo.DepartDrugResult; |
17 | import com.skua.modules.report.vo.*; | 18 | import com.skua.modules.report.vo.FRportlCommandCenterVO; |
18 | import com.skua.modules.system.service.ISysConfigService; | 19 | import com.skua.modules.report.vo.ReportDateTrendVO; |
20 | import com.skua.modules.report.vo.ReportItemvParam; | ||
19 | import com.skua.modules.system.service.ISysFactoryInfoService; | 21 | import com.skua.modules.system.service.ISysFactoryInfoService; |
20 | import com.skua.tool.util.DateUtils; | 22 | import com.skua.tool.util.DateUtils; |
21 | import com.skua.tool.util.DigitalUtils; | ||
22 | import com.skua.tool.util.JSUtils; | 23 | import com.skua.tool.util.JSUtils; |
23 | import io.swagger.annotations.Api; | 24 | import io.swagger.annotations.Api; |
24 | import io.swagger.annotations.ApiOperation; | 25 | import io.swagger.annotations.ApiOperation; |
25 | import lombok.extern.slf4j.Slf4j; | 26 | import lombok.extern.slf4j.Slf4j; |
26 | import org.springframework.beans.factory.annotation.Autowired; | 27 | import org.springframework.beans.factory.annotation.Autowired; |
27 | import org.springframework.jdbc.core.JdbcTemplate; | ||
28 | import org.springframework.web.bind.annotation.GetMapping; | 28 | import org.springframework.web.bind.annotation.GetMapping; |
29 | import org.springframework.web.bind.annotation.RequestMapping; | 29 | import org.springframework.web.bind.annotation.RequestMapping; |
30 | import org.springframework.web.bind.annotation.RequestParam; | 30 | import org.springframework.web.bind.annotation.RequestParam; |
31 | import org.springframework.web.bind.annotation.RestController; | 31 | import org.springframework.web.bind.annotation.RestController; |
32 | |||
32 | import java.time.LocalDate; | 33 | import java.time.LocalDate; |
33 | import java.time.YearMonth; | 34 | import java.time.YearMonth; |
34 | import java.time.format.DateTimeFormatter; | 35 | import java.time.format.DateTimeFormatter; |
35 | import java.util.*; | 36 | import java.util.ArrayList; |
37 | import java.util.List; | ||
36 | 38 | ||
37 | /** | 39 | /** |
38 | * 统计功能配置表 | 40 | * 统计功能配置表 |
... | @@ -42,6 +44,7 @@ import java.util.*; | ... | @@ -42,6 +44,7 @@ import java.util.*; |
42 | @RestController | 44 | @RestController |
43 | @RequestMapping("/v1/algorithm/commandCentre") | 45 | @RequestMapping("/v1/algorithm/commandCentre") |
44 | public class SysCommandCentreController { | 46 | public class SysCommandCentreController { |
47 | |||
45 | @Autowired | 48 | @Autowired |
46 | private ISysFactoryInfoService factoryInfoService; | 49 | private ISysFactoryInfoService factoryInfoService; |
47 | @Autowired | 50 | @Autowired |
... | @@ -56,7 +59,7 @@ public class SysCommandCentreController { | ... | @@ -56,7 +59,7 @@ public class SysCommandCentreController { |
56 | @AutoLog(value = "指挥中心-水量查询") | 59 | @AutoLog(value = "指挥中心-水量查询") |
57 | @ApiOperation(value="指挥中心-水量查询", notes="指挥中心-水量查询") | 60 | @ApiOperation(value="指挥中心-水量查询", notes="指挥中心-水量查询") |
58 | @GetMapping(value = "/statisticsByWaterData") | 61 | @GetMapping(value = "/statisticsByWaterData") |
59 | public Result<List<FRportlCommandCenterVO>> statisticsByWaterData(ReportItemvParam reportItemvParam)throws Exception{ | 62 | public Result<List<FRportlCommandCenterVO>> statisticsByWaterData(ReportItemvParam reportItemvParam) throws Exception{ |
60 | Result<List<FRportlCommandCenterVO> > result = new Result<>(); | 63 | Result<List<FRportlCommandCenterVO> > result = new Result<>(); |
61 | List<FRportlCommandCenterVO> fReportItemvList = new ArrayList<>();//返回集合对象 | 64 | List<FRportlCommandCenterVO> fReportItemvList = new ArrayList<>();//返回集合对象 |
62 | DateVO dateVO = new DateVO(reportItemvParam.getStartDate()); | 65 | DateVO dateVO = new DateVO(reportItemvParam.getStartDate()); |
... | @@ -70,7 +73,7 @@ public class SysCommandCentreController { | ... | @@ -70,7 +73,7 @@ public class SysCommandCentreController { |
70 | long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 73 | long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); |
71 | long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | 74 | long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); |
72 | long lastYearDifferDay = DateUtils.differenceDay(dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); | 75 | long lastYearDifferDay = DateUtils.differenceDay(dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); |
73 | //月对象数据String value, String valueTb, String valueHb | 76 | //月对象数据 value, valueTb, valueHb |
74 | FRportlCommandCenterVO monthDataVO = new FRportlCommandCenterVO("月汇总数据",JSUtils.divide(monthCSL,10000),JSUtils.divide(lastMonthCSL,10000),JSUtils.divide(lastYearCSL,10000)); | 77 | FRportlCommandCenterVO monthDataVO = new FRportlCommandCenterVO("月汇总数据",JSUtils.divide(monthCSL,10000),JSUtils.divide(lastMonthCSL,10000),JSUtils.divide(lastYearCSL,10000)); |
75 | //日处理对象 | 78 | //日处理对象 |
76 | FRportlCommandCenterVO avgDayDataVO = new FRportlCommandCenterVO("日均处理水量",JSUtils.divide(monthCSL,nowDifferDay*10000),JSUtils.divide(lastMonthCSL,lastMonthDifferDay*10000),JSUtils.divide(lastYearCSL,lastYearDifferDay*10000)); | 79 | FRportlCommandCenterVO avgDayDataVO = new FRportlCommandCenterVO("日均处理水量",JSUtils.divide(monthCSL,nowDifferDay*10000),JSUtils.divide(lastMonthCSL,lastMonthDifferDay*10000),JSUtils.divide(lastYearCSL,lastYearDifferDay*10000)); |
... | @@ -80,7 +83,6 @@ public class SysCommandCentreController { | ... | @@ -80,7 +83,6 @@ public class SysCommandCentreController { |
80 | //年数据统计: | 83 | //年数据统计: |
81 | String total = factoryInfoService.querySumProScale(); | 84 | String total = factoryInfoService.querySumProScale(); |
82 | total = String.format("%.2f", Double.parseDouble(total)); | 85 | total = String.format("%.2f", Double.parseDouble(total)); |
83 | // total = DigitalUtils.multiply(total,"10000"); | ||
84 | fReportItemvList.add( new FRportlCommandCenterVO( total,"0","0")); | 86 | fReportItemvList.add( new FRportlCommandCenterVO( total,"0","0")); |
85 | 87 | ||
86 | result.setSuccess(true); | 88 | result.setSuccess(true); | ... | ... |
1 | package com.skua.modules.algorithm.service.impl; | 1 | package com.skua.modules.dataAnalysis.service.impl; |
2 | 2 | ||
3 | import com.skua.common.constant.ReportConstant; | 3 | import com.skua.common.constant.ReportConstant; |
4 | import com.skua.common.report.ReportViewUtil; | 4 | import com.skua.common.report.ReportViewUtil; |
5 | import com.skua.core.context.SpringContextUtils; | 5 | import com.skua.core.context.SpringContextUtils; |
6 | import com.skua.core.util.ConvertUtils; | 6 | import com.skua.core.util.ConvertUtils; |
7 | import com.skua.modules.algorithm.service.ICommandCentreService; | 7 | import com.skua.modules.dataAnalysis.service.ICommandCentreService; |
8 | import com.skua.modules.algorithm.vo.WaterTreatmentVO; | 8 | import com.skua.modules.algorithm.vo.WaterTreatmentVO; |
9 | import com.skua.modules.common.vo.DateVO; | 9 | import com.skua.modules.common.vo.DateVO; |
10 | import com.skua.modules.quartz.util.BaseUtil; | 10 | import com.skua.modules.quartz.util.BaseUtil; | ... | ... |
1 | package com.skua.modules.safe.entity; | 1 | package com.skua.modules.safe.entity; |
2 | 2 | ||
3 | import java.io.Serializable; | ||
4 | import java.util.Date; | 3 | import java.util.Date; |
5 | import com.baomidou.mybatisplus.annotation.IdType; | 4 | import com.baomidou.mybatisplus.annotation.IdType; |
6 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
7 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
8 | import com.baomidou.mybatisplus.annotation.TableField; | ||
9 | import com.skua.core.aspect.annotation.Dict; | 7 | import com.skua.core.aspect.annotation.Dict; |
10 | import io.swagger.annotations.ApiModel; | 8 | import io.swagger.annotations.ApiModel; |
11 | import io.swagger.annotations.ApiModelProperty; | 9 | import io.swagger.annotations.ApiModelProperty; |
... | @@ -66,7 +64,9 @@ public class EnvironmentTarget { | ... | @@ -66,7 +64,9 @@ public class EnvironmentTarget { |
66 | @Excel(name = "责任指标评分", width = 15) | 64 | @Excel(name = "责任指标评分", width = 15) |
67 | @ApiModelProperty(value = "责任指标评分") | 65 | @ApiModelProperty(value = "责任指标评分") |
68 | private String liabilityScore ; | 66 | private String liabilityScore ; |
69 | 67 | /**安全环保目标责任状*/ | |
68 | @ApiModelProperty(value = "安全环保目标责任状") | ||
69 | private String targetFile; | ||
70 | /**创建人Id*/ | 70 | /**创建人Id*/ |
71 | @Excel(name = "创建人Id", width = 15) | 71 | @Excel(name = "创建人Id", width = 15) |
72 | @ApiModelProperty(value = "创建人Id") | 72 | @ApiModelProperty(value = "创建人Id") | ... | ... |
1 | package com.skua.modules.safe.service; | 1 | package com.skua.modules.safe.service; |
2 | 2 | ||
3 | import com.skua.modules.assessment.entity.DataAssessmentSocreMaster; | ||
3 | import com.skua.modules.safe.entity.EnvironmentTarget; | 4 | import com.skua.modules.safe.entity.EnvironmentTarget; |
4 | import com.baomidou.mybatisplus.extension.service.IService; | 5 | import com.baomidou.mybatisplus.extension.service.IService; |
6 | import org.springframework.scheduling.annotation.Async; | ||
5 | 7 | ||
6 | /** | 8 | /** |
7 | * 安环环保目标 | 9 | * 安环环保目标 |
... | @@ -9,4 +11,7 @@ import com.baomidou.mybatisplus.extension.service.IService; | ... | @@ -9,4 +11,7 @@ import com.baomidou.mybatisplus.extension.service.IService; |
9 | public interface IEnvironmentTargetService extends IService<EnvironmentTarget> { | 11 | public interface IEnvironmentTargetService extends IService<EnvironmentTarget> { |
10 | 12 | ||
11 | boolean checkData(String departId, String targetYear); | 13 | boolean checkData(String departId, String targetYear); |
14 | |||
15 | @Async | ||
16 | void addOrEdit(DataAssessmentSocreMaster dataAssessmentSocreMaster); | ||
12 | } | 17 | } | ... | ... |
1 | package com.skua.modules.safe.service.impl; | 1 | package com.skua.modules.safe.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | import com.skua.modules.assessment.entity.DataAssessmentSocreMaster; | ||
4 | import com.skua.modules.safe.entity.EnvironmentTarget; | 5 | import com.skua.modules.safe.entity.EnvironmentTarget; |
5 | import com.skua.modules.safe.mapper.EnvironmentTargetMapper; | 6 | import com.skua.modules.safe.mapper.EnvironmentTargetMapper; |
6 | import com.skua.modules.safe.service.IEnvironmentTargetService; | 7 | import com.skua.modules.safe.service.IEnvironmentTargetService; |
8 | import io.swagger.annotations.ApiModelProperty; | ||
9 | import org.jeecgframework.poi.excel.annotation.Excel; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | ||
7 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
8 | 12 | ||
9 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 13 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
... | @@ -16,6 +20,9 @@ import java.util.List; | ... | @@ -16,6 +20,9 @@ import java.util.List; |
16 | @Service | 20 | @Service |
17 | public class EnvironmentTargetServiceImpl extends ServiceImpl<EnvironmentTargetMapper, EnvironmentTarget> implements IEnvironmentTargetService { | 21 | public class EnvironmentTargetServiceImpl extends ServiceImpl<EnvironmentTargetMapper, EnvironmentTarget> implements IEnvironmentTargetService { |
18 | 22 | ||
23 | @Autowired | ||
24 | private EnvironmentTargetMapper environmentTargetMapper; | ||
25 | |||
19 | /*** | 26 | /*** |
20 | * 校验一个水厂一年只能提交一次数据 | 27 | * 校验一个水厂一年只能提交一次数据 |
21 | * @param departId | 28 | * @param departId |
... | @@ -32,5 +39,36 @@ public class EnvironmentTargetServiceImpl extends ServiceImpl<EnvironmentTargetM | ... | @@ -32,5 +39,36 @@ public class EnvironmentTargetServiceImpl extends ServiceImpl<EnvironmentTargetM |
32 | } | 39 | } |
33 | return true; | 40 | return true; |
34 | } | 41 | } |
42 | |||
43 | @Override | ||
44 | public void addOrEdit(DataAssessmentSocreMaster dataAssessmentSocreMaster) { | ||
45 | EnvironmentTarget environmentTarget = new EnvironmentTarget(); | ||
46 | environmentTarget.setDepartId(dataAssessmentSocreMaster.getDepartId()); | ||
47 | environmentTarget.setTargetYear(dataAssessmentSocreMaster.getAssessmentDate()); | ||
48 | //1859413989066813442 //安全环保目标责任状(约束指标) constraintScore | ||
49 | if("1859413989066813442".equals(dataAssessmentSocreMaster.getReportId())){ | ||
50 | environmentTarget.setConstraintScore(dataAssessmentSocreMaster.getSelfScore()); | ||
51 | } | ||
52 | //1872156241933414401 //安全环保目标责任状(责任指标) liabilityScore | ||
53 | if("1872156241933414401".equals(dataAssessmentSocreMaster.getReportId())){ | ||
54 | environmentTarget.setLiabilityScore(dataAssessmentSocreMaster.getSelfScore()); | ||
55 | } | ||
56 | QueryWrapper<EnvironmentTarget> queryWrapper = new QueryWrapper(); | ||
57 | queryWrapper.eq("depart_id" ,dataAssessmentSocreMaster.getDepartId()) ; | ||
58 | queryWrapper.eq("target_year" ,dataAssessmentSocreMaster.getAssessmentDate()) ; | ||
59 | List<EnvironmentTarget> list = this.baseMapper.selectList(queryWrapper); | ||
60 | if (list != null && !list.isEmpty()) { | ||
61 | EnvironmentTarget oldEnvironmentTarget = list.get(0); | ||
62 | environmentTarget.setId(oldEnvironmentTarget.getId()); | ||
63 | environmentTarget.setDepartAncestors(oldEnvironmentTarget.getDepartAncestors()); | ||
64 | environmentTarget.setWorkerDeathNum(oldEnvironmentTarget.getWorkerDeathNum()); | ||
65 | environmentTarget.setSuddenlyNum(oldEnvironmentTarget.getSuddenlyNum()); | ||
66 | environmentTarget.setNewCaseNum(oldEnvironmentTarget.getNewCaseNum()); | ||
67 | environmentTarget.setExamScore(oldEnvironmentTarget.getExamScore()); | ||
68 | environmentTargetMapper.updateById(oldEnvironmentTarget); | ||
69 | }else{ | ||
70 | environmentTargetMapper.insert(environmentTarget); | ||
71 | } | ||
72 | } | ||
35 | } | 73 | } |
36 | 74 | ... | ... |
... | @@ -35,7 +35,7 @@ public class DayDataSyncJob implements Job { | ... | @@ -35,7 +35,7 @@ public class DayDataSyncJob implements Job { |
35 | private ISysFactoryDeviceService sysFactoryDeviceService; | 35 | private ISysFactoryDeviceService sysFactoryDeviceService; |
36 | @Autowired | 36 | @Autowired |
37 | private IReportDataService reportDataService; | 37 | private IReportDataService reportDataService; |
38 | private DecimalFormat df = new DecimalFormat("######0.0000"); | 38 | private DecimalFormat df = new DecimalFormat("######0"); |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * 若参数变量名修改 QuartzJobController中也需对应修改 | 41 | * 若参数变量名修改 QuartzJobController中也需对应修改 | ... | ... |
1 | package com.skua.modules.equipment.entity; | 1 | package com.skua.modules.equipment.entity; |
2 | 2 | ||
3 | import java.io.Serializable; | ||
4 | import java.util.Date; | ||
5 | import com.baomidou.mybatisplus.annotation.IdType; | 3 | import com.baomidou.mybatisplus.annotation.IdType; |
6 | import com.baomidou.mybatisplus.annotation.TableId; | 4 | import com.baomidou.mybatisplus.annotation.TableId; |
7 | import com.baomidou.mybatisplus.annotation.TableName; | 5 | import com.baomidou.mybatisplus.annotation.TableName; |
8 | import com.baomidou.mybatisplus.annotation.TableField; | ||
9 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
10 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
11 | import lombok.Data; | 8 | import lombok.Data; |
... | @@ -13,7 +10,6 @@ import lombok.EqualsAndHashCode; | ... | @@ -13,7 +10,6 @@ import lombok.EqualsAndHashCode; |
13 | import lombok.experimental.Accessors; | 10 | import lombok.experimental.Accessors; |
14 | import com.fasterxml.jackson.annotation.JsonFormat; | 11 | import com.fasterxml.jackson.annotation.JsonFormat; |
15 | import com.skua.core.aspect.annotation.Dict; | 12 | import com.skua.core.aspect.annotation.Dict; |
16 | |||
17 | import org.springframework.format.annotation.DateTimeFormat; | 13 | import org.springframework.format.annotation.DateTimeFormat; |
18 | import org.jeecgframework.poi.excel.annotation.Excel; | 14 | import org.jeecgframework.poi.excel.annotation.Excel; |
19 | 15 | ||
... | @@ -168,6 +164,9 @@ public class EquipmentRepair { | ... | @@ -168,6 +164,9 @@ public class EquipmentRepair { |
168 | @Excel(name = "委外附件", width = 15) | 164 | @Excel(name = "委外附件", width = 15) |
169 | @ApiModelProperty(value = "委外附件") | 165 | @ApiModelProperty(value = "委外附件") |
170 | private java.lang.String outsourceFilepath; | 166 | private java.lang.String outsourceFilepath; |
167 | /**维修费用*/ | ||
168 | @ApiModelProperty(value = "维修费用") | ||
169 | private java.lang.String totalCost; | ||
171 | /**验收人员*/ | 170 | /**验收人员*/ |
172 | @Excel(name = "验收人员", width = 15) | 171 | @Excel(name = "验收人员", width = 15) |
173 | @ApiModelProperty(value = "验收人员") | 172 | @ApiModelProperty(value = "验收人员") | ... | ... |
... | @@ -122,6 +122,9 @@ public class EquipmentRepairVO extends FlowEntity { | ... | @@ -122,6 +122,9 @@ public class EquipmentRepairVO extends FlowEntity { |
122 | @Excel(name = "维修用时", width = 15) | 122 | @Excel(name = "维修用时", width = 15) |
123 | @ApiModelProperty(value = "维修用时") | 123 | @ApiModelProperty(value = "维修用时") |
124 | private java.lang.Double costHour; | 124 | private java.lang.Double costHour; |
125 | /**维修费用*/ | ||
126 | @ApiModelProperty(value = "维修费用") | ||
127 | private java.lang.String totalCost; | ||
125 | /**故障原因*/ | 128 | /**故障原因*/ |
126 | @Excel(name = "故障原因", width = 15) | 129 | @Excel(name = "故障原因", width = 15) |
127 | @ApiModelProperty(value = "故障原因") | 130 | @ApiModelProperty(value = "故障原因") | ... | ... |
-
请 注册 或 登录 后发表评论