Browse Source

修改了感知事件id,机构列表等

develop
zhao-meiyu 10 months ago
parent
commit
09978e3da4
  1. 2
      zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java
  2. 5
      zc-business/src/main/java/com/zc/business/controller/DcShiftsController.java
  3. 4
      zc-business/src/main/java/com/zc/business/controller/DcWarningController.java
  4. 14
      zc-business/src/main/java/com/zc/business/domain/DcWarning.java
  5. 1
      zc-business/src/main/java/com/zc/business/mapper/DcEmployeesMapper.java
  6. 2
      zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java
  7. 3
      zc-business/src/main/java/com/zc/business/mapper/DcShiftsMapper.java
  8. 2
      zc-business/src/main/java/com/zc/business/service/IDCPerceivedEventsWarningService.java
  9. 5
      zc-business/src/main/java/com/zc/business/service/IDcShiftsService.java
  10. 28
      zc-business/src/main/java/com/zc/business/service/impl/DcEmployeesServiceImpl.java
  11. 2
      zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java
  12. 26
      zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java
  13. 6
      zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml
  14. 17
      zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml

2
zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java

@ -41,7 +41,7 @@ public class DCPerceivedEventsWarningController extends BaseController {
//感知事件详情
@PostMapping("/getWarningById")
public AjaxResult getWarningById(@RequestBody DcWarning dcWarning){
Long id = dcWarning.getId();
String id = dcWarning.getId();
if (id==null){
return AjaxResult.error("参数错误");
}

5
zc-business/src/main/java/com/zc/business/controller/DcShiftsController.java

@ -1,6 +1,7 @@
package com.zc.business.controller;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@ -51,7 +52,7 @@ public class DcShiftsController extends BaseController
public TableDataInfo list(DcShifts dcShifts)
{
startPage();
List<DcShifts> list = dcShiftsService.selectDcShiftsList(dcShifts);
List<HashMap> list = dcShiftsService.selectDcShiftsList(dcShifts);
return getDataTable(list);
}
@ -64,7 +65,7 @@ public class DcShiftsController extends BaseController
@PostMapping("/export")
public void export(HttpServletResponse response, DcShifts dcShifts)
{
List<DcShifts> list = dcShiftsService.selectDcShiftsList(dcShifts);
List<DcShifts> list = dcShiftsService.selectDcShiftsListExcel(dcShifts);
ExcelUtil<DcShifts> util = new ExcelUtil<>(DcShifts.class);
util.exportExcel(response, list, "值班数据");
}

4
zc-business/src/main/java/com/zc/business/controller/DcWarningController.java

@ -1,5 +1,6 @@
package com.zc.business.controller;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.zc.business.service.IDcWarningService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@ -79,6 +80,9 @@ public class DcWarningController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody DcWarning dcWarning)
{
//设置事件Id UUID无下划线格式32
String uuid = IdUtils.fastSimpleUUID();
dcWarning.setId(uuid);
return toAjax(dcWarningService.insertDcWarning(dcWarning));
}

14
zc-business/src/main/java/com/zc/business/domain/DcWarning.java

@ -19,7 +19,7 @@ public class DcWarning extends BaseEntity
private static final long serialVersionUID = 1L;
/** 预警编号 */
private Long id;
private String id;
/** 所在桩号 */
@Excel(name = "所在桩号")
@ -165,8 +165,11 @@ public class DcWarning extends BaseEntity
this.number = number;
}
public void setId(Long id)
{
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@ -178,10 +181,7 @@ public class DcWarning extends BaseEntity
this.sectionName = sectionName;
}
public Long getId()
{
return id;
}
public void setStakeMark(String stakeMark)
{
this.stakeMark = stakeMark;

1
zc-business/src/main/java/com/zc/business/mapper/DcEmployeesMapper.java

@ -60,6 +60,7 @@ public interface DcEmployeesMapper
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteShifts(Long[] ids);
int deleteDcEmployeesByIds(Long[] ids);
//获取全部机构id与名称

2
zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java

@ -21,7 +21,7 @@ public interface DcPerceivedEventsWarningMapper {
//感知事件类型
List<DcEventType> selectEventTypeList();
//感知事件详情
DcWarning selectWarningById(Long id);
DcWarning selectWarningById(String id);
//根据类型查询预计事件
List<DcWarning> selectPerceivedEventsList(DcWarning dcWarning);
//查询感知数量按照路段进行排名

3
zc-business/src/main/java/com/zc/business/mapper/DcShiftsMapper.java

@ -81,5 +81,6 @@ public interface DcShiftsMapper
public DcShifts selectDcShiftsByEmployeesId(Long id);
//查询操作记录表
public List<DcShiftsRecord> selectDcShiftsRecord();
//根据驻点和时间查询人员
public List<HashMap<String,Object>> selectStation(@Param("station") String station,@Param("date") Date date);
}

2
zc-business/src/main/java/com/zc/business/service/IDCPerceivedEventsWarningService.java

@ -15,7 +15,7 @@ public interface IDCPerceivedEventsWarningService {
//查询预警表所有感知事件的数量
HashMap<String,Object> perceivedEventsWarningNum();
//感知事件详情
DcWarning selectWarningById(Long id);
DcWarning selectWarningById(String id);
//感知事件类型
List<DcEventType> selectEventTypeList();

5
zc-business/src/main/java/com/zc/business/service/IDcShiftsService.java

@ -1,5 +1,6 @@
package com.zc.business.service;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
@ -29,8 +30,8 @@ public interface IDcShiftsService
* @param dcShifts 值班
* @return 值班集合
*/
List<DcShifts> selectDcShiftsList(DcShifts dcShifts);
List<HashMap> selectDcShiftsList(DcShifts dcShifts);
List<DcShifts> selectDcShiftsListExcel(DcShifts dcShifts);
/**
* 新增值班

28
zc-business/src/main/java/com/zc/business/service/impl/DcEmployeesServiceImpl.java

@ -6,6 +6,7 @@ import com.zc.business.mapper.DcEmployeesMapper;
import com.zc.business.service.IDcEmployeesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
@ -19,8 +20,7 @@ import java.util.stream.Collectors;
* @date 2024-01-04
*/
@Service
public class DcEmployeesServiceImpl implements IDcEmployeesService
{
public class DcEmployeesServiceImpl implements IDcEmployeesService {
@Autowired
private DcEmployeesMapper dcEmployeesMapper;
@ -31,8 +31,7 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService
* @return 值班人员信息
*/
@Override
public DcEmployees selectDcEmployeesById(Long id)
{
public DcEmployees selectDcEmployeesById(Long id) {
return dcEmployeesMapper.selectDcEmployeesById(id);
}
@ -43,8 +42,7 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService
* @return 值班人员信息
*/
@Override
public List<DcEmployees> selectDcEmployeesList(DcEmployees dcEmployees)
{
public List<DcEmployees> selectDcEmployeesList(DcEmployees dcEmployees) {
return dcEmployeesMapper.selectDcEmployeesList(dcEmployees);
}
@ -55,8 +53,7 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService
* @return 结果
*/
@Override
public int insertDcEmployees(DcEmployees dcEmployees)
{
public int insertDcEmployees(DcEmployees dcEmployees) {
dcEmployees.setCreateTime(DateUtils.getNowDate());
return dcEmployeesMapper.insertDcEmployees(dcEmployees);
}
@ -68,8 +65,7 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService
* @return 结果
*/
@Override
public int updateDcEmployees(DcEmployees dcEmployees)
{
public int updateDcEmployees(DcEmployees dcEmployees) {
dcEmployees.setUpdateTime(DateUtils.getNowDate());
return dcEmployeesMapper.updateDcEmployees(dcEmployees);
}
@ -81,8 +77,9 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService
* @return 结果
*/
@Override
public int deleteDcEmployeesByIds(Long[] ids)
{
@Transactional
public int deleteDcEmployeesByIds(Long[] ids) {
dcEmployeesMapper.deleteShifts(ids);
return dcEmployeesMapper.deleteDcEmployeesByIds(ids);
}
@ -93,20 +90,22 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService
* @return 结果
*/
@Override
public int deleteDcEmployeesById(Long id)
{
public int deleteDcEmployeesById(Long id) {
return dcEmployeesMapper.deleteDcEmployeesById(id);
}
//获取全部机构id与名称
@Override
public List<HashMap<String, Object>> selectOrganizationAll() {
return dcEmployeesMapper.selectOrganizationAll();
}
//获取全部岗位信息
@Override
public List<HashMap<String, Object>> selectSysPostAll() {
return dcEmployeesMapper.selectSysPostAll();
}
//获取用户信息,按照岗位分组
@Override
public Map<Object, List<Map<String, Object>>> selectEmployeesPost() {
@ -114,6 +113,7 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService
Map<Object, List<Map<String, Object>>> group = mapList.stream().collect(Collectors.groupingBy(map -> map.get("postName")));
return group;
}
//获取全部用户信息,以及所在岗位信息
@Override
public List<HashMap<String, Object>> selectEmployeesPostAll() {

2
zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java

@ -41,7 +41,7 @@ public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWa
return map;
}
@Override
public DcWarning selectWarningById(Long id) {
public DcWarning selectWarningById(String id) {
return perceivedEventsWarningMapper.selectWarningById(id);
}

26
zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java

@ -19,8 +19,13 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.validation.Validator;
import java.lang.reflect.Array;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
/**
* 值班Service业务层处理
@ -57,8 +62,27 @@ public class DcShiftsServiceImpl implements IDcShiftsService
* @return 值班
*/
@Override
public List<DcShifts> selectDcShiftsList(DcShifts dcShifts)
public List<HashMap> selectDcShiftsList(DcShifts dcShifts)
{
List<HashMap> objects = new ArrayList<>();
List<DcShifts> list = dcShiftsMapper.selectDcShiftsList(dcShifts);
for (DcShifts shifts:list){
HashMap<String, Object> map = new HashMap<String, Object>();
Date date = shifts.getDate();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = formatter.format(date);
String station = shifts.getStation();
List<HashMap<String, Object>> name = dcShiftsMapper.selectStation(station, date);
map.put("date",formattedDate);
map.put("organizationName",name);
objects.add(map);
}
return objects;
}
@Override
public List<DcShifts> selectDcShiftsListExcel(DcShifts dcShifts) {
return dcShiftsMapper.selectDcShiftsList(dcShifts);
}

6
zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml

@ -86,6 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteShifts">
delete from dc_shifts where employees_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectOrganizationAll" resultType="java.util.HashMap">
select id,parent_id parentId,organization_name organizationName,organization_type organizationType
from dc_organization

17
zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml

@ -30,11 +30,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectDcShiftsList" parameterType="DcShifts" resultMap="DcShiftsResult">
<include refid="selectDcShiftsVo"/>
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
<where>
<if test="employeesId != null "> and shifts.employees_id = #{employeesId}</if>
<if test="date != null "> and shifts.date = #{date}</if>
</where>
GROUP BY shifts.date,shifts.station
order by date desc
</select>
@ -69,6 +76,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user as user on record.operator=user.user_id
</select>
<select id="selectStation" resultType="java.util.HashMap">
select shifts.scheduling,shifts.employees_id employeesId,shifts.station,shifts.id,
organization.organization_name organizationName,employees.name from dc_shifts as shifts
left join dc_employees as employees on shifts.employees_id=employees.id
left join dc_organization as organization on organization.id=shifts.station
where shifts.date=#{date} and station=#{station}
</select>
<insert id="insertDcShifts" parameterType="DcShifts" useGeneratedKeys="true" keyProperty="id">

Loading…
Cancel
Save