Commit 51694ad2 authored by xinglei's avatar xinglei

修改bug

parent 24df0c3d
......@@ -47,6 +47,11 @@ public class CheckInputBo {
private String isOK;
/**
* 是否输入框类型
*/
private String itemType;
/**
* 上报时间
*/
private Date uploadTime;
......@@ -267,5 +272,13 @@ public class CheckInputBo {
public void setIdStateStr(String idStateStr) {
this.idStateStr = idStateStr;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
}
......@@ -1069,6 +1069,14 @@ public class CheckServiceImpl implements ICheckService {
List<CheckAnalysisVo> checkAnalysisVos = null;
if (param.getStatisticsTyle() == 0) {
checkAnalysisVos = checkMapper.getCheckStatisticalByPlanTask(param);
checkAnalysisVos.forEach(
x -> {
if (!x.getFaild().equals("0")) {
String faildNum = getFaildNum(x.getStatusStr());
x.setFaild(faildNum);
}
}
);
} else {
checkAnalysisVos = checkMapper.getCheckStatisticalByCheck(param);
}
......@@ -1266,6 +1274,23 @@ public class CheckServiceImpl implements ICheckService {
}
/**
* 返回异常巡检数量
*
* @param statusStr
* @return
*/
private String getFaildNum(String statusStr) {
int num = 0;
String[] split = statusStr.split(",");
for (int i = 0; i < split.length; i++) {
if (split[i].contains("_2")) {
num++;
}
}
return String.valueOf(num);
}
/**
* 业务模板设置
*/
private void setRow(List<CheckInputBo> checkInfoList, HSSFSheet sheet, CellStyle contentStyle, CellStyle alignLeftStyle) {
......@@ -1363,22 +1388,26 @@ public class CheckServiceImpl implements ICheckService {
row = sheet.createRow(i + 3);
HSSFCell cell = row.createCell(0);
if (ObjectUtils.isEmpty(checkInputBo.getBeginTime())) {
cell.setCellValue(DateUtil.splitDate(checkInputBo.getCheckDate()));
cell.setCellValue(DateUtil.splitDate(checkInputBo.getCheckDate() + "(无计划)"));
} else {
cell.setCellValue(DateUtil.splitDate(checkInputBo.getBeginTime()));
}
cell.setCellStyle(contentStyle);
HSSFCell cell1 = row.createCell(1);
cell1.setCellValue(checkInfoList.get(i).getPointName());
cell1.setCellValue(checkInputBo.getPointName());
cell1.setCellStyle(contentStyle);
HSSFCell cell2 = row.createCell(2);
cell2.setCellStyle(contentStyle);
cell2.setCellValue(checkInfoList.get(i).getClassifyName());
cell2.setCellValue(checkInputBo.getClassifyName());
HSSFCell cell3 = row.createCell(3);
cell3.setCellValue(checkInfoList.get(i).getInputItemName());
cell3.setCellValue(checkInputBo.getInputItemName());
cell3.setCellStyle(alignLeftStyle);
HSSFCell cell4 = row.createCell(4);
cell4.setCellValue(checkInfoList.get(i).getIsOK());
if ("选择".equals(checkInputBo.getItemType())){
cell4.setCellValue(checkInputBo.getIsOK());
} else {
cell4.setCellValue(checkInputBo.getInputValue());
}
cell4.setCellStyle(alignLeftStyle);
}
}
......@@ -1514,7 +1543,7 @@ public class CheckServiceImpl implements ICheckService {
children.forEach(
y -> {
String key = DeptEnum.getEnumCode(String.valueOf(y.get("departmentName")));
List<CheckAnalysisVo> collect = checkAnalysisVos.stream().filter(z -> key.equals(z.getName()) && z.getCheckTime().equals(day)).collect(Collectors.toList());
List<CheckAnalysisVo> collect = checkAnalysisVos.stream().filter(z -> key.equals(z.getName()) && day.equals(z.getCheckTime())).collect(Collectors.toList());
String plantaskCount = getCount(collect, PLANTASK_COUNT);
String checkCount = getCount(collect, CHECK_COUNT);
String missed = getCount(collect, MISSED);
......
......@@ -389,8 +389,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
param.put("beginDate", param.get("beginDate") + " " + "00:00:00");
param.put("endDate", param.get("endDate") + " " + "23:59:59");
List<Long> ids = planTaskMapper.getGenPlanTask(param);
planTaskDetail.deletePlanTaskDetailByTaskNo(ids);
iplanTaskDao.deleteBatchById(ids);
if (!ObjectUtils.isEmpty(ids)) {
planTaskDetail.deletePlanTaskDetailByTaskNo(ids);
iplanTaskDao.deleteBatchById(ids);
}
}
/**
......
......@@ -22,6 +22,7 @@ public class CheckAnalysisVo {
@Excel(name = "不合格率%", orderNum = "8")
private String faildRate;
private String checkTime;
private String statusStr;
public String getName() {
return name;
}
......@@ -84,4 +85,12 @@ public class CheckAnalysisVo {
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public String getStatusStr() {
return statusStr;
}
public void setStatusStr(String statusStr) {
this.statusStr = statusStr;
}
}
......@@ -184,6 +184,7 @@
END
) AS IsOK,
ii.`name` AS inputItemName,
ii.item_type as itemType,
c.upload_time AS UploadTime,
u.`name` AS RealName,
ci.score AS Score,
......@@ -215,7 +216,10 @@
</trim>
GROUP BY inputId, classifyId, beginTime
ORDER BY
checkDate ASC, pointId ASC, classifyId ASC
beginTime is null,
beginTime ASC,
pointId ASC,
classifyId ASC
</when>
<otherwise>
select
......@@ -233,6 +237,7 @@
GROUP_CONCAT(DISTINCT pt.begin_time, '_', ci.is_ok) as idStateStr,
ci.id checkInputId,
ci.input_id inputId,
ci.input_value AS InputValue,
(
CASE ci.is_ok
WHEN 1 THEN
......@@ -243,6 +248,7 @@
'漏检'
END
) AS IsOK,
ii.item_type as itemType,
ii.`name` AS inputItemName,
ci.point_classify_id classifyId,
ci.point_classify_name classifyName
......@@ -259,8 +265,8 @@
<if test="departmentId!=null">and c.dep_id = #{departmentId}</if>
and (pt.id is NOT NULL or pt.id = '')
</trim>
group by pointId, inputId
order BY pointId
group by pointId, inputId, classifyId
order BY pointId, classifyId
</otherwise>
</choose>
</select>
......@@ -938,6 +944,7 @@
<result property="inputItemName" column="inputItemName"/>
<result property="inputValue" column="InputValue"/>
<result property="isOK" column="IsOK"/>
<result property="itemType" column="itemType"/>
<result property="uploadTime" column="UploadTime"/>
<result property="executor" column="RealName"/>
<result property="inputItemScore" column="Score"/>
......@@ -1922,7 +1929,10 @@
sum(a.ok) ok,
sum(a.faild) faild,
sum(a.missed) missed,
a.checkTime
a.checkTime,
a.orgCode,
a.planTaskId,
GROUP_CONCAT(DISTINCT a.taskDetailStatus) as statusStr
FROM
( SELECT
CASE
......@@ -1931,6 +1941,7 @@
ELSE
p. NAME
END planName,
pnt.id planTaskId,
pnt.plan_id planId,
r. NAME routeName,
r.id routeId,
......@@ -1938,8 +1949,10 @@
p.dept_id deptName,
pnt.finish_status isOk,
pnt.id checkId,
pnt.org_code orgCode,
DATE_FORMAT(pnt.check_date, '%Y-%m-%d') checkTime,
DATE_FORMAT(pnt.check_date, '%Y-%m') checkMonth,
GROUP_CONCAT(DISTINCT ptd.task_no, '_', ptd.status) as taskDetailStatus,
CASE
WHEN pnt.finish_status = 1 THEN
1
......@@ -1966,6 +1979,7 @@
END finish
FROM
p_plan_task pnt
LEFT JOIN p_plan_task_detail ptd ON ptd.task_no = pnt.id
LEFT JOIN p_plan p ON pnt.plan_id = p.id
LEFT JOIN p_route r ON pnt.route_id = r.id
WHERE pnt.org_code LIKE CONCAT(#{orgCode}, '%')
......@@ -1980,6 +1994,8 @@
<if test="isOk !=null and isOk != '' ">and c.isOk = #{isOk}</if>
<if test="startTime !=null and startTime!= '' "> <![CDATA[ AND pnt.check_date >= #{startTime} ]]> </if>
<if test="endTime !=null and endTime!='' "><![CDATA[AND pnt.check_date <= #{endTime} ]]></if>
GROUP BY
pnt.id
) a
GROUP BY
a.deptName,
......
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