init: 提交孚德科技双预防监管平台源码到 fude 分支
commit
44987a211b
@ -0,0 +1,18 @@
|
|||||||
|
#FROM tomcat:9.0.78-jdk8
|
||||||
|
#FROM tomcat:8.5-jdk8
|
||||||
|
FROM tomcat:8.5.23-jre8
|
||||||
|
|
||||||
|
USER root
|
||||||
|
WORKDIR /opt/prevention-pc
|
||||||
|
|
||||||
|
ARG WAR_NAME=ehs
|
||||||
|
ARG WAR_FILE=./target/${WAR_NAME}.war
|
||||||
|
|
||||||
|
ENV TERM=dumb
|
||||||
|
|
||||||
|
COPY ${WAR_FILE} /usr/local/tomcat/webapps/ehs.war
|
||||||
|
RUN mkdir -p /usr/local/tomcat/hm_data/hm_prevention_pc
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
ENV JAVA_OPTS="-Xms128m -Xmx1024m -Dspring.profiles.active=default,dev,linux -Dspring.devtools.restart.enabled=false"
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
FROM amazoncorretto:8
|
||||||
|
USER root
|
||||||
|
WORKDIR /opt/prevention-pc
|
||||||
|
|
||||||
|
ARG JAR_NAME=ehs
|
||||||
|
ARG JAR_FILE=./target/${JAR_NAME}.jar
|
||||||
|
|
||||||
|
ENV TERM=dumb
|
||||||
|
|
||||||
|
COPY ${JAR_FILE} application.jar
|
||||||
|
COPY docker-entrypoint.sh docker-entrypoint.sh
|
||||||
|
COPY config config
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
ENV JAVA_OPTS="-Xms128m -Xmx1024m -Dspring.profiles.active=default,dev,linux -Dspring.devtools.restart.enabled=false"
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/bash","docker-entrypoint.sh"]
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 必须在当前目录下执行脚本
|
||||||
|
# 临时目录
|
||||||
|
host_name=root@local-13.huamar.com
|
||||||
|
tmp_dir=/tmp/tmp-devops-$(openssl rand -hex 8)
|
||||||
|
|
||||||
|
|
||||||
|
# SCP 发布包
|
||||||
|
echo "start deploy to server path:${tmp_dir}"
|
||||||
|
ssh ${host_name} "mkdir -p ${tmp_dir}/target/"
|
||||||
|
|
||||||
|
# 发布包
|
||||||
|
scp -r ./.env ${host_name}:$tmp_dir
|
||||||
|
scp -r ./docker-compose.yml ${host_name}:$tmp_dir
|
||||||
|
scp -r ./Dockerfile ${host_name}:$tmp_dir
|
||||||
|
scp -r ../target/ehs.war ${host_name}:$tmp_dir/target/
|
||||||
|
|
||||||
|
|
||||||
|
ssh -tt ${host_name} << remotessh
|
||||||
|
cd ${tmp_dir}
|
||||||
|
docker buildx build -t hm_safety_prevention_pc:latest .
|
||||||
|
docker-compose -p hm_safety_prevention_pc up -d
|
||||||
|
exit
|
||||||
|
remotessh
|
||||||
|
echo "end"
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 必须在当前目录下执行脚本
|
||||||
|
# 临时目录
|
||||||
|
host_name=root@221.176.140.236
|
||||||
|
ssh_port=122
|
||||||
|
tmp_dir=/tmp/tmp-devops-$(openssl rand -hex 8)
|
||||||
|
service_name=hm_xy_ehs
|
||||||
|
|
||||||
|
|
||||||
|
# SCP 发布包
|
||||||
|
echo "start deploy to server path:${tmp_dir}"
|
||||||
|
ssh -p ${ssh_port} ${host_name} "mkdir -p ${tmp_dir}/target/"
|
||||||
|
|
||||||
|
# 发布包
|
||||||
|
scp -P ${ssh_port} -r ./.env ${host_name}:$tmp_dir
|
||||||
|
scp -P ${ssh_port} -r ./docker-compose.yml ${host_name}:$tmp_dir
|
||||||
|
scp -P ${ssh_port} -r ./Dockerfile ${host_name}:$tmp_dir
|
||||||
|
scp -P ${ssh_port} -r ../target/ehs.war ${host_name}:$tmp_dir/target/
|
||||||
|
|
||||||
|
|
||||||
|
ssh -tt -p ${ssh_port} ${host_name} << remotessh
|
||||||
|
cd ${tmp_dir}
|
||||||
|
docker buildx build -t ${service_name}:latest .
|
||||||
|
docker-compose -p ${service_name} up -d --force-recreate
|
||||||
|
exit
|
||||||
|
remotessh
|
||||||
|
echo "end"
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
hm_xy_ehs:
|
||||||
|
container_name: hm_xy_ehs
|
||||||
|
image: hm_xy_ehs:latest
|
||||||
|
restart: always
|
||||||
|
privileged: true
|
||||||
|
ports:
|
||||||
|
- "20033:8080"
|
||||||
|
extra_hosts:
|
||||||
|
- "dev-safety-platform-db-internal.com:192.168.10.13"
|
||||||
|
- "dev-safety-platform-redis-internal.com:192.168.10.13"
|
||||||
|
environment:
|
||||||
|
- "TZ=Asia/Shanghai"
|
||||||
|
- "JAVA_OPTS=-Xms128m -Xmx1024m -Dspring.profiles.active=default,storage,xy -Dspring.devtools.restart.enabled=false"
|
||||||
|
volumes:
|
||||||
|
- /opt/xy_safety/hm_data:/usr/local/tomcat/hm_data
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
# ---> Java
|
||||||
|
# Compiled class file
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Log file
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# BlueJ files
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
target/
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
replay_pid*
|
||||||
|
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
SELECT
|
||||||
|
p.hdcheckplan_id,
|
||||||
|
p.ctrl_id,
|
||||||
|
p.company_id,
|
||||||
|
p.create_by,
|
||||||
|
p.create_time,
|
||||||
|
DATE_FORMAT(p.create_time, '%Y%m%d%H%i%s') AS task_start_time,
|
||||||
|
p.update_by,
|
||||||
|
p.update_time,
|
||||||
|
p.hd_content,
|
||||||
|
p.check_cycle,
|
||||||
|
p.check_cycle_unit,
|
||||||
|
p.work_start_time,
|
||||||
|
p.work_end_time,
|
||||||
|
p.work_day_type,
|
||||||
|
p.work_type,
|
||||||
|
p.CHECK_USER_ID,
|
||||||
|
p.run_state,
|
||||||
|
p.next_time,
|
||||||
|
d.DANGERSRC_NAME,
|
||||||
|
u.RISK_UNIT_name,
|
||||||
|
o.RISK_OBJECT_NAME,
|
||||||
|
u.RISK_UNIT_Id,
|
||||||
|
o.RISK_OBJECT_Id,
|
||||||
|
u1.name AS create_by_name,
|
||||||
|
p.TASK_NUM,
|
||||||
|
p.upload_status,
|
||||||
|
i.RISK_INFO,
|
||||||
|
i.risk_level,
|
||||||
|
i.RISK_ID,
|
||||||
|
post_name
|
||||||
|
FROM
|
||||||
|
zzmj_ehs_hdcheck_plan p
|
||||||
|
LEFT JOIN zzmj_ehs_risk_ctrl c ON p.CTRL_ID = c.CTRL_ID
|
||||||
|
LEFT JOIN zzmj_ehs_risk_info i ON c.RISK_ID = i.RISK_ID
|
||||||
|
LEFT JOIN zzmj_ehs_risk_dangersrc d ON i.DANGERSRC_ID = d.DANGERSRC_ID
|
||||||
|
LEFT JOIN zzmj_ehs_risk_unit u ON d.RISK_UNIT_ID = u.RISK_UNIT_ID
|
||||||
|
LEFT JOIN zzmj_ehs_risk_object o ON u.risk_object_id = o.risk_object_id
|
||||||
|
LEFT JOIN zzmj_ehs_user u1 ON u1.user_id = p.create_by
|
||||||
|
LEFT JOIN zzmj_ehs_user u2 ON u2.user_id = o.DUTY_PSN_id
|
||||||
|
LEFT JOIN zzmj_ehs_sys_post post ON post.post_id = u2.post_id
|
||||||
|
WHERE
|
||||||
|
p.run_state = ?
|
||||||
|
AND (p.next_time <= ? OR p.next_time IS NULL)
|
||||||
|
AND p.check_cycle_unit = '0'
|
||||||
|
AND p.WORK_DAY_TYPE IN (0, 1)
|
||||||
|
AND p.upload_status != 'D'
|
||||||
|
ORDER BY
|
||||||
|
o.risk_object_id,
|
||||||
|
p.WORK_TYPE,
|
||||||
|
p.TASK_NUM
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import javax.servlet.MultipartConfigElement;
|
||||||
|
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用程序启动入口
|
||||||
|
* @author 13721
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||||
|
@MapperScan("com.ruoyi.**.mapper")
|
||||||
|
public class EHSApplication
|
||||||
|
{
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
ApplicationContext ctx = SpringApplication.run(EHSApplication.class, args);
|
||||||
|
Environment env = ctx.getBean(Environment.class);
|
||||||
|
|
||||||
|
String protocol = "http";
|
||||||
|
if (env.getProperty("server.ssl.key-store") != null) {
|
||||||
|
protocol = "https";
|
||||||
|
}
|
||||||
|
|
||||||
|
String serverPort = env.getProperty("server.port");
|
||||||
|
String serverContextPath = env.getProperty("server.servlet.context-path");
|
||||||
|
String hostAddress = "localhost"; // 或者使用env.getProperty("local.server.address");
|
||||||
|
|
||||||
|
String baseUrl = protocol + "://" + hostAddress + ":" + serverPort;
|
||||||
|
if (serverContextPath != null) {
|
||||||
|
baseUrl += "/" + serverContextPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("项目地址: " + baseUrl);
|
||||||
|
System.out.println("[项目启动成功 ~~~~~~~~~~~~~~~~~]" );
|
||||||
|
System.out.println("[项目启动成功 ~~~~~~~~~~~~~~~~~]" );
|
||||||
|
System.out.println("[项目启动成功 ~~~~~~~~~~~~~~~~~]" );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传配置
|
||||||
|
* @return MultipartConfigElement
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public MultipartConfigElement multipartConfigElement() {
|
||||||
|
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||||
|
//文件最大
|
||||||
|
factory.setMaxFileSize("500MB"); //KB,MB
|
||||||
|
/// 设置总上传数据总大小
|
||||||
|
factory.setMaxRequestSize("500MB");
|
||||||
|
return factory.createMultipartConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web容器中进行部署
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class EHSServletInitializer extends SpringBootServletInitializer
|
||||||
|
{
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(EHSApplication.class,args);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
|
||||||
|
{
|
||||||
|
return application.sources(EHSApplication.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,270 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAccessRecord.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsAccessRecord.entity.EhsAppAccessRecord;
|
||||||
|
import com.ruoyi.app.module.ehsAccessRecord.service.IEhsAppAccessRecordService;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsHiddenTroubleAccount.service.impl.AppHiddenDangerServiceImpl;
|
||||||
|
import com.ruoyi.backstage.common.tool.StringUtil;
|
||||||
|
import com.ruoyi.backstage.common.tool.WXInformationPush;
|
||||||
|
import com.ruoyi.backstage.module.ehsAccidentScreen.entity.WechatTemplate;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsBasicInformation.entity.EhsBasicInformation;
|
||||||
|
import com.ruoyi.backstage.module.ehsBasicInformation.service.IEhsBasicInformationService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsUser;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsDeptService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsUserService;
|
||||||
|
import com.ruoyi.common.config.Global;
|
||||||
|
import com.ruoyi.common.constant.MessageTempConstants;
|
||||||
|
import com.ruoyi.common.constant.UploadConstants;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.file.FileUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-02-10
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsAccessRecord")
|
||||||
|
public class EhsAppAccessRecordController extends BaseController
|
||||||
|
{
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(AppHiddenDangerServiceImpl.class);
|
||||||
|
private String prefix = "ehs/ehsAccessRecord";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsAppAccessRecordService ehsAccessRecordService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsDeptService ehsDeptService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsUserService ehsUserService;
|
||||||
|
@RequiresPermissions("ehs:ehsAccessRecord:view")
|
||||||
|
@RequestMapping()
|
||||||
|
public String ehsAccessRecord()
|
||||||
|
{
|
||||||
|
return prefix + "/ehsAccessRecord";
|
||||||
|
}
|
||||||
|
@Autowired
|
||||||
|
private IEhsBasicInformationService ehsBasicInformationService;
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsAppAccessRecord ehsAccessRecord)
|
||||||
|
{//
|
||||||
|
startPage();
|
||||||
|
//EhsAppAccessRecord ehsAccessRecord=new EhsAppAccessRecord();
|
||||||
|
//ehsAccessRecord.setCompanyid(companyId);
|
||||||
|
if(StringUtil.isNotEmpty(ehsAccessRecord.getInputSearch()))
|
||||||
|
ehsAccessRecord.setName(ehsAccessRecord.getInputSearch());
|
||||||
|
List<EhsAppAccessRecord> list = ehsAccessRecordService.selectEhsAccessRecordList(ehsAccessRecord);
|
||||||
|
//显示图片
|
||||||
|
// List<EhsAppAccessRecord> list1=new ArrayList<>();
|
||||||
|
// for (int i = 0; i < list.size(); i++){
|
||||||
|
// EhsAppAccessRecord s = list.get(i);
|
||||||
|
// try {
|
||||||
|
// if (StringUtil.isNotEmpty(s.getImgName())) {
|
||||||
|
// s.setImgStr(FileUtils.getFileBase64(UploadConstants.HIDDEN_DANGER_IMG + s.getImgName(),UploadConstants.PREFIX_IMG_JPEG));
|
||||||
|
// }
|
||||||
|
// list1.add(s);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("获取隐患图片异常",e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(EhsAppAccessRecord ehsAccessRecord)
|
||||||
|
{
|
||||||
|
List<EhsAppAccessRecord> list = ehsAccessRecordService.selectEhsAccessRecordList(ehsAccessRecord);
|
||||||
|
ExcelUtil<EhsAppAccessRecord> util = new ExcelUtil<EhsAppAccessRecord>(EhsAppAccessRecord.class);
|
||||||
|
return util.exportExcel(list, "ehsAccessRecord");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@RequestMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存
|
||||||
|
*/
|
||||||
|
@Log(title = "", businessType = BusinessType.INSERT)
|
||||||
|
@RequestMapping("/addSave")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(HttpServletRequest request, @RequestBody EhsAppAccessRecord ehsAccessRecord)
|
||||||
|
{
|
||||||
|
//将前台传过来的图片再次进行压缩处理
|
||||||
|
if(StringUtil.isNotEmpty(ehsAccessRecord.getImgStr()) )
|
||||||
|
ehsAccessRecord.setImgName(FileUtils.BASE64CodeToBeImage(ehsAccessRecord.getImgStr(), UploadConstants.HIDDEN_DANGER_IMG, UploadConstants.IMG_EXT_PNG));
|
||||||
|
Map<String,Object> map= new HashMap<String,Object>();
|
||||||
|
map.put("companyid",ehsAccessRecord.getCompanyid());
|
||||||
|
map.put("name",ehsAccessRecord.getName());
|
||||||
|
map.put("tel",ehsAccessRecord.getTel());
|
||||||
|
map.put("idcard",ehsAccessRecord.getIdcard());
|
||||||
|
map.put("accesstype",ehsAccessRecord.getAccesstype());
|
||||||
|
map.put("imgname",ehsAccessRecord.getImgName());
|
||||||
|
map.put("employeetype",ehsAccessRecord.getEmployeetype());
|
||||||
|
map.put("telNew",ehsAccessRecord.getTelNew());
|
||||||
|
map.put("idCardNew",ehsAccessRecord.getIdCardNew());
|
||||||
|
// map.put("remarks",ehsAccessRecord.getRemarks());
|
||||||
|
pushInfo(map);
|
||||||
|
return toAjax(ehsAccessRecordService.insertEhsAccessRecordMap(map));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员登记消息推送给安全员(管理员)
|
||||||
|
* @param map
|
||||||
|
*/
|
||||||
|
private void pushInfo(Map<String,Object> map){
|
||||||
|
EhsUser user = new EhsUser();
|
||||||
|
user.setCompanyId(map.get("companyid").toString());
|
||||||
|
user.setSafetyOfficer(1);
|
||||||
|
List<EhsUser> ehsUsers = ehsUserService.selectEhsUserList(user);
|
||||||
|
if (ehsUsers.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String accessType = map.get("accesstype").toString();
|
||||||
|
switch (accessType){
|
||||||
|
case "1":
|
||||||
|
accessType = "白班上";
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
accessType = "白班下";
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
accessType = "夜班上";
|
||||||
|
break;
|
||||||
|
case "4":
|
||||||
|
accessType = "夜班下";
|
||||||
|
break;
|
||||||
|
case "5":
|
||||||
|
accessType = "班中1";
|
||||||
|
break;
|
||||||
|
case "6":
|
||||||
|
accessType = "班中2";
|
||||||
|
break;
|
||||||
|
case "7":
|
||||||
|
accessType = "班中出入";
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
String strUrl= Global.getConfig("dd.serviceUrl")+"ehs-app-standard-temp/pages/accessRecord/ehsAccessRecord-list.html?companyId=" + map.get("companyid").toString();
|
||||||
|
//微信通知
|
||||||
|
TreeMap<String, TreeMap<String, String>> params = new TreeMap<String, TreeMap<String, String>>();
|
||||||
|
params.put("first", WechatTemplate.item("人员登记提醒", "#000000"));
|
||||||
|
params.put("keyword1", WechatTemplate.item(DateUtils.parseDateToStr(DateUtils.parsePatterns[2],new Date()), "#000000"));
|
||||||
|
params.put("keyword2", WechatTemplate.item("员工编号/公司名称:"+ehsDeptService.selectEhsDeptById((String) map.get("companyid")).getDeptName(), "#000000"));
|
||||||
|
params.put("keyword3", WechatTemplate.item("员工名称:"+map.get("name").toString(), "#000000"));
|
||||||
|
params.put("keyword4", WechatTemplate.item("测温班次:"+accessType, "#000000"));
|
||||||
|
params.put("remark", WechatTemplate.item("体温(℃):"+map.get("idcard").toString(), "#00FF00"));
|
||||||
|
List<String> userList = new ArrayList<>(16);
|
||||||
|
for (EhsUser ehsUser : ehsUsers) {
|
||||||
|
if (!userList.contains(ehsUser.getUserId()+map.get("name"))){
|
||||||
|
WXInformationPush.sendMsg(params, ehsUser.getNoticeId(), strUrl, MessageTempConstants.WX_USER_LOG_NOTICE);
|
||||||
|
userList.add(ehsUser.getUserId()+map.get("name"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@RequestMapping("/getCompanyName/{companyId}")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsBasicInformation getCompanyName(@PathVariable("companyId") String companyId) {
|
||||||
|
startPage();
|
||||||
|
// EhsDept ehsDept=new EhsDept();
|
||||||
|
// ehsDept.setDeptId(companyId);
|
||||||
|
// List<EhsDept> ehsDepts = ehsDeptService.selectEhsDeptList(ehsDept);
|
||||||
|
//
|
||||||
|
// if(ehsDepts!=null && ehsDepts.size()>0)
|
||||||
|
// return ehsDepts.get(0);
|
||||||
|
// return new EhsDept();
|
||||||
|
EhsBasicInformation ehsBasicInformation=new EhsBasicInformation();
|
||||||
|
ehsBasicInformation.setCompanyId(companyId);
|
||||||
|
List<EhsBasicInformation> list = ehsBasicInformationService.selectEhsBasicInformationList(ehsBasicInformation);
|
||||||
|
EhsBasicInformation ehsBasicInformation2 = new EhsBasicInformation();
|
||||||
|
if(!list.isEmpty()) {
|
||||||
|
ehsBasicInformation2 = list.get(0);
|
||||||
|
try {
|
||||||
|
if(ehsBasicInformation2.getCompanyLogo()!=null) {
|
||||||
|
String imgUrl =FileUtils.getFileBase64(UploadConstants.COMPANYLOGO + ehsBasicInformation2.getCompanyLogo(),UploadConstants.IMG_EXT_PNG);
|
||||||
|
imgUrl=imgUrl.substring(26);
|
||||||
|
imgUrl="data:image/png;base64,"+imgUrl;
|
||||||
|
ehsBasicInformation2.setCompanyLogo(imgUrl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ehsBasicInformation2.setCompanyLogo("");
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
ehsBasicInformation2.setCompanyLogo("");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ehsBasicInformation2;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@RequestMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") Integer id, ModelMap mmap)
|
||||||
|
{
|
||||||
|
EhsAppAccessRecord ehsAccessRecord = ehsAccessRecordService.selectEhsAccessRecordById(id);
|
||||||
|
mmap.put("ehsAccessRecord", ehsAccessRecord);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存
|
||||||
|
*/
|
||||||
|
@Log(title = "", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(EhsAppAccessRecord ehsAccessRecord)
|
||||||
|
{
|
||||||
|
return toAjax(ehsAccessRecordService.updateEhsAccessRecord(ehsAccessRecord));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@Log(title = "", businessType = BusinessType.DELETE)
|
||||||
|
@RequestMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(ehsAccessRecordService.deleteEhsAccessRecordByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,234 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAccessRecord.entity;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.base.BaseEntity;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表 zzmj_ehs_access_record
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-02-10
|
||||||
|
*/
|
||||||
|
public class EhsAppAccessRecord extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Integer id;
|
||||||
|
/** 企业id */
|
||||||
|
private Integer companyid;
|
||||||
|
/** 姓名 */
|
||||||
|
private String name;
|
||||||
|
/** 电话 */
|
||||||
|
private String tel;
|
||||||
|
/** 身份证号 */
|
||||||
|
private String idcard;
|
||||||
|
/** 出入类型=1进门,=0出门 */
|
||||||
|
private Integer accesstype;
|
||||||
|
/** 是否有发热、咳嗽、呼吸乏力症状=0没有,=1有 */
|
||||||
|
private Integer issymptom;
|
||||||
|
/** 是否为确诊或疑似病例=0没有,=1确认 */
|
||||||
|
private Integer isconfirm;
|
||||||
|
/** 办理事项 */
|
||||||
|
private String remarks;
|
||||||
|
/** 登记时间 */
|
||||||
|
private Date recordingtime;
|
||||||
|
/** 出入类型=1进门,=0出门 */
|
||||||
|
private String accesstypename;
|
||||||
|
/** 是否有发热、咳嗽、呼吸乏力症状=0没有,=1有 */
|
||||||
|
private String issymptomname;
|
||||||
|
|
||||||
|
public String getTelNew() {
|
||||||
|
return telNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelNew(String telNew) {
|
||||||
|
this.telNew = telNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdCardNew() {
|
||||||
|
return idCardNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdCardNew(String idCardNew) {
|
||||||
|
this.idCardNew = idCardNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 手机号码 */
|
||||||
|
private String telNew;
|
||||||
|
/** 身份证号码 */
|
||||||
|
private String idCardNew;
|
||||||
|
|
||||||
|
public String getEmployeetype() {
|
||||||
|
return employeetype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmployeetype(String employeetype) {
|
||||||
|
this.employeetype = employeetype;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 用户类型=0本公司,=1外协公司 */
|
||||||
|
private String employeetype;
|
||||||
|
public String getImgStr() {
|
||||||
|
return imgStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImgStr(String imgStr) {
|
||||||
|
this.imgStr = imgStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 整改前图片base64码 */
|
||||||
|
private String imgStr;
|
||||||
|
public String getImgName() {
|
||||||
|
return imgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImgName(String imgName) {
|
||||||
|
this.imgName = imgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 现场照片名称 */
|
||||||
|
private String imgName;
|
||||||
|
public String getInputSearch() {
|
||||||
|
return inputSearch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInputSearch(String inputSearch) {
|
||||||
|
this.inputSearch = inputSearch;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String inputSearch;
|
||||||
|
public String getAccesstypename() {
|
||||||
|
return accesstypename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccesstypename(String accesstypename) {
|
||||||
|
this.accesstypename = accesstypename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssymptomname() {
|
||||||
|
return issymptomname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssymptomname(String issymptomname) {
|
||||||
|
this.issymptomname = issymptomname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsconfirmname() {
|
||||||
|
return isconfirmname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsconfirmname(String isconfirmname) {
|
||||||
|
this.isconfirmname = isconfirmname;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 是否为确诊或疑似病例=0没有,=1确认 */
|
||||||
|
private String isconfirmname;
|
||||||
|
public void setId(Integer id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setCompanyid(Integer companyid)
|
||||||
|
{
|
||||||
|
this.companyid = companyid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCompanyid()
|
||||||
|
{
|
||||||
|
return companyid;
|
||||||
|
}
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setTel(String tel)
|
||||||
|
{
|
||||||
|
this.tel = tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTel()
|
||||||
|
{
|
||||||
|
return tel;
|
||||||
|
}
|
||||||
|
public void setIdcard(String idcard)
|
||||||
|
{
|
||||||
|
this.idcard = idcard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdcard()
|
||||||
|
{
|
||||||
|
return idcard;
|
||||||
|
}
|
||||||
|
public void setAccesstype(Integer accesstype)
|
||||||
|
{
|
||||||
|
this.accesstype = accesstype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAccesstype()
|
||||||
|
{
|
||||||
|
return accesstype;
|
||||||
|
}
|
||||||
|
public void setIssymptom(Integer issymptom)
|
||||||
|
{
|
||||||
|
this.issymptom = issymptom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIssymptom()
|
||||||
|
{
|
||||||
|
return issymptom;
|
||||||
|
}
|
||||||
|
public void setIsconfirm(Integer isconfirm)
|
||||||
|
{
|
||||||
|
this.isconfirm = isconfirm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIsconfirm()
|
||||||
|
{
|
||||||
|
return isconfirm;
|
||||||
|
}
|
||||||
|
public void setRemarks(String remarks)
|
||||||
|
{
|
||||||
|
this.remarks = remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemarks()
|
||||||
|
{
|
||||||
|
return remarks;
|
||||||
|
}
|
||||||
|
public void setRecordingtime(Date recordingtime)
|
||||||
|
{
|
||||||
|
this.recordingtime = recordingtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getRecordingtime()
|
||||||
|
{
|
||||||
|
return recordingtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("companyid", getCompanyid())
|
||||||
|
.append("name", getName())
|
||||||
|
.append("tel", getTel())
|
||||||
|
.append("idcard", getIdcard())
|
||||||
|
.append("accesstype", getAccesstype())
|
||||||
|
.append("issymptom", getIssymptom())
|
||||||
|
.append("isconfirm", getIsconfirm())
|
||||||
|
.append("remarks", getRemarks())
|
||||||
|
.append("recordingtime", getRecordingtime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAccessRecord.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsAccessRecord.entity.EhsAppAccessRecord;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-02-10
|
||||||
|
*/
|
||||||
|
public interface EhsAppAccessRecordMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询信息
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 信息
|
||||||
|
*/
|
||||||
|
public EhsAppAccessRecord selectEhsAccessRecordById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 集合
|
||||||
|
*/
|
||||||
|
public List<EhsAppAccessRecord> selectEhsAccessRecordList(EhsAppAccessRecord ehsAccessRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEhsAccessRecord(EhsAppAccessRecord ehsAccessRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEhsAccessRecordMap(Map<String,Object> ehsAccessRecord);
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEhsAccessRecord(EhsAppAccessRecord ehsAccessRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEhsAccessRecordById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEhsAccessRecordByIds(String[] ids);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAccessRecord.service;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsAccessRecord.entity.EhsAppAccessRecord;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-02-10
|
||||||
|
*/
|
||||||
|
public interface IEhsAppAccessRecordService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询信息
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 信息
|
||||||
|
*/
|
||||||
|
public EhsAppAccessRecord selectEhsAccessRecordById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 集合
|
||||||
|
*/
|
||||||
|
public List<EhsAppAccessRecord> selectEhsAccessRecordList(EhsAppAccessRecord ehsAccessRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEhsAccessRecord(EhsAppAccessRecord ehsAccessRecord);
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEhsAccessRecordMap(Map<String,Object> ehsAccessRecord);
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEhsAccessRecord(EhsAppAccessRecord ehsAccessRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEhsAccessRecordByIds(String ids);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAccessRecord.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsAccessRecord.entity.EhsAppAccessRecord;
|
||||||
|
import com.ruoyi.app.module.ehsAccessRecord.mapper.EhsAppAccessRecordMapper;
|
||||||
|
import com.ruoyi.app.module.ehsAccessRecord.service.IEhsAppAccessRecordService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.support.Convert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务层实现
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-02-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EhsAppAccessRecordServiceImpl implements IEhsAppAccessRecordService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private EhsAppAccessRecordMapper ehsAccessRecordMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询信息
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EhsAppAccessRecord selectEhsAccessRecordById(Integer id)
|
||||||
|
{
|
||||||
|
return ehsAccessRecordMapper.selectEhsAccessRecordById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EhsAppAccessRecord> selectEhsAccessRecordList(EhsAppAccessRecord ehsAccessRecord)
|
||||||
|
{
|
||||||
|
return ehsAccessRecordMapper.selectEhsAccessRecordList(ehsAccessRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertEhsAccessRecord(EhsAppAccessRecord ehsAccessRecord)
|
||||||
|
{
|
||||||
|
return ehsAccessRecordMapper.insertEhsAccessRecord(ehsAccessRecord);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertEhsAccessRecordMap(Map<String,Object> ehsAccessRecord)
|
||||||
|
{
|
||||||
|
return ehsAccessRecordMapper.insertEhsAccessRecordMap(ehsAccessRecord);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*
|
||||||
|
* @param ehsAccessRecord 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateEhsAccessRecord(EhsAppAccessRecord ehsAccessRecord)
|
||||||
|
{
|
||||||
|
return ehsAccessRecordMapper.updateEhsAccessRecord(ehsAccessRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除对象
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEhsAccessRecordByIds(String ids)
|
||||||
|
{
|
||||||
|
return ehsAccessRecordMapper.deleteEhsAccessRecordByIds(Convert.toStrArray(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,160 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAccidentScreen.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.common.tool.WechatUtil;
|
||||||
|
import com.ruoyi.backstage.module.ehsAccidentScreen.entity.EhsAccidentScreen;
|
||||||
|
import com.ruoyi.backstage.module.ehsAccidentScreen.service.IEhsAccidentScreenService;
|
||||||
|
import com.ruoyi.backstage.module.ehsInspectionLog.entity.EhsInspectionLog;
|
||||||
|
import com.ruoyi.backstage.module.ehsInspectionLog.service.IEhsInspectionLogService;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysUser;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.config.Global;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事故排查 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-11-29
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsAccidentScreen")
|
||||||
|
public class EhsAppAccidentScreenController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsAccidentScreenService ehsAccidentScreenService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsInspectionLogService ehsInspectionLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询事故排查列表
|
||||||
|
*/
|
||||||
|
//@RequiresPermissions("ehs:ehsAccidentScreen:list")
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsAccidentScreen ehsAccidentScreen)
|
||||||
|
{
|
||||||
|
SysUser user = ShiroUtils.getSysUser();
|
||||||
|
startPage();
|
||||||
|
EhsInspectionLog ehsInspectionLog=new EhsInspectionLog();
|
||||||
|
List<EhsInspectionLog> list=null;
|
||||||
|
if(user.getDeptLevel().equals("2")) {//查询当前二级部门的数据
|
||||||
|
ehsInspectionLog.setFactoryId(user.getFactoryId());
|
||||||
|
list = ehsInspectionLogService.selectEhsInspectionLogAccidentScreenList(ehsInspectionLog);
|
||||||
|
}
|
||||||
|
if(user.getDeptLevel().equals("1")){//查询本公司下的所有数据
|
||||||
|
ehsInspectionLog.setCompanyId(user.getCompanyId());
|
||||||
|
list = ehsInspectionLogService.selectEhsInspectionLogAccidentScreenList(ehsInspectionLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出事故排查列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("ehs:ehsAccidentScreen:export")
|
||||||
|
@RequestMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(EhsAccidentScreen ehsAccidentScreen)
|
||||||
|
{
|
||||||
|
List<EhsAccidentScreen> list = ehsAccidentScreenService.selectEhsAccidentScreenList(ehsAccidentScreen);
|
||||||
|
ExcelUtil<EhsAccidentScreen> util = new ExcelUtil<EhsAccidentScreen>(EhsAccidentScreen.class);
|
||||||
|
return util.exportExcel(list, "ehsAccidentScreen");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增事故排查
|
||||||
|
*/
|
||||||
|
@RequestMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存事故排查
|
||||||
|
*/
|
||||||
|
//@RequiresPermissions("ehs:ehsAccidentScreen:add")
|
||||||
|
@Log(title = "事故排查", businessType = BusinessType.INSERT)
|
||||||
|
@RequestMapping("/addSave")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(EhsAccidentScreen ehsAccidentScreen)
|
||||||
|
{
|
||||||
|
return toAjax(ehsAccidentScreenService.insertEhsAccidentScreen(ehsAccidentScreen));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改事故排查
|
||||||
|
*/
|
||||||
|
@RequestMapping("/selectById/{sId}")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsAccidentScreen edit(@PathVariable("sId") String sId )
|
||||||
|
{
|
||||||
|
EhsAccidentScreen ehsAccidentScreen = ehsAccidentScreenService.selectEhsAccidentScreenById(sId);
|
||||||
|
return ehsAccidentScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存事故排查
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("ehs:ehsAccidentScreen:edit")
|
||||||
|
@Log(title = "事故排查", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(EhsAccidentScreen ehsAccidentScreen)
|
||||||
|
{
|
||||||
|
return toAjax(ehsAccidentScreenService.updateEhsAccidentScreen(ehsAccidentScreen));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除事故排查
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("ehs:ehsAccidentScreen:remove")
|
||||||
|
@Log(title = "事故排查", businessType = BusinessType.DELETE)
|
||||||
|
@RequestMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(ehsAccidentScreenService.deleteEhsAccidentScreenByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/scanQRCode")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult scanQRCode(@RequestParam("url")String url) throws NoSuchAlgorithmException {
|
||||||
|
String asAppid = Global.getConfig("wx.asAppid");
|
||||||
|
String asSecret = Global.getConfig("wx.asSecret");
|
||||||
|
String ticket = WechatUtil.getWechatCache(WechatUtil.TICKET,asAppid,asSecret);
|
||||||
|
System.out.println("~~~~~~~~~~~~~~~~~~~~scanQRCode ticket="+ticket);
|
||||||
|
Long timestamp = System.currentTimeMillis() / 1000;
|
||||||
|
String nonceStr = WechatUtil.getRandomString(16);
|
||||||
|
String sign = WechatUtil.getSign(ticket,nonceStr,timestamp,url);
|
||||||
|
Map<String,Object> subJsonMap = new HashMap<>();
|
||||||
|
subJsonMap.put("result","1");
|
||||||
|
subJsonMap.put("timestamp",timestamp);
|
||||||
|
subJsonMap.put("nonceStr",nonceStr);
|
||||||
|
subJsonMap.put("appId",asAppid);
|
||||||
|
subJsonMap.put("sign",sign);
|
||||||
|
return successData(subJsonMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAppDingDing.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsHiddenTroubleAccount.entity.AppHiddenDanger;
|
||||||
|
import com.ruoyi.app.module.ehsHiddenTroubleAccount.service.IAppHiddenDangerService;
|
||||||
|
import com.ruoyi.backstage.common.tool.DDInformationPush;
|
||||||
|
import com.ruoyi.backstage.module.ehsDingDing.entity.EhsDingDing;
|
||||||
|
import com.ruoyi.backstage.module.ehsDingDing.service.IEhsDingDingService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsUser;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsUserService;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.constant.MessageTempConstants;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钉钉代办事项列 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-12-09
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsDingDing")
|
||||||
|
public class EhsAppDingDingController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "ehs/ehsDingDing";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsUserService ehsUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsDingDingService ehsDingDingService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAppHiddenDangerService ehsHiddenDangerService;
|
||||||
|
|
||||||
|
|
||||||
|
@RequiresPermissions("ehs:ehsDingDing:view")
|
||||||
|
@RequestMapping()
|
||||||
|
public String ehsDingDing()
|
||||||
|
{
|
||||||
|
return prefix + "/ehsDingDing";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询钉钉代办事项列列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsDingDing ehsDingDing)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsDingDing> list = ehsDingDingService.selectEhsDingDingList(ehsDingDing);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存钉钉代办事项列
|
||||||
|
*/
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(EhsDingDing ehsDingDing)
|
||||||
|
{
|
||||||
|
return toAjax(ehsDingDingService.updateEhsDingDing(ehsDingDing));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容改为已读状态
|
||||||
|
*/
|
||||||
|
@RequestMapping("/updateIsReadState")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult updateIsReadState(EhsDingDing ehsDingDing)
|
||||||
|
{
|
||||||
|
return toAjax(ehsDingDingService.updatState(ehsDingDing));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 改为修改内容状态 3 退回 2 废弃
|
||||||
|
*/
|
||||||
|
@RequestMapping("/updateState")
|
||||||
|
@ResponseBody
|
||||||
|
@Transactional
|
||||||
|
public AjaxResult updateState(EhsDingDing ehsDingDing)
|
||||||
|
{
|
||||||
|
EhsDingDing ehsDing = ehsDingDingService.selectEhsDingDingById(ehsDingDing.getId());
|
||||||
|
AppHiddenDanger ehsHiddenDanger = new AppHiddenDanger();
|
||||||
|
ehsHiddenDanger.setPrincipalId(ehsDingDing.getUserId());
|
||||||
|
ehsHiddenDanger.setId(ehsDing.getContendId());
|
||||||
|
String ste = ehsDingDing.getState();
|
||||||
|
ehsHiddenDanger.setState(ehsDingDing.getState());
|
||||||
|
ehsHiddenDangerService.rejectHiddenDangerById(ehsHiddenDanger);
|
||||||
|
try {
|
||||||
|
DDInformationPush ddInformationPush = new DDInformationPush();
|
||||||
|
EhsUser ehsUser = ehsUserService.selectEhsUserById(ehsDingDing.getUserId());
|
||||||
|
|
||||||
|
EhsUser ehsUser2 = ehsUserService.selectEhsUserById(ehsDing.getSendId());
|
||||||
|
String state = ehsDingDing.getState();
|
||||||
|
if("3".equals(state)){
|
||||||
|
String strUrl="";
|
||||||
|
String ddInfoTemp = MessageTempConstants.DD_MSGTYPE_OA_TEMP_BACK;
|
||||||
|
ddInfoTemp = String.format(ddInfoTemp,strUrl,"隐患整改流程退回","隐患整改流程退回",ehsDing.getHiddenDangerNo(), ehsUser.getName(), DateUtils.datePath());
|
||||||
|
DDInformationPush.sendMsg(ehsUser2.getNoticeId(),ddInfoTemp);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return toAjax(ehsDingDingService.updatState(ehsDingDing));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,337 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAppNoticeMessage;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.common.tool.StringUtil;
|
||||||
|
import com.ruoyi.backstage.module.ehsBasicInformation.entity.EhsBasicInformation;
|
||||||
|
import com.ruoyi.backstage.module.ehsBasicInformation.service.IEhsBasicInformationService;
|
||||||
|
import com.ruoyi.backstage.module.ehsNoticeMessage.entity.EhsNoticeMessage;
|
||||||
|
import com.ruoyi.backstage.module.ehsNoticeMessage.service.IEhsNoticeMessageService;
|
||||||
|
import com.ruoyi.backstage.module.ehsShortMessage.entity.ZzmjEhsShortMessage;
|
||||||
|
import com.ruoyi.backstage.module.ehsShortMessage.service.IZzmjEhsShortMessageService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsUser;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsDeptService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsUserService;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysUser;
|
||||||
|
import com.ruoyi.backstage.module.system.service.ISysUserService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
import com.ruoyi.common.constant.MessageTempConstants;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.enums.UserStatus;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.util.DateUtils2;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内部公告 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-06-06
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsAppNoticeMessage")
|
||||||
|
public class EhsAppNoticeMessageController extends BaseController {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(EhsAppNoticeMessageController.class);
|
||||||
|
|
||||||
|
private String prefix = "backstage/module/ehsNoticeMessage";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsNoticeMessageService ehsNoticeMessageService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsBasicInformationService ehsBasicInformationService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsUserService ehsUserService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsDeptService ehsDeptService;
|
||||||
|
@Autowired
|
||||||
|
private IZzmjEhsShortMessageService zzmjEhsShortMessageService;
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
@RequestMapping("listPage")
|
||||||
|
public String ehsNoticeMessage() {
|
||||||
|
return prefix + "/ehsNoticeMessage";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询内部公告列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsNoticeMessage ehsNoticeMessage) {
|
||||||
|
startPage();
|
||||||
|
SysUser sysUser = ShiroUtils.getSysUser();
|
||||||
|
ehsNoticeMessage.setCompanyId(sysUser.getCompanyId());
|
||||||
|
ehsNoticeMessage.setStatus(2);
|
||||||
|
List<EhsNoticeMessage> list = ehsNoticeMessageService.selectEhsNoticeMessageList(ehsNoticeMessage);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
@RequestMapping("/listAdmin/{companyId}")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo listAdmin(@PathVariable("companyId") String companyId ,EhsNoticeMessage ehsNoticeMessage) {
|
||||||
|
startPage();
|
||||||
|
ehsNoticeMessage.setCompanyId(companyId);
|
||||||
|
List<EhsNoticeMessage> list = ehsNoticeMessageService.selectEhsNoticeMessageList (ehsNoticeMessage);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出内部公告列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(EhsNoticeMessage ehsNoticeMessage) {
|
||||||
|
List<EhsNoticeMessage> list = ehsNoticeMessageService.selectEhsNoticeMessageList(ehsNoticeMessage);
|
||||||
|
ExcelUtil<EhsNoticeMessage> util = new ExcelUtil<EhsNoticeMessage>(EhsNoticeMessage.class);
|
||||||
|
return util.exportExcel(list, "ehsNoticeMessage");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增内部公告
|
||||||
|
*/
|
||||||
|
@RequestMapping("/addPage")
|
||||||
|
public String add() {
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存内部公告
|
||||||
|
*/
|
||||||
|
@Log(title = "内部公告", businessType = BusinessType.INSERT)
|
||||||
|
@RequestMapping("/addOld")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addOld(@RequestBody EhsNoticeMessage ehsNoticeMessage) {
|
||||||
|
if(StringUtil.isNotEmpty(ehsNoticeMessage.getCompanyId())){
|
||||||
|
ehsNoticeMessage.setStatus(Constants.ISSUE_NEWS_NOT);
|
||||||
|
if(ehsNoticeMessage.getCompanyId().equals("-1")){
|
||||||
|
EhsDept ed = new EhsDept();
|
||||||
|
ed.setParentId("12");
|
||||||
|
List<EhsDept> ehsDepts = ehsDeptService.selectEhsDeptList(ed);
|
||||||
|
int i=0;
|
||||||
|
for (EhsDept ehsD: ehsDepts) {
|
||||||
|
ehsNoticeMessage.setCompanyId(ehsD.getDeptId().toString());
|
||||||
|
ehsNoticeMessageService.insertEhsNoticeMessage(ehsNoticeMessage);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return toAjax(i);
|
||||||
|
}else{
|
||||||
|
return toAjax(ehsNoticeMessageService.insertEhsNoticeMessage(ehsNoticeMessage));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return error("未选择企业!");
|
||||||
|
}
|
||||||
|
@Log(title = "内部公告", businessType = BusinessType.INSERT)
|
||||||
|
@RequestMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(@RequestBody EhsNoticeMessage ehsNoticeMessage) {
|
||||||
|
if( ehsNoticeMessage.getAllCompany()==0 && StringUtil.isEmpty(ehsNoticeMessage.getCompanyId()) ){
|
||||||
|
return error("未选择企业!");
|
||||||
|
}else{
|
||||||
|
SysUser sysUser =userService.selectUserByUserId(ehsNoticeMessage.getCreateUserId());
|
||||||
|
List<EhsBasicInformation> list = null;
|
||||||
|
if(ehsNoticeMessage.getAllCompany()==1){
|
||||||
|
EhsBasicInformation ehsBasicInformation = new EhsBasicInformation();
|
||||||
|
String strDepts =null;
|
||||||
|
if(StringUtil.isNotEmpty(sysUser.getManagerSubDept())){
|
||||||
|
String[] m = sysUser.getManagerSubDept().split(",");
|
||||||
|
strDepts= String.format("'%s'", StringUtils.join(m,"','"));
|
||||||
|
}
|
||||||
|
ehsBasicInformation.setManagerSubDept(strDepts);
|
||||||
|
ehsBasicInformation.setManagerType(sysUser.getManagerType()) ;
|
||||||
|
list = ehsBasicInformationService.selectEhsBasicInformationList(ehsBasicInformation);
|
||||||
|
}else{
|
||||||
|
EhsBasicInformation ehsBasicInformation = new EhsBasicInformation();
|
||||||
|
ehsBasicInformation.setCompanyIds("'"+ehsNoticeMessage.getCompanyId()+"'");
|
||||||
|
list = ehsBasicInformationService.selectEhsBasicInformationList(ehsBasicInformation);
|
||||||
|
}
|
||||||
|
String rec="";
|
||||||
|
for(EhsBasicInformation ebf :list){
|
||||||
|
if(StringUtil.isNotEmpty(ebf.getSmPhone())) {
|
||||||
|
rec=rec+","+ebf.getSmPhone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(rec.substring(0,1).equals(","))
|
||||||
|
rec=rec.substring(1);
|
||||||
|
ZzmjEhsShortMessage zzmjEhsShortMessage = new ZzmjEhsShortMessage();
|
||||||
|
zzmjEhsShortMessage.setID(UUID.randomUUID().toString().replace("-",""));
|
||||||
|
zzmjEhsShortMessage.setTYPE(Long.parseLong(ehsNoticeMessage.getMesgType())+1);
|
||||||
|
zzmjEhsShortMessage.setCreateBy(ehsNoticeMessage.getCreateUserId());
|
||||||
|
zzmjEhsShortMessage.setPHONENUMBER(rec);
|
||||||
|
zzmjEhsShortMessage.setCREATEDDATE(new Date());
|
||||||
|
zzmjEhsShortMessage.setMESSAGE("850853304453861376");
|
||||||
|
zzmjEhsShortMessageService.insertZzmjEhsShortMessage(zzmjEhsShortMessage);
|
||||||
|
ehsNoticeMessage.setStatus(Constants.ISSUE_NEWS_OK);
|
||||||
|
ehsNoticeMessage.setCreateCompanyId(sysUser.getCompanyId());
|
||||||
|
return toAjax(ehsNoticeMessageService.insertEhsNoticeMessage(ehsNoticeMessage) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改内部公告
|
||||||
|
*/
|
||||||
|
@RequestMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap) {
|
||||||
|
EhsNoticeMessage ehsNoticeMessage = ehsNoticeMessageService.selectEhsNoticeMessageById(id);
|
||||||
|
mmap.put("ehsNoticeMessage", ehsNoticeMessage);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看内部公告
|
||||||
|
*/
|
||||||
|
@RequestMapping("/detailAdmin/{id}")
|
||||||
|
public String detailAdmin(@PathVariable("id") String id, ModelMap mmap) {
|
||||||
|
EhsNoticeMessage ehsNoticeMessage = ehsNoticeMessageService.selectEhsNoticeMessageById(id);
|
||||||
|
mmap.put("ehsNoticeMessage", ehsNoticeMessage);
|
||||||
|
return prefix + "/detail";
|
||||||
|
}
|
||||||
|
@RequestMapping("/detail/{id}")
|
||||||
|
public String detail(@PathVariable("id") String id, ModelMap mmap) {
|
||||||
|
EhsNoticeMessage ehsNoticeMessage = ehsNoticeMessageService.selectEhsNoticeMessageById(id);
|
||||||
|
EhsNoticeMessage nm = new EhsNoticeMessage();
|
||||||
|
if(StringUtils.isEmpty(ehsNoticeMessage.getReadCompanyId())|| ehsNoticeMessage.getReadCompanyId().indexOf(ShiroUtils.getSysUser().getCompanyId()+",")<0) {
|
||||||
|
nm.setReadCompanyId(ShiroUtils.getSysUser().getCompanyId() + ",");
|
||||||
|
nm.setId(id);
|
||||||
|
ehsNoticeMessageService.updateReadCompany(nm);
|
||||||
|
}
|
||||||
|
mmap.put("ehsNoticeMessage", ehsNoticeMessage);
|
||||||
|
return prefix + "/detail";
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 编辑时获取信息用来设置默认下拉框
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById/{id}")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsNoticeMessage getById(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
EhsNoticeMessage ehsNoticeMessage = ehsNoticeMessageService.selectEhsNoticeMessageById(id);
|
||||||
|
return ehsNoticeMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存内部公告
|
||||||
|
*/
|
||||||
|
@Log(title = "内部公告", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/editOld")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editOldSave( @RequestBody EhsNoticeMessage ehsNoticeMessage,HttpServletRequest req) {
|
||||||
|
String companyId=req.getParameter("companyId");
|
||||||
|
if(StringUtil.isNotEmpty(ehsNoticeMessage.getCompanyId())){
|
||||||
|
ehsNoticeMessage.setStatus(Constants.ISSUE_NEWS_NOT);
|
||||||
|
if(ehsNoticeMessage.getCompanyId().equals("-1")){
|
||||||
|
EhsDept ed = new EhsDept();
|
||||||
|
ed.setParentId("12");
|
||||||
|
List<EhsDept> ehsDepts = ehsDeptService.selectEhsDeptList(ed);
|
||||||
|
int i=0;
|
||||||
|
for (EhsDept ehsD: ehsDepts) {
|
||||||
|
ehsNoticeMessage.setCompanyId(ehsD.getDeptId().toString());
|
||||||
|
ehsNoticeMessageService.updateEhsNoticeMessage(ehsNoticeMessage);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return toAjax(i);
|
||||||
|
}else{
|
||||||
|
return toAjax(ehsNoticeMessageService.updateEhsNoticeMessage(ehsNoticeMessage));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return error("未选择企业!");
|
||||||
|
}
|
||||||
|
@Log(title = "内部公告", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave( @RequestBody EhsNoticeMessage ehsNoticeMessage,HttpServletRequest req) {
|
||||||
|
ehsNoticeMessage.setStatus(1);
|
||||||
|
if( ehsNoticeMessage.getAllCompany()==0 && StringUtil.isEmpty(ehsNoticeMessage.getCompanyId()) ){
|
||||||
|
return error("未选择企业!");
|
||||||
|
}else{
|
||||||
|
return toAjax(ehsNoticeMessageService.updateEhsNoticeMessage(ehsNoticeMessage));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除内部公告
|
||||||
|
*/
|
||||||
|
@Log(title = "内部公告", businessType = BusinessType.DELETE)
|
||||||
|
@RequestMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) {
|
||||||
|
return toAjax(ehsNoticeMessageService.deleteEhsNoticeMessageByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布公告
|
||||||
|
*
|
||||||
|
* @param id 公告ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@RequestMapping("/issueNews/{id}")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult issueNews(@PathVariable("id") String id) {
|
||||||
|
EhsNoticeMessage message = new EhsNoticeMessage();
|
||||||
|
message.setId(id);
|
||||||
|
message.setStatus(Constants.ISSUE_NEWS_OK);
|
||||||
|
//推送
|
||||||
|
EhsUser user = new EhsUser();
|
||||||
|
user.setStatus(UserStatus.OK.getCode());
|
||||||
|
List<EhsUser> users = ehsUserService.selectEhsUserList(user);
|
||||||
|
if (users.size() != 0) {
|
||||||
|
try {
|
||||||
|
EhsNoticeMessage ehsNoticeMessage = ehsNoticeMessageService.selectEhsNoticeMessageById(id);
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
String messages = MessageTempConstants.INTERNAL_ANNOUNCEMENT;
|
||||||
|
for (EhsUser ehsUser : users) {
|
||||||
|
if (ehsUser.getLoginNo().equals(ehsNoticeMessage.getCreateUserId())){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
messages = messages.replace(MessageTempConstants.SEPARATOR + "1", ehsNoticeMessage.getCreateUserName())
|
||||||
|
.replace(MessageTempConstants.SEPARATOR + "2", DateUtils2.formatDate(ehsNoticeMessage.getCreateTime()))
|
||||||
|
.replace(MessageTempConstants.SEPARATOR + "3", ehsNoticeMessage.getTitle());
|
||||||
|
map.put("pTitle", messages);
|
||||||
|
map.put("pUser", ehsUser.getUserId());
|
||||||
|
}
|
||||||
|
ehsNoticeMessageService.pushInfo(map);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("发布内部公告推送信息失败:",e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return toAjax(ehsNoticeMessageService.updateEhsNoticeMessage(message));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/listAdmin")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo listAdmin(EhsNoticeMessage ehsNoticeMessage) {
|
||||||
|
startPage();
|
||||||
|
List<EhsNoticeMessage> list = ehsNoticeMessageService.selectEhsNoticeMessageListAdmin(ehsNoticeMessage);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
@RequestMapping("/listAdminRead")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo listAdminRead(EhsNoticeMessage ehsNoticeMessage) {
|
||||||
|
startPage();
|
||||||
|
List<EhsNoticeMessage> list = ehsNoticeMessageService.selectEhsNoticeMessageListAdminRead(ehsNoticeMessage);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
@RequestMapping("/listPageAdmin")
|
||||||
|
public String inspectionLogList(ModelMap mmap)
|
||||||
|
{
|
||||||
|
return prefix + "/ehsNoticeMessageAdmin";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,123 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAppSiteInspection;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsHiddenTroubleAccount.entity.AppHiddenDanger;
|
||||||
|
import com.ruoyi.backstage.common.tool.StringUtil;
|
||||||
|
import com.ruoyi.backstage.module.ehsBasicInformation.entity.EhsBasicInformation;
|
||||||
|
import com.ruoyi.backstage.module.ehsBasicInformation.service.IEhsBasicInformationService;
|
||||||
|
import com.ruoyi.backstage.module.ehsShortMessage.entity.ZzmjEhsShortMessage;
|
||||||
|
import com.ruoyi.backstage.module.ehsShortMessage.service.IZzmjEhsShortMessageService;
|
||||||
|
import com.ruoyi.backstage.module.ehsSiteInspection.entity.EhsSiteInspection;
|
||||||
|
import com.ruoyi.backstage.module.ehsSiteInspection.service.IEhsSiteInspectionService;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysUser;
|
||||||
|
import com.ruoyi.backstage.module.system.service.ISysUserService;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现场检查日志 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-11-23
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsAppSiteInspection")
|
||||||
|
public class EhsAppSiteInspectionController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "backstage/module/ehsSiteInspection";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsSiteInspectionService ehsSiteInspectionService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsBasicInformationService ehsBasicInformationService;
|
||||||
|
@Autowired
|
||||||
|
private IZzmjEhsShortMessageService zzmjEhsShortMessageService;
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
/**
|
||||||
|
* 查询现场检查日志列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsSiteInspection ehsSiteInspection)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsSiteInspection> list = ehsSiteInspectionService.selectEhsSiteInspectionList(ehsSiteInspection);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存现场检查日志
|
||||||
|
*/
|
||||||
|
@Log(title = "现场检查日志", businessType = BusinessType.INSERT)
|
||||||
|
@RequestMapping("/addSave")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(HttpServletRequest request, @RequestBody EhsSiteInspection ehsSiteInspection)
|
||||||
|
{
|
||||||
|
if(ehsSiteInspection.getState()==0){
|
||||||
|
List<EhsBasicInformation> list = null;
|
||||||
|
EhsBasicInformation ehsBasicInformation = new EhsBasicInformation();
|
||||||
|
ehsBasicInformation.setCompanyId(ehsSiteInspection.getCompanyId());
|
||||||
|
list = ehsBasicInformationService.selectEhsBasicInformationList(ehsBasicInformation);
|
||||||
|
String rec="";
|
||||||
|
for(EhsBasicInformation ebf :list){
|
||||||
|
if(StringUtil.isNotEmpty(ebf.getSmPhone())) {
|
||||||
|
rec=rec+","+ebf.getSmPhone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(rec.substring(0,1).equals(","))
|
||||||
|
rec=rec.substring(1);
|
||||||
|
ZzmjEhsShortMessage zzmjEhsShortMessage = new ZzmjEhsShortMessage();
|
||||||
|
zzmjEhsShortMessage.setID(UUID.randomUUID().toString().replace("-",""));
|
||||||
|
zzmjEhsShortMessage.setTYPE(Long.parseLong("0"));
|
||||||
|
zzmjEhsShortMessage.setCreateBy(ehsSiteInspection.getFindUser());
|
||||||
|
zzmjEhsShortMessage.setPHONENUMBER(rec);
|
||||||
|
zzmjEhsShortMessage.setCREATEDDATE(new Date());
|
||||||
|
zzmjEhsShortMessage.setMESSAGE("850853568495267840");
|
||||||
|
zzmjEhsShortMessageService.insertZzmjEhsShortMessage(zzmjEhsShortMessage);
|
||||||
|
}
|
||||||
|
SysUser sysUser =userService.selectUserByUserId(ehsSiteInspection.getFindUser());
|
||||||
|
ehsSiteInspection.setCreateCompanyId(sysUser.getCompanyId());
|
||||||
|
return toAjax(ehsSiteInspectionService.insertAppEhsSiteInspection(ehsSiteInspection));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存现场检查日志
|
||||||
|
*/
|
||||||
|
@Log(title = "现场检查日志", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(EhsSiteInspection ehsSiteInspection)
|
||||||
|
{
|
||||||
|
return toAjax(ehsSiteInspectionService.updateEhsSiteInspection(ehsSiteInspection));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除现场检查日志
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("module:ehsSiteInspection:remove")
|
||||||
|
@Log(title = "现场检查日志", businessType = BusinessType.DELETE)
|
||||||
|
@RequestMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(ehsSiteInspectionService.deleteEhsSiteInspectionByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,101 @@
|
|||||||
|
package com.ruoyi.app.module.ehsAppUserManagement.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsRiskDept.entity.EhsRiskDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsRiskDept.service.IEhsRiskDeptService;
|
||||||
|
import com.ruoyi.backstage.module.ehsScreenLevel.entity.EhsScreenLevel;
|
||||||
|
import com.ruoyi.backstage.module.ehsScreenLevel.service.IEhsScreenLevelService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsDeptService;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-04-18
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsUserManagement")
|
||||||
|
public class EhsAppDeptController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsDeptService ehsDeptService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsScreenLevelService ehsScreenLevelService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载安全组织部门列表树
|
||||||
|
*/
|
||||||
|
@GetMapping("/selectSafeDeptTree")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Map<String, Object>> selectSafeDeptTree() {
|
||||||
|
return ehsDeptService.selectSafeDeptTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载安全标准列表树
|
||||||
|
*/
|
||||||
|
@GetMapping("/selectSafeBiaoZhunTree")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Map<String, Object>> selectSafeBiaoZhunTree() {
|
||||||
|
return ehsDeptService.selectSafeBiaoZhunTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载安全制度列表树
|
||||||
|
*/
|
||||||
|
@GetMapping("/selectSafeSystemTree")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Map<String, Object>> selectSafeSystemTree() {
|
||||||
|
return ehsDeptService.selectSafeSystemTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsDept ehsDept) {
|
||||||
|
startPage();
|
||||||
|
ehsDept.setDeptLevel(2);
|
||||||
|
List<EhsDept> ehsDepts = ehsDeptService.selectEhsDeptList(ehsDept);
|
||||||
|
return getDataTable(ehsDepts);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/dept/roleList")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Map<String, Object>> treeData(EhsDept ehsDept) {
|
||||||
|
return ehsDeptService.selectDeptTreeOfApp(ehsDept);
|
||||||
|
}
|
||||||
|
@RequestMapping("/getScreenLevelNameById/{screenLevelId}")
|
||||||
|
@ResponseBody
|
||||||
|
public List<String[]> getScreenLevelNameById( @PathVariable("screenLevelId") String screenLevelId) {
|
||||||
|
List<String[]> lst=new ArrayList<>();
|
||||||
|
String[] sId= screenLevelId.split(",");
|
||||||
|
for(String s:sId){
|
||||||
|
EhsScreenLevel ehsScreenLevel =ehsScreenLevelService.selectEhsScreenLevelById(Integer.parseInt(s));
|
||||||
|
if(ehsScreenLevel!=null ){
|
||||||
|
String[] r=new String[2];
|
||||||
|
r[0]=s.toString();
|
||||||
|
r[1]=ehsScreenLevel.getScreenLevelName();
|
||||||
|
lst.add(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lst;
|
||||||
|
}
|
||||||
|
@RequestMapping("/getScreenLevelList")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsScreenLevel> getScreenLevelList() {
|
||||||
|
List<EhsScreenLevel> eslList =ehsScreenLevelService.selectEhsScreenLevelList(new EhsScreenLevel());
|
||||||
|
return eslList;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
package com.ruoyi.app.module.ehsDictionaryInterface.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsHiddenDangerLevel.entity.EhsHiddenDangerLevel;
|
||||||
|
import com.ruoyi.backstage.module.ehsHiddenDangerLevel.service.IEhsHiddenDangerLevelService;
|
||||||
|
import com.ruoyi.backstage.module.ehsPunishStandard.entity.EhsPunishStandard;
|
||||||
|
import com.ruoyi.backstage.module.ehsPunishStandard.service.IEhsPunishStandardService;
|
||||||
|
import com.ruoyi.backstage.module.ehsRiskDangerType.entity.EhsRiskDangerType;
|
||||||
|
import com.ruoyi.backstage.module.ehsRiskDangerType.service.IEhsRiskDangerTypeService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsDeptService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsUserService;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysUser;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ehs 字点接口
|
||||||
|
*
|
||||||
|
* @author LiuYaTing
|
||||||
|
* @date 2019-04-28
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsDictionaryInterface")
|
||||||
|
public class EhsDictionaryInterfaceController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsHiddenDangerLevelService ehsHiddenDangerLevelService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsRiskDangerTypeService ehsRiskDangerTypeService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsPunishStandardService ehsPunishStandardService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsDeptService ehsDeptService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsUserService ehsUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询隐患等级列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getEhsHiddenDangerLevellist")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsHiddenDangerLevel> getEhsHiddenDangerLevellist(
|
||||||
|
EhsHiddenDangerLevel ehsHiddenDangerLevel) {
|
||||||
|
List<EhsHiddenDangerLevel> list = ehsHiddenDangerLevelService
|
||||||
|
.selectEhsHiddenDangerLevelList(ehsHiddenDangerLevel);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询风险/隐患类型列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getEhsRiskDangerTypelist")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsRiskDangerType> getEhsRiskDangerTypelist(
|
||||||
|
EhsRiskDangerType ehsRiskDangerType) {
|
||||||
|
List<EhsRiskDangerType> list = ehsRiskDangerTypeService
|
||||||
|
.selectEhsRiskDangerTypeList(ehsRiskDangerType);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询处罚标准列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getEhsPunishStandardlist")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsPunishStandard> getEhsPunishStandardlist(
|
||||||
|
EhsPunishStandard ehsPunishStandard) {
|
||||||
|
List<EhsPunishStandard> list = ehsPunishStandardService
|
||||||
|
.selectEhsPunishStandardList(ehsPunishStandard);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载部门列表树
|
||||||
|
*/
|
||||||
|
@GetMapping("/getDeptSelectData/{userId}")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsDept> getDeptSelectData(
|
||||||
|
@PathVariable("userId") String userId) {
|
||||||
|
SysUser sysUser = new SysUser();
|
||||||
|
sysUser.setUserId(userId);
|
||||||
|
List<SysUser> sysUsers = ehsUserService.selectEhsUserList(sysUser);
|
||||||
|
sysUser = sysUsers.get(0);
|
||||||
|
|
||||||
|
List<EhsDept> maps = ehsDeptService.selectCurrentCompanyDept(sysUser.getCompanyId());
|
||||||
|
EhsDept ehsDept = ehsDeptService.selectEhsDeptById( sysUser.getCompanyId() );
|
||||||
|
maps.add(ehsDept);
|
||||||
|
return maps;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
package com.ruoyi.app.module.ehsEncyclopedia.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsEncyclopedia.entity.EhsEncyclopedia;
|
||||||
|
import com.ruoyi.backstage.module.ehsEncyclopedia.service.IEhsEncyclopediaService;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版 权: operate Copyright 2014-2019,All rights reserved
|
||||||
|
* 文 件 名:
|
||||||
|
* 描 述:
|
||||||
|
*
|
||||||
|
* @author: sunwj
|
||||||
|
* @date: 2019/6/27 13:26
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsEncyclopedia")
|
||||||
|
public class EhsEncyclopediaAppController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsEncyclopediaService ehsEncyclopediaService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全百科列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsEncyclopedia ehsEncyclopedia)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
if(ehsEncyclopedia.getSecurityType()==6){
|
||||||
|
//微信端 新冠状病毒所有公司都可以看到
|
||||||
|
ehsEncyclopedia.setCompanyId(null);
|
||||||
|
}
|
||||||
|
List<EhsEncyclopedia> list = ehsEncyclopediaService.selectEhsEncyclopediaList(ehsEncyclopedia);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询ID获取详情
|
||||||
|
*/
|
||||||
|
@RequestMapping("/selectById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsEncyclopedia selectById(EhsEncyclopedia ehsEncyclopedia){
|
||||||
|
return ehsEncyclopediaService.selectEhsEncyclopediaById(ehsEncyclopedia.getEncyclopediaId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,123 @@
|
|||||||
|
package com.ruoyi.app.module.ehsEquipmentInspection.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsSpeciaEquipment.entity.EhsSpeciaEquipment;
|
||||||
|
import com.ruoyi.backstage.module.ehsSpeciaEquipment.service.IEhsSpeciaEquipmentService;
|
||||||
|
import com.ruoyi.backstage.module.ehsXiaofangEquipment.entity.EhsXiaofangEquipment;
|
||||||
|
import com.ruoyi.backstage.module.ehsXiaofangEquipment.service.IEhsXiaofangEquipmentService;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* App设备巡检
|
||||||
|
* @author A
|
||||||
|
* @date 2019年6月6日
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsEquipmentInspection")
|
||||||
|
public class EhsAppEquipmentInspectionController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsSpeciaEquipmentService ehsSpeciaEquipmentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsXiaofangEquipmentService ehsXiaofangEquipmentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询特种设备列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getSpecialEquipmentList")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsSpeciaEquipment> getSpecialEquipmentList(EhsSpeciaEquipment ehsSpeciaEquipment) {
|
||||||
|
return ehsSpeciaEquipmentService.selectEhsSpeciaEquipmentList(ehsSpeciaEquipment);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询特种设备 列表 --全部
|
||||||
|
*/
|
||||||
|
@GetMapping("/getSpecialEquipmentAllList")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo getSpecialEquipmentList() {
|
||||||
|
EhsSpeciaEquipment ehsSpeciaEquipment =new EhsSpeciaEquipment();
|
||||||
|
List<EhsSpeciaEquipment> list =ehsSpeciaEquipmentService.selectEhsSpeciaEquipmentList(ehsSpeciaEquipment);
|
||||||
|
TableDataInfo table = getDataTable(list);
|
||||||
|
return table ;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询消防设备列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getFireFightingApparatusList")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsXiaofangEquipment> getFireFightingApparatusList(EhsXiaofangEquipment ehsXiaofangEquipment) {
|
||||||
|
return ehsXiaofangEquipmentService.selectEhsXiaofangEquipmentList(ehsXiaofangEquipment);
|
||||||
|
}
|
||||||
|
@RequestMapping("/getFireFightingApparatusListNew")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo getFireFightingApparatusListNew(EhsXiaofangEquipment ehsXiaofangEquipment) {
|
||||||
|
List<EhsXiaofangEquipment> list = ehsXiaofangEquipmentService.selectEhsXiaofangEquipmentListNew(ehsXiaofangEquipment);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询消防设备列表 --全部
|
||||||
|
*/
|
||||||
|
@GetMapping("/getFireFightingApparatusAllList")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo getFireFightingApparatusList(String userID) {
|
||||||
|
EhsXiaofangEquipment ehsXiaofangEquipment=new EhsXiaofangEquipment();
|
||||||
|
List<EhsXiaofangEquipment> list=ehsXiaofangEquipmentService.selectEhsXiaofangEquipmentList(ehsXiaofangEquipment);
|
||||||
|
TableDataInfo table = getDataTable(list);
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询特种设备详情
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getSpecialEquipmentDetail")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsSpeciaEquipment getSpecialEquipmentDetail(EhsSpeciaEquipment ehsSpeciaEquipment) {
|
||||||
|
return ehsSpeciaEquipmentService.selectEhsSpeciaEquipmentById(ehsSpeciaEquipment.getId());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询特种设备详情 根据id
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getSpecialEquipmentDetailById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsSpeciaEquipment getSpecialEquipmentDetailById(String id) {
|
||||||
|
EhsSpeciaEquipment ehsSpeciaEquipment=new EhsSpeciaEquipment();
|
||||||
|
ehsSpeciaEquipment.setId(id);
|
||||||
|
return ehsSpeciaEquipmentService.selectEhsSpeciaEquipmentById(ehsSpeciaEquipment.getId());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询消防设备详情
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getFireFightingApparatusDetail")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsXiaofangEquipment getFireFightingApparatusDetail(EhsXiaofangEquipment ehsXiaofangEquipment) {
|
||||||
|
return ehsXiaofangEquipmentService.selectEhsXiaofangEquipmentById(ehsXiaofangEquipment.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询消防设备详情
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getFireFightingApparatusDetailById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsXiaofangEquipment getFireFightingApparatusDetail(String id) {
|
||||||
|
return ehsXiaofangEquipmentService.selectEhsXiaofangEquipmentById(id);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设备巡检
|
||||||
|
*/
|
||||||
|
// @RequestMapping("/apparatusPolling")
|
||||||
|
// @ResponseBody
|
||||||
|
// public int apparatusPolling() {
|
||||||
|
// return ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
package com.ruoyi.app.module.ehsFileContent.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsFileContent.entity.EhsFileContent;
|
||||||
|
import com.ruoyi.backstage.module.ehsFileContent.service.IEhsFileContentService;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件与内容关联 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-11-19
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsFileContent")
|
||||||
|
public class EhsFileContentAppController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsFileContentService ehsFileContentService;
|
||||||
|
/**
|
||||||
|
* 查询附件与内容关联列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsFileContent ehsFileContent)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsFileContent> list = ehsFileContentService.selectEhsFileContentList(ehsFileContent);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
package com.ruoyi.app.module.ehsInspectionLog.entity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.base.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核表相关数据
|
||||||
|
* @author Administrator
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CheckingAuditVo extends BaseEntity{
|
||||||
|
/** 审核人Id **/
|
||||||
|
private String auditId;
|
||||||
|
/** 风险点ID **/
|
||||||
|
private String riskId;
|
||||||
|
/** 巡检内容id */
|
||||||
|
private String inspectionLogContentId;
|
||||||
|
/** 转到那个部门ID */
|
||||||
|
private String deptId;
|
||||||
|
/**
|
||||||
|
* 风险点部门 原部门
|
||||||
|
*/
|
||||||
|
private String rdeptId;
|
||||||
|
/**
|
||||||
|
* 原部门名字
|
||||||
|
*/
|
||||||
|
private String rdeptName;
|
||||||
|
|
||||||
|
/** 公司ID */
|
||||||
|
private String companyId;
|
||||||
|
/** 厂ID */
|
||||||
|
private String factoryId;
|
||||||
|
/** 创建时间 **/
|
||||||
|
private Date createTime;
|
||||||
|
/**审核结果1:未审核 2:审核同过 3:审核失败 **/
|
||||||
|
private Integer auditStatus;
|
||||||
|
/** 审核人Id **/
|
||||||
|
private String auditUserId;
|
||||||
|
/** 被转移人Id **/
|
||||||
|
private String shiftId;
|
||||||
|
/** 巡检人ID */
|
||||||
|
private String inspectionUserId;
|
||||||
|
/**
|
||||||
|
* 转移人名字
|
||||||
|
*/
|
||||||
|
private String rName;
|
||||||
|
/**
|
||||||
|
* 逾期时间
|
||||||
|
*/
|
||||||
|
private Date checkDeadline;
|
||||||
|
/**
|
||||||
|
* 被转移人名字
|
||||||
|
*/
|
||||||
|
private String shiftName;
|
||||||
|
/**
|
||||||
|
* 风险点名字
|
||||||
|
*/
|
||||||
|
private String riskName;
|
||||||
|
/**
|
||||||
|
* 部门名字
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
public String getAuditId() {
|
||||||
|
return auditId;
|
||||||
|
}
|
||||||
|
public void setAuditId(String auditId) {
|
||||||
|
this.auditId = auditId;
|
||||||
|
}
|
||||||
|
public String getRiskId() {
|
||||||
|
return riskId;
|
||||||
|
}
|
||||||
|
public void setRiskId(String riskId) {
|
||||||
|
this.riskId = riskId;
|
||||||
|
}
|
||||||
|
public String getInspectionLogContentId() {
|
||||||
|
return inspectionLogContentId;
|
||||||
|
}
|
||||||
|
public void setInspectionLogContentId(String inspectionLogContentId) {
|
||||||
|
this.inspectionLogContentId = inspectionLogContentId;
|
||||||
|
}
|
||||||
|
public String getDeptId() {
|
||||||
|
return deptId;
|
||||||
|
}
|
||||||
|
public void setDeptId(String deptId) {
|
||||||
|
this.deptId = deptId;
|
||||||
|
}
|
||||||
|
public String getRdeptId() {
|
||||||
|
return rdeptId;
|
||||||
|
}
|
||||||
|
public void setRdeptId(String rdeptId) {
|
||||||
|
this.rdeptId = rdeptId;
|
||||||
|
}
|
||||||
|
public String getRdeptName() {
|
||||||
|
return rdeptName;
|
||||||
|
}
|
||||||
|
public void setRdeptName(String rdeptName) {
|
||||||
|
this.rdeptName = rdeptName;
|
||||||
|
}
|
||||||
|
public String getCompanyId() {
|
||||||
|
return companyId;
|
||||||
|
}
|
||||||
|
public void setCompanyId(String companyId) {
|
||||||
|
this.companyId = companyId;
|
||||||
|
}
|
||||||
|
public String getFactoryId() {
|
||||||
|
return factoryId;
|
||||||
|
}
|
||||||
|
public void setFactoryId(String factoryId) {
|
||||||
|
this.factoryId = factoryId;
|
||||||
|
}
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
public Integer getAuditStatus() {
|
||||||
|
return auditStatus;
|
||||||
|
}
|
||||||
|
public void setAuditStatus(Integer auditStatus) {
|
||||||
|
this.auditStatus = auditStatus;
|
||||||
|
}
|
||||||
|
public String getAuditUserId() {
|
||||||
|
return auditUserId;
|
||||||
|
}
|
||||||
|
public void setAuditUserId(String auditUserId) {
|
||||||
|
this.auditUserId = auditUserId;
|
||||||
|
}
|
||||||
|
public String getShiftId() {
|
||||||
|
return shiftId;
|
||||||
|
}
|
||||||
|
public void setShiftId(String shiftId) {
|
||||||
|
this.shiftId = shiftId;
|
||||||
|
}
|
||||||
|
public String getInspectionUserId() {
|
||||||
|
return inspectionUserId;
|
||||||
|
}
|
||||||
|
public void setInspectionUserId(String inspectionUserId) {
|
||||||
|
this.inspectionUserId = inspectionUserId;
|
||||||
|
}
|
||||||
|
public String getrName() {
|
||||||
|
return rName;
|
||||||
|
}
|
||||||
|
public void setrName(String rName) {
|
||||||
|
this.rName = rName;
|
||||||
|
}
|
||||||
|
public Date getCheckDeadline() {
|
||||||
|
return checkDeadline;
|
||||||
|
}
|
||||||
|
public void setCheckDeadline(Date checkDeadline) {
|
||||||
|
this.checkDeadline = checkDeadline;
|
||||||
|
}
|
||||||
|
public String getShiftName() {
|
||||||
|
return shiftName;
|
||||||
|
}
|
||||||
|
public void setShiftName(String shiftName) {
|
||||||
|
this.shiftName = shiftName;
|
||||||
|
}
|
||||||
|
public String getRiskName() {
|
||||||
|
return riskName;
|
||||||
|
}
|
||||||
|
public void setRiskName(String riskName) {
|
||||||
|
this.riskName = riskName;
|
||||||
|
}
|
||||||
|
public String getDeptName() {
|
||||||
|
return deptName;
|
||||||
|
}
|
||||||
|
public void setDeptName(String deptName) {
|
||||||
|
this.deptName = deptName;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "CheckingAuditVo [auditId=" + auditId + ", riskId=" + riskId
|
||||||
|
+ ", inspectionLogContentId=" + inspectionLogContentId
|
||||||
|
+ ", deptId=" + deptId + ", rdeptId=" + rdeptId
|
||||||
|
+ ", rdeptName=" + rdeptName + ", companyId=" + companyId
|
||||||
|
+ ", factoryId=" + factoryId + ", createTime=" + createTime
|
||||||
|
+ ", auditStatus=" + auditStatus + ", auditUserId="
|
||||||
|
+ auditUserId + ", shiftId=" + shiftId + ", inspectionUserId="
|
||||||
|
+ inspectionUserId + ", rName=" + rName + ", checkDeadline="
|
||||||
|
+ checkDeadline + ", shiftName=" + shiftName + ", riskName="
|
||||||
|
+ riskName + ", deptName=" + deptName + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,283 @@
|
|||||||
|
package com.ruoyi.app.module.ehsInspectionLog.entity;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsInspectionLog.entity.EhsInspLogContent;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import com.ruoyi.common.base.BaseEntity;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检日志内容子项表 zzmj_ehs_insp_log_content
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-05-09
|
||||||
|
*/
|
||||||
|
public class EhsInspLogContentVo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private String inspectionLogContentId;
|
||||||
|
/** 风险点内容id */
|
||||||
|
private String riskContentId;
|
||||||
|
/** 巡检日志id */
|
||||||
|
private String inspectionLogId;
|
||||||
|
/** 巡检结果 */
|
||||||
|
private String inspectionResult;
|
||||||
|
/** 现场照片 */
|
||||||
|
private byte[] scenePhotos;
|
||||||
|
/** 检查时间 */
|
||||||
|
private Date checkDate;
|
||||||
|
|
||||||
|
|
||||||
|
/*根据需求额外增加的字段信息*/
|
||||||
|
private String scenePhotosStr;
|
||||||
|
|
||||||
|
//隐患表的字段
|
||||||
|
/** 隐患名称 */
|
||||||
|
private String hiddenDangerName;
|
||||||
|
/** 风险点ID */
|
||||||
|
private String riskId;
|
||||||
|
/** 风险隐患类型 */
|
||||||
|
private String riskDangerTypeId;
|
||||||
|
/** 部门ID */
|
||||||
|
private String deptId;
|
||||||
|
/** 公司ID */
|
||||||
|
private String companyId;
|
||||||
|
/** 厂ID */
|
||||||
|
private String factoryId;
|
||||||
|
/** 整改责任人 userId*/
|
||||||
|
private String principalId;
|
||||||
|
/** 隐患内容 */
|
||||||
|
private String hiddenDangerContent;
|
||||||
|
/** 处罚标准ID */
|
||||||
|
private String punishStandardId;
|
||||||
|
/** 要求整改时间 */
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date rectifyTime;
|
||||||
|
/** 隐患等级ID */
|
||||||
|
private String hiddenDangerLevelId;
|
||||||
|
/** 发现人 */
|
||||||
|
private String findUser;
|
||||||
|
/** 巡检人ID */
|
||||||
|
private String inspectionUserId;
|
||||||
|
/** 关联风险任务ID*/
|
||||||
|
private String riskTaskId;
|
||||||
|
/** 验收人ID */
|
||||||
|
private String acceptorId;
|
||||||
|
private String imgName;
|
||||||
|
public String getAcceptorId() {
|
||||||
|
return acceptorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAcceptorId(String acceptorId) {
|
||||||
|
this.acceptorId = acceptorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<EhsInspLogContent> ehsInspLogContents;
|
||||||
|
|
||||||
|
public List<EhsInspLogContent> getEhsInspLogContents() {
|
||||||
|
return ehsInspLogContents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEhsInspLogContents(List<EhsInspLogContent> ehsInspLogContents) {
|
||||||
|
this.ehsInspLogContents = ehsInspLogContents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHiddenDangerName() {
|
||||||
|
return hiddenDangerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHiddenDangerName(String hiddenDangerName) {
|
||||||
|
this.hiddenDangerName = hiddenDangerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFindUser() {
|
||||||
|
return findUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFindUser(String findUser) {
|
||||||
|
this.findUser = findUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRiskId() {
|
||||||
|
return riskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRiskId(String riskId) {
|
||||||
|
this.riskId = riskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScenePhotosStr() {
|
||||||
|
return scenePhotosStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScenePhotosStr(String scenePhotosStr) {
|
||||||
|
this.scenePhotosStr = scenePhotosStr;
|
||||||
|
}
|
||||||
|
public void setInspectionLogContentId(String inspectionLogContentId)
|
||||||
|
{
|
||||||
|
this.inspectionLogContentId = inspectionLogContentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionLogContentId()
|
||||||
|
{
|
||||||
|
return inspectionLogContentId;
|
||||||
|
}
|
||||||
|
public void setRiskContentId(String riskContentId)
|
||||||
|
{
|
||||||
|
this.riskContentId = riskContentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRiskContentId()
|
||||||
|
{
|
||||||
|
return riskContentId;
|
||||||
|
}
|
||||||
|
public void setInspectionLogId(String inspectionLogId)
|
||||||
|
{
|
||||||
|
this.inspectionLogId = inspectionLogId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionLogId()
|
||||||
|
{
|
||||||
|
return inspectionLogId;
|
||||||
|
}
|
||||||
|
public void setInspectionResult(String inspectionResult)
|
||||||
|
{
|
||||||
|
this.inspectionResult = inspectionResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionResult()
|
||||||
|
{
|
||||||
|
return inspectionResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getScenePhotos() {
|
||||||
|
return scenePhotos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScenePhotos(byte[] scenePhotos) {
|
||||||
|
this.scenePhotos = scenePhotos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckDate(Date checkDate)
|
||||||
|
{
|
||||||
|
this.checkDate = checkDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCheckDate()
|
||||||
|
{
|
||||||
|
return checkDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRiskDangerTypeId() {
|
||||||
|
return riskDangerTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRiskDangerTypeId(String riskDangerTypeId) {
|
||||||
|
this.riskDangerTypeId = riskDangerTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeptId() {
|
||||||
|
return deptId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptId(String deptId) {
|
||||||
|
this.deptId = deptId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompanyId() {
|
||||||
|
return companyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompanyId(String companyId) {
|
||||||
|
this.companyId = companyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFactoryId() {
|
||||||
|
return factoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFactoryId(String factoryId) {
|
||||||
|
this.factoryId = factoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrincipalId() {
|
||||||
|
return principalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipalId(String principalId) {
|
||||||
|
this.principalId = principalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHiddenDangerContent() {
|
||||||
|
return hiddenDangerContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHiddenDangerContent(String hiddenDangerContent) {
|
||||||
|
this.hiddenDangerContent = hiddenDangerContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPunishStandardId() {
|
||||||
|
return punishStandardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPunishStandardId(String punishStandardId) {
|
||||||
|
this.punishStandardId = punishStandardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getRectifyTime() {
|
||||||
|
return rectifyTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRectifyTime(Date rectifyTime) {
|
||||||
|
this.rectifyTime = rectifyTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHiddenDangerLevelId() {
|
||||||
|
return hiddenDangerLevelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHiddenDangerLevelId(String hiddenDangerLevelId) {
|
||||||
|
this.hiddenDangerLevelId = hiddenDangerLevelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionUserId() {
|
||||||
|
return inspectionUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionUserId(String inspectionUserId) {
|
||||||
|
this.inspectionUserId = inspectionUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRiskTaskId() {
|
||||||
|
return riskTaskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRiskTaskId(String riskTaskId) {
|
||||||
|
this.riskTaskId = riskTaskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImgName() {
|
||||||
|
return imgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImgName(String imgName) {
|
||||||
|
this.imgName = imgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("inspectionLogContentId", getInspectionLogContentId())
|
||||||
|
.append("riskContentId", getRiskContentId())
|
||||||
|
.append("inspectionLogId", getInspectionLogId())
|
||||||
|
.append("inspectionResult", getInspectionResult())
|
||||||
|
.append("scenePhotos", getScenePhotos())
|
||||||
|
.append("checkDate", getCheckDate())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,103 @@
|
|||||||
|
package com.ruoyi.app.module.ehsOccuHealth.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsOccuHealth.entity.EhsOccuHealth;
|
||||||
|
import com.ruoyi.backstage.module.ehsOccuHealth.service.IEhsOccuHealthService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.constant.UploadConstants;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.util.ResourceUtils;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职业健康人员台账 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-06-06
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsOccuHealth")
|
||||||
|
public class EhsOccuHealthAppController extends BaseController {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(EhsOccuHealthAppController.class);
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsOccuHealthService ehsOccuHealthService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询职业健康人员台账列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsOccuHealth ehsOccuHealth) {
|
||||||
|
startPage();
|
||||||
|
List<EhsOccuHealth> list = ehsOccuHealthService.selectEhsOccuHealthList(ehsOccuHealth);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存职业健康人员台账
|
||||||
|
*/
|
||||||
|
@Log(title = "职业健康人员台账", businessType = BusinessType.INSERT)
|
||||||
|
@RequestMapping("/addSave")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(EhsOccuHealth ehsOccuHealth) {
|
||||||
|
return toAjax(ehsOccuHealthService.insertEhsOccuHealth(ehsOccuHealth));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存职业健康人员台账
|
||||||
|
*/
|
||||||
|
@Log(title = "职业健康人员台账", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(EhsOccuHealth ehsOccuHealth) {
|
||||||
|
return toAjax(ehsOccuHealthService.updateEhsOccuHealth(ehsOccuHealth));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除职业健康人员台账
|
||||||
|
*/
|
||||||
|
@Log(title = "职业健康人员台账", businessType = BusinessType.DELETE)
|
||||||
|
@RequestMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) {
|
||||||
|
return toAjax(ehsOccuHealthService.deleteEhsOccuHealthByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID获取职业健康人员台账
|
||||||
|
*/
|
||||||
|
@RequestMapping("/selectById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsOccuHealth selectById(String id) {
|
||||||
|
EhsOccuHealth ehsOccuHealth = ehsOccuHealthService.selectEhsOccuHealthById(id);
|
||||||
|
try {
|
||||||
|
File file = ResourceUtils.getFile(UploadConstants.CHECK_REPORTING + ehsOccuHealth.getUploadImgName());
|
||||||
|
FileInputStream inputFile = new FileInputStream(file);
|
||||||
|
byte[] buffer = new byte[(int) file.length()];
|
||||||
|
inputFile.read(buffer);
|
||||||
|
inputFile.close();
|
||||||
|
ehsOccuHealth.setUploadImgName("data:image/jpeg;base64," + new String(Base64.encodeBase64(buffer), "UTF-8"));
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("修改职业健康人员台账转换图片异常:", e);
|
||||||
|
}
|
||||||
|
return ehsOccuHealth;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.ruoyi.app.module.ehsPolicy.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsPolicy.entity.EhsPolicy;
|
||||||
|
import com.ruoyi.backstage.module.ehsPolicy.entity.EhsPolicyVo2;
|
||||||
|
import com.ruoyi.backstage.module.ehsPolicy.service.IEhsPolicyService;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysUser;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-11-21
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsPolicy")
|
||||||
|
public class EhsPolicyAppController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsPolicyService ehsPolicyService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/selectEhsPolicyByYear")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsPolicyVo2> selectEhsPolicyByYear(EhsPolicy ehsPolicy){
|
||||||
|
return ehsPolicyService.selectEhsPolicyByYear(ehsPolicy);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
package com.ruoyi.app.module.ehsRisk.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsHighRisk.entity.EhsHighriskContent;
|
||||||
|
import com.ruoyi.backstage.module.ehsHighRisk.entity.EhsHighriskRecord;
|
||||||
|
import com.ruoyi.backstage.module.ehsHighRisk.entity.EhsHighriskResult;
|
||||||
|
import com.ruoyi.backstage.module.ehsHighRisk.service.IEhsHighriskRecordService;
|
||||||
|
import com.ruoyi.backstage.module.ehsHighRisk.service.IEhsHighriskResultService;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysDictData;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.framework.web.service.DictService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-04-16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/highRiskRecord")
|
||||||
|
public class EhsAppHighRiskRecordController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsHighriskRecordService ehsHighriskRecordService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DictService dictService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsHighriskResultService ehsHighriskResultService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据APP端登录的用户id 以及 操作的tab面板的类型 获取相应的数据集合
|
||||||
|
* @param userId
|
||||||
|
* @param typeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/queryRecords/{userId}/{typeId}")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsHighriskRecord> queryRecords(
|
||||||
|
@PathVariable("userId") String userId,@PathVariable("typeId") Integer typeId) {
|
||||||
|
// 根据传递过来的用户id判断该用户是否是其所属部门的负责人
|
||||||
|
Map<String,Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("userId", userId);
|
||||||
|
map.put("typeId", typeId);
|
||||||
|
return ehsHighriskRecordService.queryAppRecords(map);
|
||||||
|
}
|
||||||
|
@RequestMapping("/apply")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult apply(EhsHighriskRecord ehsHighriskRecord){
|
||||||
|
ehsHighriskRecord.setCreateDate(new Date());
|
||||||
|
ehsHighriskRecord.setStatus(1);
|
||||||
|
ehsHighriskRecord.setId(UUID.randomUUID().toString().replaceAll("-", ""));
|
||||||
|
return toAjax(ehsHighriskRecordService.apply(ehsHighriskRecord));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/queryContentByRecordId/{recordId}")
|
||||||
|
@ResponseBody
|
||||||
|
public List<EhsHighriskContent> queryContentByRecordId(@PathVariable("recordId") String recordId){
|
||||||
|
return ehsHighriskRecordService.queryContentByRecordId(recordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/selectType")
|
||||||
|
public List<SysDictData> selectType(){
|
||||||
|
return dictService.getType("highriskType");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务的点检
|
||||||
|
*
|
||||||
|
* @param ehsHighriskResult
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/spotCheckMsg")
|
||||||
|
@ResponseBody
|
||||||
|
public int spotCheckMsg(HttpServletRequest request,
|
||||||
|
EhsHighriskResult ehsHighriskResult) {
|
||||||
|
return ehsHighriskRecordService.executeSaveCheckResult(request, ehsHighriskResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/selectInfoById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsHighriskRecord selectInfoById(String id){
|
||||||
|
return ehsHighriskRecordService.selectEhsHighriskRecordById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据巡检结果ID获取异常图片
|
||||||
|
*
|
||||||
|
* @param rId
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/selectHiddanDangerImgs")
|
||||||
|
public @ResponseBody List<String> selectHiddanDangerImgs(@RequestParam String rId){
|
||||||
|
return ehsHighriskResultService.selectHiddanDangerImgs(rId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.app.module.ehsSafetyBiao.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetyBiao.entity.EhsSafetyBiao;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetyBiao.service.IEhsSafetyBiaoService;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全技术标准 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-11-18
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsSafetyBiao")
|
||||||
|
public class EhsSafetyBiaoAppController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsSafetyBiaoService ehsSafetyBiaoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
@RequestMapping("/selectById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsSafetyBiao edit(String id)
|
||||||
|
{
|
||||||
|
EhsSafetyBiao ehsSafetyBiao = ehsSafetyBiaoService.selectEhsSafetyBiaoById(id);
|
||||||
|
return ehsSafetyBiao;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全技术标准列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsSafetyBiao ehsSafetyBiao)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsSafetyBiao> list = ehsSafetyBiaoService.selectEhsSafetyBiaoList(ehsSafetyBiao);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全技术标准历史版本
|
||||||
|
*/
|
||||||
|
@RequestMapping("/listByBiaoJi")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo listByBiaoJi(EhsSafetyBiao ehsSafetyBiao)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsSafetyBiao> list = ehsSafetyBiaoService.listByBiaoJi(ehsSafetyBiao);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
package com.ruoyi.app.module.ehsSafetyCommitment.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetyCommitment.entity.EhsSafetyCommitment;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetyCommitment.service.IEhsSafetyCommitmentService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全承诺 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-06-06
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsSafetyCommitment")
|
||||||
|
public class AppEhsSafetyCommitmentController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "backstage/module/ehsSafetyCommitment";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsSafetyCommitmentService ehsSafetyCommitmentService;
|
||||||
|
|
||||||
|
@RequestMapping("/listPage")
|
||||||
|
public String ehsSafetyCommitment()
|
||||||
|
{
|
||||||
|
return prefix + "/ehsSafetyCommitment";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全承诺列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsSafetyCommitment ehsSafetyCommitment)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsSafetyCommitment> list = ehsSafetyCommitmentService.selectEhsSafetyCommitmentList(ehsSafetyCommitment);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出安全承诺列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(EhsSafetyCommitment ehsSafetyCommitment)
|
||||||
|
{
|
||||||
|
List<EhsSafetyCommitment> list = ehsSafetyCommitmentService.selectEhsSafetyCommitmentList(ehsSafetyCommitment);
|
||||||
|
ExcelUtil<EhsSafetyCommitment> util = new ExcelUtil<EhsSafetyCommitment>(EhsSafetyCommitment.class);
|
||||||
|
return util.exportExcel(list, "ehsSafetyCommitment");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增安全承诺
|
||||||
|
*/
|
||||||
|
@RequestMapping("/addPage")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存安全承诺
|
||||||
|
*/
|
||||||
|
@Log(title = "安全承诺", businessType = BusinessType.INSERT)
|
||||||
|
@RequestMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(EhsSafetyCommitment ehsSafetyCommitment)
|
||||||
|
{
|
||||||
|
return toAjax(ehsSafetyCommitmentService.insertEhsSafetyCommitment(ehsSafetyCommitment));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改安全承诺
|
||||||
|
*/
|
||||||
|
@RequestMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
||||||
|
{
|
||||||
|
EhsSafetyCommitment ehsSafetyCommitment = ehsSafetyCommitmentService.selectEhsSafetyCommitmentById(id);
|
||||||
|
mmap.put("ehsSafetyCommitment", ehsSafetyCommitment);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存安全承诺
|
||||||
|
*/
|
||||||
|
@Log(title = "安全承诺", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(EhsSafetyCommitment ehsSafetyCommitment)
|
||||||
|
{
|
||||||
|
return toAjax(ehsSafetyCommitmentService.updateEhsSafetyCommitment(ehsSafetyCommitment));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除安全承诺
|
||||||
|
*/
|
||||||
|
@Log(title = "安全承诺", businessType = BusinessType.DELETE)
|
||||||
|
@RequestMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(ehsSafetyCommitmentService.deleteEhsSafetyCommitmentByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.ruoyi.app.module.ehsSafetyDept.controller;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetyDept.entity.EhsSafetyDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetyDept.service.IEhsSafetyDeptService;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全管理组织机构
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-11-18
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsSafetyDept")
|
||||||
|
public class EhsSafetyDeptAppController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsSafetyDeptService ehsSafetyDeptService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过Id查询HSE安全管理组织机构
|
||||||
|
*/
|
||||||
|
@RequestMapping( "/selectById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsSafetyDept selectById(String deptId)
|
||||||
|
{
|
||||||
|
return ehsSafetyDeptService.selectEhsSafetyDeptById(Integer.valueOf(deptId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.app.module.ehsSafetySystem.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetySystem.entity.EhsSafetySystem;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetySystem.service.IEhsSafetySystemService;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全管理制度 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-11-20
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsSafetySystem")
|
||||||
|
public class EhsSafetySystemAppController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IEhsSafetySystemService ehsSafetySystemService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID查找安全制度
|
||||||
|
*/
|
||||||
|
@RequestMapping("/selectById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsSafetySystem edit(String id)
|
||||||
|
{
|
||||||
|
EhsSafetySystem ehsSafetySystem = ehsSafetySystemService.selectEhsSafetySystemById(id);
|
||||||
|
return ehsSafetySystem;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询安全管理制度列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsSafetySystem ehsSafetySystem)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsSafetySystem> list = ehsSafetySystemService.selectEhsSafetySystemList(ehsSafetySystem);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询安全管理制度列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/listByBiaoJi")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo listByBiaoJi(EhsSafetySystem ehsSafetySystem)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsSafetySystem> list = ehsSafetySystemService.listByBiaoJi(ehsSafetySystem);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,119 @@
|
|||||||
|
package com.ruoyi.app.module.ehsSpecialEquipment.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsSpecialEquipment.entity.EhsSpecialEquipment;
|
||||||
|
import com.ruoyi.backstage.module.ehsSpecialEquipment.service.IEhsSpecialEquipmentService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.constant.UploadConstants;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.framework.web.domain.server.Sys;
|
||||||
|
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.util.ResourceUtils;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特种设备作业人员台账 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-06-06
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsSpecialEquipment")
|
||||||
|
public class EhsSpecialEquipmentAppController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(EhsSpecialEquipmentAppController.class);
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsSpecialEquipmentService ehsSpecialEquipmentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询特种设备作业人员台账列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsSpecialEquipment ehsSpecialEquipment)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
ehsSpecialEquipment.setCompanyId(ShiroUtils.getSysUser().getCompanyId());
|
||||||
|
List<EhsSpecialEquipment> list = ehsSpecialEquipmentService.selectEhsSpecialEquipmentList(ehsSpecialEquipment);
|
||||||
|
for (EhsSpecialEquipment e : list) {
|
||||||
|
System.err.println(e);
|
||||||
|
}
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存特种设备作业人员台账
|
||||||
|
*/
|
||||||
|
@Log(title = "特种设备作业人员台账", businessType = BusinessType.INSERT)
|
||||||
|
@RequestMapping("/addSave")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(EhsSpecialEquipment ehsSpecialEquipment)
|
||||||
|
{
|
||||||
|
return toAjax(ehsSpecialEquipmentService.insertEhsSpecialEquipment(ehsSpecialEquipment));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存特种设备作业人员台账
|
||||||
|
*/
|
||||||
|
@Log(title = "特种设备作业人员台账", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(EhsSpecialEquipment ehsSpecialEquipment)
|
||||||
|
{
|
||||||
|
return toAjax(ehsSpecialEquipmentService.updateEhsSpecialEquipment(ehsSpecialEquipment));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除特种设备作业人员台账
|
||||||
|
*/
|
||||||
|
@Log(title = "特种设备作业人员台账", businessType = BusinessType.DELETE)
|
||||||
|
@RequestMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(ehsSpecialEquipmentService.deleteEhsSpecialEquipmentByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改特种设备作业人员台账
|
||||||
|
*/
|
||||||
|
@RequestMapping("/selectById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsSpecialEquipment selectById(String id)
|
||||||
|
{
|
||||||
|
EhsSpecialEquipment eh = ehsSpecialEquipmentService.selectEhsSpecialEquipmentById(id);
|
||||||
|
System.err.println(eh.getId()+","+eh.getHiddenDangerInfo()+","+eh.getUploadImgName()+","+eh.getEquipmentType());
|
||||||
|
try {
|
||||||
|
File file = ResourceUtils.getFile(UploadConstants.SPECIAL_EQUIPMENT + eh.getUploadImgName());
|
||||||
|
FileInputStream inputFile = new FileInputStream(file);
|
||||||
|
byte[] buffer = new byte[(int)file.length()];
|
||||||
|
inputFile.read(buffer);
|
||||||
|
inputFile.close();
|
||||||
|
eh.setUploadImgName("data:image/jpeg;base64," + new String(Base64
|
||||||
|
.encodeBase64(buffer),
|
||||||
|
"UTF-8"));
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("修改特种设备转换图片异常:",e);
|
||||||
|
}
|
||||||
|
System.err.println(eh.getId()+","+eh.getHiddenDangerInfo()+","+eh.getUploadImgName()+","+eh.getEquipmentType());
|
||||||
|
return eh;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
package com.ruoyi.app.module.ehsTrain.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsTrain.entity.EhsTrainApp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 培训管理 数据层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-05-24
|
||||||
|
*/
|
||||||
|
public interface EhsTrainAppMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询培训管理信息
|
||||||
|
*
|
||||||
|
* @param id 培训管理ID
|
||||||
|
* @return 培训管理信息
|
||||||
|
*/
|
||||||
|
public EhsTrainApp selectTeTrainById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询培训管理列表
|
||||||
|
*
|
||||||
|
* @param teTrain 培训管理信息
|
||||||
|
* @return 培训管理集合
|
||||||
|
*/
|
||||||
|
public List<EhsTrainApp> selectTeTrainList(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增培训管理
|
||||||
|
*
|
||||||
|
* @param teTrain 培训管理信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTeTrain(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改培训管理
|
||||||
|
*
|
||||||
|
* @param teTrain 培训管理信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTeTrain(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除培训管理
|
||||||
|
*
|
||||||
|
* @param id 培训管理ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTeTrainById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除培训管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTeTrainByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*根据培训id获取培训详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public EhsTrainApp selectTrainDetailById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取app端培训信息列表 供人员选择培训信息
|
||||||
|
* @param teTrain
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<EhsTrainApp> selectTeTrainChooseList(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的培训类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<EhsTrainApp> selectAllTrainType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取我的培训计划列表信息
|
||||||
|
* @param teTrain
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<EhsTrainApp> selectMyTrainPlanList(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app端根据培训id获取培训详情 包含章节信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public EhsTrainApp selectTrainAndChapterDetailById(String id);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
package com.ruoyi.app.module.ehsTrain.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsTrain.entity.EhsTrainApp;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 培训管理 服务层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-05-24
|
||||||
|
*/
|
||||||
|
public interface IEhsTrainAppService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询培训管理信息
|
||||||
|
*
|
||||||
|
* @param id 培训管理ID
|
||||||
|
* @return 培训管理信息
|
||||||
|
*/
|
||||||
|
public EhsTrainApp selectTeTrainById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询培训管理列表
|
||||||
|
*
|
||||||
|
* @param teTrain 培训管理信息
|
||||||
|
* @return 培训管理集合
|
||||||
|
*/
|
||||||
|
public List<EhsTrainApp> selectTeTrainList(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增培训管理
|
||||||
|
*
|
||||||
|
* @param teTrain 培训管理信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTeTrain(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改培训管理
|
||||||
|
*
|
||||||
|
* @param teTrain 培训管理信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTeTrain(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除培训管理信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTeTrainByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*根据培训id获取培训详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public EhsTrainApp selectTrainDetailById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取app端培训信息列表 供人员选择培训信息
|
||||||
|
* @param teTrain
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<EhsTrainApp> selectTeTrainChooseList(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的培训类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<EhsTrainApp> selectAllTrainType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取我的培训计划列表信息
|
||||||
|
* @param teTrain
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<EhsTrainApp> selectMyTrainPlanList(EhsTrainApp teTrain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app端根据培训id获取培训详情 包含章节信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public EhsTrainApp selectTrainAndChapterDetailById(String id);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,178 @@
|
|||||||
|
package com.ruoyi.app.module.ehsTrain.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.app.module.ehsTrain.entity.EhsTrainApp;
|
||||||
|
import com.ruoyi.app.module.ehsTrain.mapper.EhsTrainAppMapper;
|
||||||
|
import com.ruoyi.app.module.ehsTrain.service.IEhsTrainAppService;
|
||||||
|
import com.ruoyi.backstage.module.ehsChapter.mapper.EhsChapterMapper;
|
||||||
|
import com.ruoyi.common.constant.UploadConstants;
|
||||||
|
import com.ruoyi.common.support.Convert;
|
||||||
|
import com.ruoyi.common.utils.file.FileUtils;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 培训管理 服务层实现
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-05-24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EhsTrainAppServiceImpl implements IEhsTrainAppService {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(EhsTrainAppServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EhsTrainAppMapper teTrainMapper;
|
||||||
|
@Autowired
|
||||||
|
private EhsChapterMapper teChapterMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询培训管理信息
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* 培训管理ID
|
||||||
|
* @return 培训管理信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EhsTrainApp selectTeTrainById(String id) {
|
||||||
|
return teTrainMapper.selectTeTrainById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询培训管理列表
|
||||||
|
*
|
||||||
|
* @param teTrain
|
||||||
|
* 培训管理信息
|
||||||
|
* @return 培训管理集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EhsTrainApp> selectTeTrainList(EhsTrainApp teTrain) {
|
||||||
|
List<EhsTrainApp> teTrains = teTrainMapper.selectTeTrainList(teTrain);
|
||||||
|
if (teTrains != null && teTrains.size() > 0) {
|
||||||
|
for (EhsTrainApp train : teTrains) {
|
||||||
|
try {
|
||||||
|
train.setUploadImg(FileUtils.getFileBase64(UploadConstants.SOURCE_MATERIAL + train.getCoverPhoto(), UploadConstants.PREFIX_IMG_JPEG));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("回去培训封面图片异常",e);
|
||||||
|
}
|
||||||
|
int countNum = teChapterMapper
|
||||||
|
.selectCountTeChapterListByTrainId(train.getId());
|
||||||
|
train.setChaptersNumber(countNum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return teTrains;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增培训管理
|
||||||
|
*
|
||||||
|
* @param teTrain
|
||||||
|
* 培训管理信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTeTrain(EhsTrainApp teTrain) {
|
||||||
|
String uuid = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
teTrain.setId(uuid);
|
||||||
|
teTrain.setCoverPhoto(teTrain.getUploadImg());
|
||||||
|
teTrain.setUserCode(ShiroUtils.getUserId() != null ? ShiroUtils
|
||||||
|
.getUserId().toString() : "");
|
||||||
|
return teTrainMapper.insertTeTrain(teTrain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改培训管理
|
||||||
|
*
|
||||||
|
* @param teTrain
|
||||||
|
* 培训管理信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTeTrain(EhsTrainApp teTrain) {
|
||||||
|
if (teTrain.getIsConfirmed() != null && teTrain.getIsConfirmed() > 1) {
|
||||||
|
teTrain.setAuditUser(ShiroUtils.getUserId() + "");
|
||||||
|
teTrain.setAuditTime(new Date());
|
||||||
|
} else {
|
||||||
|
teTrain.setCoverPhoto(teTrain.getUploadImg());
|
||||||
|
}
|
||||||
|
return teTrainMapper.updateTeTrain(teTrain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除培训管理对象
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTeTrainByIds(String ids) {
|
||||||
|
teTrainMapper.deleteTeTrainByIds(Convert.toStrArray(ids));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EhsTrainApp selectTrainDetailById(String id) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return teTrainMapper.selectTrainDetailById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EhsTrainApp> selectTeTrainChooseList(EhsTrainApp teTrain) {
|
||||||
|
List<EhsTrainApp> teTrains = teTrainMapper.selectTeTrainChooseList(teTrain);
|
||||||
|
if (teTrains != null && teTrains.size() > 0) {
|
||||||
|
for (EhsTrainApp train : teTrains) {
|
||||||
|
int countNum = teChapterMapper
|
||||||
|
.selectCountTeChapterListByTrainId(train.getId());
|
||||||
|
train.setChaptersNumber(countNum);
|
||||||
|
try {
|
||||||
|
train.setUploadImg(FileUtils.getFileBase64(UploadConstants.SOURCE_MATERIAL + train.getCoverPhoto(), UploadConstants.PREFIX_IMG_JPEG));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("回去培训封面图片异常",e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return teTrains;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EhsTrainApp> selectAllTrainType() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return teTrainMapper.selectAllTrainType();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EhsTrainApp> selectMyTrainPlanList(EhsTrainApp teTrain) {
|
||||||
|
List<EhsTrainApp> teTrains = teTrainMapper.selectMyTrainPlanList(teTrain);
|
||||||
|
if (teTrains != null && teTrains.size() > 0) {
|
||||||
|
for (EhsTrainApp train : teTrains) {
|
||||||
|
int countNum = teChapterMapper
|
||||||
|
.selectCountTeChapterListByTrainId(train.getId());
|
||||||
|
train.setChaptersNumber(countNum);
|
||||||
|
try {
|
||||||
|
train.setUploadImg(FileUtils.getFileBase64(UploadConstants.SOURCE_MATERIAL + train.getCoverPhoto(), UploadConstants.PREFIX_IMG_JPEG));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("回去培训封面图片异常",e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return teTrains;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EhsTrainApp selectTrainAndChapterDetailById(String id) {
|
||||||
|
EhsTrainApp ehsTrainApp = teTrainMapper.selectTrainAndChapterDetailById(id);
|
||||||
|
ehsTrainApp.setChapters(teChapterMapper.selectChapterDetailByTrainId(id));
|
||||||
|
return ehsTrainApp;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.ruoyi.app.module.ehsUseLine.Controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.ehsUseLine.entity.EhsUseLine;
|
||||||
|
import com.ruoyi.backstage.module.ehsUseLine.service.impl.EhsUseLineServiceImpl;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetyDept.entity.EhsSafetyDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsSafetyDept.service.IEhsSafetyDeptService;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全管理组织机构
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-11-18
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("app/ehsUseLine")
|
||||||
|
public class ehsUseLineAppController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EhsUseLineServiceImpl ehsUseLineService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过名字查询该不该缴费
|
||||||
|
*/
|
||||||
|
@GetMapping( "/getByName" )
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult selectByName(String companyName)
|
||||||
|
{
|
||||||
|
EhsUseLine ehsUseLine = ehsUseLineService.selectEhsUseLineByName(companyName);
|
||||||
|
|
||||||
|
return successData(ehsUseLine);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package com.ruoyi.app.module.ehsonference.controller;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.apache.tomcat.util.http.fileupload.FileUploadBase.FileSizeLimitExceededException;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.common.tool.DDInformationPush;
|
||||||
|
import com.ruoyi.backstage.common.tool.StringUtil;
|
||||||
|
import com.ruoyi.backstage.module.ehsFileContent.entity.EhsFileContent;
|
||||||
|
import com.ruoyi.backstage.module.ehsFileContent.service.IEhsFileContentService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsUser;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsDeptService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsUserService;
|
||||||
|
import com.ruoyi.backstage.module.ehsonference.entity.EhsConference;
|
||||||
|
import com.ruoyi.backstage.module.ehsonference.entity.EhsConferencetype;
|
||||||
|
import com.ruoyi.backstage.module.ehsonference.service.IEhsConferenceService;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysUser;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.constant.UploadConstants;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.util.FileUploadUtils;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门级公司例会
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-11-18
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/app/ehsConference")
|
||||||
|
public class APPEhsConferenceController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEhsConferenceService ehsConferenceService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(EhsConference ehsConference)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EhsConference> list = ehsConferenceService.selectEhsConferenceList(ehsConference);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知详情页面
|
||||||
|
* @param id
|
||||||
|
* @param mmap
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/selectById")
|
||||||
|
@ResponseBody
|
||||||
|
public EhsConference selectById(String id)
|
||||||
|
{
|
||||||
|
EhsConference ehsConference = ehsConferenceService.selectEhsConferenceById(id);
|
||||||
|
return ehsConference;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,174 @@
|
|||||||
|
package com.ruoyi.app.module.system.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.google.zxing.BarcodeFormat;
|
||||||
|
import com.google.zxing.EncodeHintType;
|
||||||
|
import com.google.zxing.MultiFormatWriter;
|
||||||
|
import com.google.zxing.client.j2se.MatrixToImageWriter;
|
||||||
|
import com.google.zxing.common.BitMatrix;
|
||||||
|
import com.ruoyi.backstage.common.tool.DDInformationPush;
|
||||||
|
import com.ruoyi.backstage.module.ehsUseLine.entity.EhsUseLine;
|
||||||
|
import com.ruoyi.backstage.module.ehsUseLine.service.IEhsUseLineService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsDept;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.entity.EhsUser;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsDeptService;
|
||||||
|
import com.ruoyi.backstage.module.ehsUserManagement.service.IEhsUserService;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysRole;
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysUser;
|
||||||
|
import com.ruoyi.backstage.module.system.service.ISysRoleService;
|
||||||
|
import com.ruoyi.backstage.module.system.service.ISysUserService;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.apache.shiro.authc.AuthenticationException;
|
||||||
|
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||||
|
import org.apache.shiro.subject.Subject;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录验证
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/app/login")
|
||||||
|
public class AppSysLoginController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsUserService ehsUserService;
|
||||||
|
@Autowired
|
||||||
|
private ISysRoleService roleService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsUseLineService ehsUseLineService;
|
||||||
|
@Autowired
|
||||||
|
private IEhsDeptService ehsDeptService;
|
||||||
|
|
||||||
|
@PostMapping("/login")
|
||||||
|
public SysUser ajaxLogin(@RequestBody JSONObject obj,HttpServletRequest req)
|
||||||
|
{
|
||||||
|
String data=obj.toJSONString();
|
||||||
|
JSONObject json = JSON.parseObject(data);
|
||||||
|
String username=json.getString("username");
|
||||||
|
String password=json.getString("password");
|
||||||
|
String rememberMe=json.getString("rememberMe");
|
||||||
|
UsernamePasswordToken token = new UsernamePasswordToken(username, password, rememberMe);
|
||||||
|
Subject subject = SecurityUtils.getSubject();
|
||||||
|
SysUser sUser=null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
subject.login(token);
|
||||||
|
req.getSession().setAttribute("userCode", username);
|
||||||
|
sUser = userService.selectUserByLoginName(username) ;
|
||||||
|
sUser.setUserName(sUser.getLoginName());
|
||||||
|
sUser.setTokenId(req.getSession().getId());
|
||||||
|
//判断是否是[新冠肺炎疫情防控]角色
|
||||||
|
List<SysRole> sysRoles = roleService.selectRolesByUserId(sUser.getEmployeeNo());
|
||||||
|
if (sysRoles.size() > 0) {
|
||||||
|
for (SysRole sysRole : sysRoles) {
|
||||||
|
if (sysRole.getRoleName().equals("新冠肺炎疫情防控") && sysRole.getRoleKey().equals("XGFYYQFK") && sysRole.isFlag()){
|
||||||
|
sUser.setDiseaseRole(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sUser;
|
||||||
|
}
|
||||||
|
catch (AuthenticationException e)
|
||||||
|
{
|
||||||
|
String msg = "用户或密码错误-";
|
||||||
|
if (StringUtils.isNotEmpty(e.getMessage()))
|
||||||
|
{
|
||||||
|
msg = e.getMessage();
|
||||||
|
}
|
||||||
|
sUser=new SysUser();
|
||||||
|
sUser.setName(msg);
|
||||||
|
sUser.setUserId("0");
|
||||||
|
return sUser;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户的钉钉信息
|
||||||
|
*
|
||||||
|
* @author 00014092
|
||||||
|
* @date 2018年2月5日 下午4:27:54
|
||||||
|
*
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping(value = "/getMobile", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
||||||
|
public Map<String,Object> getMobile(@RequestParam("code") String code) {
|
||||||
|
return DDInformationPush.getMobile(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更具手机号登陆并更新钉钉ID
|
||||||
|
* @param mobile 手机
|
||||||
|
* @param DDId 当前手机号登陆用户钉钉ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/loginByMobile")
|
||||||
|
@ResponseBody
|
||||||
|
public Map<String, Object> loginByMobile(String mobile, String DDId, HttpServletRequest req){
|
||||||
|
Map<String, Object> map = userService.executeLogin(mobile, DDId);
|
||||||
|
if ("0".equals(map.get("code").toString())){
|
||||||
|
SysUser user = (SysUser) map.get("data");
|
||||||
|
UsernamePasswordToken token = new UsernamePasswordToken(user.getUserId(), user.getPassword(), true);
|
||||||
|
Subject subject = SecurityUtils.getSubject();
|
||||||
|
subject.login(token);
|
||||||
|
user.setTokenId(req.getSession().getId());
|
||||||
|
map.put("data",user);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/mobile/unauth")
|
||||||
|
@ResponseBody
|
||||||
|
public String unauth()
|
||||||
|
{
|
||||||
|
return "/error/unauth";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/userInfo/{userid}")
|
||||||
|
@ResponseBody
|
||||||
|
public SysUser selectInfoById(@PathVariable("userid")String userid){
|
||||||
|
SysUser user = userService.selectUserById(userid);
|
||||||
|
return userService.selectUserById(user.getUserId());
|
||||||
|
}
|
||||||
|
@RequestMapping("/editPwd")
|
||||||
|
@ResponseBody
|
||||||
|
public String editPwd(String oldPwd, String newPwd,String userId){
|
||||||
|
SysUser user = userService.selectUserById(userId);
|
||||||
|
user.setPassword(oldPwd);
|
||||||
|
List<SysUser> userList= userService.selectUserList(user);
|
||||||
|
if(userList!=null && userList.size()>0){
|
||||||
|
SysUser userNew= new SysUser();
|
||||||
|
userNew.setPassword(newPwd);
|
||||||
|
userNew.setUserId(user.getUserId());
|
||||||
|
userService.updateUserInfo(userNew);
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.ruoyi.backstage.common;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公共配置
|
||||||
|
* @author LYT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CommonConfig {
|
||||||
|
|
||||||
|
//文件上传服务器的路径
|
||||||
|
private static String upladUrlString="D:/TeUploadFiles/";
|
||||||
|
|
||||||
|
//访问上传文件的前缀
|
||||||
|
private static String visitUploadFilePrefix="http://39.98.170.201:8083/TeUploadFiles/";
|
||||||
|
|
||||||
|
public static String getUpladUrlString() {
|
||||||
|
return upladUrlString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getVisitUploadFilePrefix() {
|
||||||
|
return visitUploadFilePrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,135 @@
|
|||||||
|
package com.ruoyi.backstage.common;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.been.options.service.IBeenOptionsService;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.config.Global;
|
||||||
|
import com.ruoyi.common.utils.file.FileUtils;
|
||||||
|
import com.ruoyi.framework.config.ServerConfig;
|
||||||
|
import com.ruoyi.framework.util.FileUploadUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用请求处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
public class CommonController extends BaseController
|
||||||
|
{
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBeenOptionsService beenOptionsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传路径
|
||||||
|
*/
|
||||||
|
public static final String UPLOAD_PATH = "/profile/upload/";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ServerConfig serverConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用下载请求
|
||||||
|
*
|
||||||
|
* @param fileName 文件名称
|
||||||
|
* @param delete 是否删除
|
||||||
|
*/
|
||||||
|
@GetMapping("common/download")
|
||||||
|
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
||||||
|
{
|
||||||
|
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String filePath = System.getProperty("java.io.tmpdir") + File.separator + "ehs_download" + File.separator + fileName;
|
||||||
|
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.setContentType("multipart/form-data");
|
||||||
|
response.setHeader("Content-Disposition",
|
||||||
|
"attachment;fileName=" + setFileDownloadHeader(request, realFileName));
|
||||||
|
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||||
|
if (delete)
|
||||||
|
{
|
||||||
|
FileUtils.deleteFile(filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.error("下载文件失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用上传请求
|
||||||
|
*/
|
||||||
|
@PostMapping("/common/upload")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 上传文件路径
|
||||||
|
String filePath = Global.getUploadPath();
|
||||||
|
// 上传并返回新文件名称
|
||||||
|
String fileName = FileUploadUtils.upload(filePath, file);
|
||||||
|
String url = serverConfig.getUrl() + UPLOAD_PATH + fileName;
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("fileName", fileName);
|
||||||
|
ajax.put("url", url);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return AjaxResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException
|
||||||
|
{
|
||||||
|
final String agent = request.getHeader("USER-AGENT");
|
||||||
|
String filename = fileName;
|
||||||
|
if (agent.contains("MSIE"))
|
||||||
|
{
|
||||||
|
// IE浏览器
|
||||||
|
filename = URLEncoder.encode(filename, "utf-8");
|
||||||
|
filename = filename.replace("+", " ");
|
||||||
|
}
|
||||||
|
else if (agent.contains("Firefox"))
|
||||||
|
{
|
||||||
|
// 火狐浏览器
|
||||||
|
filename = new String(fileName.getBytes(), "ISO8859-1");
|
||||||
|
}
|
||||||
|
else if (agent.contains("Chrome"))
|
||||||
|
{
|
||||||
|
// google浏览器
|
||||||
|
filename = URLEncoder.encode(filename, "utf-8");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 其它浏览器
|
||||||
|
filename = URLEncoder.encode(filename, "utf-8");
|
||||||
|
}
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.backstage.common.monitor;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* druid 监控
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/monitor/data")
|
||||||
|
public class DruidController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "/monitor/druid";
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:data:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String index()
|
||||||
|
{
|
||||||
|
return redirect(prefix + "/index");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.ruoyi.backstage.common.monitor;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.framework.web.domain.Server;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务器监控
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/monitor/server")
|
||||||
|
public class ServerController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "monitor/server";
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:server:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String server(ModelMap mmap) throws Exception
|
||||||
|
{
|
||||||
|
Server server = new Server();
|
||||||
|
server.copyTo();
|
||||||
|
mmap.put("server", server);
|
||||||
|
return prefix + "/server";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,173 @@
|
|||||||
|
package com.ruoyi.backstage.common.monitor;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.exception.job.TaskException;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.quartz.domain.SysJob;
|
||||||
|
import com.ruoyi.quartz.service.ISysJobService;
|
||||||
|
import com.ruoyi.quartz.util.CronUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.quartz.SchedulerException;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度任务信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/monitor/job")
|
||||||
|
public class SysJobController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "monitor/job";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysJobService jobService;
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:job:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String job()
|
||||||
|
{
|
||||||
|
return prefix + "/job";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:job:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysJob job)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysJob> list = jobService.selectJobList(job);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "定时任务", businessType = BusinessType.EXPORT)
|
||||||
|
@RequiresPermissions("monitor:job:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(SysJob job)
|
||||||
|
{
|
||||||
|
List<SysJob> list = jobService.selectJobList(job);
|
||||||
|
ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
|
||||||
|
return util.exportExcel(list, "定时任务");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "定时任务", businessType = BusinessType.DELETE)
|
||||||
|
@RequiresPermissions("monitor:job:remove")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) throws SchedulerException
|
||||||
|
{
|
||||||
|
jobService.deleteJobByIds(ids);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:job:detail")
|
||||||
|
@GetMapping("/detail/{jobId}")
|
||||||
|
public String detail(@PathVariable("jobId") Long jobId, ModelMap mmap)
|
||||||
|
{
|
||||||
|
mmap.put("name", "job");
|
||||||
|
mmap.put("job", jobService.selectJobById(jobId));
|
||||||
|
return prefix + "/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务调度状态修改
|
||||||
|
*/
|
||||||
|
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||||
|
@RequiresPermissions("monitor:job:changeStatus")
|
||||||
|
@PostMapping("/changeStatus")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult changeStatus(SysJob job) throws SchedulerException
|
||||||
|
{
|
||||||
|
SysJob newJob = jobService.selectJobById(job.getJobId());
|
||||||
|
newJob.setStatus(job.getStatus());
|
||||||
|
return toAjax(jobService.changeStatus(newJob));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务调度立即执行一次
|
||||||
|
*/
|
||||||
|
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||||
|
@RequiresPermissions("monitor:job:changeStatus")
|
||||||
|
@PostMapping("/run")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult run(SysJob job) throws SchedulerException
|
||||||
|
{
|
||||||
|
jobService.run(job);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增调度
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存调度
|
||||||
|
*/
|
||||||
|
@Log(title = "定时任务", businessType = BusinessType.INSERT)
|
||||||
|
@RequiresPermissions("monitor:job:add")
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(@Validated SysJob job) throws SchedulerException, TaskException
|
||||||
|
{
|
||||||
|
if (!CronUtils.isValid(job.getCronExpression()))
|
||||||
|
{
|
||||||
|
return AjaxResult.error("cron表达式不正确");
|
||||||
|
}
|
||||||
|
job.setJobId(Long.valueOf(Math.abs(new Random().nextInt())));
|
||||||
|
return toAjax(jobService.insertJob(job));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改调度
|
||||||
|
*/
|
||||||
|
@GetMapping("/edit/{jobId}")
|
||||||
|
public String edit(@PathVariable("jobId") Long jobId, ModelMap mmap)
|
||||||
|
{
|
||||||
|
mmap.put("job", jobService.selectJobById(jobId));
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存调度
|
||||||
|
*/
|
||||||
|
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||||
|
@RequiresPermissions("monitor:job:edit")
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(@Validated SysJob job) throws SchedulerException, TaskException
|
||||||
|
{
|
||||||
|
if (!CronUtils.isValid(job.getCronExpression()))
|
||||||
|
{
|
||||||
|
return AjaxResult.error("cron表达式不正确");
|
||||||
|
}
|
||||||
|
return toAjax(jobService.updateJob(job));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验cron表达式是否有效
|
||||||
|
*/
|
||||||
|
@PostMapping("/checkCronExpressionIsValid")
|
||||||
|
@ResponseBody
|
||||||
|
public boolean checkCronExpressionIsValid(SysJob job)
|
||||||
|
{
|
||||||
|
return jobService.checkCronExpressionIsValid(job.getCronExpression());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
package com.ruoyi.backstage.common.monitor;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import com.ruoyi.quartz.domain.SysJob;
|
||||||
|
import com.ruoyi.quartz.domain.SysJobLog;
|
||||||
|
import com.ruoyi.quartz.service.ISysJobLogService;
|
||||||
|
import com.ruoyi.quartz.service.ISysJobService;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度日志操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/monitor/jobLog")
|
||||||
|
public class SysJobLogController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "monitor/job";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysJobService jobService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysJobLogService jobLogService;
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:job:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String jobLog(@RequestParam(value = "jobId", required = false) Long jobId, ModelMap mmap)
|
||||||
|
{
|
||||||
|
if (StringUtils.isNotNull(jobId))
|
||||||
|
{
|
||||||
|
SysJob job = jobService.selectJobById(jobId);
|
||||||
|
mmap.put("job", job);
|
||||||
|
}
|
||||||
|
return prefix + "/jobLog";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:job:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysJobLog jobLog)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysJobLog> list = jobLogService.selectJobLogList(jobLog);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "调度日志", businessType = BusinessType.EXPORT)
|
||||||
|
@RequiresPermissions("monitor:job:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(SysJobLog jobLog)
|
||||||
|
{
|
||||||
|
List<SysJobLog> list = jobLogService.selectJobLogList(jobLog);
|
||||||
|
ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class);
|
||||||
|
return util.exportExcel(list, "调度日志");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "调度日志", businessType = BusinessType.DELETE)
|
||||||
|
@RequiresPermissions("monitor:job:remove")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(jobLogService.deleteJobLogByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:job:detail")
|
||||||
|
@GetMapping("/detail/{jobLogId}")
|
||||||
|
public String detail(@PathVariable("jobLogId") Long jobLogId, ModelMap mmap)
|
||||||
|
{
|
||||||
|
mmap.put("name", "jobLog");
|
||||||
|
mmap.put("jobLog", jobLogService.selectJobLogById(jobLogId));
|
||||||
|
return prefix + "/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "调度日志", businessType = BusinessType.CLEAN)
|
||||||
|
@RequiresPermissions("monitor:job:remove")
|
||||||
|
@PostMapping("/clean")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult clean()
|
||||||
|
{
|
||||||
|
jobLogService.cleanJobLog();
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
package com.ruoyi.backstage.common.monitor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysLogininfor;
|
||||||
|
import com.ruoyi.backstage.module.system.service.ISysLogininforService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统访问记录
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/monitor/logininfor")
|
||||||
|
public class SysLogininforController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "monitor/logininfor";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysLogininforService logininforService;
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:logininfor:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String logininfor()
|
||||||
|
{
|
||||||
|
return prefix + "/logininfor";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:logininfor:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysLogininfor logininfor)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "登陆日志", businessType = BusinessType.EXPORT)
|
||||||
|
@RequiresPermissions("monitor:logininfor:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(SysLogininfor logininfor)
|
||||||
|
{
|
||||||
|
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||||
|
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||||
|
return util.exportExcel(list, "登陆日志");
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:logininfor:remove")
|
||||||
|
@Log(title = "登陆日志", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(logininforService.deleteLogininforByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:logininfor:remove")
|
||||||
|
@Log(title = "登陆日志", businessType = BusinessType.CLEAN)
|
||||||
|
@PostMapping("/clean")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult clean()
|
||||||
|
{
|
||||||
|
logininforService.cleanLogininfor();
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
package com.ruoyi.backstage.common.monitor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysOperLog;
|
||||||
|
import com.ruoyi.backstage.module.system.service.ISysOperLogService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/monitor/operlog")
|
||||||
|
public class SysOperlogController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "monitor/operlog";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysOperLogService operLogService;
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:operlog:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String operlog()
|
||||||
|
{
|
||||||
|
return prefix + "/operlog";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:operlog:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysOperLog operLog)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||||
|
@RequiresPermissions("monitor:operlog:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(SysOperLog operLog)
|
||||||
|
{
|
||||||
|
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||||
|
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
||||||
|
return util.exportExcel(list, "操作日志");
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:operlog:remove")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(operLogService.deleteOperLogByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:operlog:detail")
|
||||||
|
@GetMapping("/detail/{operId}")
|
||||||
|
public String detail(@PathVariable("operId") Long operId, ModelMap mmap)
|
||||||
|
{
|
||||||
|
mmap.put("operLog", operLogService.selectOperLogById(operId));
|
||||||
|
return prefix + "/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||||
|
@RequiresPermissions("monitor:operlog:remove")
|
||||||
|
@PostMapping("/clean")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult clean()
|
||||||
|
{
|
||||||
|
operLogService.cleanOperLog();
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.ruoyi.backstage.common.monitor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.system.entity.SysUserOnline;
|
||||||
|
import com.ruoyi.backstage.module.system.service.ISysUserOnlineService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.enums.OnlineStatus;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.framework.shiro.session.OnlineSession;
|
||||||
|
import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
|
||||||
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线用户监控
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/monitor/online")
|
||||||
|
public class SysUserOnlineController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "monitor/online";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserOnlineService userOnlineService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OnlineSessionDAO onlineSessionDAO;
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:online:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String online()
|
||||||
|
{
|
||||||
|
return prefix + "/online";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:online:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(SysUserOnline userOnline)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysUserOnline> list = userOnlineService.selectUserOnlineList(userOnline);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:online:batchForceLogout")
|
||||||
|
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||||
|
@PostMapping("/batchForceLogout")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult batchForceLogout(@RequestParam("ids[]") String[] ids)
|
||||||
|
{
|
||||||
|
for (String sessionId : ids)
|
||||||
|
{
|
||||||
|
SysUserOnline online = userOnlineService.selectOnlineById(sessionId);
|
||||||
|
if (online == null)
|
||||||
|
{
|
||||||
|
return error("用户已下线");
|
||||||
|
}
|
||||||
|
OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
|
||||||
|
if (onlineSession == null)
|
||||||
|
{
|
||||||
|
return error("用户已下线");
|
||||||
|
}
|
||||||
|
if (sessionId.equals(ShiroUtils.getSessionId()))
|
||||||
|
{
|
||||||
|
return error("当前登陆用户无法强退");
|
||||||
|
}
|
||||||
|
onlineSession.setStatus(OnlineStatus.off_line);
|
||||||
|
online.setStatus(OnlineStatus.off_line);
|
||||||
|
userOnlineService.saveOnline(online);
|
||||||
|
}
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:online:forceLogout")
|
||||||
|
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||||
|
@PostMapping("/forceLogout")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult forceLogout(String sessionId)
|
||||||
|
{
|
||||||
|
SysUserOnline online = userOnlineService.selectOnlineById(sessionId);
|
||||||
|
if (sessionId.equals(ShiroUtils.getSessionId()))
|
||||||
|
{
|
||||||
|
return error("当前登陆用户无法强退");
|
||||||
|
}
|
||||||
|
if (online == null)
|
||||||
|
{
|
||||||
|
return error("用户已下线");
|
||||||
|
}
|
||||||
|
OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
|
||||||
|
if (onlineSession == null)
|
||||||
|
{
|
||||||
|
return error("用户已下线");
|
||||||
|
}
|
||||||
|
onlineSession.setStatus(OnlineStatus.off_line);
|
||||||
|
online.setStatus(OnlineStatus.off_line);
|
||||||
|
userOnlineService.saveOnline(online);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
import sun.misc.BASE64Decoder;
|
||||||
|
import sun.misc.BASE64Encoder;
|
||||||
|
|
||||||
|
public class Base64Util {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 将base64编码字符串转换为图片
|
||||||
|
* @Author:
|
||||||
|
* @CreateTime:
|
||||||
|
* @param imgStr
|
||||||
|
* base64编码字符串 不需要带“data:image/jpeg;base64,”前缀
|
||||||
|
* @param path 图片保存路径(具体到文件)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean generateImage(String imgStr,String path) {
|
||||||
|
if (imgStr == null)
|
||||||
|
return false;
|
||||||
|
//String path = request.getSession().getServletContext().getRealPath("shouldCompressPics/compresspic.jpg");
|
||||||
|
//String path = "E:/shouldCompressPics/compresspic.jpg";
|
||||||
|
File targetFile = new File(path);
|
||||||
|
targetFile.setWritable(true, false);
|
||||||
|
// 获取父目录
|
||||||
|
File fileParent = targetFile.getParentFile();
|
||||||
|
// 判断是否存在
|
||||||
|
if (!fileParent.exists()) {
|
||||||
|
//创建父目录文件
|
||||||
|
fileParent.mkdirs();
|
||||||
|
|
||||||
|
}
|
||||||
|
// 判断这个文件夹是否存在?若不存在,就创建这个文件夹
|
||||||
|
if (!targetFile.exists()) {
|
||||||
|
try {
|
||||||
|
targetFile.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BASE64Decoder decoder = new BASE64Decoder();
|
||||||
|
try {
|
||||||
|
// 解密
|
||||||
|
byte[] b = decoder.decodeBuffer(imgStr);
|
||||||
|
for (int i = 0; i < b.length; i++) {
|
||||||
|
if (b[i] < 0) {
|
||||||
|
b[i] += 256;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OutputStream out = new FileOutputStream(path);
|
||||||
|
out.write(b);
|
||||||
|
out.flush();
|
||||||
|
out.close();
|
||||||
|
return true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 根据图片地址转换为base64编码字符串
|
||||||
|
* @Author:
|
||||||
|
* @CreateTime:
|
||||||
|
* @return 不带“data:image/jpeg;base64,”前缀
|
||||||
|
*/
|
||||||
|
public static String getImageStr(String imgFile) {
|
||||||
|
InputStream inputStream = null;
|
||||||
|
byte[] data = null;
|
||||||
|
try {
|
||||||
|
inputStream = new FileInputStream(imgFile);
|
||||||
|
data = new byte[inputStream.available()];
|
||||||
|
inputStream.read(data);
|
||||||
|
inputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// 加密
|
||||||
|
BASE64Encoder encoder = new BASE64Encoder();
|
||||||
|
return encoder.encode(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build 表单构建
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/tool/build")
|
||||||
|
public class BuildController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "tool/build";
|
||||||
|
|
||||||
|
@RequiresPermissions("tool:build:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String build()
|
||||||
|
{
|
||||||
|
return prefix + "/build";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public final class CodeUtil {
|
||||||
|
|
||||||
|
public static int randomInt(int from, int to) {
|
||||||
|
Random r = new Random();
|
||||||
|
return from + r.nextInt(to - from);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCode(){
|
||||||
|
String charValue = "";
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
|
char c = (char) (randomInt(0, 9) + '0');
|
||||||
|
charValue += String.valueOf(c);
|
||||||
|
}
|
||||||
|
return charValue;
|
||||||
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
public class CreateCalendarScheduleAsync {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.collections.map.HashedMap;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class DDOAMsg {
|
||||||
|
public String getMessage_url() {
|
||||||
|
return message_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage_url(String message_url) {
|
||||||
|
this.message_url = message_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String message_url ;
|
||||||
|
|
||||||
|
public String getHead_text() {
|
||||||
|
return head_text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHead_text(String head_text) {
|
||||||
|
this.head_text = head_text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String head_text ;
|
||||||
|
|
||||||
|
public String getBody_title() {
|
||||||
|
return body_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBody_title(String body_title) {
|
||||||
|
this.body_title = body_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String body_title;
|
||||||
|
public Map<String, String> getForm_map() {
|
||||||
|
return form_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setForm_map(Map<String, String> form_map) {
|
||||||
|
this.form_map = form_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String,String> form_map;
|
||||||
|
String DD_MSGTYPE_OA_TEMP = "{" +
|
||||||
|
" \"msgtype\": \"oa\"," +
|
||||||
|
" \"oa\": {" +
|
||||||
|
" \"message_url\": \"%s\"," +
|
||||||
|
"\"head\": {" +
|
||||||
|
"\"bgcolor\": \"FFBBBBBB\"," +
|
||||||
|
"\"text\": \"%s\"" +//风险审核
|
||||||
|
"},"+
|
||||||
|
"\"body\": {" +
|
||||||
|
"\"title\": \"%s\"," +//您有一条新的风险信息需要审核
|
||||||
|
"\"form\": %s " +
|
||||||
|
"}" +
|
||||||
|
" }" +
|
||||||
|
"}";
|
||||||
|
|
||||||
|
private String mapTo(){
|
||||||
|
Map<String,String> mapTemp=new HashedMap();
|
||||||
|
List<Map<String,String>> lstTemp=new ArrayList();
|
||||||
|
// form_map=new HashedMap();
|
||||||
|
// form_map.put("1","2");
|
||||||
|
// form_map.put("11","22");
|
||||||
|
// form_map.put("111","222");
|
||||||
|
// form_map.put("1111","2222");
|
||||||
|
for(Map.Entry<String, String> entry : form_map.entrySet()){
|
||||||
|
mapTemp=new HashedMap();
|
||||||
|
mapTemp.put("key",entry.getKey() );
|
||||||
|
mapTemp.put("value",entry.getValue());
|
||||||
|
lstTemp.add(mapTemp);
|
||||||
|
}
|
||||||
|
String jsonString = JSONObject.toJSONString(lstTemp);
|
||||||
|
return jsonString;
|
||||||
|
}
|
||||||
|
public String toJson(){
|
||||||
|
String str=String.format(DD_MSGTYPE_OA_TEMP,message_url,head_text,body_title,mapTo());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钉钉日程结束时间实体
|
||||||
|
* @author huamar
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DatetimeVo {
|
||||||
|
|
||||||
|
private Number unix_timestamp; //结束的unix时间戳(单位:毫秒)--必须
|
||||||
|
private String timezone; //时区
|
||||||
|
|
||||||
|
public Number getUnix_timestamp() {
|
||||||
|
return unix_timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnix_timestamp(Number unix_timestamp) {
|
||||||
|
this.unix_timestamp = unix_timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimezone() {
|
||||||
|
return timezone;
|
||||||
|
}
|
||||||
|
public void setTimezone(String timezone) {
|
||||||
|
this.timezone = timezone;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
|
||||||
|
public class Decode64 {
|
||||||
|
/**
|
||||||
|
* 对给定的字符串进行base64解码操作
|
||||||
|
*/
|
||||||
|
public static String decodeData(String inputData) {
|
||||||
|
try {
|
||||||
|
if (null == inputData) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new String(Base64.decodeBase64(inputData.getBytes("utf-8")), "utf-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对给定的字符串进行base64加密操作
|
||||||
|
*/
|
||||||
|
public static String encodeData(String inputData) {
|
||||||
|
try {
|
||||||
|
if (null == inputData) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new String(Base64.encodeBase64(inputData.getBytes("utf-8")), "utf-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(decodeData("08445"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
public class DemoEntity {
|
||||||
|
|
||||||
|
private OpenCalendarCreateVo Create_vo;
|
||||||
|
|
||||||
|
public OpenCalendarCreateVo getCreate_vo() {
|
||||||
|
return Create_vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreate_vo(OpenCalendarCreateVo create_vo) {
|
||||||
|
Create_vo = create_vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.support.Convert;
|
||||||
|
import com.ruoyi.generator.domain.TableInfo;
|
||||||
|
import com.ruoyi.generator.service.IGenService;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代码生成 操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/tool/gen")
|
||||||
|
public class GenController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "tool/gen";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IGenService genService;
|
||||||
|
|
||||||
|
@RequiresPermissions("tool:gen:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String gen()
|
||||||
|
{
|
||||||
|
return prefix + "/gen";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("tool:gen:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(TableInfo tableInfo)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<TableInfo> list = genService.selectTableList(tableInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成代码
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("tool:gen:code")
|
||||||
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
|
@GetMapping("/genCode/{tableName}")
|
||||||
|
public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
|
||||||
|
{
|
||||||
|
byte[] data = genService.generatorCode(tableName);
|
||||||
|
response.reset();
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
||||||
|
response.addHeader("Content-Length", "" + data.length);
|
||||||
|
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||||
|
|
||||||
|
IOUtils.write(data, response.getOutputStream());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量生成代码
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("tool:gen:code")
|
||||||
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
|
@GetMapping("/batchGenCode")
|
||||||
|
@ResponseBody
|
||||||
|
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
||||||
|
{
|
||||||
|
String[] tableNames = Convert.toStrArray(tables);
|
||||||
|
byte[] data = genService.generatorCode(tableNames);
|
||||||
|
response.reset();
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
||||||
|
response.addHeader("Content-Length", "" + data.length);
|
||||||
|
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||||
|
|
||||||
|
IOUtils.write(data, response.getOutputStream());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钉钉创建日程 实体类
|
||||||
|
* @author huamar
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class OpenCalendarCreateVo {
|
||||||
|
|
||||||
|
private String summary; //日程主题 --必须
|
||||||
|
private String location; //地点
|
||||||
|
private String[] receiver_userids; //接收者userid --必须
|
||||||
|
private DatetimeVo end_time; //结束时间 --必须
|
||||||
|
private String calendar_type; //日程类型:notification-提醒 ---必须
|
||||||
|
private DatetimeVo start_time; //开始时间 --必须
|
||||||
|
private OpenCalendarSourceVo source; //显示日程来源 --必须
|
||||||
|
private String description; //备注
|
||||||
|
private String creator_userid; //创建者userid --必须
|
||||||
|
private String uuid; //请求的唯一标识, 保证请求唯一性 --必须
|
||||||
|
private String biz_id; //业务方自己的主键 --必须
|
||||||
|
|
||||||
|
public String getSummary() {
|
||||||
|
return summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSummary(String summary) {
|
||||||
|
this.summary = summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getReceiver_userids() {
|
||||||
|
return receiver_userids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReceiver_userids(String[] receiver_userids) {
|
||||||
|
this.receiver_userids = receiver_userids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatetimeVo getEnd_time() {
|
||||||
|
return end_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnd_time(DatetimeVo end_time) {
|
||||||
|
this.end_time = end_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCalendar_type() {
|
||||||
|
return calendar_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCalendar_type(String calendar_type) {
|
||||||
|
this.calendar_type = calendar_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatetimeVo getStart_time() {
|
||||||
|
return start_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStart_time(DatetimeVo start_time) {
|
||||||
|
this.start_time = start_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpenCalendarSourceVo getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSource(OpenCalendarSourceVo source) {
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreator_userid() {
|
||||||
|
return creator_userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreator_userid(String creator_userid) {
|
||||||
|
this.creator_userid = creator_userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBiz_id() {
|
||||||
|
return biz_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBiz_id(String biz_id) {
|
||||||
|
this.biz_id = biz_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钉钉日程通知 --显示日程来源
|
||||||
|
* @author huamar
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class OpenCalendarSourceVo {
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
private String url; //点击日程跳转目标地址 --必填
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class PushMessageUtil {
|
||||||
|
|
||||||
|
private final static String MESSAGE_URL = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=";
|
||||||
|
|
||||||
|
public static void sendTextMessage(Map<String,String> message,String token){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("touser", message.get("touser"));
|
||||||
|
jsonObject.put("msgtype", "text");
|
||||||
|
jsonObject.put("agentid", 1000015);
|
||||||
|
JSONObject content = new JSONObject();
|
||||||
|
content.put("content", message.get("content"));
|
||||||
|
jsonObject.put("text", content);
|
||||||
|
//本地把这个注释掉不发送消息,发布生产记录打开
|
||||||
|
JSONObject json =HttpKit.PostParam(MESSAGE_URL+token, jsonObject.toString());
|
||||||
|
System.out.println(json.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Map<String,String> map = new HashMap<String, String>();
|
||||||
|
|
||||||
|
map.put("content", "测试下中文");
|
||||||
|
map.put("touser", "006662");
|
||||||
|
//sendTextMessage(map,WxUtil.getAccessToken().getToken());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
public class WechatTokenForm implements Serializable{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
private String ticket;
|
||||||
|
|
||||||
|
private Long expireTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static long getSerialversionuid() {
|
||||||
|
return serialVersionUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToken() {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToken(String token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTicket() {
|
||||||
|
return ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTicket(String ticket) {
|
||||||
|
this.ticket = ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getExpireTime() {
|
||||||
|
return expireTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpireTime(Long expireTime) {
|
||||||
|
this.expireTime = expireTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "WechatTokenForm [token=" + token + ", ticket=" + ticket + ", expireTime=" + expireTime + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,164 @@
|
|||||||
|
package com.ruoyi.backstage.common.tool;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
|
||||||
|
public class WechatUtil {
|
||||||
|
|
||||||
|
protected static Logger logger = LoggerFactory.getLogger(WechatUtil.class);
|
||||||
|
|
||||||
|
public static final String TOKEN = "token";
|
||||||
|
public static final String TICKET = "ticket";
|
||||||
|
public static final String CACHEDATA = "cacheData";
|
||||||
|
public static String getTokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=SECRET";
|
||||||
|
public static String getTicketUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=TOKEN&type=jsapi";
|
||||||
|
|
||||||
|
public static final String paykey = "HUAMARYUN20171104QAZWSXEDCRFVTGB";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String SCOPE = "scope";
|
||||||
|
|
||||||
|
private static ConcurrentHashMap<String, WechatTokenForm> wechatCache = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String getWechatCache(String cacheKey,String asAppId,String asSecret) {
|
||||||
|
//System.out.println("~~~~~~~~~~~~~~~~~~~~getWechatCache");
|
||||||
|
WechatTokenForm tokenForm = wechatCache.get(cacheKey);
|
||||||
|
if(TOKEN.equals(cacheKey)) {
|
||||||
|
if(tokenForm == null){
|
||||||
|
return getToken(asAppId,asSecret);
|
||||||
|
}else {
|
||||||
|
if(tokenForm.getExpireTime().compareTo(getMillis()) >= 0 ) {
|
||||||
|
return tokenForm.getToken();
|
||||||
|
}else {
|
||||||
|
return getToken(asAppId,asSecret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(TICKET.equals(cacheKey)){
|
||||||
|
if(tokenForm == null){
|
||||||
|
return getTicket(getWechatCache(TOKEN,asAppId,asSecret));
|
||||||
|
}else {
|
||||||
|
if(tokenForm.getExpireTime().compareTo(getMillis()) >= 0 ) {
|
||||||
|
return tokenForm.getTicket();
|
||||||
|
}else {
|
||||||
|
return getTicket(getWechatCache(TOKEN,asAppId,asSecret));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addToCache(String cacheKey,WechatTokenForm data) {
|
||||||
|
//System.out.println("~~~~~~~~~~~~~~~~~~~~addToCache");
|
||||||
|
WechatTokenForm cacheData = wechatCache.get(cacheKey);
|
||||||
|
//有记录,则先丢弃
|
||||||
|
if (cacheData != null) {
|
||||||
|
wechatCache.remove(cacheKey);
|
||||||
|
}
|
||||||
|
wechatCache.put(cacheKey, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long addDateTime(int minute) {
|
||||||
|
long currentTime = getMillis();
|
||||||
|
return currentTime += minute * 60 * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long getMillis() {
|
||||||
|
return System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getToken(String asAppId,String asSecret) {
|
||||||
|
//System.out.println("~~~~~~~~~~~~~~~~~~~~getToken");
|
||||||
|
String requestUrl = getTokenUrl.replace("APPID", asAppId).replace("SECRET", asSecret);
|
||||||
|
//System.out.println("requestUrl:"+requestUrl);
|
||||||
|
JSONObject object= getUrl(requestUrl);
|
||||||
|
System.out.println("getToken --JSONObject:"+object.toString());
|
||||||
|
String token = object.getString("access_token");
|
||||||
|
WechatTokenForm addToken = new WechatTokenForm();
|
||||||
|
addToken.setToken(token);
|
||||||
|
addToken.setExpireTime(addDateTime(90));
|
||||||
|
addToCache(TOKEN,addToken);
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTicket(String token) {
|
||||||
|
System.out.println("~~~~~~~~~~~~~~~~~~~~getTicket TOKEN="+token);
|
||||||
|
String ticket_url = getTicketUrl.replace("TOKEN", token);
|
||||||
|
//System.out.println("ticket_url:"+ticket_url);
|
||||||
|
JSONObject object= getUrl(ticket_url);
|
||||||
|
String ticket = object.getString("ticket");
|
||||||
|
WechatTokenForm addTicket = new WechatTokenForm();
|
||||||
|
addTicket.setTicket(ticket);
|
||||||
|
addTicket.setExpireTime(addDateTime(90));
|
||||||
|
addToCache(TICKET,addTicket);
|
||||||
|
return ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getSign(String jsapi_ticket, String noncestr, Long timestamp, String url)throws NoSuchAlgorithmException {
|
||||||
|
String shaStr = "jsapi_ticket=" + jsapi_ticket + "&noncestr=" + noncestr + "×tamp=" + timestamp + "&url="+ url;
|
||||||
|
MessageDigest mDigest = MessageDigest.getInstance("SHA1");
|
||||||
|
byte[] result = mDigest.digest(shaStr.getBytes());
|
||||||
|
StringBuffer signature = new StringBuffer();
|
||||||
|
for (int i = 0; i < result.length; i++) {
|
||||||
|
signature.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1));
|
||||||
|
}
|
||||||
|
return signature.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getRandomString(int length){
|
||||||
|
String str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
|
Random random=new Random();
|
||||||
|
StringBuffer sb=new StringBuffer();
|
||||||
|
for(int i=0;i<length;i++){
|
||||||
|
int number=random.nextInt(62);
|
||||||
|
sb.append(str.charAt(number));
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONObject getUrl(String requestUrl) {
|
||||||
|
|
||||||
|
JSONObject tokenJson = null;
|
||||||
|
try {
|
||||||
|
URL urlGet = new URL(requestUrl);
|
||||||
|
HttpURLConnection http = (HttpURLConnection) urlGet.openConnection();
|
||||||
|
|
||||||
|
http.setRequestMethod("GET"); // 必须是get方式请求
|
||||||
|
http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||||
|
http.setDoOutput(true);
|
||||||
|
http.setDoInput(true);
|
||||||
|
System.setProperty("sun.net.client.defaultConnectTimeout", "30000");// 连接超时30秒
|
||||||
|
System.setProperty("sun.net.client.defaultReadTimeout", "30000"); // 读取超时30秒
|
||||||
|
|
||||||
|
http.connect();
|
||||||
|
|
||||||
|
InputStream is = http.getInputStream();
|
||||||
|
int size = is.available();
|
||||||
|
byte[] jsonBytes = new byte[size];
|
||||||
|
is.read(jsonBytes);
|
||||||
|
String message = new String(jsonBytes, "UTF-8");
|
||||||
|
tokenJson = new JSONObject(message);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return tokenJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.backstage.module.Util;
|
||||||
|
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpGet;
|
||||||
|
import org.apache.http.client.utils.URIBuilder;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class HttpClientUtil {
|
||||||
|
public static String doGet(String url, Map<String, String> param) {
|
||||||
|
|
||||||
|
// 创建Httpclient对象
|
||||||
|
CloseableHttpClient httpclient = HttpClients.createDefault();
|
||||||
|
|
||||||
|
String resultString = "";
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
try {
|
||||||
|
// 创建uri
|
||||||
|
URIBuilder builder = new URIBuilder(url);
|
||||||
|
if (param != null) {
|
||||||
|
for (String key : param.keySet()) {
|
||||||
|
builder.addParameter(key, param.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
URI uri = builder.build();
|
||||||
|
|
||||||
|
// 创建http GET请求
|
||||||
|
HttpGet httpGet = new HttpGet(uri);
|
||||||
|
|
||||||
|
// 执行请求
|
||||||
|
response = httpclient.execute(httpGet);
|
||||||
|
// 判断返回状态是否为200
|
||||||
|
if (response.getStatusLine().getStatusCode() == 200) {
|
||||||
|
resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (response != null) {
|
||||||
|
response.close();
|
||||||
|
}
|
||||||
|
httpclient.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String doGet(String url) {
|
||||||
|
return doGet(url, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
package com.ruoyi.backstage.module.Util;
|
||||||
|
|
||||||
|
import cn.hutool.core.codec.Base64;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.crypto.SecureUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.ruoyi.backstage.module.ehsBasicInformationAppkey.entity.EhsBasicInformationAppkey;
|
||||||
|
import com.ruoyi.backstage.module.ehsBasicInformationAppkey.mapper.EhsBasicInformationAppkeyMapper;
|
||||||
|
import com.ruoyi.backstage.module.ehsRiskService.entity.AcceptParam;
|
||||||
|
import com.ruoyi.common.json.JSONObject;
|
||||||
|
import com.ruoyi.common.utils.BeanUtil;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class Sha256Util {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EhsBasicInformationAppkeyMapper ehsBasicInformationAppkeyMapper;
|
||||||
|
// 签名对比
|
||||||
|
public boolean decode(AcceptParam acceptParam) {
|
||||||
|
// TODO: 2023/4/14 0014 appsecret 获取key值
|
||||||
|
EhsBasicInformationAppkey ehsBasicInformationAppkey = ehsBasicInformationAppkeyMapper.selectEhsBasicInformationAppkeyByAppkey(acceptParam.getAppkey());
|
||||||
|
if(ehsBasicInformationAppkey==null)
|
||||||
|
return false;
|
||||||
|
else if(ehsBasicInformationAppkey.getVer().equals("1"))
|
||||||
|
return true;
|
||||||
|
else{
|
||||||
|
if (ObjectUtil.isNotEmpty(ehsBasicInformationAppkey)) {
|
||||||
|
String stringA = "appkey=" + acceptParam.getAppkey() + "&nonce=" + acceptParam.getNonce() + "&tamp=" + acceptParam.getTimestamp() +"&data=" + JSON.toJSONString(JSONArray.parseArray(acceptParam.getData()))+"&appsecret="+ehsBasicInformationAppkey.getAppsecret();
|
||||||
|
String encode = Base64.encode(SecureUtil.sha256(stringA));
|
||||||
|
if (ObjectUtil.equal(encode, acceptParam.getSign())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.backstage.module.Util;
|
||||||
|
|
||||||
|
import org.apache.http.client.HttpClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常量
|
||||||
|
*/
|
||||||
|
public class WXPayConstants {
|
||||||
|
|
||||||
|
public enum SignType {
|
||||||
|
MD5, HMACSHA256
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String DOMAIN_API = "api.mch.weixin.qq.com";
|
||||||
|
public static final String DOMAIN_API2 = "api2.mch.weixin.qq.com";
|
||||||
|
public static final String DOMAIN_APIHK = "apihk.mch.weixin.qq.com";
|
||||||
|
public static final String DOMAIN_APIUS = "apius.mch.weixin.qq.com";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String FAIL = "FAIL";
|
||||||
|
public static final String SUCCESS = "SUCCESS";
|
||||||
|
public static final String HMACSHA256 = "HMAC-SHA256";
|
||||||
|
public static final String MD5 = "MD5";
|
||||||
|
|
||||||
|
public static final String FIELD_SIGN = "sign";
|
||||||
|
public static final String FIELD_SIGN_TYPE = "sign_type";
|
||||||
|
|
||||||
|
public static final String WXPAYSDK_VERSION = "WXPaySDK/3.0.9";
|
||||||
|
public static final String USER_AGENT = WXPAYSDK_VERSION +
|
||||||
|
" (" + System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version") +
|
||||||
|
") Java/" + System.getProperty("java.version") + " HttpClient/" + HttpClient.class.getPackage().getImplementationVersion();
|
||||||
|
|
||||||
|
public static final String MICROPAY_URL_SUFFIX = "/pay/micropay";
|
||||||
|
public static final String UNIFIEDORDER_URL_SUFFIX = "/pay/unifiedorder";
|
||||||
|
public static final String ORDERQUERY_URL_SUFFIX = "/pay/orderquery";
|
||||||
|
public static final String REVERSE_URL_SUFFIX = "/secapi/pay/reverse";
|
||||||
|
public static final String CLOSEORDER_URL_SUFFIX = "/pay/closeorder";
|
||||||
|
public static final String REFUND_URL_SUFFIX = "/secapi/pay/refund";
|
||||||
|
public static final String REFUNDQUERY_URL_SUFFIX = "/pay/refundquery";
|
||||||
|
public static final String DOWNLOADBILL_URL_SUFFIX = "/pay/downloadbill";
|
||||||
|
public static final String REPORT_URL_SUFFIX = "/payitil/report";
|
||||||
|
public static final String SHORTURL_URL_SUFFIX = "/tools/shorturl";
|
||||||
|
public static final String AUTHCODETOOPENID_URL_SUFFIX = "/tools/authcodetoopenid";
|
||||||
|
|
||||||
|
// sandbox
|
||||||
|
public static final String SANDBOX_MICROPAY_URL_SUFFIX = "/sandboxnew/pay/micropay";
|
||||||
|
public static final String SANDBOX_UNIFIEDORDER_URL_SUFFIX = "/sandboxnew/pay/unifiedorder";
|
||||||
|
public static final String SANDBOX_ORDERQUERY_URL_SUFFIX = "/sandboxnew/pay/orderquery";
|
||||||
|
public static final String SANDBOX_REVERSE_URL_SUFFIX = "/sandboxnew/secapi/pay/reverse";
|
||||||
|
public static final String SANDBOX_CLOSEORDER_URL_SUFFIX = "/sandboxnew/pay/closeorder";
|
||||||
|
public static final String SANDBOX_REFUND_URL_SUFFIX = "/sandboxnew/secapi/pay/refund";
|
||||||
|
public static final String SANDBOX_REFUNDQUERY_URL_SUFFIX = "/sandboxnew/pay/refundquery";
|
||||||
|
public static final String SANDBOX_DOWNLOADBILL_URL_SUFFIX = "/sandboxnew/pay/downloadbill";
|
||||||
|
public static final String SANDBOX_REPORT_URL_SUFFIX = "/sandboxnew/payitil/report";
|
||||||
|
public static final String SANDBOX_SHORTURL_URL_SUFFIX = "/sandboxnew/tools/shorturl";
|
||||||
|
public static final String SANDBOX_AUTHCODETOOPENID_URL_SUFFIX = "/sandboxnew/tools/authcodetoopenid";
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(SignType.MD5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.backstage.module.Util;
|
||||||
|
|
||||||
|
import org.w3c.dom.Document;
|
||||||
|
|
||||||
|
import javax.xml.XMLConstants;
|
||||||
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2018/7/3
|
||||||
|
*/
|
||||||
|
public final class WXPayXmlUtil {
|
||||||
|
public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException {
|
||||||
|
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
|
||||||
|
documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
|
||||||
|
documentBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
|
||||||
|
documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
|
||||||
|
documentBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
|
||||||
|
documentBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||||||
|
documentBuilderFactory.setXIncludeAware(false);
|
||||||
|
documentBuilderFactory.setExpandEntityReferences(false);
|
||||||
|
|
||||||
|
return documentBuilderFactory.newDocumentBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Document newDocument() throws ParserConfigurationException {
|
||||||
|
return newDocumentBuilder().newDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,138 @@
|
|||||||
|
package com.ruoyi.backstage.module.been.fromfields.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.been.fromfields.domain.BeenFromFields;
|
||||||
|
import com.ruoyi.backstage.module.been.fromfields.service.IBeenFromFieldsService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段组件 信息操作处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-02-18
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/been/beenFromFields")
|
||||||
|
public class BeenFromFieldsController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "system/beenFromFields";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBeenFromFieldsService beenFromFieldsService;
|
||||||
|
|
||||||
|
@RequiresPermissions("system:beenFromFields:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String beenFromFields()
|
||||||
|
{
|
||||||
|
return prefix + "/beenFromFields";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询字段组件列表
|
||||||
|
*/
|
||||||
|
/*@RequiresPermissions("system:beenFromFields:list")*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(BeenFromFields beenFromFields)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<BeenFromFields> list = beenFromFieldsService.selectBeenFromFieldsList(beenFromFields);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出字段组件列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:beenFromFields:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(BeenFromFields beenFromFields)
|
||||||
|
{
|
||||||
|
List<BeenFromFields> list = beenFromFieldsService.selectBeenFromFieldsList(beenFromFields);
|
||||||
|
ExcelUtil<BeenFromFields> util = new ExcelUtil<BeenFromFields>(BeenFromFields.class);
|
||||||
|
return util.exportExcel(list, "beenFromFields");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增字段组件
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存字段组件
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:beenFromFields:add")
|
||||||
|
@Log(title = "字段组件", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(BeenFromFields beenFromFields)
|
||||||
|
{
|
||||||
|
return toAjax(beenFromFieldsService.insertBeenFromFields(beenFromFields));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改字段组件
|
||||||
|
*/
|
||||||
|
@GetMapping("/edit/{apiName}")
|
||||||
|
public String edit(@PathVariable("apiName") String apiName, ModelMap mmap)
|
||||||
|
{
|
||||||
|
BeenFromFields beenFromFields = beenFromFieldsService.selectBeenFromFieldsById(apiName);
|
||||||
|
mmap.put("beenFromFields", beenFromFields);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存字段组件
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:beenFromFields:edit")
|
||||||
|
@Log(title = "字段组件", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(BeenFromFields beenFromFields)
|
||||||
|
{
|
||||||
|
return toAjax(beenFromFieldsService.updateBeenFromFields(beenFromFields));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除字段组件
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:beenFromFields:remove")
|
||||||
|
@Log(title = "字段组件", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String apiNames)
|
||||||
|
{
|
||||||
|
return toAjax(beenFromFieldsService.deleteBeenFromFieldsByIds(apiNames));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据OBJ_NAME获取页面中包含的字段信息
|
||||||
|
* @param objName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/getBeenFromFieldsByObjName")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Map<String,Object>> getBeenFromFieldsByObjName(String objName)
|
||||||
|
{
|
||||||
|
List<Map<String,Object>> list = beenFromFieldsService.selectBeenFromFieldsByObjName(objName);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package com.ruoyi.backstage.module.been.fromfields.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.base.BaseEntity;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段组件表 crm_been_from_fields
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-02-19
|
||||||
|
*/
|
||||||
|
public class BeenCondition extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String column;
|
||||||
|
private String options;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getColumn() {
|
||||||
|
return column;
|
||||||
|
}
|
||||||
|
public void setColumn(String column) {
|
||||||
|
this.column = column;
|
||||||
|
}
|
||||||
|
public String getOptions() {
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
public void setOptions(String options) {
|
||||||
|
this.options = options;
|
||||||
|
}
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
package com.ruoyi.backstage.module.been.fromfields.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.been.fromfields.domain.BeenFromFields;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段组件 数据层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-02-18
|
||||||
|
*/
|
||||||
|
public interface BeenFromFieldsMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询字段组件信息
|
||||||
|
*
|
||||||
|
* @param id 字段组件ID
|
||||||
|
* @return 字段组件信息
|
||||||
|
*/
|
||||||
|
public BeenFromFields selectBeenFromFieldsById(String apiName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询字段组件列表
|
||||||
|
*
|
||||||
|
* @param beenFromFields 字段组件信息
|
||||||
|
* @return 字段组件集合
|
||||||
|
*/
|
||||||
|
public List<BeenFromFields> selectBeenFromFieldsList(BeenFromFields beenFromFields);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增字段组件
|
||||||
|
*
|
||||||
|
* @param beenFromFields 字段组件信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBeenFromFields(BeenFromFields beenFromFields);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改字段组件
|
||||||
|
*
|
||||||
|
* @param beenFromFields 字段组件信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBeenFromFields(BeenFromFields beenFromFields);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除字段组件
|
||||||
|
*
|
||||||
|
* @param id 字段组件ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBeenFromFieldsById(String apiNames);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除字段组件
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBeenFromFieldsByIds(String[] apiNames);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据OBJ_NAME获取页面中包含的字段信息
|
||||||
|
* @param objName 所属对象名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String,Object>> selectBeenFromFieldsByObjName(String objName);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.backstage.module.been.fromfields.service;
|
||||||
|
|
||||||
|
import com.ruoyi.backstage.module.been.fromfields.domain.BeenFromFields;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段组件 服务层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2019-02-18
|
||||||
|
*/
|
||||||
|
public interface IBeenFromFieldsService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询字段组件信息
|
||||||
|
*
|
||||||
|
* @param id 字段组件ID
|
||||||
|
* @return 字段组件信息
|
||||||
|
*/
|
||||||
|
public BeenFromFields selectBeenFromFieldsById(String apiName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询字段组件列表
|
||||||
|
*
|
||||||
|
* @param beenFromFields 字段组件信息
|
||||||
|
* @return 字段组件集合
|
||||||
|
*/
|
||||||
|
public List<BeenFromFields> selectBeenFromFieldsList(BeenFromFields beenFromFields);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增字段组件
|
||||||
|
*
|
||||||
|
* @param beenFromFields 字段组件信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBeenFromFields(BeenFromFields beenFromFields);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改字段组件
|
||||||
|
*
|
||||||
|
* @param beenFromFields 字段组件信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBeenFromFields(BeenFromFields beenFromFields);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除字段组件信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBeenFromFieldsByIds(String apiNames);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据OBJ_NAME获取页面中包含的字段信息
|
||||||
|
* @param objName 所属对象名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String,Object>> selectBeenFromFieldsByObjName(String objName);
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue