点检、巡检、保养图片上传和显示

highway
wws 12 months ago
parent fe57d99362
commit 3abec72895

@ -100,6 +100,16 @@ public class EquOrderStandard extends BaseEntity {
private String repairPicture;
private List<String> checkPictrueList;
public List<String> getCheckPictrueList() {
return checkPictrueList;
}
public void setCheckPictrueList(List<String> checkPictrueList) {
this.checkPictrueList = checkPictrueList;
}
public List<BaseFileData> getPicturePaths() {
return picturePaths;
}

@ -74,4 +74,11 @@ public interface EquFileMapper {
//删除照图片
public void deleteEquFileBySourceId(String orderId);
/**
*
* @param selectTemp
* @return
*/
List<String> selectUrlList(BaseFileData selectTemp);
}

@ -104,5 +104,6 @@ public interface EquRepairOrderMapper {
public List<BaseFileData> getBaseFileBatch(String orderId);
//联系方式
@DS("master")
EquTeamUser getRepairPhoneNumber(EquTeamUser equTeamUser);
}

@ -119,6 +119,16 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode());
for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getId());
for (EquOrderStandard standard : standardList) {
// 未达标图片
BaseFileData selectTemp = new BaseFileData();
selectTemp.setSourceId(standard.getId());
selectTemp.setImageType("3");
List<String> checkPictrueList = equFileMapper.selectUrlList(selectTemp);
if (checkPictrueList != null) {
standard.setCheckPictrueList(checkPictrueList);
}
}
detail.setStandardList(standardList);
}
order.setDetailList(detailList);
@ -170,8 +180,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
boolean hasError = false;
EquOrderEqu equ = equOrder.getEqu();
List<EquOrderDetail> detailList = equ.getDetailList();
List<EquOrderDetail> detailList = equOrder.getDetailList();
for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = detail.getStandardList();
for (EquOrderStandard standard : standardList) {
@ -200,18 +209,15 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
int up = standard.getActualValue().compareTo(standard.getDetailUpLimit());
int down = standard.getActualValue().compareTo(standard.getDetailDownLimit());
standard.setDetailReach("1");
standard.setErrorFlag("0");
if (!(up != 1 && down != -1)) {
hasError = true;
standard.setErrorFlag("1");
standard.setDetailReach("0");
}
}else {
// TODO 未达标
// 未达标
standard.setErrorFlag("0");
if (standard.getDetailReach().equals("0")) {
hasError = true;
standard.setErrorFlag("1");
}
}
@ -247,7 +253,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
// 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equOrder.getEqu().getEquipmentCode();
String equipmentCode = equOrder.getEquipmentCode();
//报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息
@ -285,7 +291,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
if (!hasError) {
// TODO 删除报修单
// 删除报修单
if (equOrder.getRepairCode() != null) {
if (!equOrder.getRepairCode().isEmpty()) {
equRepairOrderMapper.deleteEquRepairOrderByRepairCode(equOrder.getRepairCode());
@ -398,6 +404,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult startMaintenanceTask(PDADTO pdadto) {
EquOrder order = equOrderMapper.selectEquOrderByOrderCode(pdadto.getOrderCode());
// 改为进行中

@ -106,6 +106,7 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setUpdateTime(DateUtils.getNowDate());
equOrder.setPlanType("maintenance");
equOrder.setUpkeep("0");
equOrder.setEquipmentCode(equPlan.getEquipmentItem().get(0).getEquipmentCode());
// 工单插入数据库
equOrderMapper.insertEquOrder(equOrder);
@ -137,7 +138,7 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
// 插入备件信息
equSpareApplyMapper.insertEquSpareApply(apply);
// TODO 减少备件仓库中备件数量
// 减少备件仓库中备件数量
sparePartsLedgerMapper.updateSpareNumReduce(apply);
}
}

@ -1,6 +1,7 @@
package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.*;
import com.op.device.domain.vo.InspectionWorkVO;
@ -37,6 +38,8 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
private EquOrderEquSpareMapper equOrderEquSpareMapper;
@Autowired
private EquSpareApplyMapper equSpareApplyMapper;
@Autowired
private EquFileMapper equFileMapper;
/**
*
@ -82,6 +85,15 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
standard.setDetailReach("达标");
}
}
// 未达标图片
BaseFileData selectTemp = new BaseFileData();
selectTemp.setSourceId(standard.getId());
selectTemp.setImageType("3");
List<String> checkPictrueList = equFileMapper.selectUrlList(selectTemp);
if (checkPictrueList != null) {
standard.setCheckPictrueList(checkPictrueList);
}
}
detail.setStandardList(standardList);
}

@ -68,7 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and image_type = #{imageType}
</select>
<insert id="insertEquFile" parameterType="EquFile">
<select id="selectUrlList" resultType="java.lang.String">
select file_address from base_file where image_type = #{imageType} and source_id = #{sourceId}
</select>
<insert id="insertEquFile" parameterType="EquFile">
insert into base_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileId != null">file_id,</if>
@ -105,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<insert id="insertEquFileBatch">
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time)
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time,image_type)
VALUES
<foreach collection="baseFiles" index="" item="baseFile" separator=",">
(
@ -115,7 +119,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{baseFile.sourceId},
#{baseFile.remark},
#{baseFile.createBy},
#{baseFile.createTime}
#{baseFile.createTime},
#{baseFile.imageType}
)
</foreach>
</insert>

@ -136,7 +136,7 @@
<select id="selectTodayTask" parameterType="String" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/>
where CONVERT(date,GETDATE()) > plan_loop_start and plan_type = #{planType} and del_flag = '0' and order_status != '1' and order_code in (
where CONVERT(date,GETDATE()) >= plan_loop_start and plan_type = #{planType} and del_flag = '0' and order_status != '1' and order_code in (
select order_code from equ_order_person where del_flag = '0' and user_id = #{userId} GROUP BY order_code
)
</select>

Loading…
Cancel
Save