1、增加单位图标管理
2、修改机构登录 3、订单问题处理 4、完善组态绑定及删除关联
This commit is contained in:
@@ -61,7 +61,7 @@ private static final long serialVersionUID = 1L;
|
||||
@Excel(name = "巡检人")
|
||||
@ApiModelProperty("巡检人")
|
||||
private String inspectionPerson;
|
||||
|
||||
private String inspection;
|
||||
/** 巡检人id */
|
||||
@Excel(name = "巡检人id")
|
||||
@ApiModelProperty("巡检人id")
|
||||
|
||||
@@ -46,13 +46,13 @@ private static final long serialVersionUID = 1L;
|
||||
private String projectName;
|
||||
|
||||
/** 计划巡检时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "计划巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("计划巡检时间")
|
||||
private Date planTime;
|
||||
|
||||
/** 实际巡检时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "实际巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("实际巡检时间")
|
||||
private Date inspectionTime;
|
||||
|
||||
@@ -57,6 +57,8 @@ private static final long serialVersionUID = 1L;
|
||||
@ApiModelProperty("完成人")
|
||||
private String finishBy;
|
||||
|
||||
private String respon;
|
||||
|
||||
/** 附件 */
|
||||
@Excel(name = "附件")
|
||||
@ApiModelProperty("附件")
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.xinda.common.core.domain.model.LoginUser;
|
||||
import com.xinda.common.utils.DateUtils;
|
||||
import com.xinda.itsm.domain.InspectionRecord;
|
||||
import com.xinda.itsm.mapper.InspectionRecordMapper;
|
||||
@@ -17,6 +18,8 @@ import com.xinda.itsm.mapper.InspectionPlanMapper;
|
||||
import com.xinda.itsm.domain.InspectionPlan;
|
||||
import com.xinda.itsm.service.IInspectionPlanService;
|
||||
|
||||
import static com.xinda.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* 巡检计划Service业务层处理
|
||||
*
|
||||
@@ -63,7 +66,7 @@ public class InspectionPlanServiceImpl implements IInspectionPlanService
|
||||
@Override
|
||||
public int insertInspectionPlan(InspectionPlan inspectionPlan)
|
||||
{
|
||||
|
||||
LoginUser loginUser = getLoginUser();
|
||||
inspectionPlan.setCreateTime(DateUtils.getNowDate());
|
||||
int num = inspectionPlanMapper.insertInspectionPlan(inspectionPlan);
|
||||
// 收集日期范围内的所有日期
|
||||
@@ -71,6 +74,8 @@ public class InspectionPlanServiceImpl implements IInspectionPlanService
|
||||
processDateRange(inspectionPlan.getStartDate(), inspectionPlan.getEndDate(), dateList::add);
|
||||
for(Date date : dateList){
|
||||
InspectionRecord inspectionRecord = getBasicRecord(inspectionPlan, date, "日");
|
||||
inspectionRecord.setCreateTime(DateUtils.getNowDate());
|
||||
inspectionRecord.setCreateBy(loginUser.getUsername());
|
||||
inspectionRecordMapper.insertInspectionRecord(inspectionRecord);
|
||||
}
|
||||
return num;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.xinda.itsm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.xinda.common.core.domain.model.LoginUser;
|
||||
import com.xinda.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -8,6 +10,8 @@ import com.xinda.itsm.mapper.InspectionRecordMapper;
|
||||
import com.xinda.itsm.domain.InspectionRecord;
|
||||
import com.xinda.itsm.service.IInspectionRecordService;
|
||||
|
||||
import static com.xinda.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* 巡检记录Service业务层处理
|
||||
*
|
||||
@@ -53,7 +57,9 @@ public class InspectionRecordServiceImpl implements IInspectionRecordService
|
||||
@Override
|
||||
public int insertInspectionRecord(InspectionRecord inspectionRecord)
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
inspectionRecord.setCreateTime(DateUtils.getNowDate());
|
||||
inspectionRecord.setCreateBy(loginUser.getUsername());
|
||||
return inspectionRecordMapper.insertInspectionRecord(inspectionRecord);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,18 +95,65 @@ public class ItsmServiceImpl implements ItsmService {
|
||||
Date finish = DateUtils.addMonths(start, i + 1);
|
||||
|
||||
StateCountVo repairCountVo = new StateCountVo();
|
||||
long repairTotal = repairs.stream().filter(r->r.getUpdateTime().after(begin) && r.getUpdateTime().before(finish)).count();
|
||||
long repairCompleted = repairs.stream().filter(r->r.getOrderStatus().equals(RepairOrderStatus.COMPLETED.getCode())
|
||||
&& r.getUpdateTime().after(begin) && r.getUpdateTime().before(finish)).count();
|
||||
long repairTotal = repairs.stream()
|
||||
.filter(Objects::nonNull) // 过滤掉null元素
|
||||
.filter(r -> {
|
||||
Date updateTime = r.getUpdateTime();
|
||||
// 检查updateTime是否为null
|
||||
return updateTime != null &&
|
||||
updateTime.after(begin) &&
|
||||
updateTime.before(finish);
|
||||
})
|
||||
.count();
|
||||
// long repairTotal = repairs.stream().filter(r->r.getUpdateTime().after(begin) && r.getUpdateTime().before(finish)).count();
|
||||
long repairCompleted = repairs.stream()
|
||||
.filter(Objects::nonNull) // 过滤掉null元素
|
||||
.filter(r -> {
|
||||
String orderStatus = r.getOrderStatus();
|
||||
Date updateTime = r.getUpdateTime();
|
||||
// 检查orderStatus和updateTime是否为null
|
||||
return orderStatus != null &&
|
||||
orderStatus.equals(RepairOrderStatus.COMPLETED.getCode()) &&
|
||||
updateTime != null &&
|
||||
updateTime.after(begin) &&
|
||||
updateTime.before(finish);
|
||||
})
|
||||
.count();
|
||||
// long repairCompleted = repairs.stream().filter(r->r.getOrderStatus().equals(RepairOrderStatus.COMPLETED.getCode())
|
||||
// && r.getUpdateTime().after(begin) && r.getUpdateTime().before(finish)).count();
|
||||
repairCountVo.setTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM,begin));
|
||||
repairCountVo.setFinished(repairCompleted);
|
||||
repairCountVo.setUnfinished(repairTotal-repairCompleted);
|
||||
repairCounts.add(repairCountVo);
|
||||
|
||||
StateCountVo inspectionCountVo = new StateCountVo();
|
||||
long inspectionTotal = inspections.stream().filter(r->r.getUpdateTime().after(begin) && r.getUpdateTime().before(finish)).count();
|
||||
long inspectionCompleted = inspections.stream().filter(r->r.getInspectionStatus().equals(InspectionRecordStatus.COMPLETED.getCode())
|
||||
&& r.getUpdateTime().after(begin) && r.getUpdateTime().before(finish)).count();
|
||||
// 修复inspectionTotal计数
|
||||
long inspectionTotal = inspections.stream()
|
||||
.filter(Objects::nonNull) // 过滤掉null元素
|
||||
.filter(r -> {
|
||||
Date updateTime = r.getUpdateTime();
|
||||
return updateTime != null &&
|
||||
updateTime.after(begin) &&
|
||||
updateTime.before(finish);
|
||||
})
|
||||
.count();
|
||||
|
||||
// 修复inspectionCompleted计数
|
||||
long inspectionCompleted = inspections.stream()
|
||||
.filter(Objects::nonNull) // 过滤掉null元素
|
||||
.filter(r -> {
|
||||
String status = r.getInspectionStatus();
|
||||
Date updateTime = r.getUpdateTime();
|
||||
return status != null &&
|
||||
status.equals(InspectionRecordStatus.COMPLETED.getCode()) &&
|
||||
updateTime != null &&
|
||||
updateTime.after(begin) &&
|
||||
updateTime.before(finish);
|
||||
})
|
||||
.count();
|
||||
// long inspectionTotal = inspections.stream().filter(r->r.getUpdateTime().after(begin) && r.getUpdateTime().before(finish)).count();
|
||||
// long inspectionCompleted = inspections.stream().filter(r->r.getInspectionStatus().equals(InspectionRecordStatus.COMPLETED.getCode())
|
||||
// && r.getUpdateTime().after(begin) && r.getUpdateTime().before(finish)).count();
|
||||
inspectionCountVo.setTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM,begin));
|
||||
inspectionCountVo.setFinished(inspectionCompleted);
|
||||
inspectionCountVo.setUnfinished(inspectionTotal-inspectionCompleted);
|
||||
|
||||
@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="inspectionCycle" column="inspection_cycle" />
|
||||
<result property="inspectionPerson" column="inspection_person" />
|
||||
<result property="inspection" column="inspection" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="setDate" column="set_date" />
|
||||
<result property="setTime" column="set_time" />
|
||||
@@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInspectionPlanVo">
|
||||
select id, plan_name, plan_content, project_name, start_date, end_date, inspection_cycle, inspection_person, user_id, set_date, set_time, status, create_by, create_time, update_by, update_time from inspection_plan
|
||||
select id, plan_name, plan_content, project_name, start_date, end_date, inspection_cycle, inspection_person,inspection, user_id, set_date, set_time, status, create_by, create_time, update_by, update_time from inspection_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectInspectionPlanList" parameterType="InspectionPlan" resultMap="InspectionPlanResult">
|
||||
@@ -37,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="endDate != null "> and end_date = #{endDate}</if>
|
||||
<if test="inspectionCycle != null and inspectionCycle != ''"> and inspection_cycle = #{inspectionCycle}</if>
|
||||
<if test="inspectionPerson != null and inspectionPerson != ''"> and inspection_person = #{inspectionPerson}</if>
|
||||
<if test="inspection!= null and inspection != ''"> and inspection = #{inspection}</if>
|
||||
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
||||
<if test="setDate != null and setDate != ''"> and set_date = #{setDate}</if>
|
||||
<if test="setTime != null and setTime != ''"> and set_time = #{setTime}</if>
|
||||
@@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="endDate != null">end_date,</if>
|
||||
<if test="inspectionCycle != null">inspection_cycle,</if>
|
||||
<if test="inspectionPerson != null">inspection_person,</if>
|
||||
<if test="inspection!= null">inspection,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="setDate != null">set_date,</if>
|
||||
<if test="setTime != null">set_time,</if>
|
||||
@@ -78,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="endDate != null">#{endDate},</if>
|
||||
<if test="inspectionCycle != null">#{inspectionCycle},</if>
|
||||
<if test="inspectionPerson != null">#{inspectionPerson},</if>
|
||||
<if test="inspection != null">#{inspection},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="setDate != null">#{setDate},</if>
|
||||
<if test="setTime != null">#{setTime},</if>
|
||||
@@ -99,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="endDate != null">end_date = #{endDate},</if>
|
||||
<if test="inspectionCycle != null">inspection_cycle = #{inspectionCycle},</if>
|
||||
<if test="inspectionPerson != null">inspection_person = #{inspectionPerson},</if>
|
||||
<if test="inspection != null">inspection = #{inspection},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="setDate != null">set_date = #{setDate},</if>
|
||||
<if test="setTime != null">set_time = #{setTime},</if>
|
||||
|
||||
@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="assignTime" column="assign_time" />
|
||||
<result property="finishTime" column="finish_time" />
|
||||
<result property="finishBy" column="finish_by" />
|
||||
<result property="respon" column="respon" />
|
||||
<result property="annex" column="annex" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="orderStatus" column="order_status" />
|
||||
@@ -23,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRepairOrderVo">
|
||||
select id, order_no, order_content, project_name, assign_time, finish_time, finish_by, annex, user_id, order_status, order_remark, create_by, create_time, update_by, update_time from repair_order
|
||||
select id, order_no, order_content, project_name, assign_time, finish_time, finish_by,respon, annex, user_id, order_status, order_remark, create_by, create_time, update_by, update_time from repair_order
|
||||
</sql>
|
||||
|
||||
<select id="selectRepairOrderList" parameterType="RepairOrder" resultMap="RepairOrderResult">
|
||||
@@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="assignTime != null "> and assign_time = #{assignTime}</if>
|
||||
<if test="finishTime != null "> and finish_time = #{finishTime}</if>
|
||||
<if test="finishBy != null and finishBy != ''"> and finish_by = #{finishBy}</if>
|
||||
<if test="respon != null and respon != ''"> and respon = #{respon}</if>
|
||||
<if test="annex != null and annex != ''"> and annex = #{annex}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
|
||||
@@ -57,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="assignTime != null">assign_time,</if>
|
||||
<if test="finishTime != null">finish_time,</if>
|
||||
<if test="finishBy != null">finish_by,</if>
|
||||
<if test="respon != null">respon,</if>
|
||||
<if test="annex != null">annex,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="orderStatus != null">order_status,</if>
|
||||
@@ -74,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="assignTime != null">#{assignTime},</if>
|
||||
<if test="finishTime != null">#{finishTime},</if>
|
||||
<if test="finishBy != null">#{finishBy},</if>
|
||||
<if test="respon != null">#{respon},</if>
|
||||
<if test="annex != null">#{annex},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="orderStatus != null">#{orderStatus},</if>
|
||||
@@ -94,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="assignTime != null">assign_time = #{assignTime},</if>
|
||||
<if test="finishTime != null">finish_time = #{finishTime},</if>
|
||||
<if test="finishBy != null">finish_by = #{finishBy},</if>
|
||||
<if test="respon != null">respon = #{respon},</if>
|
||||
<if test="annex != null">annex = #{annex},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="orderStatus != null">order_status = #{orderStatus},</if>
|
||||
|
||||
Reference in New Issue
Block a user