Commit 20497121 authored by litengwei's avatar litengwei

bug提交

parent b3fc9868
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
...@@ -43,11 +44,17 @@ public class DutyShiftController extends BaseController { ...@@ -43,11 +44,17 @@ public class DutyShiftController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增值班班次", notes = "新增值班班次") @ApiOperation(httpMethod = "POST", value = "新增值班班次", notes = "新增值班班次")
public ResponseModel<DutyShiftDto> save(HttpServletRequest request, @RequestBody DutyShiftDto model) { public ResponseModel<Boolean> save(HttpServletRequest request, @RequestBody DutyShiftDto model) {
QueryWrapper<DutyShift> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", model.getName());
List<DutyShift> list = dutyShiftServiceImpl.list(queryWrapper);
if(!list.isEmpty()) {
return ResponseHelper.buildResponse(false);
}
String appKey = request.getHeader("appKey"); String appKey = request.getHeader("appKey");
model.setAppKey(appKey); model.setAppKey(appKey);
model = dutyShiftServiceImpl.createWithModel(model); dutyShiftServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(true);
} }
/** /**
...@@ -79,7 +86,7 @@ public class DutyShiftController extends BaseController { ...@@ -79,7 +86,7 @@ public class DutyShiftController extends BaseController {
if(dutyPersonShiftServiceImpl.checkCurrentDutyIsUser(sequenceNbr)) { if(dutyPersonShiftServiceImpl.checkCurrentDutyIsUser(sequenceNbr)) {
return ResponseHelper.buildResponse(false); return ResponseHelper.buildResponse(false);
}; }
DutyShift dutyShift = dutyShiftServiceImpl.getById(sequenceNbr); DutyShift dutyShift = dutyShiftServiceImpl.getById(sequenceNbr);
if (null != dutyShift) { if (null != dutyShift) {
dutyShift.setIsDelete(true); dutyShift.setIsDelete(true);
......
...@@ -2154,10 +2154,10 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a ...@@ -2154,10 +2154,10 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a
continue; continue;
} }
} }
Cell cell4 = row.getCell(4); // Cell cell4 = row.getCell(4);
if(cell4 ==null) { // if(cell4 ==null) {
continue; // continue;
} // }
Cell cell = row.getCell(1); Cell cell = row.getCell(1);
if (cell != null) { if (cell != null) {
dutyPersonDto.setUserId(cell.toString()); dutyPersonDto.setUserId(cell.toString());
...@@ -2176,6 +2176,8 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a ...@@ -2176,6 +2176,8 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a
String[] split = cell.toString().split("@"); String[] split = cell.toString().split("@");
dutyPersonDto.setPostTypeName(split[0]); dutyPersonDto.setPostTypeName(split[0]);
dutyPersonDto.setPostType(split[1]); dutyPersonDto.setPostType(split[1]);
} else {
throw new BadRequest("第"+i+1+"行,第5列数据为空,请检查数据后再上传");
} }
// 需求958 添加值班区域 导入 by kongfm 2021-09-15 // 需求958 添加值班区域 导入 by kongfm 2021-09-15
cell = row.getCell(5); cell = row.getCell(5);
...@@ -2183,6 +2185,8 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a ...@@ -2183,6 +2185,8 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a
String[] dutyArea = cell.toString().split("@"); String[] dutyArea = cell.toString().split("@");
dutyPersonDto.setDutyArea(dutyArea[0]); dutyPersonDto.setDutyArea(dutyArea[0]);
dutyPersonDto.setDutyAreaId(dutyArea[1]); dutyPersonDto.setDutyAreaId(dutyArea[1]);
} else {
throw new BadRequest("第"+i+1+"行,第6列数据为空,请检查数据后再上传");
} }
List<DutyPersonShiftDto> dutyShift = new ArrayList<>(); List<DutyPersonShiftDto> dutyShift = new ArrayList<>();
for (int j = 0; j < dayByMonth.size(); j++) { for (int j = 0; j < dayByMonth.size(); j++) {
......
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