添加了查询核查法人任务信息的按钮

This commit is contained in:
DESKTOP-4U0TDEF\20371 2021-07-16 11:12:37 +08:00
parent a160ff3ade
commit 9138932f01
3 changed files with 51 additions and 1 deletions

View File

@ -149,4 +149,14 @@ public class FirePointController {
} }
return firePointService.insertAppTask(files,appTaskBodyVo); return firePointService.insertAppTask(files,appTaskBodyVo);
} }
/**
* 查询核查的任务信息
* @param fireCode
* @return
*/
@GetMapping("/selectAppTask")
public String selectAppTask(@RequestParam("fireCode") String fireCode) throws Exception {
return firePointService.selectAppTask(fireCode);
}
} }

View File

@ -56,4 +56,13 @@ public interface FirePointService {
* @throws IOException * @throws IOException
*/ */
String insertAppTask(MultipartFile[] files, AppTaskBodyVo appTaskBodyVo) throws IOException; String insertAppTask(MultipartFile[] files, AppTaskBodyVo appTaskBodyVo) throws IOException;
/**
* 根据火点编码查询任务信息
* @param fireCode
* @param
* @return
* @throws Exception
*/
String selectAppTask(String fireCode) throws Exception;
} }

View File

@ -5,11 +5,13 @@ import com.xkrs.common.tool.TokenUtil;
import com.xkrs.dao.*; import com.xkrs.dao.*;
import com.xkrs.model.entity.*; import com.xkrs.model.entity.*;
import com.xkrs.model.qo.FirePointQo; import com.xkrs.model.qo.FirePointQo;
import com.xkrs.model.vo.AppPhotoVo;
import com.xkrs.model.vo.AppTaskBodyVo; import com.xkrs.model.vo.AppTaskBodyVo;
import com.xkrs.service.FirePointService; import com.xkrs.service.FirePointService;
import com.xkrs.utils.*; import com.xkrs.utils.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -53,6 +55,9 @@ public class FirePointServiceImpl implements FirePointService {
@Resource @Resource
private JdbcUtils jdbcUtils; private JdbcUtils jdbcUtils;
@Resource
private FireTaskPhotoDao fireTaskPhotoDao;
/** /**
* 添加火点信息 * 添加火点信息
* @param firePointQo * @param firePointQo
@ -190,6 +195,32 @@ public class FirePointServiceImpl implements FirePointService {
if(fireTaskPhotos1.size() == 0 || fireTaskPhotos1 == null){ if(fireTaskPhotos1.size() == 0 || fireTaskPhotos1 == null){
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"图片上传失败,任务提交失败",locale); return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"图片上传失败,任务提交失败",locale);
} }
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"任务提交成功",locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"任务提交成功",locale);
}
/**
* 根据火点编码查询任务信息
* @param fireCode
* @return
* @throws Exception
*/
@Override
public String selectAppTask(String fireCode) throws Exception {
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
FireTask byTaskFireCode = fireTaskDao.findByTaskFireCode(fireCode);
if(byTaskFireCode == null){
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有该火点的任务信息",locale);
}
AppTaskBodyVo appTaskBodyVo = new AppTaskBodyVo();
// 做映射返回vo类对象
BeanCopier beanCopier = BeanCopier.create(FireTask.class, AppTaskBodyVo.class, false);
beanCopier.copy(byTaskFireCode,appTaskBodyVo,null);
List<Object[]> photoPath = fireTaskPhotoDao.findPhotoPath(fireCode);
List<AppPhotoVo> appPhotoVos = ObjectToBeanUtils.objectToBean(photoPath, AppPhotoVo.class);
appTaskBodyVo.setTaskFirePhoto(appPhotoVos);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,appTaskBodyVo,locale);
} }
} }