Quellcode durchsuchen

修复BUG

master
牧羊人 vor 4 Jahren
Ursprung
Commit
abaa8680df
9 geänderte Dateien mit 175 neuen und 28 gelöschten Zeilen
  1. +2
    -2
      src/main/java/com/taauav/front/controller/UserIndexController.java
  2. +1
    -1
      src/main/java/com/taauav/front/controller/UserScreenStatisticsController.java
  3. +2
    -2
      src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.xml
  4. +60
    -11
      src/main/java/com/taauav/front/service/impl/UserInspectQuestionServiceImpl.java
  5. +2
    -4
      src/main/java/com/taauav/front/service/impl/UserNoticeServiceImpl.java
  6. +3
    -2
      src/main/java/com/taauav/front/service/impl/UserWaterAlarmServiceImpl.java
  7. +4
    -3
      src/main/java/com/taauav/front/service/impl/UserWaterDataServiceImpl.java
  8. +8
    -2
      src/main/java/com/taauav/front/service/impl/UserWaterSpectrumServiceImpl.java
  9. +93
    -1
      src/main/java/com/taauav/front/vo/inspectquestion/UserInspectQuestionInfoVo.java

+ 2
- 2
src/main/java/com/taauav/front/controller/UserIndexController.java Datei anzeigen

