提交 2f0b2b74 authored 作者: 宋文杰's avatar 宋文杰

Merge remote-tracking branch 'origin/dev' into dev

DROP TABLE IF EXISTS `roadcondition_unit`;
CREATE TABLE `roadcondition_unit` (
`unit_id` varchar(20) NOT NULL COMMENT '单位ID',
`unit_name` varchar(20) DEFAULT NULL COMMENT '单位名称',
PRIMARY KEY (`unit_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='路况管养单位表';
DROP TABLE IF EXISTS `roadcondition_emergencyevent`;
CREATE TABLE `roadcondition_emergencyevent` (
`dept_id` int(20) NOT NULL COMMENT '部门ID',
`unit_id` varchar(20) DEFAULT NULL COMMENT '单位ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='路况事件_紧急事件对应权限表';
......@@ -35,10 +35,13 @@ public class GetZhjsInterfaceData {
private final ZhjsZqzfzsMxService zhjsZqzfzsMxService;
@Scheduled(cron = "59 59 23 ? * *")
//@Scheduled(cron = "0/5 * * * * ?")
// @Scheduled(cron = "0/5 * * * * ?")
public void scheduledSaveEvent() throws Exception{
String token = zhjsGcxmService.getTokenData();
String createDate = getLastTimestamp().toString();
// String createDate = "0";
addGcxmData(getXmData(token,createDate));
addGcHtData(getHtData(token, createDate));
addZqjlzfData(getZqjlzfData(token, createDate));
......@@ -135,6 +138,7 @@ public class GetZhjsInterfaceData {
while (it.hasNext()) {
String key = (String) it.next();
Object object = o1.get(key);
if(key.toLowerCase().indexOf("_")>-1) {
String keyLower = key.toLowerCase();
String startKey = keyLower.substring(0, keyLower.indexOf("_"));
......@@ -145,6 +149,9 @@ public class GetZhjsInterfaceData {
o2.accumulate(key.toLowerCase(), object);
}
}
if(o2.get("xy")!=null && !"".equals(o2.get("xy"))) {
o2.put("xy", "'"+o2.get("xy").toString()+"'");
}
return o2;
}
}
......@@ -44,15 +44,16 @@ public class RoadConditionEventController extends BaseController {
*/
@PostMapping("/page")
public R getRoadConditionEventPage(
Page page, @RequestBody RoadConditionEvent roadConditionEvent) {
Page page, @RequestBody RoadConditionEvent roadConditionEvent,String units) {
// log.error("接收实体:{}", roadConditionEvent);
page.setCurrent(roadConditionEvent.getCurrent());
page.setSize(roadConditionEvent.getSize());
return new R<>(roadConditionEventService.getRoadConditionEventPage(page, roadConditionEvent));
units = "";
return new R<>(roadConditionEventService.getRoadConditionEventPage(page, roadConditionEvent,units));
}
@GetMapping("/unitTree")
public R getUnitTree(){
public R getUnitTree() {
return new R<>(roadConditionEventService.getUnitTree());
}
......@@ -165,9 +166,14 @@ public class RoadConditionEventController extends BaseController {
* @param
* @return R
*/
@GetMapping("/coordinates")
public R getCoordinates() {
return new R<>(roadConditionEventService.getCoordinates());
@GetMapping("/coordinates/{deptId}")
public R getCoordinates(@PathVariable("deptId")String deptId) {
return new R<>(roadConditionEventService.getCoordinates(deptId));
}
@GetMapping("/getunitbydept/{deptId}")
public R getUnitByDept(@PathVariable("deptId")String deptId){
return new R<>(roadConditionEventService.getUnitByDept(deptId));
}
@GetMapping("/tqcoordinates")
......@@ -190,6 +196,18 @@ public class RoadConditionEventController extends BaseController {
return new R<>(roadConditionEventService.getSFZCoordinates());
}
/**
* @description : 部门和管理单位权限管理
* @author : Xingyuyang
* @date : 2019/5/21 0021 11:28
* @param params :
* @return : com.elephant.framework.galaxy.aroad.response.R
*/
@GetMapping("/saveunitwithdept/{params}")
public R saveUnitWithDept(@PathVariable("params") String params) {
return new R<> (roadConditionEventService.saveUnitWithDept(params));
}
/**
* 通过id查询路况事件统计
*
......@@ -238,53 +256,57 @@ public class RoadConditionEventController extends BaseController {
return new R<>(roadConditionEventService.removeById(id));
}
/**
* 新增养护施工事件
*
* @param
* @return List<String>
*/
@SysLog("新增养护施工事件")
@PostMapping("/saveRoadMaintainEvent")
@ApiOperation(value = "新增养护施工事件")
@ApiImplicitParam(name = "jsonString", value = "养护施工事件JSON格式字符串", required = true, dataType = "String")
public R saveRoadMaintainEvent (@RequestBody String jsonString){
@ApiImplicitParam(
name = "jsonString",
value = "养护施工事件JSON格式字符串",
required = true,
dataType = "String")
public R saveRoadMaintainEvent(@RequestBody String jsonString) {
String msg = "";
Integer code = 0;
List<MultiValueMap<String,String>> errorEventIds = new ArrayList<MultiValueMap<String,String>>();
List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
List<MultiValueMap<String, String>> errorEventIds =
new ArrayList<MultiValueMap<String, String>>();
List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
JSONArray jsonArray = JSONArray.fromObject(jsonString);
String[] dateFormats = new String[] {"yyyy-MM-dd HH:mm:ss"};
JSONUtils.getMorpherRegistry().registerMorpher(new DateMorpher(dateFormats));
List<RoadConditionEvent> roadConditionEvents = ( List<RoadConditionEvent>)JSONArray.toCollection(jsonArray,RoadConditionEvent.class);
try{
for (RoadConditionEvent event : roadConditionEvents){
if (getRoadMaintainEventByEventID(event.getEventId()) > 0 ) {
Map<String,Object> map = new HashMap<String,Object>();
map.put("eventId",event.getEventId());
List<RoadConditionEvent> roadConditionEvents =
(List<RoadConditionEvent>) JSONArray.toCollection(jsonArray, RoadConditionEvent.class);
try {
for (RoadConditionEvent event : roadConditionEvents) {
if (getRoadMaintainEventByEventID(event.getEventId()) > 0) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("eventId", event.getEventId());
listMap.add(map);
msg = "该路况事件ID已存在,请调用路况事件更新接口,更新路况事件";
code = 203;
continue;
}
else{
} else {
roadConditionEventService.save(event);
if(code!=203){
if (code != 203) {
msg = "success";
code = 200;
}
}
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return new R<>(code,msg,listMap);
return new R<>(code, msg, listMap);
}
/**
* 根据事件ID查询该路况事件是否已经存在(大于0表示已存在)
*
* @return
*/
public Integer getRoadMaintainEventByEventID(String eventID) {
......@@ -292,102 +314,116 @@ public class RoadConditionEventController extends BaseController {
}
/**
* 更新养护施工事件
* 保存历史数据
* 更新养护施工事件 保存历史数据
*
* @param
* @return void
*/
@SysLog("更新养护施工事件")
@PostMapping("/updateRoadMaintainEvent")
@ApiOperation(value = "更新养护施工事件")
@ApiImplicitParam(name = "jsonString", value = "养护施工事件JSON格式字符串", required = true, dataType = "String")
public R updateRoadMaintainEvent(@RequestBody String jsonString) throws Exception{
@ApiImplicitParam(
name = "jsonString",
value = "养护施工事件JSON格式字符串",
required = true,
dataType = "String")
public R updateRoadMaintainEvent(@RequestBody String jsonString) throws Exception {
List<Object> infoList = new ArrayList<Object>();
String msg = "";
Integer code = 0;
JSONArray jsonArray = JSONArray.fromObject(jsonString);
String[] dateFormats = new String[] {"yyyy-MM-dd HH:mm:ss"};
JSONUtils.getMorpherRegistry().registerMorpher(new DateMorpher(dateFormats));
List<RoadConditionEvent> roadConditionEvents = ( List<RoadConditionEvent>)JSONArray.toCollection(jsonArray,RoadConditionEvent.class);
try{
for(int i = 0;i< roadConditionEvents.size();i++){
RoadConditionEvent event = (RoadConditionEvent)roadConditionEvents.get(i);
List<RoadConditionEvent> roadConditionEvents =
(List<RoadConditionEvent>) JSONArray.toCollection(jsonArray, RoadConditionEvent.class);
try {
for (int i = 0; i < roadConditionEvents.size(); i++) {
RoadConditionEvent event = (RoadConditionEvent) roadConditionEvents.get(i);
RoadConditionEvent result = getRoadMaintainEvent(event);
if(result != null ){
if (result != null) {
infoList.add(jsonArray.get(i));
msg = "存在重复数据,请核实";
code = 204;
continue;
}
else{
} else {
roadConditionEventService.save(event);
if(code!=204){
if (code != 204) {
msg = "success";
code = 200;
}
}
}
}catch(Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return new R<>(code,msg,infoList);
return new R<>(code, msg, infoList);
}
/**
* 查询该路况事件是否已经存在(大于0表示已存在) *
* 查询该路况事件是否已经存在(大于0表示已存在) *
*
* @return
*/
public RoadConditionEvent getRoadMaintainEvent(RoadConditionEvent event) {
return roadConditionEventService.selectRoadMaintainEvent(event);
}
/**
* 删除养护施工事件(通过主键id)
* flag(删除:1)
* 删除养护施工事件(通过主键id) flag(删除:1)
*
* @param
* @return R
*/
@SysLog("删除养护施工事件,假删除")
@DeleteMapping("/deleteRoadMaintainEvent")
@ApiOperation(value = "删除养护施工事件")
@ApiImplicitParam(name = "jsonString", value = "养护施工事件JSON格式字符串", required = true, dataType = "String")
public R deleteRoadMaintainEvent(@RequestBody String jsonString){
@ApiImplicitParam(
name = "jsonString",
value = "养护施工事件JSON格式字符串",
required = true,
dataType = "String")
public R deleteRoadMaintainEvent(@RequestBody String jsonString) {
JSONArray jsonArray = JSONArray.fromObject(jsonString);
String[] dateFormats = new String[] {"yyyy-MM-dd HH:mm:ss"};
JSONUtils.getMorpherRegistry().registerMorpher(new DateMorpher(dateFormats));
List<RoadConditionEvent> roadConditionEvents = ( List<RoadConditionEvent>)JSONArray.toCollection(jsonArray,RoadConditionEvent.class);
try{
for(RoadConditionEvent event : roadConditionEvents){
List<RoadConditionEvent> roadConditionEvents =
(List<RoadConditionEvent>) JSONArray.toCollection(jsonArray, RoadConditionEvent.class);
try {
for (RoadConditionEvent event : roadConditionEvents) {
roadConditionEventService.deleteBatchByEvent(event);
}
}catch(Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return new R<>(200,"success");
return new R<>(200, "success");
}
/**
* 撤销养护施工事件(通过eventId)
* flag(撤销:0)
* 撤销养护施工事件(通过eventId) flag(撤销:0)
*
* @param
* @return R
*/
@SysLog("撤销养护施工事件")
@PutMapping("/revokeRoadMaintainEventByEventId")
@ApiOperation(value = "撤销养护施工事件")
@ApiImplicitParam(name = "jsonString", value = "养护施工事件JSON格式字符串", required = true, dataType = "String")
public R revokeRoadMaintainEventByEventId(@RequestBody String jsonString){
@ApiImplicitParam(
name = "jsonString",
value = "养护施工事件JSON格式字符串",
required = true,
dataType = "String")
public R revokeRoadMaintainEventByEventId(@RequestBody String jsonString) {
JSONArray jsonArray = JSONArray.fromObject(jsonString);
List<RoadConditionEvent> roadMaintainEvents = ( List<RoadConditionEvent>)JSONArray.toCollection(jsonArray,RoadConditionEvent.class);
List<RoadConditionEvent> roadMaintainEvents =
(List<RoadConditionEvent>) JSONArray.toCollection(jsonArray, RoadConditionEvent.class);
List<Object> eventIdList = new ArrayList<Object>();
try{
for(RoadConditionEvent event : roadMaintainEvents){
try {
for (RoadConditionEvent event : roadMaintainEvents) {
eventIdList.add(event.getEventId());
}
Integer rowNumber = roadConditionEventService.updateBatchByEventId(eventIdList);
}catch(Exception e){
Integer rowNumber = roadConditionEventService.updateBatchByEventId(eventIdList);
} catch (Exception e) {
e.printStackTrace();
}
return new R<>(200,"success");
return new R<>(200, "success");
}
}
package com.elephant.framework.galaxy.aroad.module.roadcondition.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @program:
* @description: 坐标类
* @author: songwenjie
* @create: 2019-04-02 10:55
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DeptUnitDto implements Serializable {
/** 单位ID */
private String unitId;
/** 部门ID */
private String deptId;
}
......@@ -16,7 +16,6 @@ import java.util.Date;
* @author Xingyuyang
* @date 2019-05-16 15:28:40
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
......@@ -24,168 +23,109 @@ import java.util.Date;
@TableName("road_condition_event")
@EqualsAndHashCode(callSuper = true)
public class RoadConditionEvent extends Model<RoadConditionEvent> {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
*
*/
/** */
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "事件ID", name = "eventId")
private String eventId;
/**
* 路线编码
*/
/** 路线编码 */
@ApiModelProperty(value = "路线编号", name = "roadCode")
private String roadCode;
/**
* 路线名称
*/
/** 路线名称 */
@ApiModelProperty(value = "路线名称", name = "roadName")
private String roadName;
/**
* 管养单位
*/
/** 管养单位 */
@ApiModelProperty(value = "管养单位", name = "maintainUnit")
private String maintainUnit;
/**
* 起止桩号
*/
/** 起止桩号 */
@ApiModelProperty(value = "起止桩号", name = "stoem")
private String stoem;
/**
* 开始桩号
*/
/** 开始桩号 */
@ApiModelProperty(value = "开始桩号", name = "startm")
private String startm;
/**
* 结束桩号
*/
/** 结束桩号 */
@ApiModelProperty(value = "结束桩号", name = "endm")
private String endm;
/**
* 事件类型
*/
/** 事件类型 */
@ApiModelProperty(value = "事件类型", name = "eventType")
private String eventType;
/**
* 事件标题
*/
/** 事件标题 */
@ApiModelProperty(value = "事件标题", name = "eventTitle")
private String eventTitle;
/**
* 事件详情
*/
/** 事件详情 */
@ApiModelProperty(value = "事件详情", name = "eventContent")
private String eventContent;
/**
* 影响程度(1=封闭交通/2=影响交通/3=可正常通行)
*/
/** 影响程度(1=封闭交通/2=影响交通/3=可正常通行) */
@ApiModelProperty(value = "影响程度(1=封闭交通/2=影响交通/3=可正常通行)", name = "influence")
private String influence;
/**
* 压车长度
*/
/** 压车长度 */
@ApiModelProperty(value = "压车长度", name = "carsLength")
private String carsLength;
/**
* 绕行方案
*/
/** 绕行方案 */
@ApiModelProperty(value = "绕行方案", name = "solution")
private String solution;
/**
* 发布人
*/
/** 发布人 */
@ApiModelProperty(value = "发布人", name = "startPerson")
private String startPerson;
/**
* 发布时间
*/
/** 发布时间 */
@ApiModelProperty(value = "发布时间", name = "startTime")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
/**
* 发布单位
*/
/** 发布单位 */
@ApiModelProperty(value = "发布单位", name = "startUnit")
private String startUnit;
/**
* 发布单位代码
*/
/** 发布单位代码 */
@ApiModelProperty(value = "发布单位代码", name = "startUnitNo")
private String startUnitNo;
/**
* 备注
*/
/** 备注 */
@ApiModelProperty(value = "备注", name = "startBz")
private String startBz;
/**
* 预撤时间
*/
/** 预撤时间 */
@ApiModelProperty(value = "预撤时间", name = "preEndTime")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date preEndTime;
/**
* 撤销人
*/
/** 撤销人 */
@ApiModelProperty(value = "撤销人", name = "endPerson")
private String endPerson;
/**
* 撤销时间
*/
/** 撤销时间 */
@ApiModelProperty(value = "撤销时间", name = "endTime")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
/**
* 撤销单位
*/
/** 撤销单位 */
@ApiModelProperty(value = "撤销单位", name = "endUnit")
private String endUnit;
/**
* 撤销单位代码
*/
/** 撤销单位代码 */
@ApiModelProperty(value = "撤销单位代码", name = "endUnitNo")
private String endUnitNo;
/**
* 撤销原因
*/
/** 撤销原因 */
@ApiModelProperty(value = "撤销原因", name = "endReason")
private String endReason;
/**
* 撤销备注
*/
/** 撤销备注 */
@ApiModelProperty(value = "撤销备注", name = "endBz")
private String endBz;
/**
* 审核人
*/
/** 审核人 */
@ApiModelProperty(value = "审核人", name = "checkPerson")
private String checkPerson;
/**
* 审核时间
*/
/** 审核时间 */
@ApiModelProperty(value = "审核时间", name = "checkTime")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date checkTime;
/**
* 经度
*/
/** 经度 */
@ApiModelProperty(value = "经度", name = "longitude")
private String longitude;
/**
* 纬度
*/
/** 纬度 */
@ApiModelProperty(value = "纬度", name = "latitude")
private String latitude;
/**
* 当前页
*/
/** 当前页 */
@ApiModelProperty(value = "当前页", name = "current")
private long current;
/**
* 一页的数量
*/
/** 一页的数量 */
@ApiModelProperty(value = "一页的数量", name = "size")
private long size;
}
/** 部门ID */
@ApiModelProperty(value = "部门ID", name = "deptId")
private String deptId;
}
......@@ -16,7 +16,7 @@ import java.util.List;
*/
public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent> {
IPage<RoadConditionEvent> getRoadConditionEventPage(
IPage<RoadConditionEvent> page, RoadConditionEvent roadConditionEvent);
IPage<RoadConditionEvent> page, RoadConditionEvent roadConditionEvent,@Param("units")String units);
List<SaveUnitDto> getUnitTree();
......@@ -32,7 +32,9 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
List<staticByCityDto> staticByCity();
List<CoordinateDto> getCoordinates();
List<DeptUnitDto> getUnitByDept(@Param("deptId") String deptId);
List<CoordinateDto> getCoordinates(@Param("units") String units);
List<CoordinateDto> getTQCoordinates();
......@@ -54,6 +56,11 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
RoadConditionEvent getById(@Param("id") Integer id);
boolean saveUnitWithDept(
@Param("deptId") String deptId, @Param("unit") String unit);
boolean deleteUnitByDept(@Param("deptId") String deptId);
/**
* 查询数据库是否存在该实体
*
......@@ -79,5 +86,6 @@ public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent>
Integer deleteBatchByEvent(RoadConditionEvent event);
boolean saveUnit();
boolean deleteUnit();
}
......@@ -76,7 +76,7 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
String yccd);
IPage<RoadConditionEvent> getRoadConditionEventPage(
Page<RoadConditionEvent> page, RoadConditionEvent roadConditionEvent);
Page<RoadConditionEvent> page, RoadConditionEvent roadConditionEvent,String units);
List<SaveUnitDto> getUnitTree();
......@@ -148,6 +148,8 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
*/
BaseTreeDto getTree();
boolean saveUnitWithDept(String params);
RoadConditionEvent getById(Integer id);
List<CoordinateDto> getYHCoordinates();
......@@ -158,7 +160,9 @@ public interface RoadConditionEventService extends IService<RoadConditionEvent>
List<CoordinateDto> getTQCoordinates();
List<CoordinateDto> getCoordinates();
List<CoordinateDto> getCoordinates(String deptId);
List<DeptUnitDto> getUnitByDept(String deptId);
boolean saveUnit();
......
......@@ -75,7 +75,7 @@ public class RoadConditionEventServiceImpl
Date writerdate,
String infchecker,
Date checkdate,
Date removedate,
Date removedate,
// String remark,
String glno,
String writerno,
......@@ -102,7 +102,7 @@ public class RoadConditionEventServiceImpl
.eq(RoadConditionEvent::getStartTime, writerdate)
.eq(RoadConditionEvent::getCheckPerson, infchecker)
.eq(RoadConditionEvent::getCheckTime, checkdate)
.eq(RoadConditionEvent::getEndTime, removedate)
.eq(RoadConditionEvent::getEndTime, removedate)
// .eq(RoadConditionEvent::getStartBz, remark)
.eq(RoadConditionEvent::getRoadCode, glno)
.eq(RoadConditionEvent::getStartUnitNo, writerno)
......@@ -124,13 +124,38 @@ public class RoadConditionEventServiceImpl
return baseMapper.getById(id);
}
public boolean saveUnitWithDept(@Param("params") String params) {
String[] paramStringList = params.split(",");
String deptId = paramStringList[0];
List<String> unitList = new ArrayList<>();
for (int i = 1; i < paramStringList.length; i++) {
unitList.add(paramStringList[i]);
}
baseMapper.deleteUnitByDept(deptId);
if (unitList.size() > 1) {
for (int i = 0; i < unitList.size(); i++) {
baseMapper.saveUnitWithDept(deptId, unitList.get(i));
}
} else {
return baseMapper.saveUnitWithDept(deptId, unitList.get(0));
}
return false;
}
public IPage<RoadConditionEvent> getRoadConditionEventPage(
Page<RoadConditionEvent> page, RoadConditionEvent roadConditionEvent) {
return baseMapper.getRoadConditionEventPage(page, roadConditionEvent);
Page<RoadConditionEvent> page, RoadConditionEvent roadConditionEvent,String units) {
List<DeptUnitDto> unitList = baseMapper.getUnitByDept(roadConditionEvent.getDeptId());
if (unitList.size() > 0) {
for (int i = 0; i < unitList.size(); i++) {
units += ",'" + unitList.get(i).getUnitId() + "'";
}
units = units.substring(1, units.length());
}
return baseMapper.getRoadConditionEventPage(page, roadConditionEvent,units);
}
public List<SaveUnitDto> getUnitTree(){
return baseMapper.getUnitTree();
public List<SaveUnitDto> getUnitTree() {
return baseMapper.getUnitTree();
}
public List<RoadConditionEvent> getRoadConditionEventMobilePage() {
......@@ -196,9 +221,21 @@ public class RoadConditionEventServiceImpl
return baseMapper.staticByCity();
}
@Cacheable(value = "roadConditionCoordinates")
public List<CoordinateDto> getCoordinates() {
return baseMapper.getCoordinates();
public List<DeptUnitDto> getUnitByDept(@Param("deptId") String deptId){
return baseMapper.getUnitByDept(deptId);
}
// @Cacheable(value = "roadConditionCoordinates")
public List<CoordinateDto> getCoordinates(@Param("deptId") String deptId) {
List<DeptUnitDto> unitList = baseMapper.getUnitByDept(deptId);
String units = "";
if (unitList.size() > 0) {
for (int i = 0; i < unitList.size(); i++) {
units += ",'" + unitList.get(i).getUnitId() + "'";
}
units = units.substring(1, units.length());
}
return baseMapper.getCoordinates(units);
}
@Cacheable(value = "tqCoordinates")
......@@ -221,13 +258,13 @@ public class RoadConditionEventServiceImpl
return baseMapper.getTFCoordinates();
}
public boolean saveUnit() {
return baseMapper.saveUnit();
}
public boolean saveUnit() {
return baseMapper.saveUnit();
}
public boolean deleteUnit(){
return baseMapper.deleteUnit();
}
public boolean deleteUnit() {
return baseMapper.deleteUnit();
}
/**
* @description : 根据城市查询
......
......@@ -86,24 +86,25 @@ public class ZhjgLzglCxysxkController extends BaseController {
*/
@GetMapping("/cxysSjfx")
public CxysDataAnalysis selectCxysSjfx(Double startLong, Double endLong,
Double startWidth, Double endWidth,
Double startHeight, Double endHeight,
Double startWeight, Double endWeight,
String startDate, String endDate) {
System.out.println("startLong :"+startLong);
System.out.println("endLong :"+endLong);
System.out.println("startWidth :"+startWidth);
System.out.println("endWidth :"+endWidth);
System.out.println("startHeight :"+startHeight);
System.out.println("endHeight :"+endHeight);
System.out.println("startWeight :"+startWeight);
System.out.println("endWeight :"+endWeight);
System.out.println("startDate :"+startDate);
System.out.println("endDate :"+endDate);
Double startWidth, Double endWidth,
Double startHeight, Double endHeight,
Double startWeight, Double endWeight,
String startDate, String endDate) {
return zhjgLzglCxysxkService.selectCxysSjfx(startLong,endLong,startWidth,endWidth,startHeight,endHeight,startWeight,endWeight,startDate,endDate);
}
/**
* 超限运输数据分析页面统计数据(英文版)
*/
@GetMapping("/cxysSjfx2")
public CxysDataAnalysis selectCxysSjfx2(Double startLong, Double endLong,
Double startWidth, Double endWidth,
Double startHeight, Double endHeight,
Double startWeight, Double endWeight,
String startDate, String endDate) {
return zhjgLzglCxysxkService.selectCxysSjfx2(startLong,endLong,startWidth,endWidth,startHeight,endHeight,startWeight,endWeight,startDate,endDate);
}
/**
* 查询某时间段内数据
* @param startDate
......
......@@ -61,6 +61,15 @@ public interface ZhjgLzglCxysxkService extends IService<ZhjgLzglCxysxk> {
Double startWeight, Double endWeight,
String startDate, String endDate);
/**
* 超限运输数据分析页面统计数据(英文版)
*/
CxysDataAnalysis selectCxysSjfx2(Double startLong, Double endLong,
Double startWidth, Double endWidth,
Double startHeight, Double endHeight,
Double startWeight, Double endWeight,
String startDate, String endDate);
/**
* 超限运输综合展示页面
* @param startDate
......
......@@ -358,7 +358,97 @@ public class ZhjgLzglCxysxkServiceImpl extends ServiceImpl<ZhjgLzglCxysxkMapper,
}
}
}
return slspData;
}
/**
* 超限运输数据分析页面统计数据(英文版)
* @param startLong
* @param endLong
* @param startWidth
* @param endWidth
* @param startHeight
* @param endHeight
* @param startWeight
* @param endWeight
* @param startDate
* @param endDate
* @return
*/
public CxysDataAnalysis selectCxysSjfx2(Double startLong,Double endLong,
Double startWidth,Double endWidth,
Double startHeight,Double endHeight,
Double startWeight,Double endWeight,
String startDate,String endDate) {
CxysDataAnalysis cxysSjfx = new CxysDataAnalysis();
cxysSjfx.setLongBeyond(selectBeyondLong(startLong,endLong,startDate,endDate));
cxysSjfx.setHeightBeyond(selectBeyondHeight(startHeight,endHeight,startDate,endDate));
cxysSjfx.setWeightBeyond(selectBeyondWeight(startWeight,endWeight,startDate,endDate));
cxysSjfx.setWidthBeyond(selectBeyondWidth(startWidth,endWidth,startDate,endDate));
cxysSjfx.setCxysSizeBeyond(selectSizeBeyond(startDate,endDate));
cxysSjfx.setCxysSsspspTj(dealWithSsspSpData2(startDate,endDate));
return cxysSjfx;
}
/**
* 查询省市受理审批数量(英文版)
* @param startDate
* @param endDate
* @return
*/
public List<Map> dealWithSsspSpData2(String startDate,String endDate) {
List<Map> slspData = new ArrayList<Map>();
String areaNames = "莱芜,菏泽,临沂,{聊城,德州,滨州,日照,威海,泰安,济宁,潍坊,烟台,东营,枣庄,淄博,青岛,济南,省厅公路局,";
for(int i=0; i<areaNames.split(",").length; i++){
String areaName = areaNames.split(",")[i];
Map<String,Object> map = new HashMap<String,Object>();
map.put("city",areaName);
map.put("slsmlj",0);
map.put("spsmlj",0);
slspData.add(map);
}
List<ZhjgLzglCxysxk> zhjgLzglCxysxks = findZhjgLzglCxysxkByDate(startDate,endDate);
for(ZhjgLzglCxysxk zhjgLzglCxysxk : zhjgLzglCxysxks){
if("10".equals(zhjgLzglCxysxk.getDwjb().trim())) {
Integer spsm = Integer.parseInt(slspData.get(17).get("spsmlj").toString());
if (slspData.get(17).containsKey("spsmlj")){
//如果存在,可以直接put新的键值对。新的键值会自动覆盖之前的。
slspData.get(17).put("spsmlj",spsm+1);
}
}
if(zhjgLzglCxysxk.getSldw().trim().indexOf("山东省交通运输厅公路局")!=-1) {
Integer slsm = Integer.parseInt(slspData.get(17).get("slsmlj").toString());
if (slspData.get(17).containsKey("slsmlj")){
//如果存在,可以直接put新的键值对。新的键值会自动覆盖之前的。
slspData.get(17).put("slsmlj",slsm+1);
}
}
for(Map map : slspData) {
String area = map.get("city").toString();
if(zhjgLzglCxysxk.getSldw().trim().indexOf(area)!=-1) {
Integer slsm = Integer.parseInt(map.get("slsmlj").toString());
if (map.containsKey("slsmlj")){
//如果存在,可以直接put新的键值对。新的键值会自动覆盖之前的。
map.put("slsmlj",slsm+1);
}
}
if(!"10".equals(zhjgLzglCxysxk.getDwjb())) {
if(zhjgLzglCxysxk.getSldw().trim().indexOf(area)!=-1) {
Integer spsm = Integer.parseInt(map.get("spsmlj").toString());
if (slspData.get(17).containsKey("spsmlj")){
//如果存在,可以直接put新的键值对。新的键值会自动覆盖之前的。
map.put("spsmlj",spsm+1);
}
}
}
}
}
return slspData;
}
}
package com.elephant.framework.galaxy.aroad.module.zhjs.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsHzmx;
import com.elephant.framework.galaxy.aroad.module.zhjs.service.ZhjsHzmxService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
/**
* 智慧建设_汇总明细
*
* @author wangjian
* @date 2019-05-17 17:50:54
*/
@RestController
@AllArgsConstructor
@RequestMapping("/zhj/shzmx")
public class ZhjsHzmxController extends BaseController {
private final ZhjsHzmxService zhjsHzmxService;
/**
* 分页查询
* @param page 分页对象
* @param zhjsHzmx 智慧建设_汇总明细
* @return
*/
@GetMapping("/page")
public R getZhjsHzmxPage(Page page, ZhjsHzmx zhjsHzmx) {
return new R<>(zhjsHzmxService.page(page,Wrappers.query(zhjsHzmx)));
}
/**
* 通过id查询智慧建设_汇总明细
* @param id id
* @return R
*/
@GetMapping("/{id}")
public R getById(@PathVariable("id") String id){
return new R<>(zhjsHzmxService.getById(id));
}
/**
* 新增智慧建设_汇总明细
* @param zhjsHzmx 智慧建设_汇总明细
* @return R
*/
@SysLog("新增智慧建设_汇总明细")
@PostMapping
public R save(@RequestBody ZhjsHzmx zhjsHzmx){
return new R<>(zhjsHzmxService.save(zhjsHzmx));
}
/**
* 修改智慧建设_汇总明细
* @param zhjsHzmx 智慧建设_汇总明细
* @return R
*/
@SysLog("修改智慧建设_汇总明细")
@PutMapping
public R updateById(@RequestBody ZhjsHzmx zhjsHzmx){
return new R<>(zhjsHzmxService.updateById(zhjsHzmx));
}
/**
* 通过id删除智慧建设_汇总明细
* @param id id
* @return R
*/
@SysLog("删除智慧建设_汇总明细")
@DeleteMapping("/{id}")
public R removeById(@PathVariable String id){
return new R<>(zhjsHzmxService.removeById(id));
}
}
package com.elephant.framework.galaxy.aroad.module.zhjs.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 智慧建设_汇总明细
*
* @author wangjian
* @date 2019-05-17 17:50:54
*/
@Data
@TableName("t_zhjs_hzmx")
@EqualsAndHashCode(callSuper = true)
public class ZhjsHzmx extends Model<ZhjsHzmx> {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId
private String id;
/**
* 项目名称
*/
private String proName;
/**
* 建设年限
*/
private String life;
/**
* 所属期次
*/
private String reportperiodName;
/**
* 项目id
*/
private String proId;
/**
* 项目编码
*/
private String proCode;
/**
* 建设性质
*/
private Integer property;
/**
* 申报日期
*/
private Long reportDate;
/**
* 年
*/
private Integer year;
/**
* 计划建设规模及标准
*/
private String planandscst;
}
......@@ -31,12 +31,12 @@ public class ZhjsXmqk {
/**
* 计划开工日期
*/
private LocalDateTime planstartdate;
private Long planstartdate;
/**
* 计划完工日期
*/
private LocalDateTime planenddate;
private Long planenddate;
/**
* 项目介绍
......
package com.elephant.framework.galaxy.aroad.module.zhjs.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsHzmx;
/**
* 智慧建设_汇总明细
*
* @author wangjian
* @date 2019-05-17 17:50:54
*/
public interface ZhjsHzmxMapper extends BaseMapper<ZhjsHzmx> {
}
package com.elephant.framework.galaxy.aroad.module.zhjs.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsHzmx;
/**
* 智慧建设_汇总明细
*
* @author wangjian
* @date 2019-05-17 17:50:54
*/
public interface ZhjsHzmxService extends IService<ZhjsHzmx> {
}
package com.elephant.framework.galaxy.aroad.module.zhjs.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsHzmx;
import com.elephant.framework.galaxy.aroad.module.zhjs.mapper.ZhjsHzmxMapper;
import com.elephant.framework.galaxy.aroad.module.zhjs.service.ZhjsHzmxService;
import org.springframework.stereotype.Service;
/**
* 智慧建设_汇总明细
*
* @author wangjian
* @date 2019-05-17 17:50:54
*/
@Service
public class ZhjsHzmxServiceImpl extends ServiceImpl<ZhjsHzmxMapper, ZhjsHzmx> implements ZhjsHzmxService {
}
......@@ -98,6 +98,12 @@
<result property="unitName" column="unit_name"/>
</resultMap>
<resultMap id="DeptUnitMap"
type="com.elephant.framework.galaxy.aroad.module.roadcondition.dto.DeptUnitDto">
<result property="unitId" column="unit_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<select id="getUnitTree" resultMap="SaveUnitMap">
select * from roadcondition_unit
</select>
......@@ -111,6 +117,14 @@
GROUP BY start_unit_no, maintain_unit
</insert>
<delete id="deleteUnitByDept">
delete from roadcondition_emergencyevent where dept_id=#{deptId}
</delete>
<insert id="saveUnitWithDept">
insert into roadcondition_emergencyevent (dept_id, unit_id) values (#{deptId},#{unit})
</insert>
<select id="getRoadConditionEventPage" resultMap="roadConditionEventMap"
parameterType="com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent">
SELECT
......@@ -122,36 +136,13 @@
<if test="roadConditionEvent.influence != null">influence = #{roadConditionEvent.influence} and</if>
<if test="roadConditionEvent.startTime != null">start_time &gt; #{roadConditionEvent.startTime} and</if>
<if test="roadConditionEvent.endTime != null">end_time &lt; #{roadConditionEvent.endTime} and</if>
1=1
start_unit_no in (#{units})
</where>
</select>
<select id="getRoadConditionEventMobilePage" resultMap="roadConditionEventMap">
SELECT *
# id,road_code,concat(road_code,'·',road_name) as
# road_name,startm,endm,event_type,event_title,event_content,influence,cars_length,solution,start_time,start_unit,start_person,pre_end_time,end_time,end_unit,end_reason,longitude,latitude
FROM road_condition_event
<!-- <where>-->
<!-- <if test="text!= null">-->
<!-- road_code like CONCAT('%',#{text},'%')-->
<!-- or-->
<!-- road_name like CONCAT('%',#{text},'%')-->
<!-- or-->
<!-- event_type like CONCAT('%',#{text},'%')-->
<!-- or-->
<!-- event_title like CONCAT('%',#{text},'%')-->
<!-- or-->
<!-- event_content like CONCAT('%',#{text},'%')-->
<!-- or-->
<!-- influence like CONCAT('%',#{text},'%')-->
<!-- or-->
<!-- cars_length like CONCAT('%',#{text},'%')-->
<!-- or-->
<!-- start_unit like CONCAT('%',#{text},'%')-->
<!-- and-->
<!-- </if>-->
<!-- road_name is not null-->
<!-- </where>-->
</select>
<select id="getById" resultMap="roadConditionEventMap">
......@@ -222,9 +213,15 @@
fullname
</select>
<select id="getUnitByDept" resultMap="DeptUnitMap">
select unit_id from roadcondition_emergencyevent
where dept_id = #{deptId}
</select>
<select id="getCoordinates" resultMap="CoordinateDtoMap">
select id, longitude, latitude, event_type,event_title
from `road_condition_event`;
from `road_condition_event`
where start_unit_no in (#{units});
</select>
<select id="getTQCoordinates" resultMap="CoordinateDtoMap">
......@@ -251,8 +248,6 @@
where event_title = '收费站异常';
</select>
<select id="selectRoadMaintainEvent"
parameterType="com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent" resultMap="roadConditionEventMap">
SELECT * FROM road_condition_event
......
......@@ -88,7 +88,8 @@
</select>
<select id="getGcxmAndShape" resultType="com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsGcxmShape">
select g.*,s.shape from t_zhjs_gcxm g LEFT JOIN t_zhjc_xmjc_ghxm_shape s ON substring(g.proname,1,char_length(g.proname)-4)=s.name
select g.*,s.shape from t_zhjs_gcxm g LEFT JOIN t_zhjc_xmjc_ghxm_shape s
ON substring(g.proname,1,char_length(SUBSTRING(g.proname,1,if(LOCATE("(",g.proname)!=0,LOCATE("(",g.proname)-1,char_length(g.proname))))-4)=s.name
<where>
<if test="attribute!=null">
g.attribute=#{attribute}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elephant.framework.galaxy.aroad.module.zhjs.mapper.ZhjsHzmxMapper">
<resultMap id="zhjsHzmxMap" type="com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsHzmx">
<id property="id" column="id"/>
<result property="proName" column="pro_name"/>
<result property="life" column="life"/>
<result property="reportperiodName" column="reportperiod_name"/>
<result property="proId" column="pro_id"/>
<result property="proCode" column="pro_code"/>
<result property="property" column="property"/>
<result property="reportDate" column="report_date"/>
<result property="year" column="year"/>
<result property="planandscst" column="planandscst"/>
</resultMap>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论