APP接口修改
This commit is contained in:
parent
20a9360668
commit
724ac17f35
|
|
@ -1,11 +1,18 @@
|
||||||
package com.bonus.app.controller;
|
package com.bonus.app.controller;
|
||||||
|
|
||||||
import com.bonus.app.service.ICraneMonitorService;
|
import com.bonus.app.service.ICraneMonitorService;
|
||||||
|
import com.bonus.common.core.constant.BusinessConstants;
|
||||||
|
import com.bonus.common.core.text.Convert;
|
||||||
|
import com.bonus.common.core.utils.ServletUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.entity.app.AppParamsDto;
|
import com.bonus.common.entity.app.AppParamsDto;
|
||||||
|
import com.bonus.common.entity.app.vo.DevWarnVo;
|
||||||
import com.bonus.common.entity.app.vo.JdConfigVo;
|
import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||||
|
import com.bonus.common.entity.bracelet.vo.EquipmentReqVo;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -42,7 +49,11 @@ public class CraneMonitorController {
|
||||||
@GetMapping("getJdWarnList")
|
@GetMapping("getJdWarnList")
|
||||||
@SysLog(title = "APP->吊装监控", businessType = OperaType.QUERY,logType = 0,module = "APP->吊装监控",details ="查询近电感应设备预警信息")
|
@SysLog(title = "APP->吊装监控", businessType = OperaType.QUERY,logType = 0,module = "APP->吊装监控",details ="查询近电感应设备预警信息")
|
||||||
public AjaxResult getJdWarnList(AppParamsDto dto){
|
public AjaxResult getJdWarnList(AppParamsDto dto){
|
||||||
return service.getJdWarnList(dto);
|
Integer pageNum = Convert.toInt(ServletUtils.getParameter(BusinessConstants.PAGE_NUM), 1);
|
||||||
|
Integer pageSize = Convert.toInt(ServletUtils.getParameter(BusinessConstants.PAGE_SIZE), 10);
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
PageInfo<DevWarnVo> pageInfo = service.getJdWarnList(dto);
|
||||||
|
return AjaxResult.success(pageInfo.getList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("configJdDevice")
|
@PostMapping("configJdDevice")
|
||||||
|
|
|
||||||
|
|
@ -51,4 +51,13 @@ public interface AppSafetyHatMapper {
|
||||||
* @date 2024/8/7 19:30
|
* @date 2024/8/7 19:30
|
||||||
*/
|
*/
|
||||||
void returnHelmet(AppParamsDto dto);
|
void returnHelmet(AppParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新设备领用表 归还状态
|
||||||
|
* @param dto
|
||||||
|
* @return void
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/21 10:43
|
||||||
|
*/
|
||||||
|
void updateReturnDeviceData(AppParamsDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ package com.bonus.app.service;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.entity.app.AppParamsDto;
|
import com.bonus.common.entity.app.AppParamsDto;
|
||||||
|
import com.bonus.common.entity.app.vo.DevWarnVo;
|
||||||
import com.bonus.common.entity.app.vo.JdConfigVo;
|
import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @className:CraneMonitorService
|
* @className:CraneMonitorService
|
||||||
|
|
@ -37,7 +39,7 @@ public interface ICraneMonitorService {
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/13 9:19
|
* @date 2024/8/13 9:19
|
||||||
*/
|
*/
|
||||||
AjaxResult getJdWarnList(AppParamsDto dto);
|
PageInfo<DevWarnVo> getJdWarnList(AppParamsDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置近电感应设备属性
|
* 配置近电感应设备属性
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,6 @@ public class AppSafetyHatServiceImpl implements IAppSafetyHatService {
|
||||||
@Resource(name = "AppSafetyHatMapper")
|
@Resource(name = "AppSafetyHatMapper")
|
||||||
private AppSafetyHatMapper mapper;
|
private AppSafetyHatMapper mapper;
|
||||||
|
|
||||||
@Resource(name = "AppEquipmentReqMapper")
|
|
||||||
private AppEquipmentReqMapper appEquipmentReqMapper;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<SafetyHatVo> getSafetyHatLists(AppParamsDto dto) {
|
public PageInfo<SafetyHatVo> getSafetyHatLists(AppParamsDto dto) {
|
||||||
List<SafetyHatVo> list = new ArrayList<>();
|
List<SafetyHatVo> list = new ArrayList<>();
|
||||||
|
|
@ -84,8 +81,8 @@ public class AppSafetyHatServiceImpl implements IAppSafetyHatService {
|
||||||
}
|
}
|
||||||
// 更新人员领用的归还状态
|
// 更新人员领用的归还状态
|
||||||
mapper.returnHelmet(dto);
|
mapper.returnHelmet(dto);
|
||||||
// 更新设备表解绑状态
|
// 更新设备领用表 归还状态
|
||||||
appEquipmentReqMapper.updateReturnDeviceData(dto,2);
|
mapper.updateReturnDeviceData(dto);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(),e);
|
log.error(e.toString(),e);
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,16 @@
|
||||||
package com.bonus.app.service.impl;
|
package com.bonus.app.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.annotation.AliasFor;
|
|
||||||
import com.bonus.app.mapper.CraneMonitorMapper;
|
import com.bonus.app.mapper.CraneMonitorMapper;
|
||||||
import com.bonus.app.service.ICraneMonitorService;
|
import com.bonus.app.service.ICraneMonitorService;
|
||||||
import com.bonus.common.core.constant.BusinessConstants;
|
import com.bonus.common.core.constant.BusinessConstants;
|
||||||
import com.bonus.common.core.utils.DateTimeHelper;
|
|
||||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.entity.app.AppParamsDto;
|
import com.bonus.common.entity.app.AppParamsDto;
|
||||||
import com.bonus.common.entity.app.vo.DevInfoVo;
|
import com.bonus.common.entity.app.vo.DevInfoVo;
|
||||||
import com.bonus.common.entity.app.vo.DevWarnVo;
|
import com.bonus.common.entity.app.vo.DevWarnVo;
|
||||||
import com.bonus.common.entity.app.vo.JdConfigVo;
|
import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
|
||||||
import com.bonus.common.security.utils.ValidatorsUtils;
|
import com.bonus.common.security.utils.ValidatorsUtils;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -74,18 +72,16 @@ public class CraneMonitorServiceImpl implements ICraneMonitorService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getJdWarnList(AppParamsDto dto) {
|
public PageInfo<DevWarnVo> getJdWarnList(AppParamsDto dto) {
|
||||||
List<DevWarnVo> list = new ArrayList<>();
|
List<DevWarnVo> list = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
dto.setDevType(BusinessConstants.JD);
|
dto.setDevType(BusinessConstants.JD);
|
||||||
// 告警数据默认展示当天,不需要加日期限制可去掉
|
|
||||||
dto.setStartTime(DateTimeHelper.getNowDay());
|
|
||||||
dto.setEndTime(DateTimeHelper.getNowDay());
|
|
||||||
list = mapper.getJdWarnList(dto);
|
list = mapper.getJdWarnList(dto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
return AjaxResult.success(list);
|
PageInfo<DevWarnVo> pageInfo = new PageInfo<>(list);
|
||||||
|
return pageInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -39,11 +39,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="returnHelmet">
|
<update id="returnHelmet">
|
||||||
UPDATE tb_sh_use SET unbid_time = #{backTime} ,time_type = 0 WHERE id = #{id}
|
UPDATE tb_sh_use SET unbid_time = #{backTime} ,time_type = 0 WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<!--更新设备领用表 归还状态-->
|
||||||
|
<update id="updateReturnDeviceData">
|
||||||
|
UPDATE tb_dev_ly SET ly_user = null,ly_status = null,ly_time = null,user_type = null WHERE dev_id = #{devId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<!--智能安全帽列表-->
|
<!--智能安全帽列表-->
|
||||||
<select id="getSafetyHatLists" resultType="com.bonus.common.entity.app.vo.SafetyHatVo">
|
<select id="getSafetyHatLists" resultType="com.bonus.common.entity.app.vo.SafetyHatVo">
|
||||||
SELECT td.dev_name AS devName,
|
SELECT tdub.dev_name AS devName,
|
||||||
td.dev_code AS devCode,
|
tdub.dev_code AS devCode,
|
||||||
tdub.id AS id,
|
tdub.id AS id,
|
||||||
tdub.dev_id AS devId,
|
tdub.dev_id AS devId,
|
||||||
tdub.ly_time AS lyTime,
|
tdub.ly_time AS lyTime,
|
||||||
|
|
@ -52,18 +56,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
tpe.phone,
|
tpe.phone,
|
||||||
tdu.team_id AS teamId,
|
tdu.team_id AS teamId,
|
||||||
twt.team_name AS teamName,
|
twt.team_name AS teamName,
|
||||||
IF(tdl.ly_user IS NULL,0,1) AS useStatus,
|
IF(tsu.id IS NULL,0,1) AS useStatus,
|
||||||
tdu.pro_id AS proId,
|
tdu.pro_id AS proId,
|
||||||
tdu.gt_id AS gtId,
|
tdu.gt_id AS gtId,
|
||||||
tsu.id AS bidId
|
tsu.id AS bidId
|
||||||
FROM tb_dev_use tdu
|
FROM tb_dev_use tdu
|
||||||
LEFT JOIN t_work_team twt ON tdu.team_id = twt.team_id AND twt.del_flag = 0
|
|
||||||
LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
|
LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
|
||||||
LEFT JOIN tb_sh_use tsu ON tdub.id = tsu.use_id AND tdub.dev_id = tsu.dev_id AND tsu.bid_type = 2 AND tsu.time_type = 1
|
LEFT JOIN tb_sh_use tsu ON tdub.id = tsu.use_id AND tdub.dev_id = tsu.dev_id AND tsu.bid_type = 2 AND tsu.time_type = 1
|
||||||
LEFT JOIN tb_dev_ly tdl ON tdub.dev_id = tdl.dev_id
|
LEFT JOIN t_work_team twt ON tdu.team_id = twt.team_id AND twt.del_flag = 0
|
||||||
LEFT JOIN tb_people tpe ON tdl.ly_user = tpe.id AND tpe.del_flag = 0
|
LEFT JOIN tb_people tpe ON tsu.bid_id = tpe.id AND tpe.del_flag = 0
|
||||||
LEFT JOIN tb_project tp ON tp.id = tdu.pro_id AND tp.del_flag = 0
|
LEFT JOIN tb_project tp ON tp.id = tdu.pro_id AND tp.del_flag = 0
|
||||||
LEFT JOIN tb_device td ON tdub.dev_id = td.id AND td.del_flag = 0
|
|
||||||
<where>
|
<where>
|
||||||
<if test="teamName!=null and teamName!=''">
|
<if test="teamName!=null and teamName!=''">
|
||||||
INSTR(twt.team_name,#{teamName}) > 0
|
INSTR(twt.team_name,#{teamName}) > 0
|
||||||
|
|
@ -71,16 +73,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="useName!=null and useName!=''">
|
<if test="useName!=null and useName!=''">
|
||||||
AND INSTR(tpe.name,#{useName}) > 0
|
AND INSTR(tpe.name,#{useName}) > 0
|
||||||
</if>
|
</if>
|
||||||
<if test="roleCode!='team' and roleCode!='administrators'">
|
<if test="roleCode!='team' and roleCode!='depart' and roleCode!='administrators'">
|
||||||
AND tdu.team_id = -1
|
AND tdu.team_id = -1
|
||||||
</if>
|
</if>
|
||||||
<if test="roleCode=='team'">
|
<if test="roleCode=='team'">
|
||||||
AND tdu.team_id = #{teamId} AND tdub.gh_time IS NULL
|
AND tdu.team_id = #{teamId}
|
||||||
</if>
|
</if>
|
||||||
<if test="roleCode=='depart'">
|
<if test="roleCode=='depart'">
|
||||||
AND tp.depart_id = #{departId} AND tdl.ly_user IS NOT NULL
|
AND tp.depart_id = #{departId} AND tsu.id IS NOT NULL
|
||||||
</if>
|
</if>
|
||||||
AND td.dev_type = 'aqm' AND tdu.del_flag = 0
|
AND tdub.dev_type = 'aqm' AND tdub.gh_time IS NULL AND tdu.del_flag = 0
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -48,10 +48,8 @@ public class PersonMgeController extends BaseController {
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
@SysLog(title = "人员管理", businessType = OperaType.QUERY, logType = 0, module = "基础管理->人员管理", details = "查询人员列表")
|
@SysLog(title = "人员管理", businessType = OperaType.QUERY, logType = 0, module = "基础管理->人员管理", details = "查询人员列表")
|
||||||
public TableDataInfo list(BraceletParamsDto dto) {
|
public TableDataInfo list(BraceletParamsDto dto) {
|
||||||
System.err.println("开始" + DateTimeHelper.getNowTime());
|
|
||||||
startPage();
|
startPage();
|
||||||
TableDataInfo tableDataInfo = service.getPersonLists(dto);
|
TableDataInfo tableDataInfo = service.getPersonLists(dto);
|
||||||
System.err.println("结束" + DateTimeHelper.getNowTime());
|
|
||||||
return tableDataInfo;
|
return tableDataInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue