daixiantong 4 lat temu
rodzic
commit
4353f42817
3 zmienionych plików z 12 dodań i 15 usunięć
  1. +1
    -1
      src/main/java/com/taauav/admin/service/impl/SysCityServiceImpl.java
  2. +1
    -7
      src/main/java/com/taauav/front/controller/IndexInspectController.java
  3. +10
    -7
      src/main/java/com/taauav/front/service/impl/UserInspectServiceImpl.java

+ 1
- 1
src/main/java/com/taauav/admin/service/impl/SysCityServiceImpl.java Wyświetl plik

@@ -304,7 +304,7 @@ public class SysCityServiceImpl extends ServiceImpl<SysCityMapper, SysCity> impl
@Override
public String getCityName(BigInteger cityId) {
List<String> nameList = new ArrayList<>();
while (cityId != null && cityId.compareTo(BigInteger.valueOf(320117)) >= 0) {
while (cityId != null && cityId.compareTo(BigInteger.valueOf(3201)) >= 0) {
SysCity cateInfo = sysCityMapper.selectById(cityId);
if (cateInfo != null) {
nameList.add(cateInfo.getName());

+ 1
- 7
src/main/java/com/taauav/front/controller/IndexInspectController.java Wyświetl plik

@@ -55,16 +55,10 @@ public class IndexInspectController {
/**
* 新建任务
* @param inspect
* @param bindingResult
* @return
*/
@PostMapping("/addTask")
public Response addTask(@RequestBody TauvInspect inspect , BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
List<FieldError> errorList = bindingResult.getFieldErrors();
String msg = bindingResult.getFieldError().getDefaultMessage();
return response.failure(msg);
}
public Response addTask(@RequestBody TauvInspect inspect) {
return inspectService.addTask(inspect);
}
}

+ 10
- 7
src/main/java/com/taauav/front/service/impl/UserInspectServiceImpl.java Wyświetl plik

@@ -7,10 +7,7 @@ import com.taauav.admin.entity.TauvInspect;
import com.taauav.admin.mapper.TauvInspectMapper;
import com.taauav.common.bean.Response;
import com.taauav.common.service.impl.BaseServiceImpl;
import com.taauav.common.util.DateUtil;
import com.taauav.common.util.FileUtil;
import com.taauav.common.util.FunctionUtils;
import com.taauav.common.util.ShiroUtils;
import com.taauav.common.util.*;
import com.taauav.front.constant.UserNoticeConstant;
import com.taauav.front.entity.UserAdmin;
import com.taauav.front.entity.UserNotice;
@@ -61,16 +58,23 @@ public class UserInspectServiceImpl extends BaseServiceImpl<TauvInspectMapper, T
*/
@Override
public Response addTask(TauvInspect inspect) {
// 巡检类型校验
if (inspect == null) {
return response.failure("任务数据不能为空");
}
if (StringUtils.isEmpty(inspect.getInspectDriverList()) || inspect.getInspectDriverList().size() == 0) {
return response.failure("请选择河道");
}
if (inspect.getType() == null || inspect.getType() <= 0) {
return response.failure("请选择巡检类型");
}
if (StringUtils.isEmpty(inspect.getInspectTime())) {
return response.failure("请填写巡检日期");
}
// 创建巡检任务
boolean result = this.addData(inspect);
if (!result) {
return response.failure("巡检任务创建失败");
}

// 生成巡检任务单号
String code = "";
if (inspect.getType() == 1) {
@@ -84,7 +88,6 @@ public class UserInspectServiceImpl extends BaseServiceImpl<TauvInspectMapper, T
String idStr = String.format("%04d", id);
inspect.setId(id);
inspect.setInspectNo(code + idStr);

// 图片处理
if (!StringUtils.isEmpty(inspect.getAttachment())) {
// 如果上传了文件则对文件进行处理

Ładowanie…
Anuluj
Zapisz