2024-5-6 设备模块-点检巡检保养工单-图片等问题

master
A0010407 11 months ago
parent ee84f9b8ed
commit a7e2eccc70

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.domain.BaseFileData;
import com.op.system.api.domain.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -268,6 +269,7 @@ public class EquOrder extends BaseEntity {
private List<String> upkeepPictures;
private String picturePath;
private List<BaseFileData> picturePaths;
//工具
private String itemTools;
@ -288,6 +290,14 @@ public class EquOrder extends BaseEntity {
this.upkeepPictures = upkeepPictures;
}
public List<BaseFileData> getPicturePaths() {
return picturePaths;
}
public void setPicturePaths(List<BaseFileData> picturePaths) {
this.picturePaths = picturePaths;
}
public List<Date> getOrderStartArray() {
return orderStartArray;
}

@ -20,6 +20,7 @@ import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.service.IEquOrderService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -88,8 +89,16 @@ public class EquOrderServiceImpl implements IEquOrderService {
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode());
for (EquOrderDetail detail : detailList) {
// 标准
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getId());
detail.setStandardList(standardList);
List<EquOrderStandard> standardLists = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getId());
for (EquOrderStandard standardList : standardLists) {
//每个检查标准里面的照片
String imageType = "3";
List<BaseFileData> file = equOrderStandardMapper.getBaseFileBatch(standardList.getId(), imageType);
if (!CollectionUtils.isEmpty(file)) {
standardList.setPicturePaths(file);
}
}
detail.setStandardList(standardLists);
}
order.setDetailList(detailList);
@ -110,6 +119,12 @@ public class EquOrderServiceImpl implements IEquOrderService {
order.setPersonList(personList);
//保养图片信息
String imageType = "3";
List<BaseFileData> file = equOrderStandardMapper.getBaseFileBatch(order.getOrderId(), imageType);
if (!CollectionUtils.isEmpty(file)) {
order.setPicturePaths(file);
}
return order;
}
@ -209,6 +224,8 @@ public class EquOrderServiceImpl implements IEquOrderService {
}
// 获取检查项信息列表
//照片格式
String imageType = "3";
List<EquOrderDetail> detailList = equOrder.getDetailList();
// 处理检查项信息
for (EquOrderDetail detail : detailList) {
@ -216,7 +233,8 @@ public class EquOrderServiceImpl implements IEquOrderService {
List<EquOrderStandard> standardList = detail.getStandardList();
// 处理标准信息
for (EquOrderStandard standard : standardList) {
//删除之前的图片,重新上传
equOrderStandardMapper.deleteBaseFileBySourceId(standard.getId(), imageType);
//上传附件
if (StringUtils.isNotEmpty(standard.getPicturePath())) {
String[] ids = standard.getPicturePath().split(",");
@ -265,6 +283,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());// 设置负责人
equOrder.setOrderEnd(DateUtils.getNowDate());// 设置结束时间
equOrder.setOrderStart(DateUtils.getNowDate());// 设置检查时间开始,实际上不需要开始时间
if (equOrder.getTimeArray().size() > 0) {
equOrder.setOrderStart(equOrder.getTimeArray().get(0));// 工单开始时间
equOrder.setOrderEnd(equOrder.getTimeArray().get(1));// 工单结束时间
@ -355,6 +374,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
}
// 保养图片
equOrderStandardMapper.deleteBaseFileBySourceId(equOrder.getOrderId(), imageType);
if (StringUtils.isNotEmpty(equOrder.getPicturePath())) {
String[] ids = equOrder.getPicturePath().split(",");
List<BaseFileData> files = new ArrayList<>();
@ -367,6 +387,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
file.setSourceId(equOrder.getOrderId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
file.setImageType("3");
files.add(file);
}
equFileMapper.insertEquFileBatch(files);

@ -169,14 +169,17 @@
<!--设备总数-->
<select id="getTotalEquipment" resultType="java.lang.String">
select count(*) from base_equipment be where be.del_flag = '0' and be.status = '1'
select count(1)
from base_equipment be
where be.del_flag = '0'
and be.status = '1'
</select>
<select id="selectGroups" resultType="com.op.device.domain.vo.IEquFaultVO">
select be.equipment_code AS 'code', be.equipment_name AS 'name'
from base_equipment be
where be.del_flag = '0'
and be.equipment_category = '1'
and be.equipment_category = '1'
</select>
<select id="selectEquipmentFaultNumForMonth" resultType="java.util.Map">

@ -61,16 +61,44 @@
</sql>
<select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult">
select eo.order_id, eo.plan_id, eo.plan_code, eo.plan_type, eo.order_code, eo.plan_workshop, eo.plan_prod_line,
eo.plan_loop,
eo.plan_loop_type,
eo.plan_loop_start, eo.plan_loop_end, eo.order_start, eo.order_end, eo.equipment_code, eo.order_status,
eo.order_cost, eo.plan_person, eo.order_cost_time, eo.order_sign_person,
eo.factory_code, eo.attr1, eo.attr2, eo.attr3, eo.del_flag, eo.create_by, eo.create_time,
eo.update_by,
eo.update_time,eo.upkeep,eo.calculation_rule,eo.shut_down,eo.order_inspect,eo.repair_code,eo.work_code,eo.outsource_code,
be.equipment_name,
ep.plan_name planName
select
eo.order_id,
eo.plan_id,
eo.plan_code,
eo.plan_type,
eo.order_code,
eo.plan_workshop,
eo.plan_prod_line,
eo.plan_loop,
eo.plan_loop_type,
eo.plan_loop_start,
eo.plan_loop_end,
eo.order_start,
eo.order_end,
eo.equipment_code,
eo.order_status,
eo.order_cost,
eo.plan_person,
eo.order_cost_time,
eo.order_sign_person,
eo.factory_code,
eo.attr1,
eo.attr2,
eo.attr3,
eo.del_flag,
eo.create_by,
eo.create_time,
eo.update_by,
eo.update_time,
eo.upkeep,
eo.calculation_rule,
eo.shut_down,
eo.order_inspect,
eo.repair_code,
eo.work_code,
eo.outsource_code,
be.equipment_name,
ep.plan_name planName
from equ_order eo
left join base_equipment be on be.equipment_code = eo.equipment_code
left join equ_plan ep on ep.plan_code = eo.plan_code
@ -83,23 +111,17 @@
<if test="planProdLine != null and planProdLine != ''">and eo.plan_prod_line = #{planProdLine}</if>
<if test="planLoop != null and planLoop != ''">and eo.plan_loop = #{planLoop}</if>
<if test="planLoopType != null and planLoopType != ''">and eo.plan_loop_type = #{planLoopType}</if>
<if test="equipmentCode != null and equipmentCode != ''">and eo.equipment_code like concat('%',
#{equipmentCode}, '%')
</if>
<if test="equipmentName != null and equipmentName != ''">and be.equipment_name like concat('%',
#{equipmentName}, '%')
</if>
<if test="equipmentCode != null and equipmentCode != ''">and eo.equipment_code like concat('%',#{equipmentCode}, '%')</if>
<if test="equipmentName != null and equipmentName != ''">and be.equipment_name like concat('%',#{equipmentName}, '%')</if>
<if test="planLoopStart != null ">and eo.plan_loop_start = #{planLoopStart}</if>
<if test="planLoopEnd != null ">and eo.plan_loop_end = #{planLoopEnd}</if>
<if test="orderStart != null ">and CONVERT(date,eo.order_start) = #{orderStart}</if>
<if test="orderEnd != null ">and eo.order_end = #{ord5erEnd}</if>
<if test="orderStatus != null and orderStatus != ''">and eo.order_status = #{orderStatus}</if>
<if test="orderCost != null ">and eo.order_cost = #{orderCost}</if>
<if test="planPerson != null and planPerson != ''">and eo.plan_person like concat('%', #{planPerson}, '%')
</if>
<if test="planPerson != null and planPerson != ''">and eo.plan_person like concat('%', #{planPerson}, '%')</if>
<if test="orderCostTime != null and orderCostTime != ''">and eo.order_cost_time = #{orderCostTime}</if>
<if test="orderSignPerson != null and orderSignPerson != ''">and eo.order_sign_person = #{orderSignPerson}
</if>
<if test="orderSignPerson != null and orderSignPerson != ''">and eo.order_sign_person = #{orderSignPerson}</if>
<if test="factoryCode != null and factoryCode != ''">and eo.factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''">and eo.attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''">and eo.attr2 = #{attr2}</if>
@ -124,6 +146,7 @@
<if test="orderStartArrayEnd != null ">and #{orderStartArrayEnd} >= CONVERT(date,eo.order_start)</if>
<if test="orderEndArrayStart != null ">and CONVERT(date,eo.order_end) >= #{orderEndArrayStart}</if>
<if test="orderEndArrayEnd != null ">and #{orderEndArrayEnd} >= CONVERT(date,eo.order_end)</if>
<if test="planName != null and planName != ''">and ep.plan_name like concat('%', #{planName}, '%')</if>
and eo.del_flag = '0' and be.del_flag = '0' and ep.del_flag = '0'
</where>
order by eo.create_time desc
@ -195,14 +218,14 @@
eo.outsource_code,
be.equipment_name
from equ_order eo
left join base_equipment be on eo.equipment_code = be.equipment_code
left join base_equipment be on eo.equipment_code = be.equipment_code
where eo.plan_type = #{planType}
and eo.del_flag = '0'
and eo.order_status != '1'
and eo.order_code in (select order_code
and eo.del_flag = '0'
and eo.order_status != '1'
and eo.order_code in (select order_code
from equ_order_person
where del_flag = '0'
and user_name = #{userId}
and user_name = #{userId}
GROUP BY order_code)
order by eo.plan_loop_type, eo.plan_loop, eo.create_time desc, eo.equipment_code
</select>
@ -245,12 +268,12 @@
eo.outsource_code,
be.equipment_name
from equ_order eo
left join base_equipment be on eo.equipment_code = be.equipment_code
left join base_equipment be on eo.equipment_code = be.equipment_code
where eo.del_flag = '0'
and eo.order_status = '1'
and eo.plan_type = #{planType}
and eo.plan_person = #{userId}
and eo.order_code in (select order_code
and eo.order_status = '1'
and eo.plan_type = #{planType}
and eo.plan_person = #{userId}
and eo.order_code in (select order_code
from equ_order_person
where del_flag = '0' and user_name = #{userId}
GROUP BY order_code)
@ -404,18 +427,18 @@
<!-- 手持维修查询检查项-->
<select id="selectCheckListByWorkCode" parameterType="EquOrder" resultMap="EquOrderResult">
select
eo.order_id,
eo.order_code,
eo.repair_code,
eo.work_code,
eo.plan_loop,
eo.plan_loop_type,
eod.id,
eod.item_name,
eod.item_method,
eod.item_type,
eod.item_type_name,
eod.item_tools
eo.order_id,
eo.order_code,
eo.repair_code,
eo.work_code,
eo.plan_loop,
eo.plan_loop_type,
eod.id,
eod.item_name,
eod.item_method,
eod.item_type,
eod.item_type_name,
eod.item_tools
from equ_order eo
left join equ_order_detail eod on eo.order_code = eod.order_code
where eo.work_code = #{workCode}
@ -425,18 +448,18 @@
<!-- 手持报修查询检查项-->
<select id="selectCheckListByRepairCode" parameterType="EquOrder" resultMap="EquOrderResult">
select
eo.order_id,
eo.order_code,
eo.repair_code,
eo.work_code,
eo.plan_loop,
eo.plan_loop_type,
eod.id,
eod.item_name,
eod.item_method,
eod.item_type,
eod.item_type_name,
eod.item_tools
eo.order_id,
eo.order_code,
eo.repair_code,
eo.work_code,
eo.plan_loop,
eo.plan_loop_type,
eod.id,
eod.item_name,
eod.item_method,
eod.item_type,
eod.item_type_name,
eod.item_tools
from equ_order eo
left join equ_order_detail eod on eo.order_code = eod.order_code
where eo.repair_code = #{repairCode}
@ -446,7 +469,7 @@
<!-- 查询对应检查项id-->
<select id="getIdsByOrderCode" parameterType="EquOrder" resultType="java.lang.String">
select
order_id
order_id
from equ_order
where repair_code = #{orderCode}
and del_flag = '0'
@ -475,7 +498,7 @@
update base_equipment
set equipment_status = #{status}
where equipment_code = #{equipmentCode}
and del_flag = '0'
and del_flag = '0'
</update>

Loading…
Cancel
Save