7fce9e8c 张雷

feat(system): 添加专家信息管理功能

- 新增专家信息管理相关的实体类、Mapper、Service和Controller
- 实现专家信息的添加、编辑、删除、查询等功能- 添加专家信息的导入导出功能
1 个父辈 4bf97960
...@@ -4,6 +4,9 @@ import com.skua.tool.util.DateUtils; ...@@ -4,6 +4,9 @@ import com.skua.tool.util.DateUtils;
4 import io.swagger.annotations.ApiModelProperty; 4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data; 5 import lombok.Data;
6 6
7 import java.time.LocalDate;
8 import java.time.format.DateTimeFormatter;
9
7 @Data 10 @Data
8 public class DateVO { 11 public class DateVO {
9 12
...@@ -57,28 +60,38 @@ public class DateVO { ...@@ -57,28 +60,38 @@ public class DateVO {
57 public DateVO(String currentDate) { 60 public DateVO(String currentDate) {
58 this.nowMonth = DateUtils.dateformat(currentDate,"yyyy-MM"); 61 this.nowMonth = DateUtils.dateformat(currentDate,"yyyy-MM");
59 this.nowMonthStartDate = nowMonth+"-01"; 62 this.nowMonthStartDate = nowMonth+"-01";
60 this.nowMonthEndDate = nowMonth+"-31"; 63 // 获取当前日期
61 this.nowYearStartDate = nowYear + "-01-01"; 64 LocalDate now = LocalDate.now();
62 this.nowYearEndDate = nowYear + "-12-31"; 65 String currentMonth = now.format(DateTimeFormatter.ofPattern("yyyy-MM"));
66 // 判断是否为当前年月
67 if (this.nowMonth.equals(currentMonth)) {
68 this.nowMonthEndDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
69 } else {
70 this.nowMonthEndDate = nowMonth + "-31";
71 }
63 72
64 this.nowYear = Integer.parseInt(DateUtils.dateformat(currentDate,"yyyy")); 73 this.nowYear = Integer.parseInt(DateUtils.dateformat(currentDate,"yyyy"));
74 this.nowYearStartDate = nowYear + "-01-01";
75 // 判断是否为当前年
76 int currentYear = now.getYear();
77 if (this.nowYear == currentYear) {
78 this.nowYearEndDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
79 } else {
80 this.nowYearEndDate = nowYear + "-12-31";
81 }
82
65 //同比时间 83 //同比时间
66 this.lastYear = nowYear -1 ;//去年 84 this.lastYear = nowYear -1 ;
67 this.lastYearMonth = DateUtils.getTbMonth(this.nowMonth); 85 this.lastYearMonth = DateUtils.getTbMonth(this.nowMonth);
68 //System.out.println(" lastYearMonth "+lastYearMonth);
69 this.lastYearMonthStartTime = lastYearMonth+"-01"; 86 this.lastYearMonthStartTime = lastYearMonth+"-01";
70 this.lastYearMonthEndTime = lastYearMonth+"-31"; 87 this.lastYearMonthEndTime = lastYearMonth+"-31";
71 this.lastYearStartDate = this.lastYear+"-01-01"; 88 this.lastYearStartDate = this.lastYear+"-01-01";
72 this.lastYearEndDate = this.lastYear+"-12-31"; 89 this.lastYearEndDate = this.lastYear+"-12-31";
73 90
74 //环比时间 91 //环比时间
75 this.lastMonth = DateUtils.getHbMonth(this.nowMonth);// 92 this.lastMonth = DateUtils.getHbMonth(this.nowMonth);
76 //System.out.println(" lastMonth "+lastMonth);
77 this.lastMonthStartTime = lastMonth+"-01"; 93 this.lastMonthStartTime = lastMonth+"-01";
78 this.lastMonthEndTime = lastMonth+"-31"; 94 this.lastMonthEndTime = lastMonth+"-31";
79
80 //this.lastYearStartTime = lastYear+"-01";
81 // this.lastYearEndTime = lastYear +"-31";
82 } 95 }
83 } 96 }
84 97
......
...@@ -302,6 +302,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -302,6 +302,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
302 return list; 302 return list;
303 } 303 }
304 //节能环保 大屏展示 304 //节能环保 大屏展示
305 @Override
305 public JnhbLargeScreenVO jnhbLargeScreenShow(String departIds,String time){ 306 public JnhbLargeScreenVO jnhbLargeScreenShow(String departIds,String time){
306 DateVO dateVO = new DateVO(time); 307 DateVO dateVO = new DateVO(time);
307 JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); 308 JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
......
...@@ -63,7 +63,10 @@ public class WorkAnalysisController { ...@@ -63,7 +63,10 @@ public class WorkAnalysisController {
63 } 63 }
64 endTime = DateUtils.checkDateByCurrentDate(endTime);//判断是否当前月,然后与当前时间对比 64 endTime = DateUtils.checkDateByCurrentDate(endTime);//判断是否当前月,然后与当前时间对比
65 65
66 String sql = "select d.id 'depart_id' , d.depart_name , (DATEDIFF('"+endTime+"', '"+startTime+"') +"+index+") 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+"+index+" ) month_num,ifnull(aaa.count,0) 'nh_num' ,ifnull(bbb.count,0) 'szsl_num' ,ifnull(ccc.count,0) 'hy_num' ,ifnull(ddd.count,0) 'yy_month_num',ifnull(fff.count,0) 'df_month_num' ,ifnull(ggg.count,0) 'year_target_num' from sys_depart d "; 66 String sql = "select d.id 'depart_id' , d.depart_name , (DATEDIFF('"+endTime+"', '"+startTime+"') +"+index+") 'day_num' , " +
67 "(month('"+endTime+"') - month('"+startTime+"')+"+index+" ) month_num,ifnull(aaa.count,0) 'nh_num' ," +
68 "ifnull(bbb.count,0) 'szsl_num' ,ifnull(ccc.count,0) 'hy_num' ,ifnull(fff.count,0) 'yy_month_num'," +
69 "ifnull(ddd.count,0) 'df_month_num' ,ifnull(ggg.count,0) 'year_target_num' from sys_depart d ";
67 sql += getWorkProgressSql(departIds, startTime, endTime, month); 70 sql += getWorkProgressSql(departIds, startTime, endTime, month);
68 sql += " where d.depart_type =1 "; 71 sql += " where d.depart_type =1 ";
69 if(StringUtils.isNotEmpty(departIds)){ 72 if(StringUtils.isNotEmpty(departIds)){
...@@ -341,7 +344,7 @@ public class WorkAnalysisController { ...@@ -341,7 +344,7 @@ public class WorkAnalysisController {
341 view2119Sql_where += " and bb.CSTN is not null and bb.CSTN <> '' and bb.CSZL is not null and bb.CSZL <> '' "; 344 view2119Sql_where += " and bb.CSTN is not null and bb.CSTN <> '' and bb.CSZL is not null and bb.CSZL <> '' ";
342 view2119Sql_where += " and bb.JSCOD is not null and bb.JSCOD <> '' and bb.CSCOD is not null and bb.CSCOD <> '' and bb.CSPH is not null and bb.CSPH <> '' "; 345 view2119Sql_where += " and bb.JSCOD is not null and bb.JSCOD <> '' and bb.CSCOD is not null and bb.CSCOD <> '' and bb.CSPH is not null and bb.CSPH <> '' ";
343 346
344 sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " group by bb.depart_id )bbb on bbb.depart_id = d.id"; 347 sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " group by bb.depart_id ) bbb on bbb.depart_id = d.id";
345 //水质水量日报 及时天数 348 //水质水量日报 及时天数
346 sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " and DATEDIFF(bb.create_time , bb.time) < 2 group by bb.depart_id )bbbHH on bbbHH.depart_id = d.id"; 349 sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " and DATEDIFF(bb.create_time , bb.time) < 2 group by bb.depart_id )bbbHH on bbbHH.depart_id = d.id";
347 350
...@@ -351,11 +354,11 @@ public class WorkAnalysisController { ...@@ -351,11 +354,11 @@ public class WorkAnalysisController {
351 viewbffaSql_where += " and cc.JSZLHY is not null and cc.JSZLHY <> '' and cc.CSZLHY is not null and cc.CSZLHY <> '' and cc.CSTNHY is not null and cc.CSTNHY <> '' and cc.JSZDHY is not null and cc.JSZDHY <> '' "; 354 viewbffaSql_where += " and cc.JSZLHY is not null and cc.JSZLHY <> '' and cc.CSZLHY is not null and cc.CSZLHY <> '' and cc.CSTNHY is not null and cc.CSTNHY <> '' and cc.JSZDHY is not null and cc.JSZDHY <> '' ";
352 viewbffaSql_where += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' "; 355 viewbffaSql_where += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' ";
353 356
354 sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" group by cc.depart_id )ccc on ccc.depart_id = d.id "; 357 sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" group by cc.depart_id )ccc on ccc.depart_id = d.id ";
355 sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" and DATEDIFF(cc.create_time , cc.time) < 2 group by cc.depart_id )cccHH on cccHH.depart_id = d.id "; 358 sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" and DATEDIFF(cc.create_time , cc.time) < 2 group by cc.depart_id )cccHH on cccHH.depart_id = d.id ";
356 359
357 //电费月报 360 //电费月报
358 sql += " left join( select ec.depart_id , count(1) 'count' from report_electric_cost ec where ec.month = '"+month+"' and ec.cost is not null and ec.cost <> '' group by ec.depart_id ) ddd on ddd.depart_id = d.id "; 361 sql += " left join( select ec.depart_id , count(1) 'count' from report_electric_cost ec where ec.month = '"+month+"' and ec.cost is not null and ec.cost <> '' group by ec.depart_id ) ddd on ddd.depart_id = d.id ";
359 362
360 //生产运营月报表:月收费水量、月药费 363 //生产运营月报表:月收费水量、月药费
361 String view4411Sql = ReportViewUtil.buildView(ReportConstant.view4411,"yyf,ysfsl",departIds,startTime,endTime); 364 String view4411Sql = ReportViewUtil.buildView(ReportConstant.view4411,"yyf,ysfsl",departIds,startTime,endTime);
......
...@@ -275,8 +275,19 @@ ...@@ -275,8 +275,19 @@
275 275
276 order by aaa.end_time desc 276 order by aaa.end_time desc
277 </select> 277 </select>
278 <select id="getList" resultType="java.util.HashMap">
279 278
279 <select id="getList" resultType="java.util.HashMap">
280 SELECT
281 t.maintain_plan_name AS taskName,
282 u.id AS userId,
283 u.cid AS cid
284 FROM
285 equipment_maintain_task t
286 LEFT JOIN sys_user u ON u.id = t.maintainer_id
287 WHERE
288 t.results_enforcement IN ( '1' )
289 AND DATE_FORMAT(t.start_time,'%Y-%m-%d %H:%i:%s') &gt;= #{startTime}
290 AND DATE_FORMAT(t.start_time,'%Y-%m-%d %H:%i:%s') &lt;= #{endTime}
280 </select> 291 </select>
281 292
282 </mapper> 293 </mapper>
......
1 package com.skua.modules.equipment.quartz; 1 package com.skua.modules.equipment.quartz;
2 2
3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 import com.google.common.collect.Lists;
5 import com.skua.core.util.push.MessageEntity; 3 import com.skua.core.util.push.MessageEntity;
6 import com.skua.modules.alarmtmp.entity.AlarmRecordHistory;
7 import com.skua.modules.equipment.entity.EquipmentMaintainTask;
8 import com.skua.modules.equipment.service.IEquipmentInfoService;
9 import com.skua.modules.equipment.service.IEquipmentMaintainTaskService; 4 import com.skua.modules.equipment.service.IEquipmentMaintainTaskService;
10 import com.skua.modules.system.service.WebNoticePushServiceExt; 5 import com.skua.modules.system.service.WebNoticePushServiceExt;
11 import lombok.extern.slf4j.Slf4j; 6 import lombok.extern.slf4j.Slf4j;
...@@ -48,8 +43,6 @@ public class TaskRemindJob implements Job { ...@@ -48,8 +43,6 @@ public class TaskRemindJob implements Job {
48 LocalDateTime oneHourLater = now.plus(1, ChronoUnit.HOURS); 43 LocalDateTime oneHourLater = now.plus(1, ChronoUnit.HOURS);
49 String startTime = now.format(formatter); 44 String startTime = now.format(formatter);
50 String endTime = oneHourLater.format(formatter); 45 String endTime = oneHourLater.format(formatter);
51 startTime = "2025-04-07 00:00:00";
52 endTime = "2025-04-08 23:59:59";
53 List<Map<String, Object>> wbList = getWbList(startTime,endTime); 46 List<Map<String, Object>> wbList = getWbList(startTime,endTime);
54 //推送维保消息 47 //推送维保消息
55 pushWbMessage(wbList); 48 pushWbMessage(wbList);
...@@ -60,13 +53,17 @@ public class TaskRemindJob implements Job { ...@@ -60,13 +53,17 @@ public class TaskRemindJob implements Job {
60 private boolean pushWbMessage(List<Map<String, Object>> wbList) { 53 private boolean pushWbMessage(List<Map<String, Object>> wbList) {
61 for (Map<String, Object> wbMap : wbList) { 54 for (Map<String, Object> wbMap : wbList) {
62 //获取用户列表后做消息推送 55 //获取用户列表后做消息推送
56 List<String> userIds = new ArrayList<>();
57 userIds.add(wbMap.get("userId").toString());
58 List<String> userCIds = new ArrayList<>();
59 userCIds.add(wbMap.get("cid").toString());
63 MessageEntity messageEntity = new MessageEntity(); 60 MessageEntity messageEntity = new MessageEntity();
64 messageEntity.setMessageTitle("流程审批消息"); 61 messageEntity.setMessageTitle("任务提醒消息");
65 messageEntity.setMessageBody("您有一条【" + wbMap.get("taskName") + "】维保任务需要完成,请及时处理"); 62 messageEntity.setMessageBody("您有一条【" + wbMap.get("taskName") + "】维保任务需要完成,请及时处理");
66 messageEntity.setReceiveUser(null); 63 messageEntity.setReceiveUser(userIds);
67 messageEntity.setReceiveUserCid(null); 64 messageEntity.setReceiveUserCid(userCIds);
68 messageEntity.setSendUser("系统"); 65 messageEntity.setSendUser("系统");
69 messageEntity.setForwardTag("maintain"); 66 messageEntity.setForwardTag("2");
70 webNoticePushServiceExt.pushMessage(messageEntity, "maintain", "M"); 67 webNoticePushServiceExt.pushMessage(messageEntity, "maintain", "M");
71 } 68 }
72 return true; 69 return true;
......
1 package com.skua.modules.system.entity;
2
3 import com.baomidou.mybatisplus.annotation.IdType;
4 import com.baomidou.mybatisplus.annotation.TableId;
5 import com.baomidou.mybatisplus.annotation.TableName;
6 import com.skua.core.aspect.annotation.Dict;
7 import io.swagger.annotations.ApiModel;
8 import io.swagger.annotations.ApiModelProperty;
9 import lombok.Data;
10 import lombok.EqualsAndHashCode;
11 import lombok.experimental.Accessors;
12 import org.jeecgframework.poi.excel.annotation.Excel;
13
14 /**
15 * 专家信息管理
16 */
17 @Data
18 @TableName("sys_factory_expert")
19 @EqualsAndHashCode(callSuper = false)
20 @Accessors(chain = true)
21 @ApiModel(value="sys_factory_expert对象", description="专家信息管理")
22 public class SysFactoryExpert {
23
24 /**主键*/
25 @TableId(type = IdType.ID_WORKER_STR)
26 @ApiModelProperty(value = "主键")
27 private String id;
28 /**对应的系统用户id*/
29 @Excel(name = "对应的系统用户id", width = 15)
30 @ApiModelProperty(value = "对应的系统用户id")
31 private String userId;
32 /**专家等级*/
33 @Excel(name = "专家等级", width = 15)
34 @ApiModelProperty(value = "专家等级")
35 @Dict(dicCode = "expertLevel")
36 private String expertLevel;
37 /**专家类型*/
38 @Excel(name = "专家类型", width = 15)
39 @ApiModelProperty(value = "专家类型")
40 @Dict(dicCode = "expertType")
41 private String expertType;
42 /**专家特长*/
43 @Excel(name = "专家特长", width = 15)
44 @ApiModelProperty(value = "专家特长")
45 private String expertTc;
46 /**专家工作经历*/
47 @Excel(name = "专家工作经历", width = 15)
48 @ApiModelProperty(value = "专家工作经历")
49 private String expertGzjl;
50 /**附件*/
51 @Excel(name = "附件", width = 15)
52 @ApiModelProperty(value = "附件")
53 private String expertFile;
54 /**备注*/
55 @Excel(name = "备注", width = 15)
56 @ApiModelProperty(value = "备注")
57 private String remark;
58 /**创建时间*/
59 @Excel(name = "创建时间", width = 15)
60 @ApiModelProperty(value = "创建时间")
61 private String createTime;
62 /**创建人*/
63 @Excel(name = "创建人", width = 15)
64 @ApiModelProperty(value = "创建人")
65 private String createBy;
66 /**修改时间*/
67 @Excel(name = "修改时间", width = 15)
68 @ApiModelProperty(value = "修改时间")
69 private String updateTime;
70 /**修改人*/
71 @Excel(name = "修改人", width = 15)
72 @ApiModelProperty(value = "修改人")
73 private String updateBy;
74 /**标识*/
75 @Excel(name = "标识", width = 15)
76 @ApiModelProperty(value = "标识")
77 private String delFlag;
78 }
1 package com.skua.modules.system.mapper;
2
3 import com.skua.modules.system.entity.SysFactoryExpert;
4 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 import io.lettuce.core.dynamic.annotation.Param;
6
7 /**
8 * 专家信息管理
9 */
10 public interface SysFactoryExpertMapper extends BaseMapper<SysFactoryExpert> {
11
12 SysFactoryExpert queryByUser(@Param("userId") String userId);
13 }
1 <?xml version="1.0" encoding="UTF-8"?>
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.system.mapper.SysFactoryExpertMapper">
4
5 <select id="queryByUser" resultType="com.skua.modules.system.entity.SysFactoryExpert">
6 select * from sys_factory_expert where user_id = #{userId} limit 1
7 </select>
8
9 </mapper>
1 package com.skua.modules.system.service;
2
3 import com.skua.modules.system.entity.SysFactoryExpert;
4 import com.baomidou.mybatisplus.extension.service.IService;
5
6 /**
7 * 专家信息管理
8 */
9 public interface ISysFactoryExpertService extends IService<SysFactoryExpert> {
10
11 SysFactoryExpert queryByUser(String userId);
12 }
1 package com.skua.modules.system.service.impl;
2
3 import com.skua.modules.system.entity.SysFactoryExpert;
4 import com.skua.modules.system.mapper.SysFactoryExpertMapper;
5 import com.skua.modules.system.service.ISysFactoryExpertService;
6 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.stereotype.Service;
8
9 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
10
11 /**
12 * 专家信息管理
13 */
14 @Service
15 public class SysFactoryExpertServiceImpl extends ServiceImpl<SysFactoryExpertMapper, SysFactoryExpert> implements ISysFactoryExpertService {
16
17 @Autowired
18 private SysFactoryExpertMapper sysFactoryExpertMapper;
19
20 @Override
21 public SysFactoryExpert queryByUser(String userId) {
22 SysFactoryExpert sysFactoryExpert = sysFactoryExpertMapper.queryByUser(userId);
23 return sysFactoryExpert;
24 }
25 }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!