7fce9e8c 张雷

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

- 新增专家信息管理相关的实体类、Mapper、Service和Controller
- 实现专家信息的添加、编辑、删除、查询等功能- 添加专家信息的导入导出功能
1 个父辈 4bf97960
......@@ -4,6 +4,9 @@ import com.skua.tool.util.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@Data
public class DateVO {
......@@ -57,28 +60,38 @@ public class DateVO {
public DateVO(String currentDate) {
this.nowMonth = DateUtils.dateformat(currentDate,"yyyy-MM");
this.nowMonthStartDate = nowMonth+"-01";
this.nowMonthEndDate = nowMonth+"-31";
this.nowYearStartDate = nowYear + "-01-01";
this.nowYearEndDate = nowYear + "-12-31";
// 获取当前日期
LocalDate now = LocalDate.now();
String currentMonth = now.format(DateTimeFormatter.ofPattern("yyyy-MM"));
// 判断是否为当前年月
if (this.nowMonth.equals(currentMonth)) {
this.nowMonthEndDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
} else {
this.nowMonthEndDate = nowMonth + "-31";
}
this.nowYear = Integer.parseInt(DateUtils.dateformat(currentDate,"yyyy"));
this.nowYearStartDate = nowYear + "-01-01";
// 判断是否为当前年
int currentYear = now.getYear();
if (this.nowYear == currentYear) {
this.nowYearEndDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
} else {
this.nowYearEndDate = nowYear + "-12-31";
}
//同比时间
this.lastYear = nowYear -1 ;//去年
this.lastYear = nowYear -1 ;
this.lastYearMonth = DateUtils.getTbMonth(this.nowMonth);
//System.out.println(" lastYearMonth "+lastYearMonth);
this.lastYearMonthStartTime = lastYearMonth+"-01";
this.lastYearMonthEndTime = lastYearMonth+"-31";
this.lastYearStartDate = this.lastYear+"-01-01";
this.lastYearEndDate = this.lastYear+"-12-31";
//环比时间
this.lastMonth = DateUtils.getHbMonth(this.nowMonth);//
//System.out.println(" lastMonth "+lastMonth);
this.lastMonth = DateUtils.getHbMonth(this.nowMonth);
this.lastMonthStartTime = lastMonth+"-01";
this.lastMonthEndTime = lastMonth+"-31";
//this.lastYearStartTime = lastYear+"-01";
// this.lastYearEndTime = lastYear +"-31";
}
}
......
......@@ -302,6 +302,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
return list;
}
//节能环保 大屏展示
@Override
public JnhbLargeScreenVO jnhbLargeScreenShow(String departIds,String time){
DateVO dateVO = new DateVO(time);
JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
......
......@@ -63,7 +63,10 @@ public class WorkAnalysisController {
}
endTime = DateUtils.checkDateByCurrentDate(endTime);//判断是否当前月,然后与当前时间对比
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 ";
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(fff.count,0) 'yy_month_num'," +
"ifnull(ddd.count,0) 'df_month_num' ,ifnull(ggg.count,0) 'year_target_num' from sys_depart d ";
sql += getWorkProgressSql(departIds, startTime, endTime, month);
sql += " where d.depart_type =1 ";
if(StringUtils.isNotEmpty(departIds)){
......@@ -341,7 +344,7 @@ public class WorkAnalysisController {
view2119Sql_where += " and bb.CSTN is not null and bb.CSTN <> '' and bb.CSZL is not null and bb.CSZL <> '' ";
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 <> '' ";
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";
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";
//水质水量日报 及时天数
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";
......@@ -351,11 +354,11 @@ public class WorkAnalysisController {
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 <> '' ";
viewbffaSql_where += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' ";
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 ";
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 ";
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 ";
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 ";
//电费月报
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 ";
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 ";
//生产运营月报表:月收费水量、月药费
String view4411Sql = ReportViewUtil.buildView(ReportConstant.view4411,"yyf,ysfsl",departIds,startTime,endTime);
......
......@@ -275,8 +275,19 @@
order by aaa.end_time desc
</select>
<select id="getList" resultType="java.util.HashMap">
<select id="getList" resultType="java.util.HashMap">
SELECT
t.maintain_plan_name AS taskName,
u.id AS userId,
u.cid AS cid
FROM
equipment_maintain_task t
LEFT JOIN sys_user u ON u.id = t.maintainer_id
WHERE
t.results_enforcement IN ( '1' )
AND DATE_FORMAT(t.start_time,'%Y-%m-%d %H:%i:%s') &gt;= #{startTime}
AND DATE_FORMAT(t.start_time,'%Y-%m-%d %H:%i:%s') &lt;= #{endTime}
</select>
</mapper>
......
package com.skua.modules.equipment.quartz;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
import com.skua.core.util.push.MessageEntity;
import com.skua.modules.alarmtmp.entity.AlarmRecordHistory;
import com.skua.modules.equipment.entity.EquipmentMaintainTask;
import com.skua.modules.equipment.service.IEquipmentInfoService;
import com.skua.modules.equipment.service.IEquipmentMaintainTaskService;
import com.skua.modules.system.service.WebNoticePushServiceExt;
import lombok.extern.slf4j.Slf4j;
......@@ -48,8 +43,6 @@ public class TaskRemindJob implements Job {
LocalDateTime oneHourLater = now.plus(1, ChronoUnit.HOURS);
String startTime = now.format(formatter);
String endTime = oneHourLater.format(formatter);
startTime = "2025-04-07 00:00:00";
endTime = "2025-04-08 23:59:59";
List<Map<String, Object>> wbList = getWbList(startTime,endTime);
//推送维保消息
pushWbMessage(wbList);
......@@ -60,13 +53,17 @@ public class TaskRemindJob implements Job {
private boolean pushWbMessage(List<Map<String, Object>> wbList) {
for (Map<String, Object> wbMap : wbList) {
//获取用户列表后做消息推送
List<String> userIds = new ArrayList<>();
userIds.add(wbMap.get("userId").toString());
List<String> userCIds = new ArrayList<>();
userCIds.add(wbMap.get("cid").toString());
MessageEntity messageEntity = new MessageEntity();
messageEntity.setMessageTitle("流程审批消息");
messageEntity.setMessageTitle("任务提醒消息");
messageEntity.setMessageBody("您有一条【" + wbMap.get("taskName") + "】维保任务需要完成,请及时处理");
messageEntity.setReceiveUser(null);
messageEntity.setReceiveUserCid(null);
messageEntity.setReceiveUser(userIds);
messageEntity.setReceiveUserCid(userCIds);
messageEntity.setSendUser("系统");
messageEntity.setForwardTag("maintain");
messageEntity.setForwardTag("2");
webNoticePushServiceExt.pushMessage(messageEntity, "maintain", "M");
}
return true;
......
package com.skua.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 专家信息管理
*/
@Data
@TableName("sys_factory_expert")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="sys_factory_expert对象", description="专家信息管理")
public class SysFactoryExpert {
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private String id;
/**对应的系统用户id*/
@Excel(name = "对应的系统用户id", width = 15)
@ApiModelProperty(value = "对应的系统用户id")
private String userId;
/**专家等级*/
@Excel(name = "专家等级", width = 15)
@ApiModelProperty(value = "专家等级")
@Dict(dicCode = "expertLevel")
private String expertLevel;
/**专家类型*/
@Excel(name = "专家类型", width = 15)
@ApiModelProperty(value = "专家类型")
@Dict(dicCode = "expertType")
private String expertType;
/**专家特长*/
@Excel(name = "专家特长", width = 15)
@ApiModelProperty(value = "专家特长")
private String expertTc;
/**专家工作经历*/
@Excel(name = "专家工作经历", width = 15)
@ApiModelProperty(value = "专家工作经历")
private String expertGzjl;
/**附件*/
@Excel(name = "附件", width = 15)
@ApiModelProperty(value = "附件")
private String expertFile;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
/**创建时间*/
@Excel(name = "创建时间", width = 15)
@ApiModelProperty(value = "创建时间")
private String createTime;
/**创建人*/
@Excel(name = "创建人", width = 15)
@ApiModelProperty(value = "创建人")
private String createBy;
/**修改时间*/
@Excel(name = "修改时间", width = 15)
@ApiModelProperty(value = "修改时间")
private String updateTime;
/**修改人*/
@Excel(name = "修改人", width = 15)
@ApiModelProperty(value = "修改人")
private String updateBy;
/**标识*/
@Excel(name = "标识", width = 15)
@ApiModelProperty(value = "标识")
private String delFlag;
}
package com.skua.modules.system.mapper;
import com.skua.modules.system.entity.SysFactoryExpert;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lettuce.core.dynamic.annotation.Param;
/**
* 专家信息管理
*/
public interface SysFactoryExpertMapper extends BaseMapper<SysFactoryExpert> {
SysFactoryExpert queryByUser(@Param("userId") String userId);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.system.mapper.SysFactoryExpertMapper">
<select id="queryByUser" resultType="com.skua.modules.system.entity.SysFactoryExpert">
select * from sys_factory_expert where user_id = #{userId} limit 1
</select>
</mapper>
package com.skua.modules.system.service;
import com.skua.modules.system.entity.SysFactoryExpert;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 专家信息管理
*/
public interface ISysFactoryExpertService extends IService<SysFactoryExpert> {
SysFactoryExpert queryByUser(String userId);
}
package com.skua.modules.system.service.impl;
import com.skua.modules.system.entity.SysFactoryExpert;
import com.skua.modules.system.mapper.SysFactoryExpertMapper;
import com.skua.modules.system.service.ISysFactoryExpertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 专家信息管理
*/
@Service
public class SysFactoryExpertServiceImpl extends ServiceImpl<SysFactoryExpertMapper, SysFactoryExpert> implements ISysFactoryExpertService {
@Autowired
private SysFactoryExpertMapper sysFactoryExpertMapper;
@Override
public SysFactoryExpert queryByUser(String userId) {
SysFactoryExpert sysFactoryExpert = sysFactoryExpertMapper.queryByUser(userId);
return sysFactoryExpert;
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!