修改数据接口
This commit is contained in:
parent
0e662b426b
commit
db403afa05
|
|
@ -12,6 +12,9 @@ public class TokenConstants
|
|||
*/
|
||||
public static final String AUTHENTICATION = "Authorization";
|
||||
|
||||
|
||||
public static final String FILE_TOKEN = "fileToken";
|
||||
|
||||
/**
|
||||
* 令牌前缀
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class TokenService {
|
|||
*/
|
||||
public Map<String, Object> createToken(LoginUser loginUser) {
|
||||
// 检查并删除已有的token
|
||||
delExistingToken(loginUser.getSysUser().getUserId());
|
||||
// delExistingToken(loginUser.getSysUser().getUserId());
|
||||
String token = IdUtils.fastUUID();
|
||||
Long userId = loginUser.getSysUser().getUserId();
|
||||
String userName = loginUser.getSysUser().getUserName();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.gateway.filter;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.bonus.common.core.constant.CacheConstants;
|
||||
import com.bonus.common.core.constant.HttpStatus;
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
|
|
@ -21,6 +22,8 @@ import org.springframework.stereotype.Component;
|
|||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import static org.bouncycastle.asn1.x500.style.RFC4519Style.o;
|
||||
|
||||
/**
|
||||
* 网关鉴权
|
||||
*
|
||||
|
|
@ -130,6 +133,14 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
// 如果前端设置了令牌前缀,则裁剪掉前缀
|
||||
if (StringUtils.isNotEmpty(token) && token.startsWith(TokenConstants.PREFIX)) {
|
||||
token = token.replaceFirst(TokenConstants.PREFIX, StringUtils.EMPTY);
|
||||
}else{
|
||||
if(StringUtils.isEmpty(token)){
|
||||
Object o= request.getQueryParams().getFirst(TokenConstants.FILE_TOKEN);
|
||||
if(o!=null){
|
||||
token=o.toString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,4 +85,8 @@ public class DeviceTypeController extends BaseController {
|
|||
return service.querySelected();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,4 +109,14 @@ public class TtSysTeamController extends BaseController {
|
|||
log.info("导出失败",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询班组下拉选·")
|
||||
@PostMapping("querySelected")
|
||||
public AjaxResult querySelected() {
|
||||
return ttSysTeamService.querySelected();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,4 +82,11 @@ public class UnitController extends BaseController {
|
|||
List<UnitVo> list = service.queryUnitList(vo);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "查询施工单位下拉选")
|
||||
@PostMapping("querySelected")
|
||||
public AjaxResult querySelected() {
|
||||
return service.querySelected();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,13 @@ import java.util.List;
|
|||
@Data
|
||||
public class TtSysUserVo {
|
||||
|
||||
private String age;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
private String workTypeName;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
|
|
@ -126,7 +133,6 @@ public class TtSysUserVo {
|
|||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
/**
|
||||
*是否关键人员0:是,1否
|
||||
*/
|
||||
|
|
@ -136,4 +142,6 @@ public class TtSysUserVo {
|
|||
* 出入场信息
|
||||
*/
|
||||
List<TtPersonnelEntryExitVo> ttPersonnelEntryExitVoList;
|
||||
|
||||
private String proId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,4 +54,10 @@ public interface IUnitMapper {
|
|||
* @date 2025/4/10 17:52
|
||||
*/
|
||||
UnitVo detailUnit(UnitVo vo);
|
||||
|
||||
/**
|
||||
* 查询1单位下拉选
|
||||
* @return
|
||||
*/
|
||||
List<UnitVo> querySelected();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,35 @@ import com.bonus.base.basic.domain.vo.TtSysTeamVo;
|
|||
import java.util.List;
|
||||
|
||||
public interface TtSysTeamMapper {
|
||||
/**
|
||||
* 分页查询班组数据集合
|
||||
* @param ttSysTeamReqVo
|
||||
* @return
|
||||
*/
|
||||
List<TtSysTeamVo> getTtSysTeamList(TtSysTeamReqVo ttSysTeamReqVo);
|
||||
|
||||
/**
|
||||
* 新增班组
|
||||
* @param ttSysTeamVo
|
||||
*/
|
||||
void addTtSysTeam(TtSysTeamVo ttSysTeamVo);
|
||||
|
||||
/**
|
||||
* 依据id查询班组
|
||||
* @param ttSysTeamReqVo
|
||||
* @return
|
||||
*/
|
||||
TtSysTeamVo getTtSysTeamById(TtSysTeamReqVo ttSysTeamReqVo);
|
||||
|
||||
/**
|
||||
* 修改班组数据
|
||||
* @param ttSysTeamVo
|
||||
*/
|
||||
void updateTtSysTeam(TtSysTeamVo ttSysTeamVo);
|
||||
|
||||
/**
|
||||
* 查询班组下拉选集合
|
||||
* @return
|
||||
*/
|
||||
List<TtSysTeamVo> querySelected();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,4 +57,10 @@ public interface IUnitService {
|
|||
* @date 2025/4/10 17:50
|
||||
*/
|
||||
AjaxResult detailUnit(UnitVo vo);
|
||||
|
||||
/**
|
||||
* 施工单位下拉选查询
|
||||
* @return
|
||||
*/
|
||||
AjaxResult querySelected();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.base.basic.service;
|
|||
|
||||
import com.bonus.base.basic.domain.TtSysTeamReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtSysTeamVo;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -37,4 +38,10 @@ public interface TtSysTeamService {
|
|||
* @param ttSysTeamVo
|
||||
*/
|
||||
void deleteTtSysTeam(TtSysTeamVo ttSysTeamVo);
|
||||
|
||||
/**
|
||||
* 查询班组下拉选
|
||||
* @return
|
||||
*/
|
||||
AjaxResult querySelected();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ public class DevModelServiceImpl implements DevModelService {
|
|||
if(StringHelper.isNullOrEmptyString(devId)){
|
||||
return AjaxResult.error("请选择需要绑定的设备");
|
||||
}else{
|
||||
mapper.deleteModelDev(vo);
|
||||
// mapper.deleteModelDev(vo);
|
||||
List<String> list= Arrays.asList(vo.getDevId().split(","));
|
||||
vo.setDevList(list);
|
||||
int num=mapper.bindDevice(vo);
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@ import com.bonus.base.basic.domain.vo.TtSysUserVo;
|
|||
import com.bonus.base.basic.mapper.TtSysTeamMapper;
|
||||
import com.bonus.base.basic.service.TtSysTeamService;
|
||||
import com.bonus.base.basic.service.TtSysUserService;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
|
@ -100,4 +102,19 @@ public class TtSysTeamServiceImpl implements TtSysTeamService {
|
|||
//修改班组信息
|
||||
ttSysTeamMapper.updateTtSysTeam(ttSysTeamVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班组下拉选
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult querySelected() {
|
||||
try{
|
||||
List<TtSysTeamVo> list=ttSysTeamMapper.querySelected();
|
||||
return AjaxResult.success(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,4 +122,20 @@ public class UnitServiceImpl implements IUnitService {
|
|||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult querySelected() {
|
||||
try {
|
||||
List<UnitVo> list=mapper.querySelected();
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
||||
}
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class ScreenDevModelController {
|
|||
|
||||
@ApiOperation(value = "设备检测数据集合")
|
||||
@PostMapping("getAttrList")
|
||||
public AjaxResult getAttrList(ParamVo vo) {
|
||||
public AjaxResult getAttrList(@RequestBody ParamVo vo) {
|
||||
return service.getAttrList(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
|
@ -16,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
*/
|
||||
@Api(tags = "劳务分包实体类控制层")
|
||||
@RestController
|
||||
@RequestMapping("/subContract")
|
||||
@RequestMapping("/screen/subContract")
|
||||
public class SubContractController {
|
||||
|
||||
|
||||
|
|
@ -52,18 +53,18 @@ public class SubContractController {
|
|||
}
|
||||
@ApiOperation(value = "查询近七日施工人员曲线图")
|
||||
@PostMapping("getUserNumByWeek")
|
||||
public AjaxResult getUserNumByWeek(SubContractVo vo) {
|
||||
public AjaxResult getUserNumByWeek( SubContractVo vo) {
|
||||
return service.getUserNumByWeek(vo);
|
||||
}
|
||||
@ApiOperation(value = "查询关键岗位人员数据")
|
||||
@PostMapping("getImportPostUser")
|
||||
public AjaxResult getImportPostUser(SubContractVo vo) {
|
||||
public AjaxResult getImportPostUser( SubContractVo vo) {
|
||||
return service.getImportPostUser(vo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询施工人员打卡记录")
|
||||
@PostMapping("getUserCheckList")
|
||||
public AjaxResult getUserCheckList(SubContractVo vo) {
|
||||
public AjaxResult getUserCheckList( SubContractVo vo) {
|
||||
return service.getUserCheckList(vo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ public class TowerCraneDetectionServiceImpl implements TowerCraneDetectionServic
|
|||
public List<ConstInfoVo> getConstDeviceList(ConstInfoVo constInfoVo) {
|
||||
//设置查询类型
|
||||
constInfoVo.setTypeCode(TypeCodeUtils.TC_CODE);
|
||||
List<ConstInfoVo> collectDevVoList = mapper.getConstDeviceList(constInfoVo);
|
||||
return collectDevVoList;
|
||||
return mapper.getConstDeviceList(constInfoVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
</select>
|
||||
<select id="getAttrList" resultType="com.bonus.base.screen.domain.MapValueVo">
|
||||
select his.attr_val,DATE_FORMAT(his.create_time,'%H:%i')
|
||||
select his.attr_val value,DATE_FORMAT(his.create_time,'%H:%i') name
|
||||
from tb_collect_device_his his
|
||||
LEFT JOIN tb_collect_device_attr cda on cda.attr_id=his.attr_id
|
||||
where cda.dev_id=#{devId} and cda.attr_code=#{code}
|
||||
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
|
||||
and his.create_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
ORDER BY his.create_time desc
|
||||
ORDER BY his.create_time ASC
|
||||
LIMIT #{limit}
|
||||
</select>
|
||||
<select id="getWarnInfo" resultType="com.bonus.base.screen.domain.WarnInfoVo">
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
|
||||
<select id="getSgUserByUnit" resultType="com.bonus.base.screen.domain.MapValueVo">
|
||||
select count(1) value,unit.unit_type name
|
||||
select count(1) value,IFNULL(unit.unit_type,'其他') name
|
||||
from tt_sys_user tsu
|
||||
left join tt_sys_unit unit on tsu.unit_id=unit.id
|
||||
where tsu.del_flag=0
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tci.`name`,
|
||||
tci.`code`,
|
||||
tcd.is_online,
|
||||
tcd.dev_location
|
||||
tcd.dev_location,
|
||||
tci.config_data
|
||||
FROM
|
||||
tb_const_info tci
|
||||
LEFT JOIN tb_collect_device tcd ON tci.id = tcd.const_id
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select team_name as teamName, user_id as userId,team_type as teamtype,unit_name as unitName,
|
||||
create_time as createTime,del_flag as delFlag,remark as remark,id sa id
|
||||
from tt_sys_team
|
||||
where 1=1
|
||||
where 1=1 and del_flag=0
|
||||
<if test="teamName != '' and teamName != null"> and team_name = #{teamName}</if>
|
||||
<if test="teamType != '' and teamType != null"> and team_type = #{teamType}</if>
|
||||
<if test="unitName != '' and unitName != null"> and unit_name = #{unitName}</if>
|
||||
|
|
@ -59,6 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select team_name as teamName, user_id as userId,team_type as teamtype,unit_name as unitName,
|
||||
create_time as createTime,del_flag as delFlag,remark as remark,id sa id
|
||||
from tt_sys_team
|
||||
where del_flag = '1' and id =#{id}
|
||||
where id =#{id}
|
||||
</select>
|
||||
<!--查询班组下拉选集合-->
|
||||
<select id="querySelected" resultType="com.bonus.base.basic.domain.vo.TtSysTeamVo">
|
||||
SELECT id,team_name teamName
|
||||
from tt_sys_team
|
||||
where del_flag=0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -8,9 +8,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="workTypeName != null and workTypeName != ''">work_type_name,</if>
|
||||
<if test="userPhone != null">user_phone,</if>
|
||||
<if test="idCar != null and idCar != ''">id_car,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="teamId != null and teamId != ''">team_id,</if>
|
||||
<if test="carImage != null and carImage != ''">car_image,</if>
|
||||
<if test="postUnit != null and postUnit != ''">post_unit,</if>
|
||||
<if test="workType != null and workType != ''">work_type,</if>
|
||||
|
|
@ -22,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="startTime != null and startTime != ''">start_time,</if>
|
||||
<if test="endTime != null and endTime != ''">end_time,</if>
|
||||
<if test="photos != null and photos != ''">photos,</if>
|
||||
<if test="age != null and age != ''">age,</if>
|
||||
<if test="keyPersonnel != null and keyPersonnel != ''">key_personnel,</if>
|
||||
create_time,
|
||||
del_flag,
|
||||
|
|
@ -30,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="workTypeName != null and workTypeName != ''">#{workTypeName},</if>
|
||||
<if test="userPhone != null">#{userPhone},</if>
|
||||
<if test="idCar != null and idCar != ''">#{idCar},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
|
|
@ -43,8 +47,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="issAuth != null and issAuth != ''">#{issAuth},</if>
|
||||
<if test="startTime != null and startTime != ''">#{startTime},</if>
|
||||
<if test="endTime != null and endTime != ''">#{remark},</if>
|
||||
<if test="endTime != null and endTime != ''">#{endTime},</if>
|
||||
<if test="photos != null and photos != ''">#{photos},</if>
|
||||
<if test="age != null and age != ''">#{age},</if>
|
||||
<if test="keyPersonnel != null and keyPersonnel != ''">#{keyPersonnel},</if>
|
||||
NOW(),
|
||||
1,
|
||||
|
|
@ -61,8 +66,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="userPhone != null">user_phone = #{userPhone},</if>
|
||||
<if test="workTypeName != null and workTypeName != ''">work_type_name=#{workTypeName},</if>
|
||||
<if test="idCar != null">id_car = #{idCar},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="age != null and age != ''">age=#{age},</if>
|
||||
<if test="teamId != null">team_id = #{teamId},</if>
|
||||
<if test="carImage != null">car_image = #{carImage},</if>
|
||||
<if test="postUnit != null">post_unit = #{postUnit},</if>
|
||||
|
|
@ -100,13 +107,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<select id="getTtSysUserList" resultType="com.bonus.base.basic.domain.vo.TtSysUserVo">
|
||||
select tsu.id as id,tsu.user_name as userName,tsu.user_phone as userPhone,tsu.id_car as idCar,
|
||||
tsu.unit_id as unitId,tsu.team_id as teamId,tsu.car_image as carImage,tsu.post_unit as postUnit,
|
||||
tsu.work_type as workType,tsu.birthday as birthday,tsu.sex as sex,tsu.nationality as nationality,
|
||||
tsu.address as address,tsu.iss_auth as issAuth,tsu.start_time as startTime,tsu.end_time as endTime,
|
||||
tsu.photos as photos,tsu.status as status,tsu.key_personnel as keyPersonnel,
|
||||
tsu2.unit_name as unitName
|
||||
tsu.unit_id as unitId,tsu.team_id as teamId,tsu.car_image as carImage,tsu.post_unit as postUnit,
|
||||
tsu.work_type as workType,tsu.birthday as birthday,tsu.sex as sex,tsu.nationality as nationality,
|
||||
tsu.address as address,tsu.iss_auth as issAuth,tsu.start_time as startTime,tsu.end_time as endTime,
|
||||
tsu.photos as photos,tsu.status as status,tsu.key_personnel as keyPersonnel,
|
||||
tsu2.unit_name as unitName,sdd.dict_label
|
||||
from tt_sys_user tsu
|
||||
left join tt_sys_unit tsu2 on tsu.unit_id = tsu2.id
|
||||
|
||||
|
||||
left JOIN sys_dict_data sdd on sdd.dict_value=tsu.work_type
|
||||
left JOIN sys_dict_data sdd2 on sdd2.dict_value=tsu.post_unit and sd2.dict_type
|
||||
|
||||
where del_flag=1
|
||||
<if test="id != null"> and tsu.id = #{id}</if>
|
||||
<if test="status != null"> and tsu.status = #{status}</if>
|
||||
|
|
|
|||
|
|
@ -120,4 +120,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM tt_sys_unit
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
<select id="querySelected" resultType="com.bonus.base.basic.domain.vo.UnitVo">
|
||||
SELECT id,
|
||||
unit_name AS unitName,
|
||||
unit_type unitType
|
||||
FROM tt_sys_unit
|
||||
where is_active=1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -35,7 +35,7 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
registry.addResourceHandler(localFilePrefix + "/**")
|
||||
.addResourceLocations("file:" + localFilePath + File.separator);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开启跨域
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue