Commit bf981480 authored by chenhao's avatar chenhao

完成需求bug :4803

parent 98a03eff
...@@ -34,4 +34,6 @@ public interface IDutyCarService extends IDutyCommonService { ...@@ -34,4 +34,6 @@ public interface IDutyCarService extends IDutyCommonService {
JSONObject isFireCarDriver(); JSONObject isFireCarDriver();
int getDutyCarCount(Long carId); int getDutyCarCount(Long carId);
List<Map<String, Object>> getDutyCaruser(Long carId); List<Map<String, Object>> getDutyCaruser(Long carId);
List<Map<String, Object>> theCarDutyPerson(Long carId);
} }
...@@ -178,4 +178,10 @@ public class DutyCarController extends BaseController { ...@@ -178,4 +178,10 @@ public class DutyCarController extends BaseController {
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType)); return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询指定車輛值班人信息列表")
@GetMapping("/theCar/personList")
public ResponseModel<List<Map<String, Object>>> theCarDutyPerson(@RequestParam Long carId){
return ResponseHelper.buildResponse(iDutyCarService.theCarDutyPerson(carId));
}
} }
\ No newline at end of file
...@@ -233,4 +233,22 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -233,4 +233,22 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
return equipmentList; return equipmentList;
} }
@Override
public List<Map<String, Object>> theCarDutyPerson(Long carId) {
List<Map<String, Object>> specifyDateList =null;
String dutyDay = DateUtils.getDateNowShortStr();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId.toString());
if(instanceMap==null) {
return null;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null);
}
return specifyDateList;
}
} }
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -26,9 +20,17 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -26,9 +20,17 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import javax.servlet.http.HttpServletResponse; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import java.util.Map; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/** /**
* 导出导入 * 导出导入
...@@ -67,7 +69,7 @@ public class ExcelController extends BaseController { ...@@ -67,7 +69,7 @@ public class ExcelController extends BaseController {
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "下载模板") @ApiOperation(value = "下载模板")
@GetMapping("/download/template/{type}") @GetMapping("/download/template/{type}")
public void downloadTemplate(HttpServletResponse response, @PathVariable(value = "type") String type) { public void downloadTemplate(HttpServletResponse response, @PathVariable(value = "type") String type) {
...@@ -92,7 +94,7 @@ public class ExcelController extends BaseController { ...@@ -92,7 +94,7 @@ public class ExcelController extends BaseController {
* date 2021/9/13 * date 2021/9/13
* </PRE> * </PRE>
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false,ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类") @ApiOperation(value = "导出公用类")
@GetMapping("/export/{type}") @GetMapping("/export/{type}")
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type, public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type,
......
...@@ -303,6 +303,8 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -303,6 +303,8 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) { if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue; continue;
} }
int num=0;
LinkedHashMap<String, String> infoMap_1 = new LinkedHashMap<String, String>(); LinkedHashMap<String, String> infoMap_1 = new LinkedHashMap<String, String>();
for (Map<String, Object> specify : specifyDateList) { for (Map<String, Object> specify : specifyDateList) {
// //
...@@ -310,6 +312,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -310,6 +312,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
if (specify.get("userName").toString().contains(",")) { if (specify.get("userName").toString().contains(",")) {
String[] userNames = specify.get("userName").toString().split(","); String[] userNames = specify.get("userName").toString().split(",");
num = num+ userNames.length;
infoMap_1.put(dutyDetail.get("name").toString(), userNames.length + ""); infoMap_1.put(dutyDetail.get("name").toString(), userNames.length + "");
} else { } else {
infoMap_1.put(dutyDetail.get("name").toString(), "1"); infoMap_1.put(dutyDetail.get("name").toString(), "1");
...@@ -317,65 +320,66 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -317,65 +320,66 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
resultList.add(infoMap_1); resultList.add(infoMap_1);
} }
} }
fireCarDto.setPersonCount(num);
} }
} }
} }
} }
int num = 0; // int num = 0;
String todayTime = DateUtils.getDateNowShortStr(); // String todayTime = DateUtils.getDateNowShortStr();
String beginDate = todayTime; // String beginDate = todayTime;
beginDate = beginDate + " 00:00:00"; // beginDate = beginDate + " 00:00:00";
String endDate = todayTime; // String endDate = todayTime;
endDate = endDate + " 23:59:59"; // endDate = endDate + " 23:59:59";
LambdaQueryWrapper<DutyShift> wrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<DutyShift> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseEntity::getIsDelete, false); // wrapper.eq(BaseEntity::getIsDelete, false);
List<DutyShift> dutyShifts = dutyShiftMapper.selectList(wrapper); // List<DutyShift> dutyShifts = dutyShiftMapper.selectList(wrapper);
//
String[] dutyShiftName = {" "}; // String[] dutyShiftName = {" "};
//
dutyShifts.forEach(e -> { // dutyShifts.forEach(e -> {
String startTime = e.getStartTime(); // String startTime = e.getStartTime();
Date startDate = null; // Date startDate = null;
Date dateEnd = null; // Date dateEnd = null;
if (startTime.startsWith("当日:")) { // if (startTime.startsWith("当日:")) {
String resultTime = startTime.replace("当日:", todayTime) + ":00"; // String resultTime = startTime.replace("当日:", todayTime) + ":00";
startDate = DateUtils.longStr2Date(resultTime); // startDate = DateUtils.longStr2Date(resultTime);
} else if (startTime.startsWith("次日:")) { // } else if (startTime.startsWith("次日:")) {
Date dateNow = DateUtils.getDateNow(); // Date dateNow = DateUtils.getDateNow();
Date date = DateUtils.dateAddDays(dateNow, 1); // Date date = DateUtils.dateAddDays(dateNow, 1);
String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN); // String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN);
String resultTime = startTime.replace("次日:", s) + ":00"; // String resultTime = startTime.replace("次日:", s) + ":00";
startDate = DateUtils.longStr2Date(resultTime); // startDate = DateUtils.longStr2Date(resultTime);
} // }
String endTime = e.getEndTime(); // String endTime = e.getEndTime();
if (endTime.startsWith("当日:")) { // if (endTime.startsWith("当日:")) {
String resultTime = endTime.replace("当日:", todayTime) + ":00"; // String resultTime = endTime.replace("当日:", todayTime) + ":00";
dateEnd = DateUtils.longStr2Date(resultTime); // dateEnd = DateUtils.longStr2Date(resultTime);
} else if (endTime.startsWith("次日:")) { // } else if (endTime.startsWith("次日:")) {
Date dateNow = DateUtils.getDateNow(); // Date dateNow = DateUtils.getDateNow();
Date date = DateUtils.dateAddDays(dateNow, 1); // Date date = DateUtils.dateAddDays(dateNow, 1);
String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN); // String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN);
String resultTime = endTime.replace("次日:", s) + ":00"; // String resultTime = endTime.replace("次日:", s) + ":00";
dateEnd = DateUtils.longStr2Date(resultTime); // dateEnd = DateUtils.longStr2Date(resultTime);
} // }
//
if (DateUtils.belongCalendar(DateUtils.getDateNow(), startDate, dateEnd)) { // if (DateUtils.belongCalendar(DateUtils.getDateNow(), startDate, dateEnd)) {
dutyShiftName[0] = dutyShiftName[0].replace(" ", e.getName()); // dutyShiftName[0] = dutyShiftName[0].replace(" ", e.getName());
} // }
}); // });
//
if (resultList != null) { // if (resultList != null) {
resultList.forEach(e -> { // resultList.forEach(e -> {
if (e.containsKey(dutyShiftName[0])) { // if (e.containsKey(dutyShiftName[0])) {
String personNum = e.get(dutyShiftName[0]); // String personNum = e.get(dutyShiftName[0]);
fireCarDto.setPersonCount(Integer.valueOf(personNum)); // fireCarDto.setPersonCount(Integer.valueOf(personNum));
} // }
}); // });
} else { // } else {
fireCarDto.setPersonCount(num); // fireCarDto.setPersonCount(num);
} // }
} }
fireCarDtoList.add(fireCarDto); fireCarDtoList.add(fireCarDto);
......
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