highway
A0010407 12 months ago
parent 33c31ae564
commit a72bdf8068

@ -1,5 +1,6 @@
package com.op.device.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@ -135,6 +136,9 @@ public class EquRepairWorkOrder extends BaseEntity {
//维修停机真正结束时间
private Date actualDownEndTime;
/** 联系方式 */
private String workConnection;
// 设备
/** 设备名称 */
@Excel(name = "设备名称")
@ -214,7 +218,7 @@ public class EquRepairWorkOrder extends BaseEntity {
/** 委外单位 */
private String workOutsourcingUnit;
/** 联系方式 */
private String workConnection;
private String outSourceConnection;
//手持
//用户id
@ -559,6 +563,13 @@ public class EquRepairWorkOrder extends BaseEntity {
return workEndTime;
}
public void setWorkConnection(String workConnection) {
this.workConnection = workConnection;
}
public String getWorkConnection() {
return workConnection;
}
//班组
public void setTeamName(String teamName) {
this.teamName = teamName;
@ -639,11 +650,11 @@ public class EquRepairWorkOrder extends BaseEntity {
return workOutsourcingUnit;
}
public void setWorkConnection(String workConnection) {
this.workConnection = workConnection;
public void setOutSourceConnection(String outSourceConnection) {
this.outSourceConnection = outSourceConnection;
}
public String getWorkConnection() {
return workConnection;
public String getOutSourceConnection() {
return outSourceConnection;
}
//手持 用户userId

@ -106,6 +106,28 @@ public class EquSpareApply extends BaseEntity {
/** 总数量 */
private BigDecimal amount;
/** 物料号 */
@Excel(name = "物料号")
private String materialCode;
/** 物料描述 */
@Excel(name = "物料描述")
private String materialDesc;
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc;
}
public String getMaterialDesc() {
return materialDesc;
}
public List<Date> getApplyTimeArray() {
return applyTimeArray;
}

@ -74,7 +74,7 @@ public interface EquOrderStandardMapper {
*
* @param files
*/
void insertBaseFileBatch(List<BaseFileData> files);
void insertBaseFileBatch(@Param("baseFiles")List<BaseFileData> files);
/**
*
@ -102,4 +102,8 @@ public interface EquOrderStandardMapper {
* @param orderIds
*/
void delEquOrderStandardByorderIds(String[] orderIds);
//更新标准
void updateActualValues(EquOrderStandard standardList);
}

@ -62,4 +62,7 @@ public interface EquOutsourceWorkMapper {
//流水号
public int selectWorkCodeSerialNumber();
//通过repairCode删除存在的委外记录
public void deleteEquOutsourceWorkByRepairCode(String workCode);
}

@ -91,7 +91,7 @@ public interface EquRepairOrderMapper {
/**
*
*/
Boolean insertBaseFileBatch(@Param("baseFiles") List<BaseFileData> baseFiles);
Boolean insertBaseFileBatch(List<BaseFileData> baseFiles);
/**
*

@ -94,4 +94,7 @@ public interface EquRepairWorkOrderMapper {
*
*/
Boolean insertBaseFileBatch(@Param("baseFiles") List<BaseFileData> baseFiles);
//更新维修工单状态
void updateWorkStatus(String repairCode);
}

@ -351,9 +351,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@DS("#header.poolName")
public AjaxResult addRepairRecord(EquRepairOrder equRepairOrder) {
try {
// equRepairOrder
//自动填入联系人 联系方式!!!!!
String id = IdUtils.fastSimpleUUID();
equRepairOrder.setOrderId(id);
// 获取故障报修流水号
// 新增 是需要获取故障报修流水号
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
//报修单号
@ -368,6 +370,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
//删除照片 不需要清照片 因为是新增
//新增文件
if (StringUtils.isNotEmpty(equRepairOrder.getFileList())) {
String[] ids1 = equRepairOrder.getFileList().split(",");
@ -485,7 +488,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
}
/**
*
*
*
* @param equTeamUser
* @return
@ -573,6 +576,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
if (!CollectionUtils.isEmpty(files)) {
standardList.setPicturePaths(files);
}
standardList.setDetailReach(standardList.getRepairReach());
standardList.setActualValue(standardList.getRepairValue());
}
equOrder1.setStandardList(standardLists);
}
@ -604,17 +609,13 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@Override
@DS("#header.poolName")
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
try {
//判断是否停机
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId());
if(list.getWorkDownMachine().equals("1")){
//维修结束时间、维修真正停机时间
equRepairWorkOrder.setActualDownEndTime(DateUtils.getNowDate());
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
//维修完成
equRepairWorkOrder.setWorkStatus("1");
}
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
//更新每一项点检/巡检检查项信息
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
for(EquOrder checkList:checkLists){
@ -643,7 +644,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
equOrderStandardMapper.insertBaseFileBatch(files);
}
equOrderStandardMapper.updateEquOrderStandard(standardList);
standardList.setRepairReach(standardList.getDetailReach());
standardList.setRepairValue(standardList.getActualValue());
standardList.setUpdateTime(DateUtils.getNowDate());
standardList.setUpdateBy(SecurityUtils.getUsername());
equOrderStandardMapper.updateActualValues(standardList);
}
equOrderMapper.updateEquOrder(checkList);
}
@ -651,11 +656,27 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//新建申领单 缺少code
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
for(EquSpareApply equSpareApply:equSpareApplies){
//生成领料单code
String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equRepairWorkOrder.getWorkCode().substring(10);
equSpareApply.setApplyCode("A" + code );
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
//备品备件规格型号!!!!!
//equSpareApply.setSpareModel(equSpareApply.getS);
equSpareApply.setSpareCode(equSpareApply.getMaterialCode());
equSpareApply.setSpareName(equSpareApply.getMaterialDesc());
equSpareApply.setApplyPeople(SecurityUtils.getUsername());
equSpareApply.setCreateBy(SecurityUtils.getUsername());
equSpareApply.setCreateTime(DateUtils.getNowDate());
equSpareApply.setApplyTime(DateUtils.getNowDate());
equSpareApply.setSpareUseEquipment(equRepairWorkOrder.getEquipmentCode());
equSpareApply.setWorkCode(equRepairWorkOrder.getWorkCode());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
// SparePartsLedger sparePartsLedger = new SparePartsLedger();
// sparePartsLedger.
}
//图片
@ -679,14 +700,16 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
equRepairWorkOrderMapper.insertBaseFileBatch(files);
}
//维修人:当前登录人
//维修状态
equRepairWorkOrder.setWorkStatus("1");
//维修结束时间
equRepairWorkOrder.setWorkPerson(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
//需要更新设备状态????这里没做
return success("提交成功,维修完成!");
} catch (Exception e) {
return error();
}
}
/**

@ -29,6 +29,9 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@Autowired
private EquOutsourceWorkMapper equOutsourceWorkMapper;
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
/**
*
@ -88,6 +91,11 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@Override
@DS("#header.poolName")
public int updateEquOutsourceWork(EquOutsourceWork equOutsourceWork) {
//1完成委外
if(equOutsourceWork.getWorkStatus().equals("1")){
//更新维修工单状态
equRepairWorkOrderMapper.updateWorkStatus(equOutsourceWork.getRepairCode());
}
equOutsourceWork.setUpdateTime(DateUtils.getNowDate());
equOutsourceWork.setUpdateBy(SecurityUtils.getUsername());
return equOutsourceWorkMapper.updateEquOutsourceWork(equOutsourceWork);

@ -56,7 +56,7 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId);
List<BaseFileData> beforeFiles = equRepairWorkOrderMapper.getBaseFileBatch(list.getOrderId());
if (!CollectionUtils.isEmpty(beforeFiles)) {
list.setBeforeRepairFiles(beforeFiles);
list.setBeforeRepairFiles(beforeFiles);
}
//查询维修后图片
List<BaseFileData> afterFiles = equRepairWorkOrderMapper.getBaseFileBatch(workId);
@ -222,15 +222,18 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Override
@DS("#header.poolName")
public int applyEquOutsourceWork(EquRepairWorkOrder equRepairWorkOrder) {
//如果存在之前的删掉重新增加,物理删除
equOutsourceWorkMapper.deleteEquOutsourceWorkByRepairCode(equRepairWorkOrder.getWorkCode());
//转委外
EquOutsourceWork equOutsourceWork = new EquOutsourceWork();
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
//委外工单号
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairWorkOrder.getEquipmentCode();
//String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
//改了,不生成流水号,从第十位开始切割
String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equRepairWorkOrder.getWorkCode().substring(10);
equOutsourceWork.setWorkCode("WW"+ code);
equOutsourceWork.setOrderCode("无");
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equOutsourceWork.setEquipmentCode(equipmentCode);
equOutsourceWork.setEquipmentCode(equRepairWorkOrder.getEquipmentCode());
equOutsourceWork.setRepairCode(equRepairWorkOrder.getWorkCode());
equOutsourceWork.setWorkReason(equRepairWorkOrder.getOutSourceReason());
equOutsourceWork.setWorkPerson(equRepairWorkOrder.getOutSourcePerson());
@ -245,6 +248,10 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
equRepairWorkOrder.setOutWorkCode(equOutsourceWork.getWorkCode());
equRepairWorkOrderMapper.updateWorkOutsource(equRepairWorkOrder);
}
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equOutsourceWork.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
}
}

@ -209,6 +209,17 @@
where id = #{id} and del_flag = '0'
</update>
<update id="updateActualValues" parameterType="EquOrderStandard">
update equ_order_standard
<trim prefix="SET" suffixOverrides=",">
<if test="repairReach != null">repair_reach = #{repairReach},</if>
<if test="repairValue != null">repair_value = #{repairValue},</if>
<if test="repairPicture != null">repair_picture = #{repairPicture},</if>
</trim>
where id = #{id}
and del_flag = '0'
</update>
<delete id="deleteEquOrderStandardById" parameterType="String">
delete from equ_order_standard where id = #{id}
</delete>
@ -231,7 +242,9 @@
eos.detail_unit,
eos.detail_reach,
eos.actual_value,
eos.standard_type
eos.standard_type,
eos.repair_reach,
eos.repair_value
from equ_order_standard eos
where parent_code = #{parentCode}
and order_code = #{orderCode}

@ -185,6 +185,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where work_id = #{workId}
</delete>
<delete id="deleteEquOutsourceWorkByRepairCode" parameterType="String">
delete from equ_outsource_work
where repair_code = #{workCode}
</delete>
<delete id="deleteEquOutsourceWorkByWorkIds" parameterType="String">
update equ_outsource_work
set del_flag = '1'

@ -21,14 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="workDownMachine" column="work_down_machine" />
<result property="workReason" column="work_reason" />
<result property="workFaultDesc" column="work_fault_desc" />
<result property="workStartTime" column="work_start_time" />
<result property="workEndTime" column="work_end_time" />
<result property="actualDownStartTime" column="actual_down_start_time" />
<result property="actualDownEndTime" column="actual_down_end_time" />
<result property="workConnection" column="work_connection" />
<result property="workCostTime" column="work_cost_time" />
<result property="workCost" column="work_cost" />
<result property="workStatus" column="work_status" />
@ -266,7 +263,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ero.order_connection,
eow.work_person AS outSourcePerson,
eow.work_outsourcing_unit AS workOutsourcingUnit,
eow.work_connection AS workConnection,
eow.work_connection AS outSourceConnection,
eow.work_reason AS outSourceReason
from equ_repair_work_order erwo
left join base_equipment be on erwo.equipment_code = be.equipment_code
@ -467,4 +464,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<update id="updateWorkStatus" parameterType="EquRepairWorkOrder">
update equ_repair_work_order
set
work_status = '1'
where work_code = #{repairCode}
and del_flag = '0'
</update>
</mapper>
Loading…
Cancel
Save