|
@@ -2,6 +2,7 @@ package cn.hmsoft.art.control.ex.photo;
|
|
|
|
|
|
import cn.hmsoft.application.web.Ajax;
|
|
import cn.hmsoft.application.web.Ajax;
|
|
import cn.hmsoft.application.web.AjaxControl;
|
|
import cn.hmsoft.application.web.AjaxControl;
|
|
|
|
+import cn.hmsoft.art.data.dao.ly.LyRoomModelPhotoDao;
|
|
import cn.hmsoft.art.service.ex.photo.LyRoomModelPhotoService;
|
|
import cn.hmsoft.art.service.ex.photo.LyRoomModelPhotoService;
|
|
import cn.hmsoft.helper.excel.Excel2007Writer;
|
|
import cn.hmsoft.helper.excel.Excel2007Writer;
|
|
import cn.hmsoft.jdbc.entity.Pager;
|
|
import cn.hmsoft.jdbc.entity.Pager;
|
|
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
import javax.servlet.ServletOutputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
+import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
@@ -29,6 +31,9 @@ public class LyRoomModelPhotoControl extends AjaxControl {
|
|
@Autowired
|
|
@Autowired
|
|
private LyRoomModelPhotoService lyRoomModelPhotoService;
|
|
private LyRoomModelPhotoService lyRoomModelPhotoService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private LyRoomModelPhotoDao lyRoomModelPhotoDao;
|
|
|
|
+
|
|
@RequestMapping("ly/room/model/photo/page")
|
|
@RequestMapping("ly/room/model/photo/page")
|
|
public Ajax page(Integer start, Integer limit, String query, String order, String type, Integer num) {
|
|
public Ajax page(Integer start, Integer limit, String query, String order, String type, Integer num) {
|
|
return new Ajax(lyRoomModelPhotoService.page(start, limit, query, getQueryOrder(order, type), num));
|
|
return new Ajax(lyRoomModelPhotoService.page(start, limit, query, getQueryOrder(order, type), num));
|
|
@@ -81,4 +86,42 @@ public class LyRoomModelPhotoControl extends AjaxControl {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 央美模特拍照照片整理-发给学校
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping("ly/room/model/photo/make")
|
|
|
|
+ public Ajax make() {
|
|
|
|
+ StringBuffer sql = new StringBuffer(
|
|
|
|
+ "select lg.group_name,rw.room_name,rw.room_addr,rw.ly_room_id from ly_room_written rw,ly_group lg,( select distinct room_id from ly_room_model_photo) mp ");
|
|
|
|
+ sql.append(" where rw.ly_group_id=lg.ly_group_id and rw.ly_room_id=mp.room_id order by rw.ly_room_id ");
|
|
|
|
+ List<Map<String, Object>> maps = lyRoomModelPhotoDao.listMapBySql(sql.toString());
|
|
|
|
+ String rooPath = "D:/mote/";
|
|
|
|
+ for (Map<String, Object> map : maps) {
|
|
|
|
+ //创建文件夹
|
|
|
|
+ String groupName = map.get("group_name").toString();
|
|
|
|
+ String roomName = map.get("room_name").toString();
|
|
|
|
+ String roomAddr = map.get("room_addr").toString();
|
|
|
|
+ String path = rooPath + groupName + "/" + roomName + "/" + roomAddr;
|
|
|
|
+ File dir = new File(path);
|
|
|
|
+ if (!dir.exists()) {
|
|
|
|
+ dir.mkdirs();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //读取拍照记录
|
|
|
|
+ String sql2 = "select * from ly_room_model_photo where room_id=" + map.get("ly_room_id");
|
|
|
|
+ List<Map<String, Object>> list = lyRoomModelPhotoDao.listMapBySql(sql2);
|
|
|
|
+ for (Map<String, Object> map2 : list) {
|
|
|
|
+ String photoPath = map2.get("photo_path").toString();
|
|
|
|
+ //移动文件到相应考场下
|
|
|
|
+ File existFile = new File("D:/" + photoPath);
|
|
|
|
+ if (existFile.exists()) {
|
|
|
|
+ File mvFile = new File(path + "/" + existFile.getName());
|
|
|
|
+ existFile.renameTo(mvFile);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return new Ajax();
|
|
|
|
+ }
|
|
}
|
|
}
|