| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.jfpt.alarm.service.IAlarmService; |
| | | import org.springblade.jfpt.feedback.entity.Feedback; |
| | | import org.springblade.jfpt.feedback.service.IFeedbackService; |
| | | import org.springblade.jfpt.feedback.vo.FeedbackVO; |
| | | import org.springblade.jfpt.feedback.wrapper.FeedbackWrapper; |
| | | import org.springblade.jfpt.operation.entity.Operation; |
| | | import org.springblade.jfpt.operation.service.IOperationService; |
| | | import org.springblade.jfpt.wj.entity.Wj; |
| | | import org.springblade.jfpt.wj.service.IWjService; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import javax.validation.Valid; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | public class FeedbackController extends BladeController { |
| | | |
| | | private final IFeedbackService feedbackService; |
| | | private final IAlarmService alarmService; |
| | | private IWjService iWjService; |
| | | private final IOperationService operationService; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/insertfeed") |
| | | public R insertfeed(String jid, String snumber, String sname, String addvcd, String place, |
| | | String result, String describe, String type, String devicenumber, String galarmpeople, |
| | |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | Map<String, Object> maps = new HashMap<String, Object>(); |
| | | //保存视频的数组 |
| | | ArrayList <String> arlistm = new ArrayList <String>(); |
| | | //保存图片的数组 |
| | | ArrayList <String> arlistj = new ArrayList <String>(); |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | List<FeedbackVO> feedbackVOS = feedbackService.selectFeedEdit(jid); |
| | | List<Map<String, Object>> map = feedbackService.selectWjEdit(jid); |
| | | for (int i=0;i<map.size();i++){ |
| | | Object address = map.get(i).get("address"); |
| | | String addr = address.toString(); |
| | | String substring = addr.substring(addr.length() - 4, addr.length()); |
| | | if (substring.equals(".mp4")){ |
| | | arlistm.add(addr); |
| | | } |
| | | else if (substring.equals(".jpg")){ |
| | | arlistj.add(addr); |
| | | } |
| | | } |
| | | maps.put("List",feedbackVOS); |
| | | maps.put("wj",map); |
| | | maps.put("tp",arlistj); |
| | | maps.put("sp",arlistm); |
| | | lists.add(maps); |
| | | return R.data(lists); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 警情反馈新增 |
| | | */ |
| | | @PostMapping("/saves") |
| | | public R saves(FeedbackVO feedback) { |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间 |
| | | sdf.applyPattern("yyyy-MM-dd HH:mm:ss");// a为am/pm的标记 |
| | | Date date = new Date();// 获取当前时间 |
| | | //System.out.println("现在时间:" + sdf.format(date)); // 输出已经格式化的现在时间(24小时制) |
| | | |
| | | Operation operation = new Operation(); |
| | | operation.setJid(feedback.getJid()); |
| | | operation.setSnumber(feedback.getSnumber()); |
| | | operation.setZc("任务反馈提交,警情结束"); |
| | | operation.setSname(feedback.getSname()); |
| | | |
| | | operation.setZctime(sdf.format(date)); |
| | | operationService.save(operation); |
| | | |
| | | feedbackService.save(feedback); |
| | | Wj wj = new Wj(); |
| | | //获取视频地址 |
| | | String[] splitsp = feedback.getSpaddress().split(",");//以逗号分割 |
| | | for (String string2 : splitsp) { |
| | | wj.setJid(feedback.getJid()); |
| | | wj.setAddress(string2); |
| | | iWjService.insertfeed(wj); |
| | | } |
| | | String[] splittp = feedback.getTpaddress().split(",");//以逗号分割 |
| | | for (String string3 : splittp) { |
| | | wj.setJid(feedback.getJid()); |
| | | wj.setAddress(string3); |
| | | iWjService.insertfeed(wj); |
| | | } |
| | | alarmService.updateJtype(operation.getJid(),"2",null,null); |
| | | |
| | | return R.success("新增成功"); |
| | | } |
| | | } |