Commit c17d2b80 authored by chenhao's avatar chenhao

Merge branch 'developer' into chenhao

parents 750fe7d2 3fa2ff39
......@@ -149,26 +149,27 @@ public class AircraftDto extends BaseDto {
@ApiModelProperty(value = "备注")
private String remark;
@ExcelProperty(value = "外观图", index = 28)
@ExcelIgnore // BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "外观图")
private String appearanceImages;
@ExcelProperty(value = "平面图", index = 29)
@ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "平面图")
private String planeImages;
@ExcelProperty(value = "救援图", index = 30)
@ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "救援图")
private String rescueImages;
@ExcelProperty(value = "方位图", index = 31)
@ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "方位图")
private String positionImages;
@ExcelProperty(value = "三维模型", index = 32)
@ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "三维模型")
private String models;
@ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "现场图片")
private List<String> scenePicture;
......
......@@ -30,6 +30,9 @@ public class FireChemicalServiceImpl extends BaseService<FireChemicalDto,FireChe
*/
@Override
public Page<FireChemicalDto> queryForFireChemicalPage(Page<FireChemicalDto> page, @Condition(Operator.like) String casNo, @Condition(Operator.like)String formula, @Condition(Operator.like)String name, String typeCode,boolean isDelete) {
if(typeCode.equals("-1")) { // bug 2673 选择 -1 时候没有查出所有危化品处理 by kongfm
typeCode = null;
}
return this.queryForPage(page, "", false,casNo, formula, name, typeCode, isDelete);
}
......
......@@ -69,7 +69,7 @@ public interface PlanTaskMapper extends BaseMapper {
* @param params
* @return
*/
List<HashMap<String, Object>> getPlanTasks(HashMap<String, Object> params);
List<Map<String, Object>> getPlanTasks(HashMap<String, Object> params);
/**
* 通过计划任务Id获得计划任务信息
* @param planTaskId
......@@ -121,6 +121,12 @@ public interface PlanTaskMapper extends BaseMapper {
* @return
*/
List<CheckChkExListBo> getChkExList(CheckPtListPageParam param);
/**
* 任务分页查询数量
* @param params 参数
* @return long
*/
long getPlanTasksCount(HashMap<String, Object> params);
Map<String, Object> getPlanTaskStatisticsForApp(HashMap<String, Object> params);
......
......@@ -79,7 +79,7 @@ public interface IPlanTaskService {
* @param params
* @return
*/
Page<HashMap<String, Object>> getPlanTasks(String toke,String product,String appKey,HashMap<String, Object> params);
Page<Map<String, Object>> getPlanTasks(String toke,String product,String appKey,HashMap<String, Object> params);
/**
* 根据计划任务Id获取计划任务信息
......
package com.yeejoin.amos.patrol.business.util;
import java.util.HashMap;
import java.util.List;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.patrol.business.param.PlanTaskPageParam;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.enums.QueryOperatorEnum;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
public class PlanTaskPageParamUtil {
public static PlanTaskPageParam fillChkInfoParam(List<CommonRequest> queryRequests, CommonPageable commonPageable,
PlanTaskPageParam param, HashMap<String, Object> paramMap) {
for(int i=0;i<queryRequests.size();i++){
for (int i = 0; i < queryRequests.size(); i++) {
String name = queryRequests.get(i).getName();
if("pointNo".equals(name)){
if ("pointNo".equals(name)) {
param.setPointNo(toString(queryRequests.get(i).getValue()));
}else if("pointName".equals(name)){
} else if ("pointName".equals(name)) {
param.setPointName(toString(queryRequests.get(i).getValue()));
}else if("beginDate".equals(name)){
} else if ("beginDate".equals(name)) {
param.setBeginDate(toString(queryRequests.get(i).getValue()));
}else if("endDate".equals(name)){
} else if ("endDate".equals(name)) {
param.setEndDate(toString(queryRequests.get(i).getValue()));
}else if("status".equals(name)){
} else if ("status".equals(name)) {
param.setStatus(toString(queryRequests.get(i).getValue()));
}else if("planId".equals(name)){
} else if ("planId".equals(name)) {
param.setPlanId(toString(queryRequests.get(i).getValue()));
}else if("routeId".equals(name)){
} else if ("routeId".equals(name)) {
param.setRouteId(toString(queryRequests.get(i).getValue()));
}
}
param.setOrgCode(paramMap.get("orgCode") == null ? null:paramMap.get("orgCode").toString());
param.setUserId(paramMap.get("userId") == null ? null:paramMap.get("userId").toString());
param.setOrgCode(paramMap.get("orgCode") == null ? null : paramMap.get("orgCode").toString());
param.setUserId(paramMap.get("userId") == null ? null : paramMap.get("userId").toString());
if (!ObjectUtils.isEmpty(commonPageable)) {
param.setPageNumber(commonPageable.getPageNumber());
param.setPageSize(commonPageable.getPageSize());
......@@ -43,43 +42,40 @@ public class PlanTaskPageParamUtil {
}
private static String toString(Object value) {
if(null ==value || value ==""){
if (null == value || value == "") {
return null;
}else{
} else {
return value.toString();
}
}
public static HashMap<String, Object> fillPlanTask(List<CommonRequest> queryRequests,
public static void fillPlanTask(List<CommonRequest> queryRequests,
HashMap<String, Object> params) {
if (ObjectUtils.isEmpty(queryRequests)) {
return params;
return;
}
String order = "";
for(int i=0;i<queryRequests.size();i++){
String name = queryRequests.get(i).getName();
String type = queryRequests.get(i).getType();
if(type!=null && type!=""){
StringBuilder order = new StringBuilder();
for (CommonRequest queryRequest : queryRequests) {
String name = queryRequest.getName();
String type = queryRequest.getType();
if (type != null && !"".equals(type)) {
if (!QueryOperatorEnum.ORDER_BY.getName().equals(type)) {
params.put(name, queryRequests.get(i).getValue());
} else if (QueryOperatorEnum.ORDER_BY.getName().equals(type)) {
order +=name + " " + queryRequests.get(i).getValue();
params.put(name, queryRequest.getValue());
} else {
order.append(name).append(" ").append(queryRequest.getValue());
}
}else{
if(name.equals("orderBy") && queryRequests.get(i).getValue()!=null){
order += queryRequests.get(i).getValue();
} else {
if ("orderBy".equals(name) && queryRequest.getValue() != null) {
order.append(queryRequest.getValue());
}
params.put(name, queryRequests.get(i).getValue());
params.put(name, queryRequest.getValue());
}
}
if (!ObjectUtils.isEmpty(order)) {
params.put("orderBy", order);
}else{
if (!ObjectUtils.isEmpty(order.toString())) {
params.put("orderBy", order.toString());
} else {
params.put("orderBy", "beginTime ASC");
}
return params;
}
}
......@@ -26,6 +26,8 @@ mybatis.mapper-locations = classpath:db/mapper/*.xml
mybatis-plus.mapper-locations=classpath:db/mapper/*.xml
mybatis.type-aliases-package = com.yeejoin.amos.maintenance.business.entity.mybatis
mybatis.configuration.mapUnderscoreToCamelCase=true
#null值也返回
mybatis-plus.configuration.call-setters-on-nulls=true
spring.liquibase.changeLog=classpath:db/changelog/changelog-master.xml
spring.liquibase.enabled=true
......
package com.yeejoin.amos;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -19,15 +14,21 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.restful.config.JsonSerializerManage;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
/**
*
* <pre>
* 服务启动类
* </pre>
......@@ -44,15 +45,14 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
@EnableFeignClients
@EnableAsync
@EnableEurekaClient
@ComponentScan({"org.typroject","com.yeejoin.amos"})
@MapperScan(basePackages = { "com.yeejoin.amos.patrol.business.dao.mapper","org.typroject.tyboot.core.auth.face.orm.dao","com.yeejoin.amos.boot.biz.common.dao.mapper" })
public class PatrolApplication
{
@ComponentScan(value = {"org.typroject", "com.yeejoin.amos"}, excludeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {JsonSerializerManage.class})})
@MapperScan(basePackages = {"com.yeejoin.amos.patrol.business.dao.mapper", "org.typroject.tyboot.core.auth.face.orm.dao", "com.yeejoin.amos.boot.biz.common.dao.mapper"})
public class PatrolApplication {
private static final Logger logger = LoggerFactory.getLogger(PatrolApplication.class);
@Bean
@LoadBalanced
RestTemplate initRestTemplate() {
......@@ -66,8 +66,7 @@ public class PatrolApplication
* @throws IOException
* @throws URISyntaxException
*/
public static void main(String[] args) throws UnknownHostException
{
public static void main(String[] args) throws UnknownHostException {
logger.info("start Service..........");
ConfigurableApplicationContext context = SpringApplication.run(PatrolApplication.class, args);
GlobalExceptionHandler.setAlwaysOk(true);
......
......@@ -168,7 +168,6 @@
and SYSDATE() <![CDATA[>=]]> pt.begin_time
and SYSDATE() <![CDATA[<]]> pt.end_time
</select>
<select id="getPlanTasks" resultType="Map">
SELECT
a.planTaskId,
......@@ -185,7 +184,6 @@
a.userId executiveName,
a.userName,
a.userDept
<!-- (SELECT GROUP_CONCAT(`name`) FROM s_user where find_in_set(id,a.userId)>0 ORDER BY `id`) AS executiveName -->
FROM
(
SELECT
......@@ -202,7 +200,6 @@
pt.end_time,
'%Y-%m-%d %H:%i:%s'
) endTime,
date_format(
pt.check_date,
'%Y-%m-%d %H:%i:%s'
......@@ -219,79 +216,10 @@
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
) a
<where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="routeId != null and userId > 0 "> and a.route_id = #{routeId} </if>
<if test="checkDate != null and checkDate != '' "> and a.beginTime <![CDATA[<=]]> #{checkDate} and a.endTime <![CDATA[>=]]> #{checkDate} </if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="orgCode != null and orgCode !=''" >
and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} )
</if>
<choose>
<when test="departmentId != null and departmentId != 0 ">and a.userDept like concat('%', #{departmentId}, '%')</when>
<!-- <when test="departmentId == -1 and ids != null">and a.userId in-->
<!-- <foreach item="item" collection="ids" separator="," open="(" close=")" index="index">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </when>-->
</choose>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
a.beginTime <![CDATA[>=]]> #{startTime}
AND a.endTime <![CDATA[<=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{endTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>]]> #{startTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
)
</if>
<if test="query != null and query != '' ">
<if test="queryType != null and queryType != 'executiveName' and queryType != 'plan' ">
AND EXISTS (
SELECT
1
FROM
p_point pp
LEFT JOIN p_route_point rp ON rp.point_id = pp.id
LEFT JOIN p_route r ON r.id = rp.route_id
where a.route_id = r.id
<if test="queryType == null or queryType == '' or queryType == 'all' ">
AND CONCAT(pp.name, ',',r.name, ',', pp.point_no,a.taskName, ',', a.batchNo) LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'route' ">
AND r.name LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'point' ">
AND CONCAT(pp.name, ',', pp.point_no) LIKE concat('%', #{query}, '%')
</if>
)
</if>
<if test="queryType != null and queryType == 'executiveName' ">
AND a.userName LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'plan' ">
AND CONCAT(a.taskName, ',', a.batchNo) LIKE concat('%', #{query}, '%')
</if>
</if>
</where>
<if test="orderBy != null and orderBy != '' "> order by ${orderBy} </if>
<include refid="plan-task-app-where"/>
<if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
limit #{offset},#{pageSize}
</select>
<select id="getPlanTasksCount" resultType="long">
SELECT
count(1) tasksCount
......@@ -324,24 +252,18 @@
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
) a
<include refid="plan-task-app-where"/>
</select>
<sql id="plan-task-app-where">
<where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0 </if>
<if test="routeId != null and userId > 0 "> and a.route_id = #{routeId} </if>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="routeId != null and routeId > 0 "> and a.route_id = #{routeId} </if>
<if test="checkDate != null and checkDate != '' "> and a.beginTime <![CDATA[<=]]> #{checkDate} and a.endTime <![CDATA[>=]]> #{checkDate} </if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="orgCode != null and orgCode !=''" >
and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} )
</if>
<choose>
<when test="departmentId != null and departmentId!= 0 ">and a.userDept like concat('%', #{departmentId}, '%') </when>
<!-- <when test="departmentId == -1 and ids != null">and a.userId in-->
<!-- <foreach item="item" collection="ids" separator="," open="(" close=")" index="index">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </when>-->
</choose>
<if test="departmentId != null and departmentId != 0 ">and a.userDept like concat('%', #{departmentId}, '%')</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
......@@ -361,7 +283,6 @@
AND a.endTime <![CDATA[>=]]> #{endTime}
)
)
</if>
<if test="query != null and query != '' ">
<if test="queryType != null and queryType != 'executiveName' and queryType != 'plan' ">
......@@ -382,10 +303,8 @@
<if test="queryType != null and queryType == 'point' ">
AND CONCAT(pp.name, ',', pp.point_no) LIKE concat('%', #{query}, '%')
</if>
)
</if>
<if test="queryType != null and queryType == 'executiveName' ">
AND a.userName LIKE concat('%', #{query}, '%')
</if>
......@@ -394,8 +313,7 @@
</if>
</if>
</where>
</select>
</sql>
<select id="queryPlanTaskById" resultType="Map">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment