Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-07-15 10:23:10 +08:00
commit 5707d6948f
13 changed files with 114 additions and 33 deletions

View File

@ -98,7 +98,6 @@ public class AbilityCenterControllerV2 {
}
final String applyFlag = UUID.randomUUID().toString();
abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识
// String applyNumber = codeGenerationUtils.getApplyNumber("NLSY");
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
final UserDetail user = SecurityUser.getUser();
@ -108,7 +107,6 @@ public class AbilityCenterControllerV2 {
return null;
}
TAbilityApplicationDTO tAbilityApplicationDTO = new TAbilityApplicationDTO();
// tAbilityApplicationDTO.setApplyNumber(applyNumber);
tAbilityApplicationDTO.setArea(abilityBatchApplicationDTO.getArea());
tAbilityApplicationDTO.setAttachment(abilityBatchApplicationDTO.getAttachment());
tAbilityApplicationDTO.setBasis(abilityBatchApplicationDTO.getBasis());

View File

@ -14,15 +14,15 @@ public enum TDemandDataEntityFlag {
/**
* 1:审批中
*/
UNDER_REVIEW(1, ""),
UNDER_REVIEW(1, ""),
/**
* 2审批拒绝
*/
REJECT(2, "审批拒绝"),
REJECT(2, "拒绝"),
/**
* 3:审批通过
*/
APPROVE(3, "审批通过"),
APPROVE(3, "通过"),
/**
* 4:未知
*/

View File

@ -11,7 +11,7 @@ public enum TDemandCommentEntityDelFlag {
/**
* 正常
*/
NORMAL(0, "正常"),
NORMAL(0, "通过"),
/**
* 已删除
*/

View File

@ -638,14 +638,26 @@ public class Controller {
if (null != labelCodes && labelCodes.length > 0) {
list1 = Arrays.asList(labelCodes);
}
List<Map> list = cameraChannelMapper.selectByParentIdNew(queryMap, list1);
//查询当前地区及下级地区的id,组成list,2022-07-14,ytl
List<Map> orgenIds = monitorService.listChildOrgenIds(new ArrayList<Map>(), queryMap.get("parentId").toString());
List<Map> list = cameraChannelMapper.selectByParentIdNew(queryMap, list1,orgenIds);
Result success = Result.success(list);
success.setCount(cameraChannelMapper.selectByParentIdCountNew(queryMap, list1));
success.setCount(cameraChannelMapper.selectByParentIdCountNew(queryMap, list1,orgenIds));
return success;
}
//测试获取某个地区 及旗下的所有地区id
@GetMapping("listChildOrgenIds")
public Result listChildOrgenIds(String id){
List<Map> list = new ArrayList<>();
List<Map> maps = monitorService.listChildOrgenIds(list, id);
return Result.success(maps);
}
/**
* 摄像头按照市区进行聚合查询
*/

View File

@ -0,0 +1,36 @@
package io.renren.modules.monitor.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("t_camera_channel01")
public class CameraChannelNew {
@TableId
private Long idtCameraChannel;
private String channelCode;
private String channelId;
private String channelName;
private String gpsX;
private String gpsY;
private Integer status;//1在线0离线
private String nodeName;
private Integer checkStatus;//1正常0异常
private String parentId;
private String regionCode;
private String regionName;
}

View File

@ -64,9 +64,9 @@ public interface CameraChannelMapper extends BaseDao<CameraChannel> {
Integer selectChannelCounts(@Param("path") String path);
List<Map> selectByParentIdNew(@Param("map") Map queryMap, @Param("labelCodes") List labelCodes);
List<Map> selectByParentIdNew(@Param("map") Map queryMap, @Param("labelCodes") List labelCodes,@Param("orgenIds") List<Map> orgenIds);
Integer selectByParentIdCountNew(@Param("map") Map queryMap, @Param("labelCodes") List labelCodes);
Integer selectByParentIdCountNew(@Param("map") Map queryMap, @Param("labelCodes") List labelCodes,@Param("orgenIds") List<Map> orgenIds);
List<Map> selectChannelNumByRegion();
}

View File

@ -17,12 +17,15 @@ public interface CameraOrgenizationMapper extends BaseDao<CameraOrganization> {
@Select("select * from t_camera_organization where parent_id = #{parentId}")
List<CameraOrganization> selectSubOrganization(@Param("parentId") String parentId);
@Select("select * channelCount from t_camera_organization02 where parent_id = #{parentId}")
@Select("select * from t_camera_organization02 where parent_id = #{parentId}")
List<Map> selectSubOrganizationMap(@Param("parentId") String parentId);
@Select("select name,parent_id,id from t_camera_organization02 where parent_id = #{parentId}")
List<Map> selectSubOrganizationMapByPid(@Param("parentId") String parentId);
void batchSaveOrgenization(List<Map> list);
@Select("SELECT name,parent_id FROM t_camera_organization02 WHERE id = #{id}")
@Select("SELECT name,parent_id,id FROM t_camera_organization02 WHERE id = #{id}")
Map selectOrgenizationById(@Param("id") String id);
@Update("UPDATE t_camera_organization02 SET path = TRIM( TRAILING '->' FROM #{path}) where id = #{id}")

View File

@ -1243,6 +1243,18 @@ public class MonitorService {
setNodeName(map,map2.get("parent_id").toString());
}
}
public List<Map> listChildOrgenIds(List<Map> list,String id){
Map orgenNow = cameraOrgenMapper.selectOrgenizationById(id);
list.add(orgenNow);
List<Map> childs = cameraOrgenMapper.selectSubOrganizationMapByPid(id);
if(childs.size() > 0){
childs.forEach(child->{
listChildOrgenIds(list,child.get("id").toString());
});
}
return list;
}
}

View File

@ -88,7 +88,9 @@ public class TAbilityApplicationController {
@ApiImplicitParams({@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")})
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "ended", value = "是否完成(true, false)", paramType = "query", dataType = "String")}
)
public Result<PageData<TAbilityApplicationDTO>> myPage(@ApiIgnore @RequestParam Map<String, Object> params) {
final UserDetail user = SecurityUser.getUser();
params.put("abilityprocess_v2", Boolean.TRUE); // 是否根据流程 abilityprocess_v2 来分页

View File

@ -88,4 +88,7 @@ public class TAbilityApplicationDTO extends AuditingBaseDTO implements Serializa
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "整个申请单是否结束")
private boolean isEnded;
}

