提交代码
parent
482a7322bf
commit
78325d3fbd
|
@ -37,4 +37,14 @@ public interface RemoteFileService
|
|||
*/
|
||||
@PostMapping(value = "/upload/{proPackage}/dirs/{dirs}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<SysFile> dirsUploadFile(@PathVariable("proPackage") String proPackage, @PathVariable("dirs") String dirs, @RequestPart(value = "file") MultipartFile file);
|
||||
|
||||
/**
|
||||
* 指定上传文件
|
||||
* @param proPackage 项目包
|
||||
* @param dirs 目录
|
||||
* @param file 文件
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/upload/{proPackage}/dirs/{dirs}/date/{datePath}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<SysFile> dirDatePathUploadFile(@PathVariable("proPackage") String proPackage, @PathVariable("dirs") String dirs, @PathVariable("datePath") String datePath, @RequestPart(value = "file") MultipartFile file);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,12 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ
|
|||
{
|
||||
return R.fail("上传文件失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<SysFile> dirDatePathUploadFile(String proPackage, String dirs, String datePath, MultipartFile file)
|
||||
{
|
||||
return R.fail("上传文件失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,33 +18,43 @@ const findTowerConfigListByProjectId = (data) => {
|
|||
};
|
||||
|
||||
// 查询塔基运行统计
|
||||
const findTowerStatisticsView = (deviceSn) => {
|
||||
const findTowerStatisticsView = (proId,deviceSn) => {
|
||||
return request({
|
||||
url: `/manage/bgscreen/tower/findTowerStatisticsView?deviceKey=${deviceSn}`,
|
||||
url: `/manage/bgscreen/tower/findTowerStatisticsView?projectId=${proId}&deviceSn=${deviceSn}`,
|
||||
method: "get",
|
||||
});
|
||||
};
|
||||
|
||||
// 查询塔基限位数据
|
||||
const selectDevTowerDataLimitList = (deviceSn) => {
|
||||
const selectDevTowerDataLimitList = (proId,deviceSn) => {
|
||||
return request({
|
||||
url: `/manage/bgscreen/tower/selectDevTowerDataLimitList?deviceKey=${deviceSn}&pageNum=1&pageSize=10`,
|
||||
url: `/manage/bgscreen/tower/selectDevTowerDataLimitList?projectId=${proId}&deviceKey=${deviceSn}`,
|
||||
method: "get",
|
||||
});
|
||||
};
|
||||
|
||||
// 查询塔基实时数据
|
||||
const selectDevTowerDataRunList = (deviceSn) => {
|
||||
const selectDevTowerDataRunList = (proId,deviceSn) => {
|
||||
return request({
|
||||
url: `manage/bgscreen/tower/selectDevTowerDataRunList?deviceKey=${deviceSn}&pageNum=1&pageSize=10`,
|
||||
url: `manage/bgscreen/tower/selectDevTowerDataRunList?projectId=${proId}&deviceKey=${deviceSn}`,
|
||||
method: "get",
|
||||
});
|
||||
};
|
||||
|
||||
// 查询塔基实时数据
|
||||
const findDevTowerDataWarningDatas = (query) => {
|
||||
return request({
|
||||
url: `manage/bgscreen/tower/findDevTowerDataWarningDatas`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
|
||||
export default {
|
||||
findTowerConfigGroupOnline,
|
||||
findTowerConfigListByProjectId,
|
||||
findTowerStatisticsView,
|
||||
selectDevTowerDataLimitList,
|
||||
selectDevTowerDataRunList,
|
||||
findDevTowerDataWarningDatas
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -16,7 +16,8 @@ module.exports = defineConfig({
|
|||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
"/dev-api": {
|
||||
target: "http://localhost:8080",
|
||||
//target: "http://localhost:8080",
|
||||
target: 'http://62.234.3.186/prod-api/',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/dev-api": "/",
|
||||
|
|
|
@ -78,12 +78,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||
return parseDateToStr(format, new Date());
|
||||
}
|
||||
|
||||
public static final String date(final Date date)
|
||||
public static final String dateStr(final Date date)
|
||||
{
|
||||
return parseDateToStr(YYYY_MM_DD, date);
|
||||
}
|
||||
|
||||
public static final String dateTime(final Date date)
|
||||
public static final String dateTimeStr(final Date date)
|
||||
{
|
||||
return parseDateToStr(YYYY_MM_DD_HH_MM_SS, date);
|
||||
}
|
||||
|
@ -114,6 +114,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||
return DateFormatUtils.format(now, "yyyy/MM/dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如2018/08/08
|
||||
*/
|
||||
public static final String datePath(Date date)
|
||||
{
|
||||
return DateFormatUtils.format(date, "yyyy/MM/dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期格式字符串
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.device.mapper;
|
||||
|
||||
import com.yanzhu.device.domain.DevTowerDataRound;
|
||||
import com.yanzhu.device.domain.DevTowerDataWarning;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -59,4 +60,12 @@ public interface DevTowerDataWarningMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevTowerDataWarningByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询塔机预警数据
|
||||
*
|
||||
* @param devTowerDataWarning 设备预警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int findWarningCountByDeviceKey(DevTowerDataWarning devTowerDataWarning);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevTowerDataCollideList" parameterType="DevTowerDataCollide" resultMap="DevTowerDataCollideResult">
|
||||
<include refid="selectDevTowerDataCollideVo"/>
|
||||
<where>
|
||||
dtdc.is_del=0
|
||||
<if test="cfgId != null">and dtdc.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdc.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdc.com_id = #{comId}</if>
|
||||
|
@ -82,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSource != null and deviceSource != ''"> and dtdc.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtdc.tower_id = #{towerId}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdc.is_del=0
|
||||
</where>
|
||||
order by dtdc.id desc
|
||||
</select>
|
||||
|
|
|
@ -70,7 +70,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevTowerDataLimitList" parameterType="DevTowerDataLimit" resultMap="DevTowerDataLimitResult">
|
||||
<include refid="selectDevTowerDataLimitVo"/>
|
||||
<where>
|
||||
dtdl.is_del=0
|
||||
<if test="cfgId != null">and dtdl.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdl.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdl.com_id = #{comId}</if>
|
||||
|
@ -83,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSource != null and deviceSource != ''"> and dtdl.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtdl.tower_id = #{towerId}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdl.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdl.is_del=0
|
||||
</where>
|
||||
order by dtdl.id desc
|
||||
</select>
|
||||
|
|
|
@ -84,7 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevTowerDataLocalList" parameterType="DevTowerDataLocal" resultMap="DevTowerDataLocalResult">
|
||||
<include refid="selectDevTowerDataLocalVo"/>
|
||||
<where>
|
||||
dtdl.is_del=0
|
||||
<if test="cfgId != null">and dtdl.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdl.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdl.com_id = #{comId}</if>
|
||||
|
@ -97,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSource != null and deviceSource != ''"> and dtdl.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtdl.tower_id = #{towerId}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdl.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdl.is_del=0
|
||||
</where>
|
||||
order by dtdl.id desc
|
||||
</select>
|
||||
|
|
|
@ -101,7 +101,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevTowerDataRoundList" parameterType="DevTowerDataRound" resultMap="DevTowerDataRoundResult">
|
||||
<include refid="selectDevTowerDataRoundVo"/>
|
||||
<where>
|
||||
dtdr.is_del=0
|
||||
<if test="cfgId != null">and dtdr.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdr.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdr.com_id = #{comId}</if>
|
||||
|
@ -114,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSource != null and deviceSource != ''"> and dtdr.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtdr.tower_id = #{towerId}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdr.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdr.is_del=0
|
||||
</where>
|
||||
order by dtdr.id desc
|
||||
</select>
|
||||
|
|
|
@ -242,10 +242,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="findRunCountByDeviceKey" parameterType="DevTowerDataRound" resultType="Int">
|
||||
select count(1) as total from dev_tower_data_run
|
||||
<where>
|
||||
is_del=0
|
||||
<if test="deviceKey != null and deviceKey != ''">and cfg_id in (select dc.id from dev_tower_project_config dc where dc.device_sn=#{deviceKey}) and device_key = #{deviceKey}</if>
|
||||
<if test='activeName == "gj"'> and is_alarm = 1 </if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and date(create_time) between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and is_del=0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -43,13 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
dtdw.project_id,
|
||||
dtdw.com_id,
|
||||
sp.project_name as projectName,
|
||||
sd.dept_name as com_name, dtdw.dept_id,
|
||||
sd.dept_name as com_name,
|
||||
dtdw.dept_id,
|
||||
dtdw.device_key,
|
||||
dtdw.device_source,
|
||||
dtdw.tower_id,
|
||||
dtdw.warn_type,
|
||||
dtdw.warn_name,
|
||||
dtdw.warn_note,
|
||||
IFNULL(dtdw.warn_note,sdd.dict_label) as warn_note,
|
||||
dtdw.height,
|
||||
dtdw.range,
|
||||
dtdw.rotation,
|
||||
|
@ -67,14 +68,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
dtdw.update_time,
|
||||
dtdw.remark
|
||||
from dev_tower_data_warning dtdw
|
||||
left join sys_dept sp on sp.dept_id = dtdw.project_id
|
||||
left join pro_project_info sp on sp.id = dtdw.project_id
|
||||
left join sys_dept sd on sd.dept_id = dtdw.com_id
|
||||
left join sys_dict_data sdd on sdd.dict_value = dtdw.warn_type and sdd.dict_type = 'device_tower_warning'
|
||||
</sql>
|
||||
|
||||
<select id="selectDevTowerDataWarningList" parameterType="DevTowerDataWarning" resultMap="DevTowerDataWarningResult">
|
||||
<include refid="selectDevTowerDataWarningVo"/>
|
||||
<where>
|
||||
dtdw.is_del=0
|
||||
<if test="cfgId != null">and dtdw.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdw.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdw.com_id = #{comId}</if>
|
||||
|
@ -88,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="towerId != null and towerId != ''"> and dtdw.tower_id = #{towerId}</if>
|
||||
<if test="warnType != null "> and dtdw.warn_type = #{warnType}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdw.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdw.is_del=0
|
||||
</where>
|
||||
order by dtdw.id desc
|
||||
</select>
|
||||
|
@ -200,4 +202,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="findWarningCountByDeviceKey" parameterType="DevTowerDataWarning" resultType="Int">
|
||||
select count(1) as total from dev_tower_data_warning
|
||||
<where>
|
||||
<if test="deviceKey != null and deviceKey != ''">and device_key = #{deviceKey}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and date(create_time) between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and is_del=0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -112,6 +112,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors))
|
||||
))
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
AND u.remark like concat('%', #{remark}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
|
|
@ -100,7 +100,7 @@ public class SysFileController
|
|||
* 文件上传请求
|
||||
*/
|
||||
@PostMapping("/upload/{proPackage}/dirs/{dirs}")
|
||||
public R<SysFile> dirsUploadFile(@PathVariable("busKey") String proPackage, @PathVariable("dirs") String dirs, MultipartFile file)
|
||||
public R<SysFile> dirsUploadFile(@PathVariable("proPackage") String proPackage, @PathVariable("dirs") String dirs, MultipartFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -119,6 +119,29 @@ public class SysFileController
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传请求
|
||||
*/
|
||||
@PostMapping("/upload/{proPackage}/dirs/{dirs}/date/{datePath}")
|
||||
public R<SysFile> dirDatePathUploadFile(@PathVariable("proPackage") String proPackage, @PathVariable("dirs") String dirs, @PathVariable("datePath") String datePath, MultipartFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
String catalog = "/"+proPackage+"/"+dirs;
|
||||
// 上传并返回访问地址
|
||||
String url = sysFileService.dirsUploadFile(catalog,datePath,file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(url));
|
||||
sysFile.setUrl(url);
|
||||
return R.ok(sysFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("上传文件失败", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件通用下载...
|
||||
* @param fileName
|
||||
|
|
|
@ -53,6 +53,20 @@ public class FastDfsSysFileServiceImpl implements ISysFileService
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param dirs 文件目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 时间地址
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String dirsUploadFile(String dirs, String datePath, MultipartFile file) throws Exception{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名文件上传接口
|
||||
*
|
||||
|
|
|
@ -28,6 +28,17 @@ public interface ISysFileService
|
|||
*/
|
||||
public String dirsUploadFile(String dirs, MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param dirs 文件目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 时间地址
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
public String dirsUploadFile(String dirs, String datePath, MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 签名文件上传接口
|
||||
*
|
||||
|
|
|
@ -58,7 +58,22 @@ public class LocalSysFileServiceImpl implements ISysFileService
|
|||
@Override
|
||||
public String dirsUploadFile(String dirs, MultipartFile file) throws Exception{
|
||||
String name = FileUploadUtils.upload(localFilePath+dirs, file);
|
||||
return localFilePrefix + name;
|
||||
return localFilePrefix + dirs+ "/" + name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param dirs 文件目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 时间地址
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String dirsUploadFile(String dirs, String datePath, MultipartFile file) throws Exception{
|
||||
String name = FileUploadUtils.upload(localFilePath+dirs, datePath, file);
|
||||
return localFilePrefix + dirs+ "/" + name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,6 +56,20 @@ public class MinioSysFileServiceImpl implements ISysFileService
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param dirs 文件目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 时间地址
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String dirsUploadFile(String dirs, String datePath, MultipartFile file) throws Exception{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名文件上传接口
|
||||
*
|
||||
|
|
|
@ -64,6 +64,27 @@ public class FileUploadUtils
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件路径上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 上传的时间目录
|
||||
* @return 文件名称
|
||||
* @throws IOException
|
||||
*/
|
||||
public static final String upload(String baseDir, String datePath, MultipartFile file) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
return upload(baseDir, datePath, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new IOException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件路径上传
|
||||
*
|
||||
|
@ -117,6 +138,39 @@ public class FileUploadUtils
|
|||
return getPathFileName(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param allowedExtension 上传文件类型
|
||||
* @return 返回上传成功的文件名
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||
* @throws IOException 比如读写文件出错时
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static final String upload(String baseDir, String datePath, MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||
InvalidExtensionException
|
||||
{
|
||||
int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||
{
|
||||
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||
}
|
||||
|
||||
assertAllowed(file, allowedExtension);
|
||||
|
||||
String fileName = extractFilename(datePath, file);
|
||||
|
||||
String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
|
||||
file.transferTo(Paths.get(absPath));
|
||||
// 压缩图片
|
||||
makeMiniImage(absPath);
|
||||
return getPathFileName(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
|
@ -266,6 +320,16 @@ public class FileUploadUtils
|
|||
MD5Utils.md5Hex(FilenameUtils.getBaseName(file.getOriginalFilename()),"utf-8"), Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码文件名
|
||||
*/
|
||||
public static final String extractFilename(String dateStr, MultipartFile file)
|
||||
{
|
||||
String datePath = DateUtils.datePath(DateUtils.parseDate(dateStr));
|
||||
return StringUtils.format("{}/{}_{}.{}", datePath,
|
||||
MD5Utils.md5Hex(FilenameUtils.getBaseName(file.getOriginalFilename()),"utf-8"), Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
|
||||
}
|
||||
|
||||
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
File desc = new File(uploadDir + File.separator + fileName);
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.yanzhu.common.core.utils.Md5Utils;
|
|||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.utils.file.FileUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.*;
|
||||
import com.yanzhu.job.service.*;
|
||||
import com.yanzhu.system.api.RemoteFileService;
|
||||
|
@ -32,7 +33,7 @@ import java.util.*;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Description: 济公网数据定时任务
|
||||
* @Description: 济工网数据定时任务
|
||||
* @Title: AttendanceJgwTask
|
||||
* @Package com.yanzhu.job.task
|
||||
* @Author: JiangYuQi
|
||||
|
@ -80,7 +81,7 @@ public class AttendanceJgwTask {
|
|||
* @return
|
||||
*/
|
||||
public static String getToken(String appid, String secret) {
|
||||
log.info("开始查询济公网TOKEN...{}::{}",appid,secret);
|
||||
log.info("开始查询济工网TOKEN...{}::{}",appid,secret);
|
||||
String grantType = "client_credential";
|
||||
String path = "/webapi/credential";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
|
@ -105,7 +106,7 @@ public class AttendanceJgwTask {
|
|||
* 同步单位及班组信息
|
||||
*/
|
||||
public void syncContractorAndGroupData() {
|
||||
log.info("开始同步济公网单位&班组信息...{}",DateUtils.dateTimeStr());
|
||||
log.info("开始同步济工网单位&班组信息...{}",DateUtils.dateTimeStr());
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(ShiFouEnums.SHI.getCode());
|
||||
where.setIsDel(ShiFouEnums.FOU.getCode());
|
||||
|
@ -139,7 +140,7 @@ public class AttendanceJgwTask {
|
|||
* @param it 配置信息
|
||||
*/
|
||||
private void doSyncProContractor(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步济公参建单位信息...rows::{}",startId);
|
||||
log.info("开始同步济工网参建单位信息...rows::{}",startId);
|
||||
String appId = jo.getString("appId");
|
||||
String token = jo.getString("token");
|
||||
String projectId = jo.getString("appProjectId");
|
||||
|
@ -207,6 +208,22 @@ public class AttendanceJgwTask {
|
|||
}else{
|
||||
redisService.setCacheObject("doSyncProContractor.contractorId::"+json.getString("contractorId"),list.get(0),2L,TimeUnit.HOURS);
|
||||
}
|
||||
}else{
|
||||
QuartzProSubdepts quartzProSubdepts = new QuartzProSubdepts();
|
||||
quartzProSubdepts.setComId(it.getComId());
|
||||
quartzProSubdepts.setProjectId(it.getProjectId());
|
||||
quartzProSubdepts.setSubDeptType(subDeptType);
|
||||
quartzProSubdepts.setSubDeptName(json.getString("corpName"));
|
||||
quartzProSubdepts.setSubDeptCode(json.getString("corpCode"));
|
||||
quartzProSubdepts.setSubDeptLeaderName(json.getString("pmName"));
|
||||
quartzProSubdepts.setSubDeptLeaderPhone(json.getString("pmPhone"));
|
||||
quartzProSubdepts.setUseStatus(UseStateEnums.IN.getCode());
|
||||
quartzProSubdepts.setUseDates(DateUtils.getNowDate());
|
||||
quartzProSubdepts.setApproveStatus(ApproveStatus.passed.getCode());
|
||||
quartzProSubdepts.setSource(code.toUpperCase()+"::"+json.getString("contractorId"));
|
||||
quartzProSubdepts.setCreateBy("JGW-TASK");
|
||||
quartzProSubdepts.setCreateTime(DateUtils.getNowDate());
|
||||
redisService.setCacheObject("doSyncProContractor.contractorId::"+json.getString("contractorId"),quartzProSubdepts,2L,TimeUnit.HOURS);
|
||||
}
|
||||
}
|
||||
if (arr.size()>=10 && rowId > 0) {
|
||||
|
@ -247,7 +264,7 @@ public class AttendanceJgwTask {
|
|||
* @param it 配置信息
|
||||
*/
|
||||
private void doSyncDirectlyUnderGroup(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步济公直属班组信息...rows::{}",startId);
|
||||
log.info("开始同步济工网直属班组信息...rows::{}",startId);
|
||||
String appId = jo.getString("appId");
|
||||
String token = jo.getString("token");
|
||||
String projectId = jo.getString("appProjectId");
|
||||
|
@ -278,6 +295,7 @@ public class AttendanceJgwTask {
|
|||
long rowId = 0;
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
//log.info("doSyncDirectlyUnderGroup...{}"+json);
|
||||
Map<String, String> dataMap = convertSubJobTypes(json.getString("corpType"));
|
||||
QuartzProSubdeptsGroup quartzProSubdeptsGroupQuery = new QuartzProSubdeptsGroup();
|
||||
quartzProSubdeptsGroupQuery.setProjectId(it.getProjectId());
|
||||
|
@ -330,6 +348,11 @@ public class AttendanceJgwTask {
|
|||
*/
|
||||
private Map<String, String> convertSubJobTypes(String jobTypes){
|
||||
Map<String, String> dataMap = new HashMap<>();
|
||||
if(StringUtils.isEmpty(jobTypes)){
|
||||
dataMap.put("type","3");
|
||||
dataMap.put("post","4037");
|
||||
return dataMap;
|
||||
}
|
||||
switch (jobTypes){
|
||||
case "3001" : dataMap.put("type","2");dataMap.put("post","1015"); break;
|
||||
case "3002" : dataMap.put("type","2");dataMap.put("post","1014"); break;
|
||||
|
@ -500,7 +523,7 @@ public class AttendanceJgwTask {
|
|||
* 同步人员信息
|
||||
*/
|
||||
public void syncProSubDeptWorker() {
|
||||
log.info("开始同步济公网人员信息...{}",DateUtils.dateTimeStr());
|
||||
log.info("开始同步济工网人员信息...{}",DateUtils.dateTimeStr());
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
|
@ -529,7 +552,7 @@ public class AttendanceJgwTask {
|
|||
* 同步人员信息
|
||||
*/
|
||||
private void doSyncProSubDeptWorker(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步济公网人员信息...rows::{}",startId);
|
||||
log.info("开始同步济工网人员信息...rows::{}",startId);
|
||||
String appId = jo.getString("appId");
|
||||
String token = jo.getString("token");
|
||||
String projectId = jo.getString("appProjectId");
|
||||
|
@ -557,6 +580,7 @@ public class AttendanceJgwTask {
|
|||
if (arr.size() > 0) {
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
//log.info("doSyncProSubDeptWorker...{}",json);
|
||||
QuartzProSubdeptsUsers quartzProSubdeptsUsersQuery = new QuartzProSubdeptsUsers();
|
||||
quartzProSubdeptsUsersQuery.setProjectId(it.getProjectId());
|
||||
quartzProSubdeptsUsersQuery.setUserPhone(json.getString("workPhone"));
|
||||
|
@ -593,7 +617,7 @@ public class AttendanceJgwTask {
|
|||
quartzProSubdeptsUsers.setUserSex(json.getString("sex"));
|
||||
Map<String, String> userInfos = new HashMap<>();
|
||||
userInfos.put("nation",json.getString("minor"));
|
||||
userInfos.put("birthDay",DateUtils.date(DateUtils.parseDate(json.getString("birthday"))));
|
||||
userInfos.put("birthDay",DateUtils.dateStr(DateUtils.parseDate(json.getString("birthday"))));
|
||||
long idStr = Long.parseLong(quartzProSubdeptsUsers.getCardCode().substring(0, 6));
|
||||
String natStr = getNative(idStr);
|
||||
userInfos.put("nativePlace",natStr);
|
||||
|
@ -605,7 +629,9 @@ public class AttendanceJgwTask {
|
|||
userInfos.put("bankOffice",json.getString("branchName"));
|
||||
userInfos.put("cardImgPos",cardImgPos);
|
||||
userInfos.put("cardImgInv",cardImgInv);
|
||||
quartzProSubdeptsUsers.setUserInfos(JSON.toJSONString(userInfos));
|
||||
quartzProSubdeptsUsers.setUserPicture(userPicture);
|
||||
quartzProSubdeptsUsers.setUserPhone(json.getString("workPhone"));
|
||||
String adminCraftPost = convertAdminType(json.getString("adminType"));
|
||||
if(StringUtils.isEmpty(adminCraftPost)){
|
||||
//判断是否有岗位2
|
||||
|
@ -640,6 +666,9 @@ public class AttendanceJgwTask {
|
|||
* @return
|
||||
*/
|
||||
private String convertAdminType(String adminType){
|
||||
if(StringUtils.isEmpty(adminType)){
|
||||
return "";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(adminType)){
|
||||
String craftPost = "";
|
||||
switch (adminType){
|
||||
|
@ -680,6 +709,9 @@ public class AttendanceJgwTask {
|
|||
* @return
|
||||
*/
|
||||
private String convertJobType2(String jobType2){
|
||||
if(StringUtils.isEmpty(jobType2)){
|
||||
return "";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(jobType2)){
|
||||
String craftPost = "";
|
||||
switch (jobType2){
|
||||
|
@ -712,9 +744,11 @@ public class AttendanceJgwTask {
|
|||
sysUser.setUserName(quartzProSubdeptsUsers.getUserPhone());
|
||||
sysUser.setNickName(quartzProSubdeptsUsers.getUserName());
|
||||
sysUser.setPhonenumber(quartzProSubdeptsUsers.getUserPhone());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(sysUser.getPhonenumber()+"@jgw"));
|
||||
sysUser.setUpdateBy("JGW-TASK");
|
||||
sysUser.setUpdateTime(DateUtils.getNowDate());
|
||||
sysUser.setUserInfos(quartzProSubdeptsUsers.getUserInfos());
|
||||
sysUser.setRemark(quartzProSubdeptsUsers.getSource());
|
||||
|
||||
String subDeptType = quartzProSubdeptsUsers.getSubDeptType();
|
||||
// 判断单位类型
|
||||
|
@ -854,7 +888,7 @@ public class AttendanceJgwTask {
|
|||
* 同步之前考勤数据
|
||||
*/
|
||||
public void syncBeforeAttendanceData(String dtStart, String dtEnd, Long cfgId) {
|
||||
log.info("开始同步济公网人员考勤信息...{}::{}::{}",dtStart,dtEnd,cfgId);
|
||||
log.info("开始同步济工网人员考勤信息...{}::{}::{}",dtStart,dtEnd,cfgId);
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
|
@ -873,10 +907,20 @@ public class AttendanceJgwTask {
|
|||
secret = Base64.encode(secret);
|
||||
jo.put("secret", secret);
|
||||
String token = getToken(appId, secret);
|
||||
jo.put("token", token);
|
||||
jo.put("startTime", dtStart);
|
||||
jo.put("endTime", dtEnd);
|
||||
doSyncAttendanceData(jo, "0", it);
|
||||
|
||||
Calendar startCalendar = Calendar.getInstance();
|
||||
startCalendar.setTime(DateUtils.parseDate(dtStart));
|
||||
|
||||
Calendar endCalendar = Calendar.getInstance();
|
||||
endCalendar.setTime(DateUtils.parseDate(dtEnd));
|
||||
while (startCalendar.before(endCalendar)){
|
||||
String findTimes = DateUtils.dateStr(startCalendar.getTime());
|
||||
jo.put("token", token);
|
||||
jo.put("startTime", findTimes);
|
||||
jo.put("endTime", findTimes);
|
||||
doSyncAttendanceData(jo, "0", it);
|
||||
startCalendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
@ -888,7 +932,7 @@ public class AttendanceJgwTask {
|
|||
* 同步当前考勤数据
|
||||
*/
|
||||
public void syncNowAttendanceData() {
|
||||
log.info("开始同步济公网人员考勤信息...{}",DateUtils.dateTimeStr());
|
||||
log.info("开始同步济工网人员考勤信息...{}",DateUtils.dateTimeStr());
|
||||
String dtStart = DateUtils.getDate();
|
||||
String dtEnd = DateUtils.getDate();
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
|
@ -924,7 +968,7 @@ public class AttendanceJgwTask {
|
|||
* @param it
|
||||
*/
|
||||
private void doSyncAttendanceData(JSONObject jo, String startId, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步济公网人员考勤数据...rows:{}",startId);
|
||||
log.info("开始同步济工网人员考勤数据...rows:{}",startId);
|
||||
String appId = jo.getString("appId");
|
||||
String token = jo.getString("token");
|
||||
String projectId = jo.getString("appProjectId");
|
||||
|
@ -955,6 +999,7 @@ public class AttendanceJgwTask {
|
|||
if (arr != null && arr.size() > 0) {
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
String datePath = json.getString("signDate");
|
||||
String machineType = Convert.toStr(json.getString("machineType"),"1");
|
||||
QuartzProSubdeptsUsers quartzProSubdeptsUsersQuery = new QuartzProSubdeptsUsers();
|
||||
quartzProSubdeptsUsersQuery.setProjectId(it.getProjectId());
|
||||
|
@ -974,23 +1019,23 @@ public class AttendanceJgwTask {
|
|||
//签进
|
||||
if(quartzProAttendanceData.getOutTime()==null && quartzProAttendanceData.getInData()==null){
|
||||
quartzProAttendanceData.setInTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
}
|
||||
}else if(machineType.equals("3")){
|
||||
//签出
|
||||
quartzProAttendanceData.setOutTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
}else{
|
||||
//默认
|
||||
if(quartzProAttendanceData.getInData()==null){
|
||||
quartzProAttendanceData.setInTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
}else{
|
||||
quartzProAttendanceData.setOutTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
}
|
||||
}
|
||||
|
@ -1015,17 +1060,17 @@ public class AttendanceJgwTask {
|
|||
if(machineType.equals("2")){
|
||||
//签进
|
||||
quartzProAttendanceData.setInTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
}else if(machineType.equals("3")){
|
||||
//签出
|
||||
quartzProAttendanceData.setOutTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
}else{
|
||||
//默认
|
||||
quartzProAttendanceData.setInTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
}
|
||||
quartzProAttendanceData.setDeviceNo(json.getString("deviceSerialNo"));
|
||||
|
@ -1042,12 +1087,21 @@ public class AttendanceJgwTask {
|
|||
|
||||
/**
|
||||
* 查询照片
|
||||
* @param appId
|
||||
* @param token
|
||||
* @param photo
|
||||
* @param appId 应用
|
||||
* @param token 令牌
|
||||
* @param proPackage 项目目录
|
||||
* @param datePath 时间地址
|
||||
* @param photo 照片地址
|
||||
* @return
|
||||
*/
|
||||
private String getPhoto(String appId, String token, String proPackage, String photo) {
|
||||
private String getPhoto(String appId, String token, String proPackage, String datePath, String photo) {
|
||||
try {
|
||||
MultipartFile multipartFile = FileUtils.downloadFileToMultipart("https://gymspic1.oss-cn-shanghai.aliyuncs.com/"+photo);
|
||||
return remoteFileService.dirDatePathUploadFile(proPackage,"jgw",datePath, multipartFile).getData().getUrl();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
/**try {
|
||||
String path = "/webapi/dictInfo/getPhoyoAllPaths";
|
||||
String time = System.currentTimeMillis() + "";
|
||||
String url = JGW_HOST + path + "?appId=" + appId + "&tokenSign=" + token + "×tamp=" + time;
|
||||
|
@ -1065,13 +1119,12 @@ public class AttendanceJgwTask {
|
|||
String data = getResult(request);
|
||||
JSONObject j = JSON.parseObject(data);
|
||||
JSONObject json = j.getJSONObject("data");
|
||||
try {
|
||||
MultipartFile multipartFile = FileUtils.downloadFileToMultipart(json.getString("result"));
|
||||
R<SysFile> result = remoteFileService.dirsUploadFile(proPackage,"jgw",multipartFile);
|
||||
R<SysFile> result = remoteFileService.dirDatePathUploadFile(proPackage, "jgw", datePath, multipartFile);
|
||||
return result.getData().getUrl();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectProAttendanceCfgVo">
|
||||
select pac.id, pac.com_id, pac.project_id, pac.vendors_code, pac.vendors_parameter, pac.enabled, pac.state, pac.remark, pac.is_del, pac.create_by, pac.create_time, pac.update_by
|
||||
, pac.update_time, dp.`dept_name` as comp_name, pp.`project_name`, pp.project_package as dic.`dict_label` as vendors_name, sd.sub_dept_name as dept_name, pac.dept_id
|
||||
, pac.update_time, dp.`dept_name` as comp_name, pp.`project_name`, pp.project_package, dic.`dict_label` as vendors_name, sd.sub_dept_name as dept_name, pac.dept_id
|
||||
from attendance_cfg pac
|
||||
left join sys_dept dp on pac.`com_id` = dp.`dept_id`
|
||||
left join pro_project_info pp on pac.`project_id` = pp.`id`
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.yanzhu.common.core.web.controller.BaseController;
|
|||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.device.domain.DevTowerDataLimit;
|
||||
import com.yanzhu.device.domain.DevTowerDataRun;
|
||||
import com.yanzhu.device.domain.DevTowerDataWarning;
|
||||
import com.yanzhu.device.domain.DevTowerProjectConfig;
|
||||
import com.yanzhu.manage.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -42,6 +43,9 @@ public class TowerCraneController extends BaseController {
|
|||
@Autowired
|
||||
private IDevTowerDataCollideService devTowerDataCollideService;
|
||||
|
||||
@Autowired
|
||||
private IDevTowerDataWarningService devTowerDataWarningService;
|
||||
|
||||
@Autowired
|
||||
private IDevTowerProjectConfigService devTowerProjectConfigService;
|
||||
|
||||
|
@ -87,7 +91,7 @@ public class TowerCraneController extends BaseController {
|
|||
@GetMapping("/selectDevTowerDataLimitList")
|
||||
public AjaxResult selectDevTowerDataLimitList(DevTowerDataLimit devTowerDataLimit)
|
||||
{
|
||||
startPage();
|
||||
startPage(1,1);
|
||||
devTowerDataLimit.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode()));
|
||||
List<DevTowerDataLimit> list = devTowerDataLimitService.selectDevTowerDataLimitList(devTowerDataLimit);
|
||||
return success(list);
|
||||
|
@ -99,9 +103,20 @@ public class TowerCraneController extends BaseController {
|
|||
@GetMapping("/selectDevTowerDataRunList")
|
||||
public AjaxResult selectDevTowerDataRunList(DevTowerDataRun devTowerDataRun)
|
||||
{
|
||||
startPage();
|
||||
startPage(1,1);
|
||||
devTowerDataRun.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode()));
|
||||
List<DevTowerDataRun> list = devTowerDataRunService.selectDevTowerDataRunList(devTowerDataRun);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询塔基实时数据
|
||||
*/
|
||||
@GetMapping("/findDevTowerDataWarningDatas")
|
||||
public AjaxResult findDevTowerDataWarningDatas(DevTowerDataWarning devTowerDataWarning)
|
||||
{
|
||||
startPage(1,10);
|
||||
List<DevTowerDataWarning> list = devTowerDataWarningService.selectDevTowerDataWarningList(devTowerDataWarning);
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,11 @@ import com.yanzhu.common.core.utils.DateUtils;
|
|||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.device.domain.DevTowerDataRound;
|
||||
import com.yanzhu.device.domain.DevTowerDataRun;
|
||||
import com.yanzhu.device.domain.DevTowerDataWarning;
|
||||
import com.yanzhu.device.mapper.DevTowerDataCollideMapper;
|
||||
import com.yanzhu.device.mapper.DevTowerDataRoundMapper;
|
||||
import com.yanzhu.device.mapper.DevTowerDataRunMapper;
|
||||
import com.yanzhu.device.mapper.DevTowerDataWarningMapper;
|
||||
import com.yanzhu.manage.service.IDevTowerDataRunService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -32,6 +34,9 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
|
|||
@Autowired
|
||||
private DevTowerDataRoundMapper devTowerDataRoundMapper;
|
||||
|
||||
@Autowired
|
||||
private DevTowerDataWarningMapper devTowerDataWarningMapper;
|
||||
|
||||
@Autowired
|
||||
private DevTowerDataCollideMapper devTowerDataCollideMapper;
|
||||
|
||||
|
@ -129,8 +134,9 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
|
|||
devTowerDataRound.setActiveName("cz");
|
||||
int b0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("b0",b0);
|
||||
devTowerDataRound.setActiveName("gj");
|
||||
int c0 = devTowerDataRunMapper.findRunCountByDeviceKey(devTowerDataRound);
|
||||
DevTowerDataWarning devTowerDataWarning = new DevTowerDataWarning();
|
||||
devTowerDataWarning.setDeviceKey(deviceSn);
|
||||
int c0 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning);
|
||||
//int d0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
//int e0 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("c0",c0);
|
||||
|
@ -153,18 +159,17 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
|
|||
params.put("beginCreateTime",firstDay);
|
||||
params.put("endCreateTime",lastDay);
|
||||
devTowerDataRound.setParams(params);
|
||||
devTowerDataWarning.setParams(params);
|
||||
int a1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("a1",a1);
|
||||
devTowerDataRound.setActiveName("cz");
|
||||
int b1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("b1",b1);
|
||||
devTowerDataRound.setActiveName("gj");
|
||||
int c1 = devTowerDataRunMapper.findRunCountByDeviceKey(devTowerDataRound);
|
||||
int c1 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning);
|
||||
//int d1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
//int e1 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("c1",c1);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -421,6 +421,16 @@ public class SysUserController extends BaseController {
|
|||
return toAjax(userService.updataUserPassWord(vo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@Log(title = "修改密码", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updatePwd/specify/{type}")
|
||||
public AjaxResult updatePwd(@PathVariable(value = "type") String type) {
|
||||
userService.updataUserPassWordSpecify(type);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
|
|
|
@ -271,6 +271,13 @@ public interface ISysUserService
|
|||
*/
|
||||
public int updataUserPassWord(AlertUserPassVo alertUserPassVo);
|
||||
|
||||
/**
|
||||
* 修改指定用户类型密码
|
||||
* @param type 用户类型
|
||||
* @return
|
||||
*/
|
||||
public void updataUserPassWordSpecify(String type);
|
||||
|
||||
/**
|
||||
* 获取普通用户的租户信息
|
||||
* @param userId
|
||||
|
|
|
@ -539,6 +539,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
user.setCreateBy(user.getUpdateBy());
|
||||
user.setCreateTime(user.getUpdateTime());
|
||||
user.setWorkType(user.getWorkType());
|
||||
if(StringUtils.isEmpty(user.getPassword())){
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPhonenumber()+"@"+user.getUserType()));
|
||||
}
|
||||
userMapper.insertUser(user);
|
||||
try {
|
||||
String maOpenId = Convert.toStr(redisService.getCacheObject("SysUserUniopen::"+user.getPhonenumber()),null);
|
||||
|
@ -1101,6 +1104,26 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
return userMapper.updateUser(sysUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改指定用户类型密码
|
||||
* @param type 用户类型
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void updataUserPassWordSpecify(String type){
|
||||
SysUser userQuery = new SysUser();
|
||||
userQuery.setRemark(type.toUpperCase()+"::");
|
||||
List<SysUser> userList = selectUserList(userQuery);
|
||||
if(userList.size()>0){
|
||||
for (SysUser sysUser:userList){
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(sysUser.getPhonenumber()+"@"+type));
|
||||
sysUser.setUpdateBy(SecurityUtils.getUsername());
|
||||
sysUser.setUpdateTime(new Date());
|
||||
userMapper.updateUser(sysUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserCom> getUserComs(Long userId) {
|
||||
SysUserCom where=new SysUserCom();
|
||||
|
@ -1162,8 +1185,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
return userComs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private SysUserExt findActiveUserExt(List<SysUserExt> userExts) {
|
||||
SysUserExt find=null;
|
||||
for(SysUserExt userExt:userExts){
|
||||
|
|
Loading…
Reference in New Issue