Commit d06cb8f3 authored by 耿迪迪's avatar 耿迪迪
parents e4b33e08 91487f9c
......@@ -73,6 +73,19 @@
<build>
<finalName>gassafetyprogress-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.3.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
......
......@@ -33,6 +33,9 @@ public class TVehicleInfoController extends BaseController
@Autowired
private ITVehicleLocationInfoService itVehicleLocationInfoService;
@Autowired
private ITVehicleLocationInfoService tVehicleLocationInfoService;
/**
* 查询燃气车辆信息列表
*/
......@@ -80,6 +83,8 @@ public class TVehicleInfoController extends BaseController
return util.exportExcel(list, "燃气车辆信息数据");
}
/**
* 获取燃气车辆信息详细信息
*/
......
package com.zehong.web.controller.standingBook;
import java.util.ArrayList;
import java.util.List;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.web.controller.tool.TimeConfig;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -47,6 +50,44 @@ public class THiddenDangerStandingBookController extends BaseController
return getDataTable(list);
}
/**
* 获取隐患整治台账统计信息
*/
@GetMapping("/hazardStatistics")
public AjaxResult hazardStatistics()
{
//生成近7天数据
List<String> sevenDate = TimeConfig.getSevenDate();
List<Statistics> list=new ArrayList<>();
//查询统计日期和数量
List<Statistics> statistics = tHiddenDangerStandingBookService.hazardStatistics(TimeConfig.getSevenDate());
if (statistics.size()==0){
for (int n=0;n<7;n++){
Statistics statisticsn=new Statistics();
statisticsn.setCount(0);
statisticsn.setDate(sevenDate.get(n));
list.add(statisticsn);
}
}
for (int s=0;s<statistics.size();s++){
for (int i=0;i<sevenDate.size();i++){
Statistics statistics1=new Statistics();
if (statistics.get(s).getDate().equals(sevenDate.get(i))){
statistics1.setCount(statistics.get(s).getCount());
statistics1.setDate(sevenDate.get(i));
list.add(statistics1);
}else {
statistics1.setCount(0);
statistics1.setDate(sevenDate.get(i));
list.add(statistics1);
}
}
}
return AjaxResult.success(list);
}
/**
* 导出隐患整治台账列表
*/
......
package com.zehong.web.controller.standingBook;
import java.util.ArrayList;
import java.util.List;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.web.controller.tool.TimeConfig;
import com.zehong.web.timeconfig.TimeConFig;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -47,6 +51,43 @@ public class TTroubleStandingBookController extends BaseController
return getDataTable(list);
}
/**
* 获取事故台账统计
*/
@GetMapping("/accidentLedger")
public AjaxResult accidentLedger()
{
List<Statistics> list=new ArrayList<>();
//查询统计日期和数量
List<Statistics> statistics = tTroubleStandingBookService.accidentLedger(TimeConfig.getSevenDate());
//生成近7天数据
List<String> sevenDate = TimeConfig.getSevenDate();
if (statistics.size()==0){
for (int n=0;n<7;n++){
Statistics statisticsn=new Statistics();
statisticsn.setCount(0);
statisticsn.setDate(sevenDate.get(n));
list.add(statisticsn);
}
}
for (int s=0;s<statistics.size();s++){
for (int i=0;i<sevenDate.size();i++){
Statistics statistics1=new Statistics();
if (statistics.get(s).getDate().equals(sevenDate.get(i))){
statistics1.setCount(statistics.get(s).getCount());
statistics1.setDate(sevenDate.get(i));
list.add(statistics1);
}else {
statistics1.setCount(0);
statistics1.setDate(sevenDate.get(i));
list.add(statistics1);
}
}
}
return AjaxResult.success(list);
}
/**
* 导出事故台账列表
*/
......
......@@ -37,14 +37,14 @@ public class PipeInterfaceController extends BaseController {
//循环根据权属单位名称分组的数据
for (int i=0;i<pipeDatesGroup.size();i++){
//循环全部数据
for (int n=0;n<pipeDates.size();n++){
//判断如果名称一样就一组
if (pipeDatesGroup.get(i).getPowerCompany().equals(pipeDates.get(n).getPowerCompany())){
// //设置分组类型
// pipeDates.get(n).setCompanyType(Integer.parseInt(pipeDates.get(n).getPipeId()));
pipeDates.get(n).setIconType(1);
}
}
// for (int n=0;n<pipeDates.size();n++){
// //判断如果名称一样就一组
// if (pipeDatesGroup.get(i).getPowerCompany().equals(pipeDates.get(n).getPowerCompany())){
//// //设置分组类型
//// pipeDates.get(n).setCompanyType(Integer.parseInt(pipeDates.get(n).getPipeId()));
// pipeDates.get(n).setIconType(1);
// }
// }
k++;
}
PipeList pipeList=new PipeList();
......
......@@ -51,6 +51,17 @@ public class TDetectorUserController extends BaseController
return getDataTable(list);
}
/**
* 获取燃气用户统计信息
*/
@GetMapping("/userStatistics")
public AjaxResult userStatistics()
{
return AjaxResult.success(tDetectorUserService.userStatistics());
}
/**
* 获取探测器用户列表
* @return
......
......@@ -49,6 +49,16 @@ public class TEnterpriseInfoController extends BaseController
return getDataTable(list);
}
/**
* 查询企业类型
* @return
*/
// @RequestMapping("/getEnterpriseType")
// public TableDataInfo getEnterpriseType(){
// List<TEnterpriseInfo> enterpriseType = tEnterpriseInfoService.getEnterpriseType();
// return getDataTable(enterpriseType);
// }
/**
*查询所有企业信息
* @param tEnterpriseInfo
......
package com.zehong.web.controller.system;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import com.zehong.framework.systemsetting.SystemSetting;
import com.zehong.framework.web.domain.server.Sys;
import com.zehong.system.service.ISysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -79,11 +81,14 @@ public class SysLoginController
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
HashMap hashMap=new HashMap();
hashMap.put("map_center","[118.168541,39.838353]");
hashMap.put("prod_test","prod");
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
ajax.put("systemSetting",systemSetting.getSystemWebSetting());
ajax.put("systemSetting",hashMap);
ajax.put("posts",iSysPostService.getPostListByUserId(user.getUserId()));
return ajax;
}
......
package com.zehong.web.controller.system;
import java.util.List;
import com.zehong.system.domain.TVehicleLocationInfo;
import com.zehong.system.service.ITVehicleLocationInfoService;
import io.jsonwebtoken.lang.Collections;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TVehicleInfo;
import com.zehong.system.service.ITVehicleInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 燃气车辆信息Controller
*
* @author zehong
* @date 2023-08-16
*/
@RestController
@RequestMapping("/system/infos")
public class TVehicleInfosController extends BaseController
{
@Autowired
private ITVehicleInfoService tVehicleInfoService;
@Autowired
private ITVehicleLocationInfoService itVehicleLocationInfoService;
/**
* 查询燃气车辆信息列表
*/
@PreAuthorize("@ss.hasPermi('system:info:list')")
@GetMapping("/list")
public TableDataInfo list(TVehicleInfo tVehicleInfo)
{
startPage();
List<TVehicleInfo> list = tVehicleInfoService.selectTVehicleInfoList(tVehicleInfo);
for (int i=0;i<list.size();i++){
//获取最后位置信息
TVehicleLocationInfo tVehicleLocationInfo = new TVehicleLocationInfo();
tVehicleLocationInfo.setCarNum(list.get(i).getCarNum());
tVehicleLocationInfo.setLast(true);
List<TVehicleLocationInfo> tVehicleLocationInfoList=itVehicleLocationInfoService.selectTVehicleLocationInfoList(tVehicleLocationInfo);
//车辆最后位置
if(!Collections.isEmpty(tVehicleLocationInfoList) && tVehicleLocationInfoList.size() > 0){
list.get(i).setLongitude(tVehicleLocationInfoList.get(0).getLongitude());
list.get(i).setLatitude(tVehicleLocationInfoList.get(0).getLatitude());
}
}
return getDataTable(list);
}
/**
* 导出燃气车辆信息列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@Log(title = "燃气车辆信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TVehicleInfo tVehicleInfo)
{
List<TVehicleInfo> list = tVehicleInfoService.selectTVehicleInfoList(tVehicleInfo);
ExcelUtil<TVehicleInfo> util = new ExcelUtil<TVehicleInfo>(TVehicleInfo.class);
return util.exportExcel(list, "燃气车辆信息数据");
}
/**
* 获取燃气车辆信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:info:query')")
@GetMapping(value = "/{vehicleId}")
public AjaxResult getInfo(@PathVariable("vehicleId") Long vehicleId)
{
return AjaxResult.success(tVehicleInfoService.selectTVehicleInfoById(vehicleId));
}
/**
* 新增燃气车辆信息
*/
@PreAuthorize("@ss.hasPermi('system:info:add')")
@Log(title = "燃气车辆信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TVehicleInfo tVehicleInfo)
{
return toAjax(tVehicleInfoService.insertTVehicleInfo(tVehicleInfo));
}
/**
* 修改燃气车辆信息
*/
@PreAuthorize("@ss.hasPermi('system:info:edit')")
@Log(title = "燃气车辆信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TVehicleInfo tVehicleInfo)
{
return toAjax(tVehicleInfoService.updateTVehicleInfo(tVehicleInfo));
}
/**
* 删除燃气车辆信息
*/
@PreAuthorize("@ss.hasPermi('system:info:remove')")
@Log(title = "燃气车辆信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{vehicleIds}")
public AjaxResult remove(@PathVariable Long[] vehicleIds)
{
return toAjax(tVehicleInfoService.deleteTVehicleInfoByIds(vehicleIds));
}
}
package com.zehong.web.controller.tool;
import com.zehong.common.utils.DateUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 时间工具类
*/
public class TimeConfig {
//获取近七天日期
public static List<String> getSevenDate() {
List<String> dateList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for (int i = 0; i < 7; i++) {
Date date = DateUtils.addDays(new Date(), -i);
String formatDate = sdf.format(date);
dateList.add(formatDate);
}
return dateList;
}
}
package com.zehong.system.domain;
import lombok.Data;
import lombok.ToString;
/**
* 统计封装类
*/
@Data
@ToString
public class Statistics {
private int count;
private String date;
}
package com.zehong.system.domain;
import lombok.Data;
import lombok.ToString;
/**
* 用户信息统计封装类
*/
@Data
@ToString
public class TDetectorUserCount {
/**
* 用户总数
*/
private int totalNumberUsers;
/**
* 居民用户
*/
private int residentUsers;
/**
* 商业用户
*/
private int businessUser;
/**
* 工业用户
*/
private int industrialUsers;
}
......@@ -11,7 +11,7 @@ import java.math.BigDecimal;
* 燃气车辆信息对象 t_vehicle_info
*
* @author zehong
* @date 2022-03-17
* @date 2023-08-16
*/
public class TVehicleInfo extends BaseEntity
{
......@@ -50,7 +50,7 @@ public class TVehicleInfo extends BaseEntity
/** 所属企业 */
@Excel(name = "所属企业")
private String beyondEnterpriseId;
private int beyondEnterpriseId;
/** 责任人 */
@Excel(name = "责任人")
......@@ -69,15 +69,37 @@ public class TVehicleInfo extends BaseEntity
private String remarks;
/**
* 经度
* 储配站名称
*/
private String siteStationName;
private BigDecimal longitude;
/**
* 纬度
*/
private BigDecimal latitude;
private String beyondEnterpriseName;
public String getSiteStationName() {
return siteStationName;
}
public void setSiteStationName(String siteStationName) {
this.siteStationName = siteStationName;
}
public String getBeyondEnterpriseName() {
return beyondEnterpriseName;
}
public void setBeyondEnterpriseName(String beyondEnterpriseName) {
this.beyondEnterpriseName = beyondEnterpriseName;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public BigDecimal getLongitude() {
return longitude;
......@@ -167,15 +189,15 @@ public class TVehicleInfo extends BaseEntity
{
return vehicleInspect;
}
public void setBeyondEnterpriseId(String beyondEnterpriseId)
{
this.beyondEnterpriseId = beyondEnterpriseId;
}
public String getBeyondEnterpriseId()
{
public int getBeyondEnterpriseId() {
return beyondEnterpriseId;
}
public void setBeyondEnterpriseId(int beyondEnterpriseId) {
this.beyondEnterpriseId = beyondEnterpriseId;
}
public void setPersonLiable(String personLiable)
{
this.personLiable = personLiable;
......
......@@ -6,6 +6,16 @@ public class TenterpriseInfoData {
private String enterpriseName;
private String enterpriseType;
public String getEnterpriseType() {
return enterpriseType;
}
public void setEnterpriseType(String enterpriseType) {
this.enterpriseType = enterpriseType;
}
public String getEnterpriseId() {
return enterpriseId;
}
......
......@@ -5,6 +5,7 @@ import java.util.Map;
import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorUser;
import com.zehong.system.domain.TDetectorUserCount;
import com.zehong.system.domain.vo.TDetectorUserVO;
/**
......@@ -90,4 +91,10 @@ public interface TDetectorUserMapper
* @return
*/
public Map<String,Object> selectUserNum();
/**
* 查询用户统计信息
* @return
*/
TDetectorUserCount userStatistics();
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.THiddenDangerStandingBook;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
......@@ -67,4 +69,11 @@ public interface THiddenDangerStandingBookMapper
* @return 结果
*/
public int deleteTHiddenDangerStandingBookByIds(Long[] hiddenIds);
/**
* 获取隐患整治台账统计信息
* @param sevenDate
* @return
*/
List<Statistics> hazardStatistics(List<String> sevenDate);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.TTroubleStandingBook;
import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.TTroubleStandingBookVo;
......@@ -67,4 +69,11 @@ public interface TTroubleStandingBookMapper
* @return 结果
*/
public int deleteTTroubleStandingBookByIds(Long[] troubleIds);
/**
* 查询统计信息
* @param sevenDate
* @return
*/
List<Statistics> accidentLedger(List<String> sevenDate);
}
......@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TDetectorUser;
import com.zehong.system.domain.TDetectorUserCount;
import com.zehong.system.domain.vo.TDetectorUserVO;
/**
......@@ -98,4 +99,11 @@ public interface ITDetectorUserService
* @return
*/
public Map<String,Object> selectUserNum();
/**
* 查询用户统计信息
* @return
*/
TDetectorUserCount userStatistics();
}
......@@ -61,4 +61,6 @@ public interface ITEnterpriseInfoService
* @return 结果
*/
public int deleteTEnterpriseInfoById(Long enterpriseId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.THiddenDangerStandingBook;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
......@@ -67,4 +69,10 @@ public interface ITHiddenDangerStandingBookService
* @return 结果
*/
public int deleteTHiddenDangerStandingBookById(Long hiddenId);
/**
* 获取隐患整治台账统计信息
* @param sevenDate
*/
List<Statistics> hazardStatistics(List<String> sevenDate);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.TTroubleStandingBook;
import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.TTroubleStandingBookVo;
......@@ -67,4 +69,14 @@ public interface ITTroubleStandingBookService
* @return 结果
*/
public int deleteTTroubleStandingBookById(Long troubleId);
/**
* 查询统计信息
* @return
*/
List<Statistics> accidentLedger(List<String> sevenDate);
}
......@@ -5,6 +5,7 @@ import java.util.List;
import java.util.Map;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDetectorUserCount;
import com.zehong.system.domain.vo.TDetectorUserVO;
import com.zehong.system.mapper.TDetectorInfoMapper;
import com.zehong.system.mapper.TDeviceInfoMapper;
......@@ -221,4 +222,13 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
public Map<String,Object> selectUserNum(){
return tDetectorUserMapper.selectUserNum();
}
/**
* 查询用户统计信息
* @return
*/
@Override
public TDetectorUserCount userStatistics() {
return tDetectorUserMapper.userStatistics();
}
}
......@@ -2,6 +2,7 @@ package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -105,4 +106,14 @@ public class THiddenDangerStandingBookServiceImpl implements ITHiddenDangerStand
{
return tHiddenDangerStandingBookMapper.deleteTHiddenDangerStandingBookById(hiddenId);
}
/**
* 获取隐患整治台账统计信息
* @param sevenDate
* @return
*/
@Override
public List<Statistics> hazardStatistics(List<String> sevenDate) {
return tHiddenDangerStandingBookMapper.hazardStatistics(sevenDate);
}
}
......@@ -2,6 +2,7 @@ package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.TTroubleStandingBookVo;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -111,4 +112,17 @@ public class TTroubleStandingBookServiceImpl implements ITTroubleStandingBookSer
{
return tTroubleStandingBookMapper.deleteTTroubleStandingBookById(troubleId);
}
/**
* 查询统计信息
* @param sevenDate
* @return
*/
@Override
public List<Statistics> accidentLedger(List<String> sevenDate) {
return tTroubleStandingBookMapper.accidentLedger(sevenDate);
}
}
......@@ -6,6 +6,7 @@
<!--管道-->
<resultMap type="PipeDate" id="PipeDateResult">
<result property="pipeId" column="pipe_id" />
<result property="pipePressure" column="pipe_pressure" />
<result property="pipeDiameter" column="pipe_diameter" />
<result property="pipeMaterial" column="pipe_material" />
<result property="pipeDepth" column="buried_depth" />
......@@ -85,6 +86,8 @@
<resultMap type="TenterpriseInfoData" id="TenterpriseInfoDataResult">
<result property="enterpriseId" column="enterprise_id" />
<result property="enterpriseName" column="enterprise_name" />
<result property="enterpriseType" column="enterprise_type" />
</resultMap>
<!--感知设备列表-->
......@@ -100,7 +103,7 @@
<!--查询管道数据列表-->
<select id="selectPipeData" parameterType="PipeDate" resultMap="PipeDateResult">
select format(pipe_length,2)pipe_length,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
select format(pipe_length,2)pipe_length,pipe_pressure,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
where is_del='0'
</select>
......@@ -149,7 +152,7 @@
<!--查询企业名称id方法-->
<select id="selectTenterpriseInfoData" resultMap="TenterpriseInfoDataResult">
select enterprise_id,enterprise_name from t_enterprise_info where is_del='0'
select enterprise_id,enterprise_name,enterprise_type from t_enterprise_info where is_del='0'
</select>
<!--查询阀门井数据-->
......
......@@ -176,4 +176,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT SUM(IF(user_type=1,1,0)) AS juminNum,SUM(IF(user_type=2,1,0)) AS shangNum,
SUM(IF(user_type=3,1,0)) AS gongNum FROM t_detector_user WHERE is_del = 0
</select>
<!--查询用户统计信息-->
<select id="userStatistics" resultType="com.zehong.system.domain.TDetectorUserCount">
SELECT
(select count(user_id) from t_detector_user where is_del='0')as totalNumberUsers,
(select count(user_id) from t_detector_user where user_type=1 and is_del='0')as residentUsers,
(select count(user_id) from t_detector_user where user_type=2 and is_del='0')as businessUser,
(select count(user_id) from t_detector_user where user_type=3 and is_del='0')as industrialUsers
FROM `t_detector_user` limit 0,1
</select>
</mapper>
......@@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update t_enterprise_info
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseType!=null"> enterprise_type = #{enterpriseType}</if>
<if test="enterpriseType!=null"> enterprise_type = #{enterpriseType},</if>
<if test="registerAddress != null">register_address = #{registerAddress},</if>
<if test="legalRepresentative != null">legal_representative = #{legalRepresentative},</if>
<if test="businessArea != null">business_area = #{businessArea},</if>
......
......@@ -132,4 +132,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{hiddenId}
</foreach>
</delete>
<!--获取隐患整治台账统计信息-->
<select id="hazardStatistics" resultType="com.zehong.system.domain.Statistics">
SELECT
COUNT( * ) AS 'count',
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS date
FROM
t_hidden_danger_standing_book
WHERE
is_del='0'
and
DATE_FORMAT( create_time, '%Y-%m-%d' ) IN
<foreach collection="list" item="sevenDate" separator="," open="(" close=")">
#{sevenDate}
</foreach>
GROUP BY
DATE_FORMAT( create_time, '%Y-%m-%d' )
ORDER BY
DATE_FORMAT( create_time, '%Y-%m-%d' ) DESC;
</select>
</mapper>
......@@ -148,4 +148,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{troubleId}
</foreach>
</delete>
<!--查询统计信息-->
<select id="accidentLedger" resultType="com.zehong.system.domain.Statistics">
SELECT
COUNT( * ) AS 'count',
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS date
FROM
t_trouble_standing_book
WHERE
is_del='0'
and
DATE_FORMAT( create_time, '%Y-%m-%d' ) IN
<foreach collection="list" item="sevenDate" separator="," open="(" close=")">
#{sevenDate}
</foreach>
GROUP BY
DATE_FORMAT( create_time, '%Y-%m-%d' )
ORDER BY
DATE_FORMAT( create_time, '%Y-%m-%d' ) DESC;
</select>
</mapper>
......@@ -18,6 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="phone" column="phone" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="beyondEnterpriseName" column="enterprise_name" />
<result property="siteStationName" column="site_station_name" />
</resultMap>
<sql id="selectTVehicleInfoVo">
......@@ -25,25 +27,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectTVehicleInfoList" parameterType="TVehicleInfo" resultMap="TVehicleInfoResult">
<include refid="selectTVehicleInfoVo"/>
select a.*,b.enterprise_name,c.site_station_name
from t_vehicle_info a
left join t_enterprise_info b on a.beyond_enterprise_id=b.enterprise_id
left join t_site_station_info c on c.site_station_id=a.station_id
<where>
<if test="carNum != null and carNum != ''"> and car_num like concat('%', #{carNum}, '%') </if>
<if test="brandModel != null and brandModel != ''"> and brand_model = #{brandModel}</if>
<if test="vehicleType != null and vehicleType != ''"> and vehicle_type = #{vehicleType}</if>
<if test="vehicleLoad != null and vehicleLoad != ''"> and vehicle_load = #{vehicleLoad}</if>
<if test="vehicleSize != null and vehicleSize != ''"> and vehicle_size = #{vehicleSize}</if>
<if test="vehicleLimt != null and vehicleLimt != ''"> and vehicle_limt = #{vehicleLimt}</if>
<if test="vehicleInspect != null and vehicleInspect != ''"> and vehicle_inspect = #{vehicleInspect}</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != ''"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="personLiable != null and personLiable != ''"> and person_liable = #{personLiable}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="brandModel != null and brandModel != ''"> and a.brand_model = #{brandModel}</if>
<if test="vehicleType != null and vehicleType != ''"> and a.vehicle_type = #{vehicleType}</if>
<if test="vehicleLoad != null and vehicleLoad != ''"> and a.vehicle_load = #{vehicleLoad}</if>
<if test="vehicleSize != null and vehicleSize != ''"> and a.vehicle_size = #{vehicleSize}</if>
<if test="vehicleLimt != null and vehicleLimt != ''"> and a.vehicle_limt = #{vehicleLimt}</if>
<if test="vehicleInspect != null and vehicleInspect != ''"> and a.vehicle_inspect = #{vehicleInspect}</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != ''"> and a.beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="personLiable != null and personLiable != ''"> and a.person_liable = #{personLiable}</if>
<if test="phone != null and phone != ''"> and a.phone = #{phone}</if>
<if test="isDel != null and isDel != ''"> and a.is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and a.remarks = #{remarks}</if>
</where>
order by a.vehicle_id desc
</select>
<select id="selectTVehicleInfoById" parameterType="Long" resultMap="TVehicleInfoResult">
<include refid="selectTVehicleInfoVo"/>
select a.*,b.enterprise_name
from t_vehicle_info a left join t_enterprise_info b on a.beyond_enterprise_id=b.enterprise_id
where vehicle_id = #{vehicleId}
</select>
......
import request from '@/utils/request'
// 查询燃气车辆信息列表
export function listInfo(query) {
return request({
url: '/system/infos/list',
method: 'get',
params: query
})
}
// 查询燃气车辆信息详细
export function getInfo(vehicleId) {
return request({
url: '/system/infos/' + vehicleId,
method: 'get'
})
}
// 新增燃气车辆信息
export function addInfo(data) {
return request({
url: '/system/infos',
method: 'post',
data: data
})
}
// 修改燃气车辆信息
export function updateInfo(data) {
return request({
url: '/system/infos',
method: 'put',
data: data
})
}
// 删除燃气车辆信息
export function delInfo(vehicleId) {
return request({
url: '/system/infos/' + vehicleId,
method: 'delete'
})
}
// 导出燃气车辆信息
export function exportInfo(query) {
return request({
url: '/system/infos/export',
method: 'get',
params: query
})
}
......@@ -339,25 +339,25 @@ export default {
{ required: true, message: "请输入管道长度", trigger: "blur" },
// { min: 0, max: 10, message: "长度10位", trigger: "blur" },
],
pipeDiameter: [
{ required: true, message: "请输入管径", trigger: "blur" },
// { min: 0, max: 15, message: "长度15位", trigger: "blur" },
],
pipePressure: [
{ required: true, message: "请输入压力", trigger: "blur" },
// { min: 0, max: 10, message: "长度10位", trigger: "blur" },
],
buildDate: [
{ required: true, message: "请选择建设年代", trigger: "blur" },
],
pipeMaterial: [
{ required: true, message: "请输入材质", trigger: "blur" },
// { min: 0, max: 10, message: "长度10位", trigger: "blur" },
],
buriedDepth:[
{ required: true, message: "请输入埋深", trigger: "blur" },
// { min: 0, max: 10, message: "长度10位", trigger: "blur" },
],
// pipeDiameter: [
// { required: true, message: "请输入管径", trigger: "blur" },
// // { min: 0, max: 15, message: "长度15位", trigger: "blur" },
// ],
// pipePressure: [
// { required: true, message: "请输入压力", trigger: "blur" },
// // { min: 0, max: 10, message: "长度10位", trigger: "blur" },
// ],
// buildDate: [
// { required: true, message: "请选择建设年代", trigger: "blur" },
// ],
// pipeMaterial: [
// { required: true, message: "请输入材质", trigger: "blur" },
// // { min: 0, max: 10, message: "长度10位", trigger: "blur" },
// ],
// buriedDepth:[
// { required: true, message: "请输入埋深", trigger: "blur" },
// // { min: 0, max: 10, message: "长度10位", trigger: "blur" },
// ],
}
};
},
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="车牌号" prop="carNum">
<el-input
v-model="queryParams.carNum"
placeholder="请输入车牌号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="责任人" prop="personLiable">
<el-input
v-model="queryParams.personLiable"
placeholder="请输入责任人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入联系电话"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:info:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:info:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:info:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- :loading="exportLoading"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:info:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="车辆id" align="center" prop="vehicleId" />-->
<el-table-column label="储配站" align="center" prop="siteStationName">
<template slot-scope="scope">
<span v-if="scope.row.siteStationName!=null">{{scope.row.siteStationName}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="车牌号" align="center" prop="carNum">
<template slot-scope="scope">
<span v-if="scope.row.carNum!=null">{{scope.row.carNum}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="品牌型号" align="center" prop="brandModel">
<template slot-scope="scope">
<span v-if="scope.row.brandModel!=null">{{scope.row.brandModel}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="车辆类型" align="center" prop="vehicleType">
<template slot-scope="scope">
<span v-if="scope.row.vehicleType == 1">罐车</span>
<span v-if="scope.row.vehicleType == 2">卡车</span>
</template>
</el-table-column>
<el-table-column label="车辆载重" align="center" prop="vehicleLoad">
<template slot-scope="scope">
<span v-if="scope.row.vehicleLoad!=null">{{scope.row.vehicleLoad}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="车辆大小" align="center" prop="vehicleSize">
<template slot-scope="scope">
<span v-if="scope.row.vehicleSize!=null">{{scope.row.vehicleSize}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="车辆限乘" align="center" prop="vehicleLimt">
<template slot-scope="scope">
<span v-if="scope.row.vehicleLimt!=null">{{scope.row.vehicleLimt}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="车辆检测信息" align="center" prop="vehicleInspect">
<template slot-scope="scope">
<span v-if="scope.row.vehicleInspect!=null">{{scope.row.vehicleInspect}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="责任人" align="center" prop="personLiable">
<template slot-scope="scope">
<span v-if="scope.row.personLiable!=null">{{scope.row.personLiable}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="经度" align="center" prop="longitude">
<template slot-scope="scope">
<span v-if="scope.row.longitude!=null">{{scope.row.longitude}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="经度" align="center" prop="latitude">
<template slot-scope="scope">
<span v-if="scope.row.latitude!=null">{{scope.row.latitude}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:info:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:info:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改燃气车辆信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-row>
<el-col :span="11">
<el-form-item label="车牌号" prop="carNum">
<el-input v-model="form.carNum" placeholder="请输入车牌号" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="品牌型号" prop="brandModel">
<el-input v-model="form.brandModel" placeholder="请输入品牌型号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="车辆类型" prop="vehicleType">
<el-select v-model="form.vehicleType" placeholder="请选择车辆类型" style="width: 100%;">
<el-option label="罐车" value="1" />
<el-option label="卡车" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="车辆载重" prop="vehicleLoad">
<el-input v-model="form.vehicleLoad" placeholder="请输入车辆载重" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="车辆大小" prop="vehicleSize">
<el-input v-model="form.vehicleSize" placeholder="请输入车辆大小" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="车辆限乘" prop="vehicleLimt">
<el-input v-model="form.vehicleLimt" placeholder="请输入车辆限乘" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="车辆检测信息" prop="vehicleInspect">
<el-input v-model="form.vehicleInspect" placeholder="请输入车辆检测信息" />
</el-form-item>
</el-col>
<el-col :span="11">
<!-- -->
<!-- <el-form-item label="所属企业" prop="beyondEnterpriseId">-->
<!-- <el-input v-model="form.beyondEnterpriseId" placeholder="请输入所属企业" />-->
<!-- </el-form-item>-->
<el-form-item label="所属企业" prop="beyondEnterpriseId">
<el-select v-model="form.beyondEnterpriseId" placeholder="请选择所属企业" >
<el-option
v-for = "dict in enterpriseList"
:key = "dict.enterpriseId"
:label = "dict.enterpriseName"
:value = "dict.enterpriseId"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="责任人" prop="personLiable">
<el-input v-model="form.personLiable" placeholder="请输入责任人" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarks">
<el-input type="textarea" v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/system/license";
import {enterpriseList} from "@/api/system/eventInfo";
export default {
name: "Info",
components: {
},
data() {
return {
enterpriseList:[],
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 燃气车辆信息表格数据
infoList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
carNum: null,
brandModel: null,
vehicleType: null,
vehicleLoad: null,
vehicleSize: null,
vehicleLimt: null,
vehicleInspect: null,
beyondEnterpriseId: null,
personLiable: null,
phone: null,
isDel: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
qiyechang(value){
let obj = {};
obj = this.enterpriseList.find((item)=>{
return item.enterpriseId === value;
``});
this.form.beyondEnterpriseName = obj.enterpriseName;
this.form.beyondEnterpriseId = value;
},
/** 查询燃气车辆信息列表 */
getList() {
this.loading = true;
listInfo(this.queryParams).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
vehicleId: null,
carNum: null,
brandModel: null,
vehicleType: null,
vehicleLoad: null,
vehicleSize: null,
vehicleLimt: null,
vehicleInspect: null,
beyondEnterpriseId: null,
personLiable: null,
phone: null,
isDel: null,
remarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.vehicleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加燃气车辆信息";
enterpriseList(this.queryParams).then(response => {
this.enterpriseList = response.data;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const vehicleId = row.vehicleId || this.ids
enterpriseList(this.queryParams).then(response => {
this.enterpriseList = response.data;
});
getInfo(vehicleId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改燃气车辆信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.vehicleId != null) {
updateInfo(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInfo(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const vehicleIds = row.vehicleId || this.ids;
this.$confirm('是否确认删除此数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delInfo(vehicleIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有燃气车辆信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportInfo(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
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