View File

@ -61,6 +61,9 @@ public class TAbilityApplicationV2DTO implements Serializable {
@ApiModelProperty(value = "申请单号")
private String applyNumber;
@ApiModelProperty(value = "整个申请单是否结束")
private boolean isEnded;
// 以上为申请时公共信息
@ApiModelProperty(value = "资源申请情况(包含资源信息和流程流转)")

View File

@ -37,7 +37,6 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
.isNotNull(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_number");
wrapper.groupBy(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_flag")
.groupBy(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_number");
wrapper.orderByDesc("apply_number"); // 流程排序
break;
case "user_id":
wrapper.eq(params.get("user_id") != null, "user_id", Long.valueOf(params.get("user_id").toString()));
@ -45,9 +44,19 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl<TAbilityAppl
case "apply_flag":
wrapper.eq(params.get("apply_flag") != null, "apply_flag", params.get("apply_flag").toString());
break;
case "ended":
boolean ended = Boolean.valueOf(params.get("ended").toString());
if (ended) {
wrapper.notExists("SELECT 1 FROM t_ability_application t1 WHERE t1.apply_flag = t_ability_application.apply_flag AND approve_status = '审核中'");
} else {
wrapper.exists("SELECT 1 FROM t_ability_application t1 WHERE t1.apply_flag = t_ability_application.apply_flag AND approve_status = '审核中'");
}
break;
}
});
// wrapper.orderByDesc("cre"); // 流程排序
if (params.containsKey("abilityprocess_v2")) {
wrapper.orderByDesc("apply_number"); // 流程排序
}
return wrapper;
}

View File

@ -121,9 +121,12 @@
WHERE b.path like concat(#{path},'%')
</select>
<select id="selectByParentIdNew" resultType="java.util.Map">
SELECT
tcc.*
tcc.channel_code as channelCode,tcc.channel_id as channelId,tcc.channel_name as channelName,
tcc.check_status as checkStatus,tcc.gps_x as gpsX,tcc.gps_y as gpsY,tcc.idt_camera_channel as idtCameraChannel,
tcc.node_name as nodeName,tcc.parent_id as parentId,tcc.status as status
<if test = "(map.gpsX != null and map.gpsX != '') and (map.gpsY != null and map.gpsY != '')">
, 6371 * 1000 * acos(cos(radians( ${map.gpsY} ))
* cos(radians( tcc.gps_y ))
@ -138,9 +141,11 @@
JOIN t_label tl ON tl.label_code = tcml.label_code
</if>
WHERE 1 = 1
<if test = "map.parentId != null and map.parentId != ''">
AND tcc.parent_id = #{map.parentId}
</if>
AND tcc.parent_id IN
<foreach collection="orgenIds" item="item" open="(" separator="," close=")">
#{item.id}
</foreach>
AND tcc.check_status IN (${map.checkStatus})
AND tcc.gps_x != ''
AND tcc.gps_y != ''
@ -166,8 +171,9 @@
</if>
</select>
<select id="selectByParentIdNew" resultType="java.util.Map">
<select id="selectByParentIdCountNew" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM (
SELECT
tcc.*
<if test = "(map.gpsX != null and map.gpsX != '') and (map.gpsY != null and map.gpsY != '')">
@ -184,14 +190,13 @@
JOIN t_label tl ON tl.label_code = tcml.label_code
</if>
WHERE 1 = 1
<if test = "map.parentId != null and map.parentId != ''">
AND tcc.parent_id = #{map.parentId}
</if>
AND tcc.parent_id IN
<foreach collection="orgenIds" item="item" open="(" separator="," close=")">
#{item.id}
</foreach>
AND tcc.check_status IN (${map.checkStatus})
AND tcc.gps_x != ''
AND tcc.gps_y != ''
AND tcc.gps_x IS NOT NULL
AND tcc.gps_y IS NOT NULL
<if test = "map.cameraName != null and map.cameraName != ''">
AND tcc.channel_name LIKE CONCAT('%',#{map.cameraName},'%')
</if>
@ -206,13 +211,11 @@
distance &lt; ${map.radius}
ORDER BY
distance
</if>
<if test = "map.pageNum != null and map.pageSize != null">
LIMIT ${map.pageNum}, ${map.pageSize}
</if>
</if> ) temp
</select>
<select id="selectChannelNumByRegion" resultType="java.util.Map">
SELECT COUNT(idt_camera_channel) AS channelNum,region_code,region_name FROM t_camera_channel01 GROUP BY region_code,region_name
SELECT ROUND(COUNT(idt_camera_channel) /10000,1) AS channelCount,region_code,region_name FROM t_camera_channel01 WHERE region_name is not null GROUP BY region_code,region_name
</select>
</mapper>