Commit 51694ad2 authored by xinglei's avatar xinglei

修改bug

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