diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java b/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java index 96a64f6f..fc99bc96 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java @@ -55,7 +55,7 @@ public class DcEmployeesController extends BaseController * 导出值班人员信息列表 */ @ApiOperation("导出值班人员信息列表") - //@PreAuthorize("@ss.hasPermi('business:employees:export')") + @PreAuthorize("@ss.hasPermi('business:employees:export')") @Log(title = "值班人员信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEmployees dcEmployees) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcOrganizationController.java b/zc-business/src/main/java/com/zc/business/controller/DcOrganizationController.java index bc6fc1a8..f9c05daf 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcOrganizationController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcOrganizationController.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.zc.business.domain.DcOrganizationExport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; @@ -61,8 +62,8 @@ public class DcOrganizationController extends BaseController @PostMapping("/export") public void export(HttpServletResponse response, DcOrganization dcOrganization) { - List list = dcOrganizationService.selectDcOrganizationListExport(dcOrganization); - ExcelUtil util = new ExcelUtil<>(DcOrganization.class); + List list = dcOrganizationService.selectDcOrganizationListExport(dcOrganization); + ExcelUtil util = new ExcelUtil<>(DcOrganizationExport.class); util.exportExcel(response, list, "机构管理数据"); } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcOrganizationExport.java b/zc-business/src/main/java/com/zc/business/domain/DcOrganizationExport.java new file mode 100644 index 00000000..26107c31 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcOrganizationExport.java @@ -0,0 +1,183 @@ +package com.zc.business.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.TreeEntity; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * @author 王思祥 + * @ClassName DcOrganizationExport + */ + +public class DcOrganizationExport extends TreeEntity { + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 1-运管中心2-驻点 */ + @ApiModelProperty(value = "类型1-运管中心 2-驻点", required = true) + @Excel(name = "1-运管中心 2-驻点") + private Integer organizationType; + + /** 名称 */ + @ApiModelProperty(value = "名称", required = true) + @Excel(name = "名称") + private String organizationName; + + /** 地址 */ + @ApiModelProperty("地址") + @Excel(name = "地址") + private String organizationAddress; + + /** 桩号 */ + @ApiModelProperty("桩号") + @Excel(name = "桩号") + private String stakeMark; + + /** 救援单位 */ + @ApiModelProperty("救援单位") + @Excel(name = "救援单位") + private String rescueUnit; + + /** 描述 */ + @ApiModelProperty("描述") + @Excel(name = "描述") + private String description; + /** 方向 */ + @ApiModelProperty(value = "方向", required = true) + @Excel(name = "方向") + private String direction; + /** 机构人员数量 */ + @ApiModelProperty(value = "机构人员数量", required = true) + @Excel(name = "机构人员数量") + private String employeesNum; + /** 经度 */ + @ApiModelProperty(value = "经度", required = true) + @Excel(name = "经度") + private String longitude; + /** 纬度 */ + @ApiModelProperty(value = "纬度", required = true) + @Excel(name = "纬度") + private String latitude; + + + + public String getEmployeesNum() { + return employeesNum; + } + + public void setEmployeesNum(String employeesNum) { + this.employeesNum = employeesNum; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + + + + + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOrganizationType(Integer organizationType) + { + this.organizationType = organizationType; + } + + public Integer getOrganizationType() + { + return organizationType; + } + public void setOrganizationName(String organizationName) + { + this.organizationName = organizationName; + } + + public String getOrganizationName() + { + return organizationName; + } + public void setOrganizationAddress(String organizationAddress) + { + this.organizationAddress = organizationAddress; + } + + public String getOrganizationAddress() + { + return organizationAddress; + } + public void setStakeMark(String stakeMark) + { + this.stakeMark = stakeMark; + } + + public String getStakeMark() + { + return stakeMark; + } + public void setRescueUnit(String rescueUnit) + { + this.rescueUnit = rescueUnit; + } + + public String getRescueUnit() + { + return rescueUnit; + } + public void setDescription(String description) + { + this.description = description; + } + + public String getDescription() + { + return description; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("parentId", getParentId()) + .append("organizationType", getOrganizationType()) + .append("organizationName", getOrganizationName()) + .append("organizationAddress", getOrganizationAddress()) + .append("stakeMark", getStakeMark()) + .append("rescueUnit", getRescueUnit()) + .append("description", getDescription()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcShifts.java b/zc-business/src/main/java/com/zc/business/domain/DcShifts.java index 4624b258..554c248b 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcShifts.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcShifts.java @@ -40,14 +40,14 @@ public class DcShifts extends BaseEntity /** 开始时间 */ @ApiModelProperty("开始时间") - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "HH:mm:ss") + @Excel(name = "开始时间", width = 30, dateFormat = "HH:mm:ss") private Date startTime; /** 结束时间 */ @ApiModelProperty("结束时间") - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "HH:mm:ss") + @Excel(name = "结束时间", width = 30, dateFormat = "HH:mm:ss") private Date endTime; @ApiModelProperty("姓名") @@ -65,7 +65,29 @@ public class DcShifts extends BaseEntity private String remark; @ApiModelProperty("所属路管驻点名称") @Excel(name = "所属路管驻点名称") - private String stationName; + private String organizationName; + @ApiModelProperty("排班 1-白班 2-夜班") + @Excel(name = "排班 1-白班 2-夜班") + private String scheduling; + + @ApiModelProperty("驻点id") + @Excel(name = "驻点id") + private String station; + public String getScheduling() { + return scheduling; + } + + public String getStation() { + return station; + } + + public void setStation(String station) { + this.station = station; + } + + public void setScheduling(String scheduling) { + this.scheduling = scheduling; + } public Long getIdBefore() { return idBefore; @@ -75,12 +97,12 @@ public class DcShifts extends BaseEntity this.idBefore = idBefore; } - public String getStationName() { - return stationName; + public String getOrganizationName() { + return organizationName; } - public void setStationName(String stationName) { - this.stationName = stationName; + public void setOrganizationName(String organizationName) { + this.organizationName = organizationName; } public String getName() { diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcOrganizationMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcOrganizationMapper.java index 1094b5f3..6fc42e98 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcOrganizationMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcOrganizationMapper.java @@ -5,6 +5,7 @@ import java.util.List; import cn.hutool.core.lang.hash.Hash; import com.zc.business.domain.DcOrganization; +import com.zc.business.domain.DcOrganizationExport; import org.apache.ibatis.annotations.Param; /** @@ -30,7 +31,8 @@ public interface DcOrganizationMapper * @return 机构管理集合 */ List selectDcOrganizationList(DcOrganization dcOrganization); - + //导出列表 + List selectDcOrganizationListExport(DcOrganization dcOrganization); /** * 新增机构管理 * @@ -69,5 +71,7 @@ public interface DcOrganizationMapper List selectDcOrganizationCar(Long id); //计算机构人数 String selectEmployeesNum(Long id); + //根据桩号和方向拿到经纬度 + HashMap coordinate(@Param("stakeMark") String stakeMark,@Param("direction")String direction); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcOrganizationService.java b/zc-business/src/main/java/com/zc/business/service/IDcOrganizationService.java index d0203851..b53827bc 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcOrganizationService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcOrganizationService.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import com.zc.business.domain.DcOrganization; +import com.zc.business.domain.DcOrganizationExport; import org.apache.ibatis.annotations.Param; /** @@ -30,7 +31,8 @@ public interface IDcOrganizationService */ ArrayList selectDcOrganizationList(DcOrganization dcOrganization); - List selectDcOrganizationListExport(DcOrganization dcOrganization); + List selectDcOrganizationListExport(DcOrganization dcOrganization); + /** * 新增机构管理 * diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcOrganizationServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcOrganizationServiceImpl.java index 01db712a..5444c44c 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcOrganizationServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcOrganizationServiceImpl.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Scanner; import com.ruoyi.common.utils.DateUtils; +import com.zc.business.domain.DcOrganizationExport; import org.apache.ibatis.annotations.Param; import org.checkerframework.framework.qual.FromByteCode; import org.springframework.beans.factory.annotation.Autowired; @@ -53,21 +54,23 @@ public class DcOrganizationServiceImpl implements IDcOrganizationService return null; } for (DcOrganization dcOrganizations:dcOrganizationsList){ - Long id = dcOrganizations.getId(); + Long id = dcOrganizations.getId();; List car = dcOrganizationMapper.selectDcOrganizationCar(id); String employeesNum = dcOrganizationMapper.selectEmployeesNum(id); + HashMap coordinate = dcOrganizationMapper.coordinate(dcOrganizations.getStakeMark(), dcOrganizations.getDirection()); HashMap map = new HashMap<>(); map.put("car",car); map.put("dcOrganizations",dcOrganizations); map.put("employeesNum",employeesNum); + map.put("coordinate",coordinate); objects.add(map); } return objects; } @Override - public List selectDcOrganizationListExport(DcOrganization dcOrganization) { - return dcOrganizationMapper.selectDcOrganizationList(dcOrganization); + public List selectDcOrganizationListExport(DcOrganization dcOrganization) { + return dcOrganizationMapper.selectDcOrganizationListExport(dcOrganization); } diff --git a/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml b/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml index eec53113..1d950060 100644 --- a/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml @@ -34,7 +34,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and organization_name like concat('%', #{organizationName}, '%') - + + select count(1) from dc_employees where organization_id=#{id} + + \ No newline at end of file diff --git a/zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml b/zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml index 68cc1fd4..759dfdcd 100644 --- a/zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml @@ -20,12 +20,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select shifts.id, shifts.employees_id, - employees.name,employees.contact_number,post.post_name, - shifts.date, shifts.start_time, shifts.end_time, + select shifts.id, shifts.employees_id,shifts.station, + employees.name,employees.contact_number,post.post_name,organization.organization_name, + shifts.date, shifts.start_time, shifts.end_time,shifts.scheduling, shifts.remark, shifts.create_time, shifts.update_time from dc_shifts as shifts left join dc_employees as employees on employees.id=shifts.employees_id left join sys_post as post on employees.post_id=post.post_id + left join dc_organization as organization on organization.id=shifts.station