Commit 76b34c17 authored by wuqinghua's avatar wuqinghua

2022-3-30 吴卿华

parent 0cba0013
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -40,6 +43,9 @@ public class TDetectorUserController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TDetectorUser tDetectorUser)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDetectorUser.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TDetectorUser> list = tDetectorUserService.selectTDetectorUserList(tDetectorUser);
return getDataTable(list);
......@@ -71,6 +77,9 @@ public class TDetectorUserController extends BaseController
@GetMapping("/export")
public AjaxResult export(TDetectorUser tDetectorUser)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDetectorUser.setBeyondEnterpriseId(user.getDeptId());
List<TDetectorUser> list = tDetectorUserService.selectTDetectorUserList(tDetectorUser);
ExcelUtil<TDetectorUser> util = new ExcelUtil<TDetectorUser>(TDetectorUser.class);
return util.exportExcel(list, "燃气用户数据");
......@@ -94,6 +103,9 @@ public class TDetectorUserController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody TDetectorUser tDetectorUser)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDetectorUser.setBeyondEnterpriseId(user.getDeptId());
return toAjax(tDetectorUserService.insertTDetectorUser(tDetectorUser));
}
......
......@@ -5,6 +5,8 @@ import java.util.List;
import java.util.Map;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.Listaw;
import com.zehong.system.domain.TDetailInfoList;
import com.zehong.system.domain.TDeviceInfoS;
......@@ -53,6 +55,9 @@ public class TDeviceInfoController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TDeviceInfo tDeviceInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDeviceInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
return getDataTable(list);
......@@ -66,6 +71,9 @@ public class TDeviceInfoController extends BaseController
@GetMapping("/export")
public AjaxResult export(TDeviceInfo tDeviceInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tDeviceInfo.setBeyondEnterpriseId(user.getDeptId());
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
ExcelUtil<TDeviceInfo> util = new ExcelUtil<TDeviceInfo>(TDeviceInfo.class);
return util.exportExcel(list, "设备信息数据");
......@@ -95,7 +103,6 @@ public class TDeviceInfoController extends BaseController
listaw.gettDeviceInfo().setDeviceCode(intFlag);
//添加设备信息表数据 并且返回新增id
tDeviceInfoService.insertTDeviceInfo(listaw.gettDeviceInfo());
if (CollectionUtils.isNotEmpty(listaw.gettDeviceInfoS())){
//将关联设备信息与设备进行绑定
tDeviceInfoService.updatetRelationDeviceDetailInfo(listaw.gettDeviceInfoS(),listaw.gettDeviceInfo().getDeviceId(),listaw.gettDeviceInfo().getRelationDeviceType());
......
......@@ -2,8 +2,9 @@ package com.zehong.web.controller.supervise;
import java.io.File;
import java.text.ParseException;
import java.util.List;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -37,6 +38,9 @@ public class TEmployedPeopleInfoController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TEmployedPeopleInfo tEmployedPeopleInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEmployedPeopleInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TEmployedPeopleInfo> list = tEmployedPeopleInfoService.selectTEmployedPeopleInfoList(tEmployedPeopleInfo);
return getDataTable(list);
......@@ -50,6 +54,9 @@ public class TEmployedPeopleInfoController extends BaseController
@GetMapping("/export")
public AjaxResult export(TEmployedPeopleInfo tEmployedPeopleInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEmployedPeopleInfo.setBeyondEnterpriseId(user.getDeptId());
List<TEmployedPeopleInfo> list = tEmployedPeopleInfoService.selectTEmployedPeopleInfoList(tEmployedPeopleInfo);
ExcelUtil<TEmployedPeopleInfo> util = new ExcelUtil<TEmployedPeopleInfo>(TEmployedPeopleInfo.class);
return util.exportExcel(list, "从业人员信息数据");
......@@ -122,7 +129,9 @@ public class TEmployedPeopleInfoController extends BaseController
@Log(title = "企业信息查询")
@RequestMapping("/selectTEnterprise")
public AjaxResult select(){
return AjaxResult.success(tEmployedPeopleInfoService.selectTEnterprise());
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
return AjaxResult.success(tEmployedPeopleInfoService.selectTEnterprise(user.getDeptId()));
}
......
package com.zehong.web.controller.system;
package com.zehong.web.controller.supervise;
import java.io.File;
import java.util.List;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.utils.file.FileUploadUtils;
import com.zehong.framework.config.ServerConfig;
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.config.GassafetyProgressConfig;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.framework.config.ServerConfig;
import com.zehong.system.domain.TEnterpriseInfo;
import com.zehong.system.service.ITEnterpriseInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import static com.zehong.common.utils.file.FileUtils.deleteFile;
import static org.apache.tomcat.util.http.fileupload.FileUtils.deleteDirectory;
import java.io.File;
import java.util.List;
/**
* 企业信息Controller
......@@ -45,10 +36,13 @@ public class TEnterpriseInfoController extends BaseController
/**
* 查询企业信息列表
*/
@PreAuthorize("@ss.hasPermi('system:info:list')")
@PreAuthorize("@ss.hasPermi('regulation:info:list')")
@GetMapping("/list")
public TableDataInfo list(TEnterpriseInfo tEnterpriseInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEnterpriseInfo.setEnterpriseId(user.getDeptId());
startPage();
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
return getDataTable(list);
......@@ -62,6 +56,9 @@ public class TEnterpriseInfoController extends BaseController
@GetMapping("/enterpriseLists")
public TableDataInfo enterpriseLists(TEnterpriseInfo tEnterpriseInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEnterpriseInfo.setEnterpriseId(user.getDeptId());
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
return getDataTable(list);
}
......@@ -80,11 +77,14 @@ public class TEnterpriseInfoController extends BaseController
/**
* 导出企业信息列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@PreAuthorize("@ss.hasPermi('regulation:info:export')")
@Log(title = "企业信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TEnterpriseInfo tEnterpriseInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEnterpriseInfo.setEnterpriseId(user.getDeptId());
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
ExcelUtil<TEnterpriseInfo> util = new ExcelUtil<TEnterpriseInfo>(TEnterpriseInfo.class);
return util.exportExcel(list, "企业信息数据");
......@@ -93,7 +93,7 @@ public class TEnterpriseInfoController extends BaseController
/**
* 获取企业信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:info:query')")
@PreAuthorize("@ss.hasPermi('regulation:info:query')")
@GetMapping(value = "/{enterpriseId}")
public AjaxResult getInfo(@PathVariable("enterpriseId") Long enterpriseId)
{
......@@ -103,18 +103,21 @@ public class TEnterpriseInfoController extends BaseController
/**
* 新增企业信息
*/
@PreAuthorize("@ss.hasPermi('system:info:add')")
@PreAuthorize("@ss.hasPermi('regulation:info:add')")
@Log(title = "企业信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TEnterpriseInfo tEnterpriseInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tEnterpriseInfo.setCreateEnterpriseId(user.getDeptId());
return toAjax(tEnterpriseInfoService.insertTEnterpriseInfo(tEnterpriseInfo));
}
/**
* 修改企业信息
*/
@PreAuthorize("@ss.hasPermi('system:info:edit')")
@PreAuthorize("@ss.hasPermi('regulation:info:edit')")
@Log(title = "企业信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TEnterpriseInfo tEnterpriseInfo)
......@@ -139,7 +142,7 @@ public class TEnterpriseInfoController extends BaseController
/**
* 删除企业信息
*/
@PreAuthorize("@ss.hasPermi('system:info:remove')")
@PreAuthorize("@ss.hasPermi('regulation:info:remove')")
@Log(title = "企业信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{enterpriseIds}")
public AjaxResult remove(@PathVariable Long[] enterpriseIds)
......
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.service.ITEmployedPeopleInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -43,6 +46,9 @@ public class TPipeInfoController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TPipeInfo tPipeInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tPipeInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TPipeInfo> list = tPipeInfoService.selectTPipeInfoList(tPipeInfo);
return getDataTable(list);
......@@ -56,6 +62,9 @@ public class TPipeInfoController extends BaseController
@GetMapping("/export")
public AjaxResult export(TPipeInfo tPipeInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tPipeInfo.setBeyondEnterpriseId(user.getDeptId());
List<TPipeInfo> list = tPipeInfoService.selectTPipeInfoList(tPipeInfo);
ExcelUtil<TPipeInfo> util = new ExcelUtil<TPipeInfo>(TPipeInfo.class);
return util.exportExcel(list, "管道信息数据");
......
......@@ -44,6 +44,9 @@ public class TProjectInfoController extends BaseController
@GetMapping("/list")
public TableDataInfo list(TProjectInfo tProjectInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tProjectInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TProjectInfo> list = tProjectInfoService.selectTProjectInfoList(tProjectInfo);
return getDataTable(list);
......@@ -57,6 +60,9 @@ public class TProjectInfoController extends BaseController
@GetMapping("/export")
public AjaxResult export(TProjectInfo tProjectInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tProjectInfo.setBeyondEnterpriseId(user.getDeptId());
List<TProjectInfo> list = tProjectInfoService.selectTProjectInfoList(tProjectInfo);
ExcelUtil<TProjectInfo> util = new ExcelUtil<TProjectInfo>(TProjectInfo.class);
return util.exportExcel(list, "工程项目信息数据");
......@@ -79,17 +85,25 @@ public class TProjectInfoController extends BaseController
@Log(title = "工程项目信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProjectInfo tProjectInfo) throws ParseException {
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tProjectInfo.setBeyondEnterpriseId(user.getDeptId());
//查询是否已经有重复的年份数据
List<TProjectInfo> tProjectInfos = tProjectInfoService.selectSameYear(tProjectInfo.getProjectYear());
List<TProjectInfo> tProjectInfos = tProjectInfoService.selectSameYear(tProjectInfo.getProjectYear(),tProjectInfo.getBeyondEnterpriseId());
//说明有重复的年份 将重复的年份删除
if (tProjectInfos.size()!=0){
//重复年份删除方法
tProjectInfoService.deleteisSameYear(tProjectInfo.getProjectYear());
tProjectInfoService.deleteisSameYear(tProjectInfo.getProjectYear(),tProjectInfo.getBeyondEnterpriseId());
}
SysUser user = SecurityUtils.getLoginUser().getUser();
//获取用户所属单位
String enterpriseName = user.getEnterpriseName();
if (user.getDeptId()!=-2){
//查询企业名称
String enterpriseName = tProjectInfoService.selectEnterpriseName(user.getDeptId());
tProjectInfo.setEnterpriseCode(String.valueOf(enterpriseName));
}else {
tProjectInfo.setEnterpriseCode("政府部门");
}
//添加企业
tProjectInfo.setBeyondEnterpriseId(user.getDeptId());
return toAjax(tProjectInfoService.insertTProjectInfo(tProjectInfo));
}
......
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TTSiteStationInfoList;
import com.zehong.system.service.ITDeviceInfoService;
import com.zehong.system.service.ITEmployedPeopleInfoService;
......@@ -49,6 +51,9 @@ public class TSiteStationInfoController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(TSiteStationInfo tSiteStationInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tSiteStationInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<TSiteStationInfo> list = tSiteStationInfoService.selectTSiteStationInfoList(tSiteStationInfo);
return getDataTable(list);
......@@ -62,6 +67,9 @@ public class TSiteStationInfoController extends BaseController {
@GetMapping("/export")
public AjaxResult export(TSiteStationInfo tSiteStationInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tSiteStationInfo.setBeyondEnterpriseId(user.getDeptId());
List<TSiteStationInfo> list = tSiteStationInfoService.selectTSiteStationInfoList(tSiteStationInfo);
ExcelUtil<TSiteStationInfo> util = new ExcelUtil<TSiteStationInfo>(TSiteStationInfo.class);
return util.exportExcel(list, "场站信息数据");
......
......@@ -20,13 +20,15 @@ public class TDetectorUser extends BaseEntity
private Long userId;
/** 用户账号 */
@Excel(name = "用户账号")
private String username;
/** 用户名称 */
@Excel(name = "用户名称")
private String nickName;
/** 权属单位 */
private Long beyondEnterpriseId;
/** 用户类型(1居民用户,2商业用户,3工业用户) */
@Excel(name = "用户类型")
private String userType;
......@@ -62,6 +64,18 @@ public class TDetectorUser extends BaseEntity
@Excel(name = "备注")
private String remarks;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Long getBeyondEnterpriseId() {
return beyondEnterpriseId;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId) {
this.beyondEnterpriseId = beyondEnterpriseId;
}
public void setUserId(Long userId)
{
this.userId = userId;
......@@ -173,19 +187,20 @@ public class TDetectorUser extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("username", getUsername())
.append("nickName", getNickName())
.append("userType", getUserType())
.append("address", getAddress())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("linkman", getLinkman())
.append("phone", getPhone())
.append("email", getEmail())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
return "TDetectorUser{" +
"userId=" + userId +
", username='" + username + '\'' +
", nickName='" + nickName + '\'' +
", beyondEnterpriseId=" + beyondEnterpriseId +
", userType='" + userType + '\'' +
", address='" + address + '\'' +
", longitude=" + longitude +
", latitude=" + latitude +
", linkman='" + linkman + '\'' +
", phone='" + phone + '\'' +
", email='" + email + '\'' +
", isDel='" + isDel + '\'' +
", remarks='" + remarks + '\'' +
'}';
}
}
......@@ -20,6 +20,9 @@ public class TEnterpriseInfo extends BaseEntity
/** 企业id */
private Long enterpriseId;
/**创建企业id*/
private Long createEnterpriseId;
/** 企业名称 */
@Excel(name = "企业名称")
private String enterpriseName;
......@@ -70,6 +73,14 @@ public class TEnterpriseInfo extends BaseEntity
/**本地存储图片路径*/
private String burl;
public Long getCreateEnterpriseId() {
return createEnterpriseId;
}
public void setCreateEnterpriseId(Long createEnterpriseId) {
this.createEnterpriseId = createEnterpriseId;
}
public String getBurl() {
return burl;
}
......@@ -210,6 +221,7 @@ public class TEnterpriseInfo extends BaseEntity
public String toString() {
return "TEnterpriseInfo{" +
"enterpriseId=" + enterpriseId +
", createEnterpriseId=" + createEnterpriseId +
", enterpriseName='" + enterpriseName + '\'' +
", registerAddress='" + registerAddress + '\'' +
", legalRepresentative='" + legalRepresentative + '\'' +
......
......@@ -20,11 +20,11 @@ public class TPipeInfo extends BaseEntity
private Long pipeId;
/** 管道长度 */
@Excel(name = "管道长度")
@Excel(name = "管道长度(米)")
private BigDecimal pipeLength;
/** 管径 */
@Excel(name = "管径")
@Excel(name = "管径(厘米)")
private String pipeDiameter;
/** 压力 */
......@@ -36,7 +36,6 @@ public class TPipeInfo extends BaseEntity
private String pipeMaterial;
/** 管道地址 */
@Excel(name = "管道地址")
private String pipeAddr;
/** 埋深 */
......@@ -59,7 +58,6 @@ public class TPipeInfo extends BaseEntity
private String peopleOccupation;
/** 权属单位 */
@Excel(name = "权属单位")
private Long beyondEnterpriseId;
/** 权属单位名称 */
......
......@@ -23,33 +23,35 @@ public class TProjectInfo extends BaseEntity
/** 工程项目年度 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "工程项目年度", width = 30, dateFormat = "yyyy-MM-dd")
@Excel(name = "工程项目年度", width = 30, dateFormat = "yyyy")
private Date projectYear;
/**企业编码*/
@Excel(name = "企业名称")
private String enterpriseCode;
/** 权属单位 */
private Long beyondEnterpriseId;
/** 门站地址 */
@Excel(name = "门站地址")
private String gateStationAddress;
/** 门站金额 */
@Excel(name = "门站金额")
@Excel(name = "门站投资额(万元)")
private BigDecimal gateStationInvestment;
/** 门站数量 */
@Excel(name = "门站数量")
@Excel(name = "门站数量(个)")
private Long numberGateStations;
/** 管道长度 */
@Excel(name = "管道长度")
@Excel(name = "管道长度(米)")
private Long pipeLength;
/** 管道金额 */
@Excel(name = "管道金额")
@Excel(name = "管道投资额(万元)")
private BigDecimal pipeInvestment;
/**企业编码*/
@Excel(name = "企业编码")
private String enterpriseCode;
/** 附件地址 */
private String nearbyAddress;
......@@ -60,6 +62,13 @@ public class TProjectInfo extends BaseEntity
@Excel(name = "备注")
private String remarks;
public Long getBeyondEnterpriseId() {
return beyondEnterpriseId;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId) {
this.beyondEnterpriseId = beyondEnterpriseId;
}
public String getEnterpriseCode() {
return enterpriseCode;
......@@ -167,6 +176,7 @@ public class TProjectInfo extends BaseEntity
return "TProjectInfo{" +
"projectId=" + projectId +
", projectYear=" + projectYear +
", beyondEnterpriseId=" + beyondEnterpriseId +
", gateStationAddress='" + gateStationAddress + '\'' +
", gateStationInvestment=" + gateStationInvestment +
", numberGateStations=" + numberGateStations +
......
......@@ -64,7 +64,7 @@ public interface TEmployedPeopleInfoMapper
* 企业信息查询(下拉框数据)
* @return
*/
List<TEnterpriseInfo> selectTEnterprise();
List<TEnterpriseInfo> selectTEnterprise(Long deptId);
/**
* 根据企业id查询企业名称
......
......@@ -3,6 +3,7 @@ package com.zehong.system.mapper;
import java.util.Date;
import java.util.List;
import com.zehong.system.domain.TProjectInfo;
import org.apache.ibatis.annotations.Param;
/**
* 工程项目信息Mapper接口
......@@ -65,13 +66,13 @@ public interface TProjectInfoMapper
* @param projectYear
* @return
*/
List<TProjectInfo> selectSameYear(Date projectYear);
List<TProjectInfo> selectSameYear(@Param("projectYear") Date projectYear,@Param("beyondEnterpriseId") Long beyondEnterpriseId);
/**
* 重复年份删除方法
* @param isSameYear
*/
void deleteisSameYear(Date isSameYear);
void deleteisSameYear(@Param("isSameYear")Date isSameYear,@Param("beyondEnterpriseId")Long beyondEnterpriseId);
/**
* 查询修改文件之前的路径
......@@ -79,4 +80,11 @@ public interface TProjectInfoMapper
* @return
*/
TProjectInfo selectNearbyAddress(Long projectId);
/**
* 查询企业名称
* @param deptId
* @return
*/
String selectEnterpriseName(Long deptId);
}
......@@ -64,7 +64,7 @@ public interface ITEmployedPeopleInfoService
* 企业信息查询(下拉框数据)
* @return
*/
public List<TEnterpriseInfo> selectTEnterprise();
public List<TEnterpriseInfo> selectTEnterprise(Long deptId);
/**
* 根据企业id查询企业名称
......
......@@ -65,17 +65,24 @@ public interface ITProjectInfoService
* @param projectYear
* @return
*/
List<TProjectInfo> selectSameYear(Date projectYear);
List<TProjectInfo> selectSameYear(Date projectYear,Long beyondEnterpriseId);
/**
* 重复年份删除方法
* @param isSameYear
*/
void deleteisSameYear(Date isSameYear);
void deleteisSameYear(Date isSameYear,Long beyondEnterpriseId);
/**
* 查询修改文件之前的路径
* @param projectId
*/
TProjectInfo selectNearbyAddress(Long projectId);
/**
* 查询企业名称
* @param deptId
* @return
*/
String selectEnterpriseName(Long deptId);
}
......@@ -100,8 +100,8 @@ public class TEmployedPeopleInfoServiceImpl implements ITEmployedPeopleInfoServi
* @return
*/
@Override
public List<TEnterpriseInfo> selectTEnterprise() {
return tEmployedPeopleInfoMapper.selectTEnterprise();
public List<TEnterpriseInfo> selectTEnterprise(Long deptId) {
return tEmployedPeopleInfoMapper.selectTEnterprise(deptId);
}
/**
......
......@@ -101,8 +101,8 @@ public class TProjectInfoServiceImpl implements ITProjectInfoService
* @return
*/
@Override
public List<TProjectInfo> selectSameYear(Date projectYear) {
List<TProjectInfo> tProjectInfos = tProjectInfoMapper.selectSameYear(projectYear);
public List<TProjectInfo> selectSameYear(Date projectYear,Long beyondEnterpriseId) {
List<TProjectInfo> tProjectInfos = tProjectInfoMapper.selectSameYear(projectYear,beyondEnterpriseId);
return tProjectInfos;
}
......@@ -111,8 +111,8 @@ public class TProjectInfoServiceImpl implements ITProjectInfoService
* @param isSameYear
*/
@Override
public void deleteisSameYear(Date isSameYear) {
tProjectInfoMapper.deleteisSameYear(isSameYear);
public void deleteisSameYear(Date isSameYear,Long beyondEnterpriseId) {
tProjectInfoMapper.deleteisSameYear(isSameYear,beyondEnterpriseId);
}
/**
......@@ -125,4 +125,15 @@ public class TProjectInfoServiceImpl implements ITProjectInfoService
TProjectInfo tProjectInfo = tProjectInfoMapper.selectNearbyAddress(projectId);
return tProjectInfo;
}
/**
* 查询企业名称
* @param deptId
* @return
*/
@Override
public String selectEnterpriseName(Long deptId) {
String enterpriseName = tProjectInfoMapper.selectEnterpriseName(deptId);
return enterpriseName;
}
}
......@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userId" column="user_id" />
<result property="username" column="username" />
<result property="nickName" column="nick_name" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="userType" column="user_type" />
<result property="address" column="address" />
<result property="longitude" column="longitude" />
......@@ -26,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTDetectorUserList" parameterType="TDetectorUser" resultMap="TDetectorUserResult">
select user_id, username, nick_name, (CASE user_type WHEN '1' THEN '居民用户' WHEN '2' THEN '商业用户'WHEN '3' THEN '工业用户'end) as user_type , address, longitude, latitude, linkman, phone, email, is_del, remarks from t_detector_user
<where> is_del = '0'
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2"> and beyond_enterprise_id =#{beyondEnterpriseId}</if>
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
</where>
......@@ -115,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">address,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="linkman != null">linkman,</if>
<if test="phone != null">phone,</if>
<if test="email != null">email,</if>
......@@ -128,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">#{address},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="linkman != null">#{linkman},</if>
<if test="phone != null">#{phone},</if>
<if test="email != null">#{email},</if>
......
......@@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTDeviceInfoVo"/>
<where>
a.is_del='0'
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="deviceAddr != null and deviceAddr != ''"> and device_addr = #{deviceAddr}</if>
......
......@@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select employed_people_id, employed_people_name,avatar_address, id_card, certificate_num, beyond_enterprise_name, beyond_enterprise_id, register_examination_type,(CASE people_occupation WHEN '1' THEN '主要负责人' WHEN '2' THEN '安全管理人员' WHEN '3' THEN '运行维护和抢修人员'end ) as people_occupation, issue_date, certificate_change, create_by, create_time, update_by, update_time, is_del, remarks from t_employed_people_info
<where>
1=1 and is_del='0'
<if test=" beyondEnterpriseId !='-2' and beyondEnterpriseId != null and beyondEnterpriseId != ''"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="employedPeopleName != null and employedPeopleName != ''"> and employed_people_name like concat('%', #{employedPeopleName}, '%')</if>
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
......@@ -137,7 +138,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--企业信息查询(下拉框数据)-->
<select id="selectTEnterprise" resultMap="TEnterpriseInfoResult">
select enterprise_id,enterprise_name from t_enterprise_info where is_del='0'
select enterprise_id,enterprise_name from t_enterprise_info where
<if test="deptId!=null and deptId!= -2">
enterprise_id =#{deptId} and
</if>
is_del='0'
</select>
<!--根据企业id查询企业名称-->
......
......@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TEnterpriseInfo" id="TEnterpriseInfoResult">
<result property="enterpriseId" column="enterprise_id" />
<result property="createEnterpriseId" column="create_enterprise_id" />
<result property="enterpriseName" column="enterprise_name" />
<result property="registerAddress" column="register_address" />
<result property="legalRepresentative" column="legal_representative" />
......@@ -35,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTEnterpriseInfoVo"/>
<where>
1=1 and is_del='0'
<if test="enterpriseId != -2 and enterpriseId != null and enterpriseId != ''">
and create_enterprise_id = #{enterpriseId}
</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="registerAddress != null and registerAddress != ''"> and register_address = #{registerAddress}</if>
<if test="legalRepresentative != null and legalRepresentative != ''"> and legal_representative = #{legalRepresentative}</if>
......@@ -43,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="licenseValidityTime != null and licenseValidityTime != ''"> and license_validity_time = #{licenseValidityTime}</if>
<if test="annualSupervisionInspection != null and annualSupervisionInspection != ''"> and annual_supervision_inspection = #{annualSupervisionInspection}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
</where>
group by enterprise_id desc
</select>
......@@ -56,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTEnterpriseInfo" parameterType="TEnterpriseInfo" useGeneratedKeys="true" keyProperty="enterpriseId">
insert into t_enterprise_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createEnterpriseId != null">create_enterprise_id,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="registerAddress != null">register_address,</if>
<if test="legalRepresentative != null">legal_representative,</if>
......@@ -75,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="doDusiness != null">do_business,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createEnterpriseId != null">#{createEnterpriseId},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="registerAddress != null">#{registerAddress},</if>
<if test="legalRepresentative != null">#{legalRepresentative},</if>
......
......@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="pipeTrend != null and pipeTrend != ''"> and pipe_trend = #{pipeTrend}</if>
<if test="buildDate != null and buildDate != ''"> and build_date = #{buildDate}</if>
<if test="buildUnit != null and buildUnit != ''"> and build_unit = #{buildUnit}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="coordinates != null and coordinates != ''"> and coordinates = #{coordinates}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
......
......@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="projectId" column="project_id" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="projectYear" column="project_year" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="gateStationAddress" column="gate_station_address" />
<result property="gateStationInvestment" column="gate_station_investment" />
<result property="numberGateStations" column="number_gate_stations" />
......@@ -31,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
is_del='0'
<if test="projectYear != null "> and project_year = #{projectYear}</if>
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2 "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="gateStationAddress != null and gateStationAddress != ''"> and gate_station_address = #{gateStationAddress}</if>
<if test="gateStationInvestment != null "> and gate_station_investment = #{gateStationInvestment}</if>
<if test="numberGateStations != null "> and number_gate_stations = #{numberGateStations}</if>
......@@ -51,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTProjectInfo" parameterType="TProjectInfo" useGeneratedKeys="true" keyProperty="projectId">
insert into t_project_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="projectYear != null">project_year,</if>
<if test="enterpriseCode != null">enterprise_code,</if>
<if test="gateStationAddress != null">gate_station_address,</if>
......@@ -67,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="projectYear != null">#{projectYear},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="gateStationAddress != null">#{gateStationAddress},</if>
......@@ -118,16 +122,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--查询是否已经有重复的年份数据-->
<select id="selectSameYear" resultMap="TProjectInfoResult">
select project_id from t_project_info where project_year=#{projectYear}
select project_id from t_project_info where project_year=#{projectYear} and beyond_enterprise_id=#{beyondEnterpriseId}
</select>
<!--重复年份删除方法-->
<update id="deleteisSameYear">
update t_project_info set is_del='1' where project_year=#{isSameYear}
update t_project_info set is_del='1' where project_year=#{isSameYear} and beyond_enterprise_id=#{beyondEnterpriseId}
</update>
<!--查询修改文件之前的路径-->
<select id="selectNearbyAddress" resultMap="TProjectInfoResult">
select nearby_address from t_project_info where project_id=#{projectId}
</select>
<!--查询企业名称-->
<select id="selectEnterpriseName" resultType="java.lang.String">
select enterprise_name from t_enterprise_info where
enterprise_id =#{deptId} and is_del='0'
</select>
</mapper>
......@@ -33,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTSiteStationInfoVo"/>
<where>
is_del='0'
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2">
and beyond_enterprise_id = #{beyondEnterpriseId}
</if>
<if test="siteStationName != null and siteStationName != ''"> and site_station_name like concat('%', #{siteStationName}, '%')</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
......
......@@ -365,7 +365,7 @@
<el-row>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型">
<el-select v-model="form.deviceType" placeholder="请选择设备类型" style="width: 100%">
<el-option label="阀井" value="1" />
<el-option label="调压箱" value="2" />
</el-select>
......@@ -374,7 +374,7 @@
<el-col :span="11">
<el-form-item label="权属单位" prop="beyondEnterpriseId">
<el-select v-model="form.beyondEnterpriseId" placeholder="请在下拉框中选择权属单位" maxlength="255" :disabled="false" clearable>
<el-select v-model="form.beyondEnterpriseId" style="width: 100%" placeholder="请在下拉框中选择权属单位" maxlength="255" :disabled="false" clearable>
<el-option v-for="item in test" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId">
</el-option>
</el-select>
......
......@@ -36,6 +36,28 @@
v-hasPermi="['supervise:user: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="['supervise:user: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="['supervise:user:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
......@@ -133,9 +155,9 @@
</el-row>
<el-row>
<el-col :span="11">
<el-col :span="11" >
<el-form-item label="用户类型" prop="userType">
<el-select v-model="form.userType" placeholder="请选择用户类型">
<el-select v-model="form.userType" placeholder="请选择用户类型" style="width:220px">
<el-option label="居民用户" value="1" />
<el-option label="商业用户" value="2" />
<el-option label="工业用户" value="3" />
......
......@@ -105,10 +105,10 @@
<span slot-scope="scope" v-if="scope.row.buildUnit">{{scope.row.buildUnit}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="权属单位" align="center" prop="beyondEnterpriseId" >
<span slot-scope="scope" v-if="scope.row.beyondEnterpriseId">{{scope.row.beyondEnterpriseId}}</span>
<span v-else>-</span>
</el-table-column>
<!-- <el-table-column label="权属单位" align="center" prop="beyondEnterpriseId" >-->
<!-- <span slot-scope="scope" v-if="scope.row.beyondEnterpriseId">{{scope.row.beyondEnterpriseId}}</span>-->
<!-- <span v-else>-</span>-->
<!-- </el-table-column>-->
<el-table-column label="权属单位" align="center" prop="beyondEnterpriseName" >
<span slot-scope="scope" v-if="scope.row.beyondEnterpriseName">{{scope.row.beyondEnterpriseName}}</span>
<span v-else>-</span>
......
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