highway
A0010407 1 year ago
parent 688fe5c39e
commit 5c2b404e76

@ -78,7 +78,18 @@ public class DevicePDAController {
//维修
/**
*
*
*
* @param equRepairWorkOrder
* @return
*/
@GetMapping("/getMaintenancePendRecords")
public AjaxResult getMaintenancePendRecords(EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.getMaintenancePendRecords(equRepairWorkOrder);
}
/**
*
*
* @param equRepairWorkOrder
* @return
@ -125,5 +136,4 @@ public class DevicePDAController {
public AjaxResult updateMaintenanceRecords(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.updateMaintenanceRecords(equRepairWorkOrder);
}
}

@ -84,7 +84,7 @@ public class EquRepairOrderController extends BaseController {
@Log(title = "故障报修", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody EquRepairOrder equRepairOrder) {
return toAjax(equRepairOrderService.updateEquRepairOrder(equRepairOrder));
return equRepairOrderService.updateEquRepairOrder(equRepairOrder);
}
/**

@ -74,7 +74,7 @@ public class EquSpareApplyController extends BaseController {
@Log(title = "申领记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquSpareApply equSpareApply) {
return toAjax(equSpareApplyService.insertEquSpareApply(equSpareApply));
return equSpareApplyService.insertEquSpareApply(equSpareApply);
}
/**

@ -150,6 +150,28 @@ public class EquOrder extends BaseEntity {
private int days;
private String equipmentName;
//检查项列表
private List<EquOrderStandard> standardList;
/** 检查项名称 */
private String itemName;
/** 检查项方法/工具 */
private String itemMethod;
/** 维护类型编码 */
private String itemType;
/** 维护类型名称 */
private String itemTypeName;
//标准列表
public List<EquOrderStandard> getStandardList() {
return standardList;
}
public void setStandardList(List<EquOrderStandard> standardList) {
this.standardList = standardList;
}
private String planRestrict;
private String outsourceCode;

@ -1,6 +1,9 @@
package com.op.device.domain;
import java.math.BigDecimal;
import java.util.List;
import com.op.common.core.domain.BaseFileData;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
@ -83,6 +86,7 @@ public class EquOrderStandard extends BaseEntity {
// 图片路径
private String picturePath;
private List<BaseFileData> picturePaths;
private String standardTypeName;
@ -96,8 +100,12 @@ public class EquOrderStandard extends BaseEntity {
private String repairPicture;
//检查项检查方法
private String itemMethod;
public List<BaseFileData> getPicturePaths() {
return picturePaths;
}
public void setPicturePaths(List<BaseFileData> picturePaths) {
this.picturePaths = picturePaths;
}
public String getRepairPicture() {
return repairPicture;
@ -275,14 +283,6 @@ public class EquOrderStandard extends BaseEntity {
return delFlag;
}
//检查项检查方法
public void setItemMethod(String itemMethod) {
this.itemMethod = itemMethod;
}
public String getItemMethod() {
return itemMethod;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.domain.BaseFileData;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
@ -51,9 +52,13 @@ public class EquRepairOrder extends BaseEntity {
@Excel(name = "是否立即处理")
private String orderHandle;
/** 报修人 */
@Excel(name = "报修人")
private String orderRepairman;
/** 报修人编号 */
@Excel(name = "报修人编号")
private String orderRepairmanCode;
/** 报修人名字 */
@Excel(name = "报修人名字")
private String orderRepairmanName;
/** 联系方式 */
@Excel(name = "联系方式")
@ -168,7 +173,10 @@ public class EquRepairOrder extends BaseEntity {
//图片文件
private String fileList;
private List<EquFile> files;
private List<BaseFileData> files;
//检查项列表
private List<EquOrder> checkList;
//图片文件
public String getFileList() {
@ -177,10 +185,10 @@ public class EquRepairOrder extends BaseEntity {
public void setFileList(String fileList) {
this.fileList = fileList;
}
public List<EquFile> getFiles() {
public List<BaseFileData> getFiles() {
return files;
}
public void setFiles(List<EquFile> files) {
public void setFiles(List<BaseFileData> files) {
this.files = files;
}
@ -355,12 +363,20 @@ public class EquRepairOrder extends BaseEntity {
public String getOrderHandle() {
return orderHandle;
}
public void setOrderRepairman(String orderRepairman) {
this.orderRepairman = orderRepairman;
public void setOrderRepairmanCode(String orderRepairmanCode) {
this.orderRepairmanCode = orderRepairmanCode;
}
public String getOrderRepairman() {
return orderRepairman;
public String getOrderRepairmanCode() {
return orderRepairmanCode;
}
public void setOrderRepairmanName(String orderRepairmanName) {
this.orderRepairmanName = orderRepairmanName;
}
public String getOrderRepairmanName() {
return orderRepairmanName;
}
public void setOrderConnection(String orderConnection) {
this.orderConnection = orderConnection;
@ -440,6 +456,13 @@ public class EquRepairOrder extends BaseEntity {
return factoryCode;
}
public List<EquOrder> getCheckList() {
return checkList;
}
public void setCheckList(List<EquOrder> checkList) {
this.checkList = checkList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -451,7 +474,7 @@ public class EquRepairOrder extends BaseEntity {
.append("orderSource", getOrderSource())
.append("orderTime", getOrderTime())
.append("orderHandle", getOrderHandle())
.append("orderRepairman", getOrderRepairman())
.append("orderRepairmanCode", getOrderRepairmanCode())
.append("orderConnection", getOrderConnection())
.append("orderStatus", getOrderStatus())
.append("orderRelevance", getOrderRelevance())

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.domain.BaseFileData;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
@ -80,9 +81,8 @@ public class EquRepairWorkOrder extends BaseEntity {
private String workFaultDesc;
/** 维修用时 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修用时", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workCostTime;
@Excel(name = "维修用时")
private String workCostTime;
/** 维修费用 */
@Excel(name = "维修费用")
@ -129,6 +129,12 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private String workEndTime;
//维修停机真正开始时间
private String actualDownStartTime;
//维修停机真正结束时间
private String actualDownEndTime;
// 设备
/** 设备名称 */
@Excel(name = "设备名称")
@ -150,6 +156,14 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "部门")
private String department;
/** 所属工作中心编码 */
@Excel(name = "所属工作中心编码")
private String workshopCode;
/** 所属工作中心名称 */
@Excel(name = "所属工作中心名称")
private String workshopName;
//报修
/** 故障描述 */
@Excel(name = "故障描述")
@ -170,20 +184,16 @@ public class EquRepairWorkOrder extends BaseEntity {
private Date orderTime;
/** 报修人 */
@Excel(name = "报修人")
private String orderRepairman;
private String orderRepairmanCode;
/** 联系方式 */
@Excel(name = "联系方式")
private String orderConnection;
//班组
/** 班组名称 */
@Excel(name = "班组名称")
private String teamName;
/** 班组人员 */
@Excel(name = "班组人员")
private String teamPerson;
//时间列表 虚拟字段
@ -209,11 +219,58 @@ public class EquRepairWorkOrder extends BaseEntity {
//手持
//用户id
private String userId;
//检查项列表
private List<EquOrderStandard> checkList;
private List<EquOrder> detailList;
//维修前照片
private String beforeRepairFile;
private List<BaseFileData> beforeRepairFiles;
//维修后照片
private String afterRepairFile;
private List<BaseFileData> afterRepairFiles;
//申领单列表
private List<EquSpareApply> applyList;
//维修前 维修后
public String getAfterRepairFile() {
return afterRepairFile;
}
public void setAfterRepairFile(String afterRepairFile) {
this.afterRepairFile = afterRepairFile;
}
public List<BaseFileData> getAfterRepairFiles() {
return afterRepairFiles;
}
public void setAfterRepairFiles(List<BaseFileData> afterRepairFiles) {
this.afterRepairFiles = afterRepairFiles;
}
public String getBeforeRepairFile() {
return beforeRepairFile;
}
public void setBeforeRepairFile(String beforeRepairFile) {
this.beforeRepairFile = beforeRepairFile;
}
public List<BaseFileData> getBeforeRepairFiles() {
return beforeRepairFiles;
}
public void setBeforeRepairFiles(List<BaseFileData> beforeRepairFiles) {
this.beforeRepairFiles = beforeRepairFiles;
}
//detailList 检查项详情
public List<EquOrder> getDetailList() {
return detailList;
}
public void setDetailList(List<EquOrder> detailList) {
this.detailList = detailList;
}
//报修
public void setOrderDesc(String orderDesc) {
this.orderDesc = orderDesc;
@ -243,12 +300,13 @@ public class EquRepairWorkOrder extends BaseEntity {
return orderTime;
}
public void setOrderRepairman(String orderRepairman) {
this.orderRepairman = orderRepairman;
public void setOrderRepairmanCode(String orderRepairmanCode) {
this.orderRepairmanCode = orderRepairmanCode;
}
public String getOrderRepairman() {
return orderRepairman;
public String getOrderRepairmanCode() {
return orderRepairmanCode;
}
public void setOrderConnection(String orderConnection) {
this.orderConnection = orderConnection;
}
@ -292,6 +350,20 @@ public class EquRepairWorkOrder extends BaseEntity {
return department;
}
public void setWorkshopCode(String workshopCode) {
this.workshopCode = workshopCode;
}
public String getWorkshopCode() {
return workshopCode;
}
public void setWorkshopName(String workshopName) {
this.workshopName = workshopName;
}
public String getWorkshopName() {
return workshopName;
}
public void setWorkId(String workId) {
this.workId = workId;
}
@ -299,6 +371,7 @@ public class EquRepairWorkOrder extends BaseEntity {
return workId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
@ -397,10 +470,10 @@ public class EquRepairWorkOrder extends BaseEntity {
return workFaultDesc;
}
public void setWorkCostTime(Date workCostTime) {
public void setWorkCostTime(String workCostTime) {
this.workCostTime = workCostTime;
}
public Date getWorkCostTime() {
public String getWorkCostTime() {
return workCostTime;
}
@ -528,17 +601,17 @@ public class EquRepairWorkOrder extends BaseEntity {
}
//计划停机开始时间、结束时间
public String getWorkPlanTimeStart() {
return workPlanTimeStart;
public String getActualDownStartTime() {
return actualDownStartTime;
}
public void setWorkPlanTimeStart(String workPlanTimeStart) {
this.workPlanTimeStart = workPlanTimeStart;
public void setActualDownStartTime(String actualDownStartTime) {
this.actualDownStartTime = actualDownStartTime;
}
public String getWorkPlanTimeEnd() {
return workPlanTimeEnd;
public String getActualDownEndTime() {
return actualDownEndTime;
}
public void setWorkPlanTimeEnd(String workPlanTimeEnd) {
this.workPlanTimeEnd = workPlanTimeEnd;
public void setActualDownEndTime(String actualDownEndTime) {
this.actualDownEndTime = actualDownEndTime;
}
//委外维修人员/委外维修原因 虚拟字段
@ -578,13 +651,6 @@ public class EquRepairWorkOrder extends BaseEntity {
return userId;
}
public List<EquOrderStandard> getCheckList() {
return checkList;
}
public void setCheckList(List<EquOrderStandard> checkList) {
this.checkList = checkList;
}
public List<EquSpareApply> getApplyList() {
return applyList;
}
@ -592,6 +658,38 @@ public class EquRepairWorkOrder extends BaseEntity {
this.applyList = applyList;
}
//实际停机开始时间、结束时间
public String getWorkPlanTimeStart() {
return workPlanTimeStart;
}
public void setWorkPlanTimeStart(String workPlanTimeStart) {
this.workPlanTimeStart = workPlanTimeStart;
}
public String getWorkPlanTimeEnd() {
return workPlanTimeEnd;
}
public void setWorkPlanTimeEnd(String workPlanTimeEnd) {
this.workPlanTimeEnd = workPlanTimeEnd;
}
//图片文件
private String fileList;
private List<BaseFileData> files;
//图片文件
public String getFileList() {
return fileList;
}
public void setFileList(String fileList) {
this.fileList = fileList;
}
public List<BaseFileData> getFiles() {
return files;
}
public void setFiles(List<BaseFileData> files) {
this.files = files;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -1,5 +1,6 @@
package com.op.device.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@ -98,6 +99,13 @@ public class EquSpareApply extends BaseEntity {
/** 领用类型 */
private String applyType ;
//批量新增申领记录
private List<EquSpareApply> spareApplyLists;
/** 库存表 id */
private String storageId;
/** 总数量 */
private BigDecimal amount;
public List<Date> getApplyTimeArray() {
return applyTimeArray;
}
@ -261,6 +269,31 @@ public class EquSpareApply extends BaseEntity {
this.applyType=applyType;
}
//批量新增申领记录
public List<EquSpareApply> getSpareApplyLists(){
return this.spareApplyLists;
}
/** 领用类型 */
public void setSpareApplyLists(List<EquSpareApply> spareApplyLists){
this.spareApplyLists = spareApplyLists;
}
//id
public void setStorageId(String storageId) {
this.storageId = storageId;
}
public String getStorageId() {
return storageId;
}
//总数量
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getAmount() {
return amount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquOrderStandard;
import com.op.device.domain.EquPlan;
import com.op.device.domain.dto.PDADTO;
import org.apache.ibatis.annotations.Mapper;
@ -120,6 +121,13 @@ public interface EquOrderMapper {
*/
List<EquOrder> selectTodayTask(PDADTO pdadto);
/**
* PC
* @param
* @return
*/
List<EquOrder> selectEquOrderDetailsList(EquOrder equOrder);
/**
*
* @param equipmentCode

@ -71,10 +71,23 @@ public interface EquOrderStandardMapper {
List<EquOrderStandard> selectEquOrderStandardByParentCode(String code);
/**
*
* @param equOrder
* @return
*
* @param files
*/
void insertBaseFileBatch(List<BaseFileData> files);
/**
*
*/
void deleteBaseFileBySourceId(String id);
/**
*
*/
public List<BaseFileData> getBaseFileBatch(String id);
//PC查询点检巡检报修
List<EquOrderStandard> selectPdaEquOrderList(EquOrderStandard equOrderStandard);
public List<EquOrderStandard> selectPdaEquOrderList(EquOrder equOrder);
int insertEquOrderStandards(@Param("list") List<EquPlanStandard> standards);

@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.BaseFileData;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquFile;
import com.op.device.domain.EquRepairOrder;
import org.apache.ibatis.annotations.Param;
@ -85,4 +86,20 @@ public interface EquRepairOrderMapper {
* @param repairCode
*/
void deleteEquRepairOrderByRepairCode(String repairCode);
/**
*
*/
Boolean insertBaseFileBatch(@Param("baseFiles") List<BaseFileData> baseFiles);
/**
*
*/
void deleteBaseFileBySourceId(String OrderId);
/**
*
*/
public List<BaseFileData> getBaseFileBatch(String orderId);
}

@ -3,8 +3,10 @@ package com.op.device.mapper;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.BaseFileData;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.EquTeamUser;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -22,13 +24,20 @@ public interface EquRepairWorkOrderMapper {
public EquRepairWorkOrder selectEquRepairWorkOrderByWorkId(String workId);
/**
*
*
*
* @param equRepairWorkOrder
* @return
*/
public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param equRepairWorkOrder
* @return
*/
public List<EquRepairWorkOrder> selectRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
@ -70,4 +79,19 @@ public interface EquRepairWorkOrderMapper {
//获取维修人员列表
@DS("master")
public List<EquTeamUser> getMaintenancePersonList(EquTeamUser equTeamUser);
/**
*
*/
public List<BaseFileData> getBaseFileBatch(String workId);
/**
*
*/
void deleteBaseFileBySourceId(String workId);
/**
*
*/
Boolean insertBaseFileBatch(@Param("baseFiles") List<BaseFileData> baseFiles);
}

@ -90,4 +90,7 @@ public interface IDevicePDAService {
* @return
*/
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder);
//待处理
AjaxResult getMaintenancePendRecords(EquRepairWorkOrder equRepairWorkOrder);
}

@ -2,6 +2,7 @@ package com.op.device.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquRepairOrder;
@ -44,7 +45,7 @@ public interface IEquRepairOrderService {
* @param equRepairOrder
* @return
*/
public int updateEquRepairOrder(EquRepairOrder equRepairOrder);
public AjaxResult updateEquRepairOrder(EquRepairOrder equRepairOrder);
/**
*

@ -2,6 +2,7 @@ package com.op.device.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.EquSpareApply;
@ -34,7 +35,7 @@ public interface IEquSpareApplyService {
* @param equSpareApply
* @return
*/
public int insertEquSpareApply(EquSpareApply equSpareApply);
public AjaxResult insertEquSpareApply(EquSpareApply equSpareApply);
/**
*

@ -304,7 +304,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@DS("#header.poolName")
public AjaxResult addRepairRecord(EquRepairOrder equRepairOrder) {
try {
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
String id = IdUtils.fastSimpleUUID();
equRepairOrder.setOrderId(id);
// 获取故障报修流水号
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
@ -312,10 +313,33 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderRepairmanCode(SecurityUtils.getUsername());
equRepairOrder.setOrderTime(DateUtils.getNowDate());
equRepairOrder.setOrderStatus("待审核");
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// String key = "#header.poolName";
// equRepairOrder.setFactory(request.getHeader(key.substring(8)).replace("ds_",""));
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
//新增文件
if (StringUtils.isNotEmpty(equRepairOrder.getFileList())) {
String[] ids1 = equRepairOrder.getFileList().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id1 : ids1) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileName(id1.split("&fileName=")[1]);
file.setFileAddress(id1);
file.setSourceId(id);
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
file.setImageType("3");
files.add(file);
}
equRepairOrderMapper.insertBaseFileBatch(files);
}
return success("新增报修记录成功!");
} catch (Exception e) {
return error();
@ -323,14 +347,14 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
/**
*
* ()
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
public AjaxResult getMaintenancePendRecords(EquRepairWorkOrder equRepairWorkOrder) {
try {
if (equRepairWorkOrder.getWorkPlanTimeArray() != null) {
// 设置创建日期开始和结束值
@ -356,6 +380,39 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
try {
if (equRepairWorkOrder.getWorkPlanTimeArray() != null) {
// 设置创建日期开始和结束值
if (equRepairWorkOrder.getWorkPlanTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairWorkOrder.setWorkPlanTimeStart(formatter.format(equRepairWorkOrder.getWorkPlanTimeArray().get(0)));
equRepairWorkOrder.setWorkPlanTimeEnd(formatter.format(equRepairWorkOrder.getWorkPlanTimeArray().get(1)));
}
}
if (equRepairWorkOrder.getWorkPlanDownTimeArray() != null) {
// 设置更新日期开始和结束
if (equRepairWorkOrder.getWorkPlanDownTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairWorkOrder.setWorkPlanDownTimeStart(formatter.format(equRepairWorkOrder.getWorkPlanDownTimeArray().get(0)));
equRepairWorkOrder.setWorkPlanDownTimeEnd(formatter.format(equRepairWorkOrder.getWorkPlanDownTimeArray().get(1)));
}
}
List<EquRepairWorkOrder> list = equRepairWorkOrderMapper.selectRepairWorkOrderList(equRepairWorkOrder);
return success(list);
} catch (Exception e) {
return error();
}
}
/**
*
*
@ -383,11 +440,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@DS("#header.poolName")
public AjaxResult updateDowntime(EquRepairWorkOrder equRepairWorkOrder) {
try {
if(equRepairWorkOrder.getWorkDownMachine().equals("0")){
equRepairWorkOrder.setWorkPlanDownTime(null);
}
//不停机 那么实际停机开始时间和实际停机结束时间都没有
//如果停机 那么实际停机时间就是传入的时间 停机时间必须选择校验
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
//维修中
equRepairWorkOrder.setWorkStatus("2");
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
return success("提交成功,开始维修!");
} catch (Exception e) {
@ -396,7 +454,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
/**
*
*
*
* @param equipmentId
* @return
@ -426,13 +484,35 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//查询对应检查项信息
EquOrder equOrder = new EquOrder();
equOrder.setWorkCode(list.getWorkCode());
List<EquOrderStandard> checkLists = equOrderStandardMapper.selectPdaEquOrderList(equOrder);
list.setCheckList(checkLists);
//检查项
List<EquOrder> checkLists = equOrderMapper.selectEquOrderDetailsList(equOrder);
//每个检查项对应的检测标准
for(EquOrder equOrder1 :checkLists){
EquOrderStandard equOrderStandard = new EquOrderStandard();
equOrderStandard.setOrderCode(equOrder1.getOrderCode());
List<EquOrderStandard> standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard);
for(EquOrderStandard standardList :standardLists){
//每个检查标准里面的照片
List<BaseFileData> files = equOrderStandardMapper.getBaseFileBatch(standardList.getId());
if (!CollectionUtils.isEmpty(files)) {
standardList.setPicturePaths(files);
}
}
equOrder1.setStandardList(standardLists);
}
list.setDetailList(checkLists);
//备件申领单
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
equRepairWorkOrder.setWorkCode(list.getWorkCode());
List<EquSpareApply> applyLists = equSpareApplyMapper.selectRepairSparePartsRecord(equRepairWorkOrder);
list.setApplyList(applyLists);
//文件
List<BaseFileData> files = equRepairWorkOrderMapper.getBaseFileBatch(workId);
if (!CollectionUtils.isEmpty(files)) {
list.setFiles(files);
}
return success(list);
} catch (Exception e) {
return error();
@ -450,11 +530,36 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
try {
//更新每一项点检/巡检检查项信息
List<EquOrderStandard> equOrderStandards = equRepairWorkOrder.getCheckList();
for(EquOrderStandard equOrderStandard:equOrderStandards){
equOrderStandard.setUpdateBy(SecurityUtils.getUsername());
equOrderStandard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateEquOrderStandard(equOrderStandard);
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
for(EquOrder checkList:checkLists){
checkList.setUpdateBy(SecurityUtils.getUsername());
checkList.setUpdateTime(DateUtils.getNowDate());
List<EquOrderStandard> standardLists = checkList.getStandardList();
for(EquOrderStandard standardList :standardLists){
//先删除每个检查项标准图片
equOrderStandardMapper.deleteBaseFileBySourceId(standardList.getId());
//图片
if (StringUtils.isNotEmpty(standardList.getPicturePath())) {
String[] ids = standardList.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(standardList.getId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
//维修后
file.setImageType("4");
files.add(file);
}
equOrderStandardMapper.insertBaseFileBatch(files);
}
equOrderStandardMapper.updateEquOrderStandard(standardList);
}
equOrderMapper.updateEquOrder(checkList);
}
//新建申领单 缺少code
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
@ -466,6 +571,27 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
}
//维修人员名字????前端能够提供吗???
//图片
//先删除每个维修工单对应图片
equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId());
if (StringUtils.isNotEmpty(equRepairWorkOrder.getFileList())) {
String[] ids = equRepairWorkOrder.getFileList().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(equRepairWorkOrder.getWorkId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
//维修后
file.setImageType("4");
files.add(file);
}
equRepairWorkOrderMapper.insertBaseFileBatch(files);
}
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);

@ -29,8 +29,6 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@Autowired
private EquOutsourceWorkMapper equOutsourceWorkMapper;
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
/**
*

@ -9,18 +9,23 @@ import com.op.common.core.domain.BaseFileData;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.*;
import com.op.device.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.service.IEquRepairOrderService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import static com.op.common.core.web.domain.AjaxResult.error;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* Service
*
@ -42,7 +47,10 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
private EquOutsourceWorkMapper equOutsourceWorkMapper;
@Autowired
private EquFileMapper equFileMapper;
private EquOrderStandardMapper equOrderStandardMapper;
@Autowired
private EquOrderMapper equOrderMapper;
/**
*
*
@ -53,10 +61,45 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@DS("#header.poolName")
public EquRepairOrder selectEquRepairOrderByOrderId(String orderId) {
EquRepairOrder list = equRepairOrderMapper.selectEquRepairOrderByOrderId(orderId);
List<EquFile> files = equFileMapper.getEquFileBatch(orderId);
List<BaseFileData> files = equRepairOrderMapper.getBaseFileBatch(orderId);
if (!CollectionUtils.isEmpty(files)) {
list.setFiles(files);
}
// //查询对应检查项信息
// EquOrder equOrder = new EquOrder();
// equOrder.setOrderCode(list.getOrderCode());
// List<EquOrderStandard> checkLists = equOrderStandardMapper.selectPdaEquOrderList(equOrder);
// //每个检查项对应文件
// for(EquOrderStandard equOrderStandard :checkLists){
// List<BaseFileData> file = equOrderStandardMapper.getBaseFileBatch(equOrderStandard.getId());
// if (!CollectionUtils.isEmpty(file)) {
// equOrderStandard.setPicturePaths(file);
// }
// }
// list.setCheckList(checkLists);
//查询对应检查项信息
EquOrder equOrder = new EquOrder();
//报修单号
equOrder.setRepairCode(list.getOrderCode());
//检查项
List<EquOrder> checkLists = equOrderMapper.selectEquOrderDetailsList(equOrder);
//每个检查项对应的检测标准
for(EquOrder equOrder1 :checkLists){
EquOrderStandard equOrderStandard = new EquOrderStandard();
equOrderStandard.setOrderCode(equOrder1.getOrderCode());
List<EquOrderStandard> standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard);
for(EquOrderStandard standardList :standardLists){
//每个检查标准里面的照片
List<BaseFileData> file = equOrderStandardMapper.getBaseFileBatch(standardList.getId());
if (!CollectionUtils.isEmpty(file)) {
standardList.setPicturePaths(file);
}
}
equOrder1.setStandardList(standardLists);
}
list.setCheckList(checkLists);
return list;
}
@ -109,9 +152,8 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
file.setCreateTime(new Date());
files.add(file);
}
equFileMapper.insertEquFileBatch(files);
equRepairOrderMapper.insertBaseFileBatch(files);
}
return equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
}
@ -201,30 +243,36 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
* @param equRepairOrder
* @return
*/
@Transactional//增加事务注解,出错时自动回滚
@Override
@DS("#header.poolName")
public int updateEquRepairOrder(EquRepairOrder equRepairOrder) {
equFileMapper.deleteEquFileBySourceId(equRepairOrder.getOrderId());
//上传附件
if (StringUtils.isNotEmpty(equRepairOrder.getFileList())) {
String[] ids = equRepairOrder.getFileList().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileAddress(id);
file.setFileName(id.split("&fileName=")[1]);
file.setSourceId(equRepairOrder.getOrderId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
files.add(file);
public AjaxResult updateEquRepairOrder(EquRepairOrder equRepairOrder) {
try{
equRepairOrderMapper.deleteBaseFileBySourceId(equRepairOrder.getOrderId());
//上传附件
if (StringUtils.isNotEmpty(equRepairOrder.getFileList())) {
String[] ids = equRepairOrder.getFileList().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileAddress(id);
file.setFileName(id.split("&fileName=")[1]);
file.setSourceId(equRepairOrder.getOrderId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
files.add(file);
}
equRepairOrderMapper.insertBaseFileBatch(files);
}
equFileMapper.insertEquFileBatch(files);
}
equRepairOrder.setUpdateTime(DateUtils.getNowDate());
equRepairOrder.setUpdateBy(SecurityUtils.getUsername());
return equRepairOrderMapper.updateEquRepairOrder(equRepairOrder);
equRepairOrder.setUpdateTime(DateUtils.getNowDate());
equRepairOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairOrderMapper.updateEquRepairOrder(equRepairOrder);
return success("修改故障报修成功!");
}catch (Exception e) {
return error();
}
}
/**

@ -4,22 +4,22 @@ import java.text.SimpleDateFormat;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.domain.EquTeamUser;
import com.op.device.mapper.EquOutsourceWorkMapper;
import com.op.device.domain.*;
import com.op.device.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairWorkOrderMapper;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.service.IEquRepairWorkOrderService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* Service
*
@ -28,6 +28,12 @@ import javax.servlet.http.HttpServletRequest;
*/
@Service
public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService {
@Autowired
private EquOrderMapper equOrderMapper;
@Autowired
private EquOrderStandardMapper equOrderStandardMapper;
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
@ -43,7 +49,40 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Override
@DS("#header.poolName")
public EquRepairWorkOrder selectEquRepairWorkOrderByWorkId(String workId) {
return equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId);
//查询报修前图片
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId);
List<BaseFileData> beforeFiles = equRepairWorkOrderMapper.getBaseFileBatch(list.getOrderId());
if (!CollectionUtils.isEmpty(beforeFiles)) {
list.setBeforeRepairFiles(beforeFiles);
}
//查询维修后图片
List<BaseFileData> afterFiles = equRepairWorkOrderMapper.getBaseFileBatch(workId);
if (!CollectionUtils.isEmpty(afterFiles)) {
list.setAfterRepairFiles(afterFiles);
}
//查询报修前检查项图片
EquOrder equOrder = new EquOrder();
equOrder.setWorkCode(list.getWorkCode());
//检查项
List<EquOrder> checkLists = equOrderMapper.selectEquOrderDetailsList(equOrder);
//每个检查项对应的检测标准
for(EquOrder equOrder1 :checkLists){
EquOrderStandard equOrderStandard = new EquOrderStandard();
equOrderStandard.setOrderCode(equOrder1.getOrderCode());
List<EquOrderStandard> standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard);
for(EquOrderStandard standardList :standardLists){
//每个检查标准里面的照片
List<BaseFileData> files = equOrderStandardMapper.getBaseFileBatch(standardList.getId());
if (!CollectionUtils.isEmpty(files)) {
standardList.setPicturePaths(files);
}
}
equOrder1.setStandardList(standardLists);
}
list.setDetailList(checkLists);
return list;
}
/**

@ -1,13 +1,17 @@
package com.op.device.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.SparePartsLedger;
import com.op.device.mapper.SparePartsLedgerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquSpareApplyMapper;
@ -18,6 +22,8 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import static com.op.common.core.web.domain.AjaxResult.error;
/**
* Service
*
@ -28,6 +34,8 @@ import javax.servlet.http.HttpServletRequest;
public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
@Autowired
private EquSpareApplyMapper equSpareApplyMapper;
@Autowired
private SparePartsLedgerMapper sparePartsLedgerMapper;
/**
*
@ -69,15 +77,46 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
*/
@Override
@DS("#header.poolName")
public int insertEquSpareApply(EquSpareApply equSpareApply) {
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equSpareApply.setCreateTime(DateUtils.getNowDate());
equSpareApply.setCreateBy(SecurityUtils.getUsername());
return equSpareApplyMapper.insertEquSpareApply(equSpareApply);
public AjaxResult insertEquSpareApply(EquSpareApply equSpareApply) {
try {
//equSpareApply.getSpareApplyLists().size() 是在申领备件的时候进行的操作
if(equSpareApply.getSpareApplyLists().size() >= 1){
List<EquSpareApply> list = equSpareApply.getSpareApplyLists();
for(EquSpareApply applyList:list){
applyList.setApplyId(IdUtils.fastSimpleUUID());
//领用时间
applyList.setApplyTime(DateUtils.getNowDate());
//申领人
applyList.setApplyPeople(SecurityUtils.getUsername());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
applyList.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
applyList.setCreateTime(DateUtils.getNowDate());
applyList.setCreateBy(SecurityUtils.getUsername());
equSpareApplyMapper.insertEquSpareApply(applyList);
//更新完备品申领单后,更新库存
SparePartsLedger sparePartsLedger = new SparePartsLedger();
sparePartsLedger.setStorageId(applyList.getStorageId());
BigDecimal applyNum = new BigDecimal(applyList.getSpareQuantity());
BigDecimal amount = applyList.getAmount();
sparePartsLedger.setAmount(amount.subtract(applyNum));
sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger);
}
}else{
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equSpareApply.setCreateTime(DateUtils.getNowDate());
equSpareApply.setCreateBy(SecurityUtils.getUsername());
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
}
return AjaxResult.success("新增申领记录成功!");
} catch (Exception e) {
return error();
}
}
/**

@ -39,6 +39,12 @@
<result property="orderInspect" column="order_inspect" />
<result property="repairCode" column="repair_code" />
<result property="workCode" column="work_code" />
<result property="itemName" column="item_name" />
<result property="itemMethod" column="item_method" />
<result property="itemType" column="item_type" />
<result property="itemTypeName" column="item_type_name" />
<result property="outsourceCode" column="outsource_code" />
</resultMap>
@ -277,4 +283,25 @@
#{orderId}
</foreach>
</delete>
<!-- 手持维修查询检查项-->
<select id="selectEquOrderDetailsList" parameterType="EquOrder" resultMap="EquOrderResult">
select
eo.order_id,
eo.order_code,
eo.repair_code,
eo.work_code,
eod.item_name,
eod.item_method,
eod.item_type,
eod.item_type_name
from equ_order eo
left join equ_order_detail eod on eo.order_code = eod.order_code
<where>
<if test="workCode != null "> and eo.work_code = #{workCode}</if>
<if test="repairCode != null "> and eo.repair_code = #{repairCode}</if>
and eo.del_flag = '0'
</where>
</select>
</mapper>

@ -31,11 +31,31 @@
<result property="repairReach" column="repair_reach" />
<result property="repairValue" column="repair_value" />
<result property="repairPicture" column="repair_picture" />
</resultMap>
<!-- 检查项检查方法-->
<result property="itemMethod" column="item_method" />
<resultMap type="com.op.common.core.domain.BaseFileData" id="BaseFileResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="fileAddress" column="file_address" />
<result property="sourceId" column="source_id" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="imageType" column="image_type" />
</resultMap>
<sql id="selectBaseFileVo">
select file_id, file_name, file_address, source_id, remark, attr1,
attr2, attr3, attr4, create_by, create_time, update_by,
update_time,image_type from base_file
</sql>
<sql id="selectEquOrderStandardVo">
select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit,
detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3,
@ -215,7 +235,7 @@
</foreach>
</delete>
<!--手持查询维修工单接口-->
<!--手持查询维修工单接口 /PC查询点检巡检信息接口-->
<select id="selectPdaEquOrderList" parameterType="EquOrderStandard" resultMap="EquOrderStandardResult">
select
eos.id,
@ -226,14 +246,41 @@
eos.detail_down_limit,
eos.detail_unit,
eos.detail_reach,
eos.actual_value
eos.actual_value,
eos.standard_type
from equ_order_standard eos
left join equ_order eo on eos.order_code = eo.order_code
left join equ_order_detail eod on eos.order_code = eod.order_code
<where>
<if test="workCode != null "> and eo.work_code = #{workCode}</if>
<if test="orderCode != null "> and eo.order_code = #{orderCode}</if>
and eo.del_flag = '0'
and eos.error_flag = '1'
</where>
</select>
</mapper>
<insert id="insertBaseFileBatch">
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=",">
(
#{baseFile.fileId},
#{baseFile.fileName},
#{baseFile.fileAddress},
#{baseFile.sourceId},
#{baseFile.remark},
#{baseFile.createBy},
#{baseFile.createTime},
#{baseFile.imageType}
)
</foreach>
</insert>
<delete id="deleteBaseFileBySourceId">
delete from base_file where source_id = #{sourceId}
</delete>
<select id="getBaseFileBatch" resultMap="BaseFileResult">
<include refid="selectBaseFileVo"/>
where source_id = #{sourceId}
</select>
</mapper>

@ -13,7 +13,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="orderSource" column="order_source" />
<result property="orderTime" column="order_time" />
<result property="orderHandle" column="order_handle" />
<result property="orderRepairman" column="order_repairman" />
<!--报修人编号、名字-->
<result property="orderRepairmanCode" column="order_repairman_code" />
<result property="orderRepairmanName" column="order_repairman_name" />
<result property="orderConnection" column="order_connection" />
<result property="orderStatus" column="order_status" />
<result property="orderRelevance" column="order_relevance" />
@ -46,8 +48,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="outSourceReason" column="work_reason" />
</resultMap>
<resultMap type="com.op.common.core.domain.BaseFileData" id="BaseFileResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="fileAddress" column="file_address" />
<result property="sourceId" column="source_id" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="imageType" column="image_type" />
</resultMap>
<sql id="selectBaseFileVo">
select file_id, file_name, file_address, source_id, remark, attr1,
attr2, attr3, attr4, create_by, create_time, update_by,
update_time,image_type from base_file
</sql>
<sql id="selectEquRepairOrderVo">
select order_id, order_code, equipment_code, order_desc, order_breakdown_time, order_source, order_time, order_handle, order_repairman, order_connection, order_status, order_relevance, order_picture, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,factory_code,repair_destination from equ_repair_order
select order_id, order_code, equipment_code, order_desc, order_breakdown_time, order_source, order_time, order_handle, order_repairman_code,order_repairman_name, order_connection, order_status, order_relevance, order_picture, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,factory_code,repair_destination from equ_repair_order
</sql>
<select id="selectEquRepairOrderList" parameterType="EquRepairOrder" resultMap="EquRepairOrderResult">
@ -60,7 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderSource != null and orderSource != ''"> and order_source like concat('%', #{orderSource}, '%')</if>
<if test="orderTime != null "> and order_time = #{orderTime}</if>
<if test="orderHandle != null and orderHandle != ''"> and order_handle = #{orderHandle}</if>
<if test="orderRepairman != null and orderRepairman != ''"> and order_repairman like concat('%', #{orderRepairman}, '%')</if>
<if test="orderRepairmanCode != null and orderRepairmanCode != ''"> and order_repairman_code like concat('%', #{orderRepairmanCode}, '%')</if>
<if test="orderRepairmanName != null and orderRepairmanName != ''"> and order_repairman_name like concat('%', #{orderRepairmanName}, '%')</if>
<if test="orderConnection != null and orderConnection != ''"> and order_connection like concat('%', #{orderConnection}, '%')</if>
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
@ -87,7 +113,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ero.order_source,
ero.order_time,
ero.order_handle,
ero.order_repairman,
ero.order_repairman_code,
ero.order_repairman_name,
ero.order_connection,
ero.order_status,
ero.order_relevance,
@ -114,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from equ_repair_order ero
left join base_equipment be on ero.equipment_code = be.equipment_code
left join equ_repair_work_order rwo on ero.order_code = rwo.order_code
left join equ_outsource_work eow on ero.order_code = eow.work_code
left join equ_outsource_work eow on ero.order_code = eow.order_code
where ero.order_id = #{orderId}
and ero.del_flag = '0'
ORDER BY create_time DESC
@ -131,7 +158,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderSource != null">order_source,</if>
<if test="orderTime != null">order_time,</if>
<if test="orderHandle != null">order_handle,</if>
<if test="orderRepairman != null">order_repairman,</if>
<if test="orderRepairmanCode != null">order_repairman_code,</if>
<if test="orderRepairmanName != null">order_repairman_name,</if>
<if test="orderConnection != null">order_connection,</if>
<if test="orderStatus != null">order_status,</if>
<if test="orderRelevance != null">order_relevance,</if>
@ -156,7 +184,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderSource != null">#{orderSource},</if>
<if test="orderTime != null">#{orderTime},</if>
<if test="orderHandle != null">#{orderHandle},</if>
<if test="orderRepairman != null">#{orderRepairman},</if>
<if test="orderRepairmanCode != null">#{orderRepairmanCode},</if>
<if test="orderRepairmanName != null">#{orderRepairmanName},</if>
<if test="orderConnection != null">#{orderConnection},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="orderRelevance != null">#{orderRelevance},</if>
@ -184,7 +213,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderSource != null">order_source = #{orderSource},</if>
<if test="orderTime != null">order_time = #{orderTime},</if>
<if test="orderHandle != null">order_handle = #{orderHandle},</if>
<if test="orderRepairman != null">order_repairman = #{orderRepairman},</if>
<if test="orderRepairmanCode != null">order_repairman_code = #{orderRepairmanCode},</if>
<if test="orderRepairmanName != null">order_repairman_name = #{orderRepairmanName},</if>
<if test="orderConnection != null">order_connection = #{orderConnection},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="orderRelevance != null">order_relevance = #{orderRelevance},</if>
@ -246,4 +276,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where order_code = #{repairCode} and del_flag = '0'
</select>
<insert id="insertBaseFileBatch">
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=",">
(
#{baseFile.fileId},
#{baseFile.fileName},
#{baseFile.fileAddress},
#{baseFile.sourceId},
#{baseFile.remark},
#{baseFile.createBy},
#{baseFile.createTime},
#{baseFile.imageType}
)
</foreach>
</insert>
<delete id="deleteBaseFileBySourceId">
delete from base_file where source_id = #{sourceId}
</delete>
<select id="getBaseFileBatch" resultMap="BaseFileResult">
<include refid="selectBaseFileVo"/>
where source_id = #{sourceId}
</select>
</mapper>

@ -43,18 +43,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="equipmentTypeName" column="equipment_type_name" />
<result property="equipmentLocation" column="equipment_location" />
<result property="department" column="department" />
<result property="workshopCode" column="workshop_code" />
<result property="workshopName" column="workshop_name" />
<!--报修信息-->
<result property="orderDesc" column="order_desc" />
<result property="orderBreakdownTime" column="order_breakdown_time" />
<result property="orderSource" column="order_source" />
<result property="orderTime" column="order_time" />
<result property="orderRepairman" column="order_repairman" />
<result property="orderRepairmanCode" column="order_repairman_code" />
<result property="orderConnection" column="order_connection" />
<!--班组-->
<result property="teamName" column="team_name" />
<result property="teamPerson" column="team_person" />
</resultMap>
<resultMap type="com.op.common.core.domain.BaseFileData" id="BaseFileResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="fileAddress" column="file_address" />
<result property="sourceId" column="source_id" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="imageType" column="image_type" />
</resultMap>
<sql id="selectBaseFileVo">
select file_id, file_name, file_address, source_id, remark, attr1,
attr2, attr3, attr4, create_by, create_time, update_by,
update_time,image_type from base_file
</sql>
<sql id="selectEquRepairWorkOrderVo">
select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code from equ_repair_work_order
</sql>
@ -132,6 +157,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
ORDER BY erwo.create_time DESC
</select>
<!-- 除了待维修-->
<select id="selectRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
select
erwo.work_id,
erwo.order_id,
erwo.order_code,
erwo.work_code,
erwo.work_handle,
erwo.work_plan_time,
erwo.work_plan_down_time,
erwo.order_relevance,
erwo.work_person,
erwo.work_team,
erwo.work_outsource,
erwo.work_down_machine,
erwo.equipment_code,
erwo.work_reason,
erwo.work_fault_desc,
erwo.work_start_time,
erwo.work_end_time,
erwo.work_cost_time,
erwo.work_cost,
erwo.work_status,
erwo.out_work_id,
erwo.out_work_code,
erwo.attr1,
erwo.attr2,
erwo.attr3,
erwo.create_by,
erwo.create_time,
erwo.update_time,
erwo.update_by,
erwo.del_flag,
erwo.factory_code,
be.equipment_name,
et.team_name,
et.team_person
from equ_repair_work_order erwo
left join base_equipment be on erwo.equipment_code = be.equipment_code
left join equ_team et on erwo.work_team = et.team_code
where NOT (erwo.work_status = #{workStatus})
and erwo.work_outsource = #{workOutsource}
and erwo.del_flag = '0'
ORDER BY erwo.create_time DESC
</select>
<select id="selectEquRepairWorkOrderByWorkId" parameterType="String" resultMap="EquRepairWorkOrderResult">
select
@ -169,12 +240,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
be.equipment_spec,
be.equipment_type_name,
be.equipment_location,
be.workshop_code,
be.workshop_name,
be.department,
ero.order_desc,
ero.order_breakdown_time,
ero.order_source,
ero.order_time,
ero.order_repairman,
ero.order_repairman_code,
ero.order_connection,
eow.work_person AS outSourcePerson,
eow.work_outsourcing_unit AS workOutsourcingUnit,
@ -344,4 +417,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and sp.post_id = '12'
</select>
<delete id="deleteBaseFileBySourceId">
delete from base_file where source_id = #{sourceId}
</delete>
<select id="getBaseFileBatch" resultMap="BaseFileResult">
<include refid="selectBaseFileVo"/>
where source_id = #{sourceId}
</select>
<insert id="insertBaseFileBatch">
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=",">
(
#{baseFile.fileId},
#{baseFile.fileName},
#{baseFile.fileAddress},
#{baseFile.sourceId},
#{baseFile.remark},
#{baseFile.createBy},
#{baseFile.createTime},
#{baseFile.imageType}
)
</foreach>
</insert>
</mapper>
Loading…
Cancel
Save