@@ -169,9 +169,9 @@ public class UserIndexController {
private List<TauvWaterWarn> getWaterWarnList() {
QueryWrapper<TauvWaterWarn> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mark", 1);
queryWrapper.gt("status", 1);
queryWrapper.le("status", 2);
queryWrapper.orderByDesc("id");
IPage<TauvWaterWarn> page = new Page<>(1, 4);
IPage<TauvWaterWarn> page = new Page<>(1, 3);
IPage<TauvWaterWarn> data = waterWarnMapper.selectPage(page, queryWrapper);
List<TauvWaterWarn> waterWarnList = data.getRecords();
if (!waterWarnList.isEmpty()) {

+ 1
- 1
src/main/java/com/taauav/front/controller/UserScreenStatisticsController.java Datei anzeigen

@@ -169,7 +169,7 @@ public class UserScreenStatisticsController {
// 计算百分比
for (Map<String, Object> map : mapList) {
Map<String, String> item = new HashMap<>();
item.put("name", map.get("name").toString());
item.put("name", map.get("code").toString());
item.put("value", map.get("totalNum").toString());
result.add(item);
}

+ 2
- 2
src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.xml Datei anzeigen

@@ -16,7 +16,7 @@
and q.question_no like concat('%', #{query.questionNo}, '%')
</if>
<if test="query.driverAreaList != null and query.driverAreaList !=''"> and d.driver_area in
<foreach collection="query.driverArea" item="area" open="(" close=")" separator=",">
<foreach collection="query.driverAreaList" item="area" open="(" close=")" separator=",">
#{area}
</foreach>
</if>
@@ -34,7 +34,7 @@

<!-- 获取巡检问题详情 -->
<select id="getInspectQuestionInfoById" parameterType="java.lang.Integer" resultType="com.taauav.front.vo.inspectquestion.UserInspectQuestionInfoVo">
SELECT q.id,q.question_no,q.`status`,q.handler_image,f.src as file_src,o.content as question_type,f.description,f.location,f.gaode_longitude,f.gaode_latitude,f.gaode_address,d.driver_id,d.driver_name,d.driver_area,c.name as driver_area_name,i.inspect_time
SELECT q.id,q.question_no,q.inspect_driver_id,q.inspect_file_id,q.question_id,q.assign_user,q.assign_contact,q.assign_note,q.assign_time,q.handler_user,q.handler_image,q.handler_result,q.handler_time,q.note,q.`status`,q.create_user,q.create_time,q.update_user,q.update_time,f.src as file_src,o.content as question_type,f.description,f.location,f.gaode_longitude,f.gaode_latitude,f.gaode_address,d.driver_id,d.driver_name,d.driver_area,c.name as driver_area_name,i.inspect_time
FROM tauv_inspect_question q
LEFT JOIN tauv_inspect_file f ON f.id=q.inspect_file_id
INNER JOIN tauv_inspect_driver d ON d.id=q.inspect_driver_id

+ 60
- 11
src/main/java/com/taauav/front/service/impl/UserInspectQuestionServiceImpl.java Datei anzeigen

@@ -16,6 +16,8 @@ import com.taauav.front.dto.IndexQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDealwithDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionFinishedDto;
import com.taauav.front.entity.UserAdmin;
import com.taauav.front.mapper.UserAdminMapper;
import com.taauav.front.mapper.UserInspectQuestionMapper;
import com.taauav.front.query.UserInspectQuestionQuery;
import com.taauav.front.service.IUserInspectQuestionService;
@@ -33,6 +35,7 @@ import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.UUID;

/**
* <p>
@@ -53,6 +56,8 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ

@Autowired
private ISysCityService sysCityService;
@Autowired
private UserAdminMapper userAdminMapper;

@Value("${server.UPLOAD_URL}")
private String uploadUrl;
@@ -133,6 +138,9 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
entity.setAssignNote(inspectQuestionDto.getAssignNote());
entity.setAssignTime(DateUtil.now());
entity.setStatus(2);
// 问题指派是当前指派人默认为问题确认人
entity.setCreateUser(ShiroUtils.getAdminId());
entity.setCreateTime(DateUtil.now());
result = editData(entity);
}
} else {
@@ -197,16 +205,31 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
String year = String.valueOf(date.get(Calendar.YEAR));
String month = String.valueOf(date.get(Calendar.MONTH) + 1);
String day = String.valueOf(date.get(Calendar.DATE));
String destFile = uploadFolder + "file/file/" + year + "/" + month + "/" + day + "/";
boolean flag = FileUtil.cutGeneralFile(file, destFile);
if (flag) {
// 文件名
String fileName = oldFile.getName();
destFile = destFile.replace(uploadFolder, "");
stringList.add(destFile + fileName);
} else {
return response.failure("文件保存失败了");
}
String destFile = uploadFolder + "file/file/" + year + month + day + "/";

String extension = oldFile.getName().substring(oldFile.getName().lastIndexOf(".") + 1);
String nname = UUID.randomUUID().toString().replaceAll("-", "").substring(0, 32);
String newName = nname + "." + extension;
String destNewFileUrl = destFile + newName;

// FileUtil.cutGeneralFile(fileSrc, destPath);
// File destFile = new File(destFileUrl);
File destNewFile = new File(destNewFileUrl);
oldFile.renameTo(destNewFile);


destFile = destFile.replace(uploadFolder, "");
stringList.add(destFile + newName);

//
// boolean flag = FileUtil.cutGeneralFile(file, destFile);
// if (flag) {
// // 文件名
// String fileName = oldFile.getName();
//
// } else {
// return response.failure("文件保存失败了");
// }
}
}
entity.setHandlerImage(org.apache.commons.lang3.StringUtils.join(stringList, ","));
@@ -243,7 +266,33 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
}
// 处理之后的图片
if (!StringUtils.isEmpty(entity.getHandlerImage())) {
inspectQuestionInfoVo.setHandlerImage(uploadUrl + entity.getHandlerImage());
String[] strings = entity.getHandlerImage().split(",");
List<String> stringList = new ArrayList<>();
for (String string : strings) {
stringList.add(uploadUrl + string);
}
inspectQuestionInfoVo.setHandlerImageList(stringList);
}
// 创建人
if (inspectQuestionInfoVo.getCreateUser() != null && inspectQuestionInfoVo.getCreateUser() > 0) {
UserAdmin userAdmin = userAdminMapper.selectById(inspectQuestionInfoVo.getCreateUser());
if (userAdmin != null) {
inspectQuestionInfoVo.setCreateUserName(userAdmin.getRealname());
}
}
// 指派人
if (inspectQuestionInfoVo.getAssignUser() != null && inspectQuestionInfoVo.getAssignUser() > 0) {
UserAdmin userAdmin = userAdminMapper.selectById(inspectQuestionInfoVo.getAssignUser());
if (userAdmin != null) {
inspectQuestionInfoVo.setAssignUserName(userAdmin.getRealname());
}
}
// 处理人
if (inspectQuestionInfoVo.getHandlerUser() != null && inspectQuestionInfoVo.getHandlerUser() > 0) {
UserAdmin userAdmin = userAdminMapper.selectById(inspectQuestionInfoVo.getHandlerUser());
if (userAdmin != null) {
inspectQuestionInfoVo.setHandlerUserName(userAdmin.getRealname());
}
}
return response.success(inspectQuestionInfoVo);
}

+ 2
- 4
src/main/java/com/taauav/front/service/impl/UserNoticeServiceImpl.java Datei anzeigen

@@ -67,13 +67,11 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
}
// 发布开始时间
if (!StringUtils.isEmpty(query.getStartTime())) {
Date startTime = DateUtil.parse(query.getStartTime(), "yyyy-MM-dd HH:mm:ss");
queryWrapper.ge("create_time", startTime);
queryWrapper.ge("create_time", query.getStartTime());
}
// 发布结束时间
if (!StringUtils.isEmpty(query.getEndTime())) {
Date endTime = DateUtil.parse(query.getEndTime(), "yyyy-MM-dd HH:mm:ss");
queryWrapper.le("create_time", endTime);
queryWrapper.le("create_time", query.getEndTime());
}
queryWrapper.eq("mark", 1);


+ 3
- 2
src/main/java/com/taauav/front/service/impl/UserWaterAlarmServiceImpl.java Datei anzeigen

@@ -93,8 +93,9 @@ public class UserWaterAlarmServiceImpl extends BaseServiceImpl<UserWaterAlarmMap
}
// 报警时间
if (!StringUtils.isEmpty(query.getAlarmTime())) {
String startTime = FunctionUtils.formatTime(Integer.valueOf(query.getAlarmTime()), "yyyy-MM-dd") + " 0:00:00";
String endTime = FunctionUtils.formatTime(Integer.valueOf(query.getAlarmTime()), "yyyy-MM-dd") + " 23:59:59";
String[] strings = query.getAlarmTime().split("~");
String startTime = strings[0] + " 0:00:00";
String endTime = strings[1] + " 23:59:59";
queryWrapper.between("alarm_time", startTime, endTime);
}
IPage<TauvWaterAlarm> page = new Page<>(query.getPage(), query.getPageSize());

+ 4
- 3
src/main/java/com/taauav/front/service/impl/UserWaterDataServiceImpl.java Datei anzeigen

@@ -56,12 +56,13 @@ public class UserWaterDataServiceImpl extends BaseServiceImpl<UserWaterDataMappe
}
// 巡检时间处理
if (!StringUtils.isEmpty(query.getInspectTime())) {
String startTime = FunctionUtils.formatTime(Integer.valueOf(query.getInspectTime()), "yyyy-MM-dd") + " 0:00:00";
String endTime = FunctionUtils.formatTime(Integer.valueOf(query.getInspectTime()), "yyyy-MM-dd") + " 23:59:59";
String[] strings = query.getInspectTime().split("~");
String startTime = strings[0] + " 0:00:00";
String endTime = strings[1] + " 23:59:59";
query.setInspectStartTime(startTime);
query.setInspectEndTime(endTime);
}
IPage<UserWaterDataListVo> page = new Page<>(query.getPage(), query.getPage());
IPage<UserWaterDataListVo> page = new Page<>(query.getPage(), query.getPageSize());
List<UserWaterDataListVo> inspectQuestionList = userWaterDataMapper.getWaterDataList(page, query);
page.setRecords(inspectQuestionList);
return response.success(page);

+ 8
- 2
src/main/java/com/taauav/front/service/impl/UserWaterSpectrumServiceImpl.java Datei anzeigen

@@ -62,7 +62,10 @@ public class UserWaterSpectrumServiceImpl extends BaseServiceImpl<UserWaterSpect
public Response getList(UserWaterSpectrumQuery query) {
// 查询条件
QueryWrapper<TauvWaterSpectrum> queryWrapper = new QueryWrapper<>();

// 任务单号
if (!StringUtils.isEmpty(query.getInspectNo())) {
queryWrapper.like("inspect_no", query.getInspectNo());
}
// 区划ID处理
if (query.getDriverArea() != null) {
List<BigInteger> cityIds = sysCityService.getChildCityIds(query.getDriverArea());
@@ -71,10 +74,13 @@ public class UserWaterSpectrumServiceImpl extends BaseServiceImpl<UserWaterSpect
BigInteger[] integers = cityIds.toArray(new BigInteger[cityIds.size()]);
queryWrapper.in("area_id", integers);
}
// 河道名称
if (!StringUtils.isEmpty(query.getDriverName())) {
queryWrapper.like("driver_name", query.getDriverName());
}
// 巡检时间处理
if (!StringUtils.isEmpty(query.getInspectTime())) {
String[] strings = query.getInspectTime().split("~");

String startTime = strings[0] + " 0:00:00";
String endTime = strings[1] + " 23:59:59";
queryWrapper.between("inspect_time", startTime, endTime);

+ 93
- 1
src/main/java/com/taauav/front/vo/inspectquestion/UserInspectQuestionInfoVo.java Datei anzeigen

@@ -6,6 +6,7 @@ import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigInteger;
import java.util.Date;
import java.util.List;

/**
* 巡检问题详情Vo
@@ -29,10 +30,72 @@ public class UserInspectQuestionInfoVo {
private Integer status;

/**
* 处理后图片
* 巡检河流ID
*/
private Integer inspectDriverId;
/**
* 巡检图片文件ID
*/
private Integer inspectFileId;
/**
* 问题选项id
*/
private Integer questionId;
/**
* 指派负责人
*/
private Integer assignUser;

/**
* 指派负责人名称
*/
private String assignUserName;
/**
* 指派负责人联系方式
*/
private String assignContact;
/**
* 指派备注
*/
private String assignNote;
/**
* 指派时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date assignTime;
/**
* 处理人
*/
private Integer handlerUser;
/**
* 处理人名称
*/
private String handlerUserName;
/**
* 处理反馈图片
*/
private String handlerImage;

/**
* 处理后图片列表
*/
private List<String> handlerImageList;

/**
* 处理结果
*/
private String handlerResult;
/**
* 处理完成时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date handlerTime;

/**
* 备注
*/
private String note;

/**
* 状态描述
*/
@@ -100,4 +163,33 @@ public class UserInspectQuestionInfoVo {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date inspectTime;

/**
* 创建人
*/
private Integer createUser;

/**
* 创建人名称
*/
private String createUserName;

/**
* 创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;

/**
* 更新人
*/
private Integer updateUser;

/**
* 更新时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;

}

Laden…
Abbrechen
Speichern