Commit da47a9ce authored by taabe's avatar taabe

警情报送列表接口

parent d9f14a6c
...@@ -520,19 +520,19 @@ public class DateUtils { ...@@ -520,19 +520,19 @@ public class DateUtils {
return dateParse(dateFormat(date, MONTH_PATTERN) + "-" + value, null); return dateParse(dateFormat(date, MONTH_PATTERN) + "-" + value, null);
} }
// public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// /*System.out.println(dateTimeToDate(new Date())); /*System.out.println(dateTimeToDate(new Date()));
// System.out.println(dateParse("2017-02-04 14:58:20", null)); System.out.println(dateParse("2017-02-04 14:58:20", null));
// System.out.println(dateTimeToDateStringIfTimeEndZero(new Date())); System.out.println(dateTimeToDateStringIfTimeEndZero(new Date()));
// System.out.println(dateTimeToDateStringIfTimeEndZero(dateTimeToDate(new Date())));*/ System.out.println(dateTimeToDateStringIfTimeEndZero(dateTimeToDate(new Date())));*/
// //System.out.println(dateBetween(dateParse("2017-01-30", null), dateParse("2017-02-01", null))); //System.out.println(dateBetween(dateParse("2017-01-30", null), dateParse("2017-02-01", null)));
// //System.out.println(dateBetweenIncludeToday(dateParse("2017-01-30", null), dateParse("2017-02-01", null))); //System.out.println(dateBetweenIncludeToday(dateParse("2017-01-30", null), dateParse("2017-02-01", null)));
// System.out.println(getDate(dateParse("2017-01-17", null))); System.out.println(getDate(dateParse("2017-01-17", null)));
// /* /*
// System.out.println(getDaysOfMonth(dateParse("2017-02-01", null))); System.out.println(getDaysOfMonth(dateParse("2017-02-01", null)));
// System.out.println(getDaysOfYear(dateParse("2017-01-30", null)));*/ System.out.println(getDaysOfYear(dateParse("2017-01-30", null)));*/
// //System.out.println(dateFormat(dateAddMonths(dateParse("2017-02-07", StrUtils.MONTH_PATTERN), -12), StrUtils.MONTH_PATTERN)); //System.out.println(dateFormat(dateAddMonths(dateParse("2017-02-07", StrUtils.MONTH_PATTERN), -12), StrUtils.MONTH_PATTERN));
// /*System.out.println(dateFormat(maxDateOfMonth(dateParse("2016-02", "yyyy-MM")), null)); /*System.out.println(dateFormat(maxDateOfMonth(dateParse("2016-02", "yyyy-MM")), null));
// System.out.println(dateFormat(minDateOfMonth(dateParse("2016-03-31", null)), null));*/ System.out.println(dateFormat(minDateOfMonth(dateParse("2016-03-31", null)), null));*/
// } }
} }
...@@ -85,7 +85,7 @@ public class MyBatisPlusCodeGenerator { ...@@ -85,7 +85,7 @@ public class MyBatisPlusCodeGenerator {
throw new MybatisPlusException("请输入正确的" + tip + "!"); throw new MybatisPlusException("请输入正确的" + tip + "!");
} }
public static void main1(String[] args) { public static void main(String[] args) {
// 代码生成器 // 代码生成器
AutoGenerator autoGenerator = new AutoGenerator(); AutoGenerator autoGenerator = new AutoGenerator();
......
package com.yeejoin.amos.boot.biz.config; package com.yeejoin.amos.boot.biz.config;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.reflection.MetaObject; import org.apache.ibatis.reflection.MetaObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject; import java.util.Date;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
@Component @Component
...@@ -47,8 +47,13 @@ public class MetaHandler implements MetaObjectHandler { ...@@ -47,8 +47,13 @@ public class MetaHandler implements MetaObjectHandler {
private void autoFillUser(MetaObject metaObject) { private void autoFillUser(MetaObject metaObject) {
//获取用户信息 以及当前用户登录公司部门,角色 //获取用户信息 以及当前用户登录公司部门,角色
ReginParams reginParams=JSONObject.parseObject(redisUtils.get(buildKey( getToken())).toString(), ReginParams.class); ReginParams reginParams =
AgencyUserModel agencyUserModel=reginParams.getUserModel(); JSONObject.parseObject(null != redisUtils.get(buildKey(getToken())) ?
redisUtils.get(buildKey(getToken())).toString() : "", ReginParams.class);
if (ObjectUtils.isEmpty(reginParams)) {
return;
}
AgencyUserModel agencyUserModel = reginParams.getUserModel();
if(ObjectUtils.isEmpty(reginParams)||ObjectUtils.isEmpty(agencyUserModel)){ if(ObjectUtils.isEmpty(reginParams)||ObjectUtils.isEmpty(agencyUserModel)){
return; return;
......
spring.application.name=AIRPORT spring.application.name=AIRPORT-tb
server.servlet.context-path=/jcs server.servlet.context-path=/jcs
server.port=11000 server.port=11000
spring.profiles.active=dev spring.profiles.active=dev
......
...@@ -16,10 +16,18 @@ import java.util.List; ...@@ -16,10 +16,18 @@ import java.util.List;
*/ */
public interface AlertSubmittedMapper extends BaseMapper<AlertSubmitted> { public interface AlertSubmittedMapper extends BaseMapper<AlertSubmitted> {
/** /**
* 根据参数获取警情报送/融合调度列表 * 根据参数获取融合调度列表
* *
* @param alertSubmittedDto * @param alertSubmittedDto
* @return * @return
*/ */
List<AlertSubmittedExtVo> listByParam(@Param("alertSubmittedDto") AlertSubmittedDto alertSubmittedDto); List<AlertSubmittedExtVo> listSchedulingByParam(@Param("alertSubmittedDto") AlertSubmittedDto alertSubmittedDto);
/**
* 根据参数获取警情报送列表
*
* @param alertSubmittedDto
* @return
*/
List<AlertSubmittedExtVo> listReportingByParam(@Param("alertSubmittedDto") AlertSubmittedDto alertSubmittedDto);
} }
...@@ -14,10 +14,18 @@ import com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo; ...@@ -14,10 +14,18 @@ import com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo;
public interface IAlertSubmittedService extends IService<AlertSubmitted> { public interface IAlertSubmittedService extends IService<AlertSubmitted> {
/** /**
* 根据参数查询警情报送/融合调度记录 * 根据参数查询融合调度记录
* *
* @param queryParam * @param queryParam
* @return SchedulingReportingVo * @return SchedulingReportingVo
*/ */
SchedulingReportingVo listByParam(AlertSubmittedDto queryParam); SchedulingReportingVo listSchedulingByParam(AlertSubmittedDto queryParam);
/**
* 根据参数查询警情报送记录
*
* @param queryParam
* @return SchedulingReportingVo
*/
SchedulingReportingVo listReportingByParam(AlertSubmittedDto queryParam);
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper">
<select id="listByParam" resultType="com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedExtVo"> <select id="listSchedulingByParam" resultType="com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedExtVo">
select select
jas.sequence_nbr alertSubmittedId, jas.sequence_nbr alertSubmittedId,
jas.alert_called_id, jas.alert_called_id,
...@@ -32,4 +32,34 @@ ...@@ -32,4 +32,34 @@
and jas.business_type_code = #{alertSubmittedDto.businessTypeCode} and jas.business_type_code = #{alertSubmittedDto.businessTypeCode}
</if> </if>
</select> </select>
<select id="listReportingByParam" resultType="com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedExtVo">
select
jas.sequence_nbr alertSubmittedId,
jas.alert_called_id,
jas.business_type,
jas.business_type_code,
jas.scheduling_type,
jas.scheduling_type_code,
jas.submission_time,
jas.submission_content,
jas.submission_method,
jas.submission_method_code,
jas.update_time,
jaso.sequence_nbr,
group_concat(jaso.company_name) companyNames,
group_concat(jaso.user_name) userNames
from jc_alert_submitted jas
left join jc_alert_submitted_object jaso on jas.sequence_nbr = jaso.alert_submitted_id
where 1=1
<if test="alertSubmittedDto.alertCalledId != null and alertSubmittedDto.alertCalledId != ''">
and jas.alert_called_id = #{alertSubmittedDto.alertCalledId}
</if>
<if test="alertSubmittedDto.submissionMethodCode != null and alertSubmittedDto.submissionMethodCode != ''">
and jas.submission_method_code = #{alertSubmittedDto.submissionMethodCode}
</if>
<if test="alertSubmittedDto.businessTypeCode != null and alertSubmittedDto.businessTypeCode != ''">
and jas.business_type_code = #{alertSubmittedDto.businessTypeCode}
</if>
group by jaso.alert_submitted_id
</select>
</mapper> </mapper>
...@@ -91,11 +91,18 @@ public class AlertSubmittedController extends BaseController { ...@@ -91,11 +91,18 @@ public class AlertSubmittedController extends BaseController {
return CommonResponseUtil.success(iAlertSubmittedService.getById(id)); return CommonResponseUtil.success(iAlertSubmittedService.getById(id));
} }
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/schedulingReporting/list", method = RequestMethod.POST) @RequestMapping(value = "/scheduling/list", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "根据警情id查询融合调度、警情报送列表", notes = "根据警情id查询融合调度、警情报送列表") @ApiOperation(httpMethod = "POST", value = "根据警情id查询融合调度列表", notes = "根据警情id查询融合调度列表")
public ResponseModel listByParam(@RequestBody AlertSubmittedDto queryParam) { public ResponseModel listSchedulingByParam(@RequestBody AlertSubmittedDto queryParam) {
return CommonResponseUtil.success(iAlertSubmittedService.listByParam(queryParam)); return CommonResponseUtil.success(iAlertSubmittedService.listSchedulingByParam(queryParam));
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/reporting/list", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "根据警情id查询警情报送列表", notes = "根据警情id查询警情报送列表")
public ResponseModel listReportingByParam(@RequestBody AlertSubmittedDto queryParam) {
return CommonResponseUtil.success(iAlertSubmittedService.listReportingByParam(queryParam));
} }
/** /**
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper;
...@@ -22,12 +21,22 @@ import java.util.List; ...@@ -22,12 +21,22 @@ import java.util.List;
public class AlertSubmittedServiceImpl extends ServiceImpl<AlertSubmittedMapper, AlertSubmitted> implements IAlertSubmittedService { public class AlertSubmittedServiceImpl extends ServiceImpl<AlertSubmittedMapper, AlertSubmitted> implements IAlertSubmittedService {
@Override @Override
public SchedulingReportingVo listByParam(AlertSubmittedDto queryParam) { public SchedulingReportingVo listSchedulingByParam(AlertSubmittedDto queryParam) {
SchedulingReportingVo schedulingReportingVo = new SchedulingReportingVo(); SchedulingReportingVo schedulingReportingVo = new SchedulingReportingVo();
List<AlertSubmittedExtVo> alertSubmittedExtVoList = this.baseMapper.listByParam(queryParam); List<AlertSubmittedExtVo> alertSubmittedExtVoList = this.baseMapper.listSchedulingByParam(queryParam);
schedulingReportingVo.setSchedulingReportingList(alertSubmittedExtVoList); schedulingReportingVo.setSchedulingReportingList(alertSubmittedExtVoList);
String extraInfo = "已调度电话" + alertSubmittedExtVoList.size() + "起"; String extraInfo = "已调度电话" + alertSubmittedExtVoList.size() + "起";
schedulingReportingVo.setExtraInfo(extraInfo); schedulingReportingVo.setExtraInfo(extraInfo);
return schedulingReportingVo; return schedulingReportingVo;
} }
@Override
public SchedulingReportingVo listReportingByParam(AlertSubmittedDto queryParam) {
SchedulingReportingVo schedulingReportingVo = new SchedulingReportingVo();
List<AlertSubmittedExtVo> alertSubmittedExtVoList = this.baseMapper.listReportingByParam(queryParam);
schedulingReportingVo.setSchedulingReportingList(alertSubmittedExtVoList);
String extraInfo = "已报送" + alertSubmittedExtVoList.size() + "条";
schedulingReportingVo.setExtraInfo(extraInfo);
return schedulingReportingVo;
}
} }
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