Commit bba2ca4c authored by 李博今's avatar 李博今

更新文件上传路径

parent 6af6f36d
......@@ -63,8 +63,8 @@ public class BArrangeController extends PaginationController<BArrange> {
@ApiImplicitParam(name = "importFile", value = "excel文件", required = true, dataType = "MultipartFile")
@PreAuthorize("hasRole('ROLE_1001')")
@PostMapping(value = "excelImport")
public Result excelImport(MultipartFile importFile) throws Exception {
PersistModel data = bArrangeServiceImpl.importExcel(MultipartFile2HSSFWorkbookConverter.convert(importFile),getToken());
public Result excelImport(MultipartFile importFile,String subtaskId) throws Exception {
PersistModel data = bArrangeServiceImpl.importExcel(MultipartFile2HSSFWorkbookConverter.convert(importFile),getToken(),subtaskId);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
......
......@@ -69,6 +69,7 @@ public interface BArrangeRepository extends BaseMapper<BArrange> {
List<BSubtask> queryBSubtask1(String businessId);
int insertList(ArrayList<ScheduleDto> list);
int insertBSubtask(List<BSubtask> list);
......
......@@ -81,10 +81,10 @@ public class ScheduleDto extends IdEntity<ScheduleDto>{
@NotBlank
private String roomCode;
/*企业编号*/
/*子任务Id*/
@Length(min = 1,max = 64,message = "长度最小为1,最大为64")
@NotBlank
private String agencyCode;
private String subtaskId;
@Transient
private String roomName;
......
......@@ -28,5 +28,5 @@ public interface BArrangeService {
List<BArrange> findAll(BArrange bArrange);
PersistModel importExcel(HSSFWorkbook convert, String token);
PersistModel importExcel(HSSFWorkbook convert, String token , String subtaskId);
}
......@@ -101,11 +101,8 @@ public class BArrangeServiceImpl implements BArrangeService {
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
@Override
public PersistModel importExcel(HSSFWorkbook hwb, String token) {
public PersistModel importExcel(HSSFWorkbook hwb, String token , String subtaskId) {
ArrayList<ScheduleDto> scheduleDtos = new ArrayList<ScheduleDto>();
//获取用户ID
String userBusinessId = UserUtil.getAuthenBusinessId();
String agencyCode = sysUserMapper.queryAgencyCodeByBusinessId(userBusinessId);
String[] headers = {"课程编号", "教师编号", "班级编号","教室编号","周次","周学时","周一",
"周二","周三","周四","周五","周六"};
......@@ -184,7 +181,7 @@ public class BArrangeServiceImpl implements BArrangeService {
scheduleDto.setThursday(value[9]);
scheduleDto.setFriday(value[10]);
scheduleDto.setSaturday(value[11]);
scheduleDto.setAgencyCode(agencyCode);
scheduleDto.setSubtaskId(subtaskId);
scheduleDto.setCommonBusinessId();
UserUtil.setCurrentPersistOperation(scheduleDto);
scheduleDtos.add(scheduleDto);
......
......@@ -123,7 +123,7 @@ public class BRoomsController extends FileController<BRooms> {
@PostMapping(value = "/uploadExcel")
public Result uploadExcel(@RequestParam(value="uploadFile",required=true) MultipartFile uploadFile){
String path = super.globalCommonFileUpload(uploadFile,"UUID",
"G:/testplace"+ File.separator + "/xmlAndHtml");
global.getBASE_UPLOAD_SERVER_LOCATION()+ File.separator + global.getXML_LOCATION());
return bRoomsServiceImpl.uploadExcel(path);
}
}
......@@ -154,6 +154,7 @@ public class Upload2DataBase {
}
finalResult.put("list",list);
finalResult.put("errorDetail",errorDetail);
file.delete();
return finalResult;
}
......
......@@ -257,4 +257,7 @@ public class Global {
/*redis缓存超时时间*/
@Value("${spring.redis.timeout}")
private Integer REDIS_TIMEOUT;
@Value("${global.path.xml_location}")
private String XML_LOCATION;
}
......@@ -137,6 +137,7 @@ global:
cource_code_location: code
cource_project_location: project
student_code_location: studentCode
xml_location: /xmlTemp
other:
server_url: http://127.0.0.1:8888/eduServer
is_server_linux: 5
......
......@@ -138,6 +138,7 @@ global:
cource_code_location: code
cource_project_location: project
student_code_location: studentCode
xml_location: /xmlTemp
other:
server_url: http://106.2.3.134:10180/eduServer
is_server_linux: 1
......
......@@ -96,14 +96,14 @@
<insert id="insertList">
insert into b_schedule_dto(business_id,flag,del_flag,update_by,create_by,create_date,update_date,remarks,
lesson_code,teacher_code,class_code,week,class_hour,
monday,tuesday,wednesday,thursday,friday,saturday,room_code,agency_code)
monday,tuesday,wednesday,thursday,friday,saturday,room_code,subtask_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.businessId},#{item.flag},#{item.delFlag},#{item.updateBy},#{item.createBy},
#{item.createDate},#{item.updateDate},#{item.remarks},
#{item.lessonCode},#{item.teacherCode},#{item.classCode},
#{item.week},#{item.classHour},
#{item.monday},#{item.tuesday},#{item.wednesday},#{item.thursday},#{item.friday},#{item.saturday},#{item.roomCode},#{item.agencyCode})
#{item.monday},#{item.tuesday},#{item.wednesday},#{item.thursday},#{item.friday},#{item.saturday},#{item.roomCode},#{item.subtaskId})
</foreach>
</insert>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment