|
|
@@ -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())) { |
|
|
|
// 如果上传了文件则对文件进行处理 |