Commit 1b9620c5 authored by limei's avatar limei

Merge branch 'develop_dl_plan6' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6

parents a49c3602 e7672af6
......@@ -65,6 +65,12 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("dutyDate") String dutyDate,
@Param("groupCode") String groupCode
);
List<Map<String, Object>> newStationViewDataByFieldCode(
@Param("dutyDate") String dutyDate,
@Param("groupCode") String groupCode,
@Param("fieldCode") String fieldCode
);
/**
* 利用mysql 生成连续时间区间
*
......
......@@ -32,12 +32,14 @@ public interface IDutyCommonService {
List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException;
/**
* 新值班月视图
*
* @param beginDate
* @param endDate
* @param dutyType
* @return
* @throws ParseException
*/
List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException;
List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate, String fieldCode) throws ParseException;
/**
* 不分页查询
*
......
......@@ -102,6 +102,21 @@
and i.group_code =#{groupCode}
GROUP BY i.field_value
</select>
<select id="newStationViewDataByFieldCode" resultType="java.util.Map">
select
i.field_value as postTypeName,
count(1) as total
from
cb_duty_person_shift s,
cb_dynamic_form_instance i
where
s.instance_id = i.instance_id
and i.field_code = #{fieldCode}
AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
and i.group_code =#{groupCode}
GROUP BY i.field_value
</select>
<select id="genRangeDate" resultType="map">
SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
......
......@@ -103,9 +103,10 @@ public class DutyCarController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode
) throws ParseException {
return ResponseHelper.buildResponse(iDutyCarService.newStatisticsDay(beginDate, endDate));
return ResponseHelper.buildResponse(iDutyCarService.newStatisticsDay(beginDate, endDate, fieldCode));
}
/**
* 调班
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.text.ParseException;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
......@@ -18,18 +17,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
......@@ -102,9 +97,10 @@ public class DutyFireFightingController extends BaseController{
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.newStatisticsDay(beginDate, endDate));
return ResponseHelper.buildResponse(iDutyFireFightingService.newStatisticsDay(beginDate, endDate, fieldCode));
}
/**
* 调班
......
......@@ -89,9 +89,10 @@ public class DutyFirstAidController extends BaseController{
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.newStatisticsDay(beginDate, endDate));
return ResponseHelper.buildResponse(iDutyFirstAidService.newStatisticsDay(beginDate, endDate, fieldCode));
}
/**
* 调班
......
......@@ -103,9 +103,10 @@ public class DutyPersonController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate));
return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate, fieldCode));
}
/**
......
......@@ -170,7 +170,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
LocalDate startDate = LocalDate.parse(start);
LocalDate endDate = LocalDate.parse(end);
long distance = ChronoUnit.DAYS.between(startDate, endDate);
if (distance < 1) {
if (distance < 1 && StringUtils.isNotBlank(start)) {
list.add(start);
return list;
}
Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).forEach(f -> list.add(f.toString()));
......@@ -218,7 +219,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/
}
public List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException {
public List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate, String fieldCode) throws ParseException {
Date dateBegin = DateUtils.dateParse(beginDate, DateUtils.DATE_PATTERN);
String timeStart = DateUtils.dateTimeToDateString(dateBegin);
......@@ -246,7 +247,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
result.put("key", objectMap.get("date"));
String dateString = objectMap.get("date").toString();
if(this.getGroupCode().equals("dutyPerson")) {
result.put("data", getPersonPostTypeNameAndCount(dateString));
result.put("data", getPersonPostTypeNameAndCount(dateString, fieldCode));
}else if(this.getGroupCode().equals("dutyCar")) {
result.put("data", getCarPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyFireFighting")) {
......@@ -264,10 +265,15 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
/**
* 排班值班人员的统计类型为:
* 岗位: 岗位人员数量
*
* @param dutyDate
* @param dutyType
* @return
*/
public Object getPersonPostTypeNameAndCount(String dutyDate) {
public Object getPersonPostTypeNameAndCount(String dutyDate, String fieldCode) {
if (StringUtils.isNotBlank(fieldCode)) {
return dutyPersonShiftService.getBaseMapper().newStationViewDataByFieldCode(dutyDate, this.getGroupCode(), fieldCode);
}
return dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
}
/**
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.tdc.api.mapper.CheckResultMapper">
<select id="selectResult" resultType="com.yeejoin.amos.boot.module.tdc.api.dto.CheckResultDto">
select check_date, case when check_type="1" then '全站校验' else `model_name` end as `name`
select check_date, case when check_type="0" then '全站校验' else `model_name` end as `name`
from `tdc_check_result`
<where>
<if test="code != '' and code != null">
......
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