保养图片上传BUG解决

highway
wws 1 year ago
parent b8e783e6a7
commit 4ea11df041

@ -203,6 +203,26 @@ public class EquOrder extends BaseEntity {
private Date orderEndArrayStart;
private Date orderEndArrayEnd;
private List<String> upkeepPictures;
private String picturePath;
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
public List<String> getUpkeepPictures() {
return upkeepPictures;
}
public void setUpkeepPictures(List<String> upkeepPictures) {
this.upkeepPictures = upkeepPictures;
}
public List<Date> getOrderStartArray() {
return orderStartArray;
}

@ -150,6 +150,13 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
order.setPersonList(personList);
// 保养图片
BaseFileData selectTemp = new BaseFileData();
selectTemp.setSourceId(equOrder.getId());
List<String> upkeepPictures = equFileMapper.selectUrlList(selectTemp);
if (upkeepPictures != null) {
order.setUpkeepPictures(upkeepPictures);
}
return success(order);
}
@ -304,6 +311,23 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
if (equOrder.getPlanType().equals("maintenance")) {
// 设置结束时间
equOrder.setOrderEnd(DateUtils.getNowDate());
//上传附件
if (StringUtils.isNotEmpty(equOrder.getPicturePath())) {
String[] ids = equOrder.getPicturePath().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileName(id.split("&fileName=")[1]);
file.setFileAddress(id);
file.setSourceId(equOrder.getOrderId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
files.add(file);
}
equFileMapper.insertEquFileBatch(files);
}
}
// 更新工单信息
@ -413,6 +437,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
order.setShutDown(pdadto.getShutDown());
// 设置开始时间
order.setOrderStart(DateUtils.getNowDate());
// 设置保养人
order.setPlanPerson(SecurityContextHolder.getUserName());
// 更新数据表
order.setUpdateBy(SecurityContextHolder.getUserName());
order.setUpdateTime(DateUtils.getNowDate());

@ -308,7 +308,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
}
if (!hasError) {
// TODO 删除报修单
// 删除报修单
if (equOrder.getRepairCode() != null) {
if (!equOrder.getRepairCode().isEmpty()) {
equRepairOrderMapper.deleteEquRepairOrderByRepairCode(equOrder.getRepairCode());
@ -324,6 +324,23 @@ public class EquOrderServiceImpl implements IEquOrderService {
long diffSeconds = (equOrder.getOrderEnd().getTime() - equOrder.getOrderStart().getTime()) / 60000;
equOrder.setOrderCostTime(String.valueOf(diffSeconds));
}
// 保养图片
if (StringUtils.isNotEmpty(equOrder.getPicturePath())) {
String[] ids = equOrder.getPicturePath().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileName(id.split("&fileName=")[1]);
file.setFileAddress(id);
file.setSourceId(equOrder.getOrderId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
files.add(file);
}
equFileMapper.insertEquFileBatch(files);
}
}
// 更新工单信息

@ -59,6 +59,14 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
order.setPlanName(equPlan.getPlanName());
}
// 保养图片
BaseFileData selectTemp = new BaseFileData();
selectTemp.setSourceId(orderId);
List<String> upkeepPictures = equFileMapper.selectUrlList(selectTemp);
if (upkeepPictures != null) {
order.setUpkeepPictures(upkeepPictures);
}
// 查询备件信息
List<EquSpareApply> spareList = equSpareApplyMapper.selectEquSpareApplyListByParentCode(order.getOrderCode());
@ -86,7 +94,6 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
}
}
// 未达标图片
BaseFileData selectTemp = new BaseFileData();
selectTemp.setSourceId(standard.getId());
selectTemp.setImageType("3");
List<String> checkPictrueList = equFileMapper.selectUrlList(selectTemp);

@ -69,7 +69,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectUrlList" resultType="java.lang.String">
select file_address from base_file where image_type = #{imageType} and source_id = #{sourceId}
select file_address from base_file
<where>
<if test="imageType != null and imageType != ''"> and image_type = #{imageType}</if>
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
</where>
</select>
<insert id="insertEquFile" parameterType="EquFile">

Loading…
Cancel
Save