Merge remote-tracking branch 'origin/master'

master
mengjiao 1 year ago
commit 4c7b2aae74

@ -0,0 +1,461 @@
package com.op.system.api.domain.device;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.util.Date;
public class DeviceRepairOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String orderId;
/** 报修单号 */
@Excel(name = "报修单号")
private String orderCode;
/** 设备编码 */
@Excel(name = "设备编码")
private String equipmentCode;
/** 故障描述 */
@Excel(name = "故障描述")
private String orderDesc;
/** 故障时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "故障时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderBreakdownTime;
/** 报修来源 */
@Excel(name = "报修来源")
private String orderSource;
/** 报修时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "报修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderTime;
/** 是否立即处理 */
@Excel(name = "是否立即处理")
private String orderHandle;
/** 报修人编号 */
@Excel(name = "报修人编号")
private String orderRepairmanCode;
/** 报修人名字 */
@Excel(name = "报修人名字")
private String orderRepairmanName;
/** 联系方式 */
@Excel(name = "联系方式")
private String orderConnection;
/** 处理状态 */
@Excel(name = "处理状态")
private String orderStatus;
/** 关联计划 */
@Excel(name = "关联计划")
private String orderRelevance;
/** 故障图片 */
@Excel(name = "故障图片")
private String orderPicture;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标志 */
private String delFlag;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
//设备
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String equipmentTypeName;
/** 设备位置 */
@Excel(name = "设备位置")
private String equipmentLocation;
/** 部门 */
@Excel(name = "部门")
private String department;
/** 规格型号 */
@Excel(name = "规格型号")
private String equipmentSpec;
/** 设备名称 */
@Excel(name = "设备名称")
private String equipmentName;
/** 创建人 */
@Excel(name = "创建人")
private String createBy;
/** 报修后去向 */
@Excel(name = "报修去向")
private String repairDestination;
/** 计划维修时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanTime;
/** 计划停机时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanDownTime;
/** 是否停机维修 */
@Excel(name = "是否停机维修")
private String workDownMachine;
/** 维修人员 */
@Excel(name = "维修人员")
private String workPerson;
/** 维修组 */
@Excel(name = "维修组")
private String workTeam;
//委外
/** 主键 */
private String workId;
/** 委外工单编码 */
@Excel(name = "委外工单编码")
private String workCode;
/** 维修人员 */
@Excel(name = "委外维修人员")
private String outSourcePerson;
/** 委外单位 */
@Excel(name = "委外单位")
private String workOutsourcingUnit;
/** 联系方式 */
@Excel(name = "联系方式")
private String workConnection;
/** 原因 */
@Excel(name = "原因")
private String outSourceReason;
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getOrderDesc() {
return orderDesc;
}
public void setOrderDesc(String orderDesc) {
this.orderDesc = orderDesc;
}
public Date getOrderBreakdownTime() {
return orderBreakdownTime;
}
public void setOrderBreakdownTime(Date orderBreakdownTime) {
this.orderBreakdownTime = orderBreakdownTime;
}
public String getOrderSource() {
return orderSource;
}
public void setOrderSource(String orderSource) {
this.orderSource = orderSource;
}
public Date getOrderTime() {
return orderTime;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public String getOrderHandle() {
return orderHandle;
}
public void setOrderHandle(String orderHandle) {
this.orderHandle = orderHandle;
}
public String getOrderRepairmanCode() {
return orderRepairmanCode;
}
public void setOrderRepairmanCode(String orderRepairmanCode) {
this.orderRepairmanCode = orderRepairmanCode;
}
public String getOrderRepairmanName() {
return orderRepairmanName;
}
public void setOrderRepairmanName(String orderRepairmanName) {
this.orderRepairmanName = orderRepairmanName;
}
public String getOrderConnection() {
return orderConnection;
}
public void setOrderConnection(String orderConnection) {
this.orderConnection = orderConnection;
}
public String getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
public String getOrderRelevance() {
return orderRelevance;
}
public void setOrderRelevance(String orderRelevance) {
this.orderRelevance = orderRelevance;
}
public String getOrderPicture() {
return orderPicture;
}
public void setOrderPicture(String orderPicture) {
this.orderPicture = orderPicture;
}
public String getAttr1() {
return attr1;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr2() {
return attr2;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr3() {
return attr3;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getEquipmentTypeName() {
return equipmentTypeName;
}
public void setEquipmentTypeName(String equipmentTypeName) {
this.equipmentTypeName = equipmentTypeName;
}
public String getEquipmentLocation() {
return equipmentLocation;
}
public void setEquipmentLocation(String equipmentLocation) {
this.equipmentLocation = equipmentLocation;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getEquipmentSpec() {
return equipmentSpec;
}
public void setEquipmentSpec(String equipmentSpec) {
this.equipmentSpec = equipmentSpec;
}
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
@Override
public String getCreateBy() {
return createBy;
}
@Override
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getRepairDestination() {
return repairDestination;
}
public void setRepairDestination(String repairDestination) {
this.repairDestination = repairDestination;
}
public Date getWorkPlanTime() {
return workPlanTime;
}
public void setWorkPlanTime(Date workPlanTime) {
this.workPlanTime = workPlanTime;
}
public Date getWorkPlanDownTime() {
return workPlanDownTime;
}
public void setWorkPlanDownTime(Date workPlanDownTime) {
this.workPlanDownTime = workPlanDownTime;
}
public String getWorkDownMachine() {
return workDownMachine;
}
public void setWorkDownMachine(String workDownMachine) {
this.workDownMachine = workDownMachine;
}
public String getWorkPerson() {
return workPerson;
}
public void setWorkPerson(String workPerson) {
this.workPerson = workPerson;
}
public String getWorkTeam() {
return workTeam;
}
public void setWorkTeam(String workTeam) {
this.workTeam = workTeam;
}
public String getWorkId() {
return workId;
}
public void setWorkId(String workId) {
this.workId = workId;
}
public String getWorkCode() {
return workCode;
}
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
public String getOutSourcePerson() {
return outSourcePerson;
}
public void setOutSourcePerson(String outSourcePerson) {
this.outSourcePerson = outSourcePerson;
}
public String getWorkOutsourcingUnit() {
return workOutsourcingUnit;
}
public void setWorkOutsourcingUnit(String workOutsourcingUnit) {
this.workOutsourcingUnit = workOutsourcingUnit;
}
public String getWorkConnection() {
return workConnection;
}
public void setWorkConnection(String workConnection) {
this.workConnection = workConnection;
}
public String getOutSourceReason() {
return outSourceReason;
}
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
}
}

@ -0,0 +1,55 @@
package com.op.system.api.domain.device;
// 上位机报修DTO
public class EquRepairOrderDTO {
// 设备编码
private String equipmentCode;
// 工厂数据源
private String factory;
// 用户账号
private String userName;
// 用户名称
private String userNickName;
// 联系方式
private String phoneNumber;
public String getUserNickName() {
return userNickName;
}
public void setUserNickName(String userNickName) {
this.userNickName = userNickName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getFactory() {
return factory;
}
public void setFactory(String factory) {
this.factory = factory;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
}

@ -46,6 +46,16 @@ public class EquUpkeepController extends BaseController {
return equUpkeepService.formatEquItem(equPlanEquList);
}
/**
*
* @param equPlanEquList
* @return
*/
@PostMapping("/formatEquItemNoCondition")
public AjaxResult formatEquItemNoCondition(@RequestBody List<EquPlanEqu> equPlanEquList) {
return equUpkeepService.formatEquItemNoCondition(equPlanEquList);
}
/**
*
*/

@ -131,7 +131,7 @@ public class EquPlan extends BaseEntity {
private List<Date> planTimeArray;
private List<Long> personListVO;
private List<String> personListVO;
private String workCenterName;
@ -285,11 +285,11 @@ public class EquPlan extends BaseEntity {
this.workCenterName = workCenterName;
}
public List<Long> getPersonListVO() {
public List<String> getPersonListVO() {
return personListVO;
}
public void setPersonListVO(List<Long> personListVO) {
public void setPersonListVO(List<String> personListVO) {
this.personListVO = personListVO;
}

@ -2,6 +2,7 @@ package com.op.device.domain.dto;
// 手持传参dto
public class PDADTO {
// 用户名
private String userId;
private String planType;

@ -19,7 +19,7 @@ public interface PersonMapper {
* @return
*/
@DS("#master")
public SysUser selectSysUserByUserId(Long userId);
public SysUser selectSysUserByUserId(String userId);
/**
*

@ -69,4 +69,6 @@ public interface IEquUpkeepService {
* @return
*/
AjaxResult formatEquItem(List<EquPlanEqu> equPlanEquList);
AjaxResult formatEquItemNoCondition(List<EquPlanEqu> equPlanEquList);
}

@ -160,7 +160,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
// 处理人员信息
List<SysUser> personList = new ArrayList<>();
for (String id : users) {
personList.add(personMapper.selectSysUserByUserId(Long.valueOf(id)));
personList.add(personMapper.selectSysUserByUserId(id));
}
// 将人员信息置入工单
order.setPersonList(personList);
@ -272,11 +272,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equOrder.setUpdateTime(DateUtils.getNowDate());
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));// 工单结束时间
}
equOrder.setOrderStart(DateUtils.getNowDate());// 设置检查时间
// 是否存在报修单
boolean checkRepair = false;

@ -128,11 +128,9 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
new LinkedBlockingQueue<Runnable>());
try {
dateSources.forEach(dateSource -> {
//if("ds_1000".equals(dateSource.get("poolName"))){//TODO生产去掉
logger.info("++++++++++++" + dateSource.get("poolName") + "++++巡检开始++++++++++");
Runnable run = () -> createPatrolCheckPlanFunc(dateSource.get("poolName"));
executorService.execute(run);
//}
});
} catch (Exception e) {
logger.error("service == dataClearTask == exception", e);

@ -104,7 +104,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
List<SysUser> personList = new ArrayList<>();
for (String id : users) {
personList.add(personMapper.selectSysUserByUserId(Long.valueOf(id)));
personList.add(personMapper.selectSysUserByUserId(id));
}
order.setPersonList(personList);
@ -269,6 +269,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
equOrder.setUpdateTime(DateUtils.getNowDate());
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());// 设置负责人
equOrder.setOrderEnd(DateUtils.getNowDate());// 设置结束时间
if (equOrder.getTimeArray().size() > 0) {
equOrder.setOrderStart(equOrder.getTimeArray().get(0));// 工单开始时间
equOrder.setOrderEnd(equOrder.getTimeArray().get(1));// 工单结束时间

@ -217,7 +217,7 @@ public class EquPlanServiceImpl implements IEquPlanService {
equPlanDetailMapper.delEquPlanDetailByPlanCode(equPlan.getPlanCode());// 检查项
equPlanEquMapper.delEquPlanEquByPlanCode(equPlan.getPlanCode());// 设备
equPlanStandardMapper.delEquPlanStandardByPlanCode(equPlan.getPlanCode());// 标准
equPlanEquSpareMapper.delEquPlanEquSpareByPlanCode(equPlan.getPlanCode());// TODO 备件(没有删除成功?)
equPlanEquSpareMapper.delEquPlanEquSpareByPlanCode(equPlan.getPlanCode());// 备件
}
return success();
}
@ -306,9 +306,9 @@ public class EquPlanServiceImpl implements IEquPlanService {
List<EquPlanPerson> personList = equPlanPersonMapper.selectEquPlanPersonByPlanCode(equPlan.getPlanCode());
// 处理人员信息列表信息用于前端穿梭框信息回填
List<Long> persons = new ArrayList<>();
List<String> persons = new ArrayList<>();
for (EquPlanPerson person : personList) {
persons.add(person.getUserId());
persons.add(person.getUserName());
}
// 通过计划编码获取设备信息列表
@ -378,7 +378,7 @@ public class EquPlanServiceImpl implements IEquPlanService {
EquPlanPerson equPlanPerson = new EquPlanPerson();
equPlanPerson.setId(IdUtils.fastSimpleUUID());// id
equPlanPerson.setUserId(user.getUserId());// 用户id
equPlanPerson.setUserName(user.getUserName());// 用户名称
equPlanPerson.setPlanCode(equPlan.getPlanCode());// 计划编码
equPlanPerson.setFactoryCode(factory);// 工厂code
equPlanPerson.setCreateBy(SecurityContextHolder.getUserName());

@ -185,7 +185,7 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
equOrderPerson.setId(IdUtils.fastSimpleUUID());// id
equOrderPerson.setOrderCode(equOrder.getOrderCode());// 工单编码
equOrderPerson.setFactoryCode(factory);// 工厂
equOrderPerson.setUserId(user.getUserId());// 用户id
equOrderPerson.setUserName(user.getUserName());// 用户名称
equOrderPerson.setCreateBy(SecurityContextHolder.getUserName());
equOrderPerson.setCreateTime(DateUtils.getNowDate());
equOrderPerson.setUpdateBy(SecurityContextHolder.getUserName());

@ -113,7 +113,13 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
@Override
@DS("#header.poolName")
public AjaxResult formatEquItem(List<EquPlanEqu> equPlanEquList) {
return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!");
return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!",true);
}
@Override
@DS("#header.poolName")
public AjaxResult formatEquItemNoCondition(List<EquPlanEqu> equPlanEquList) {
return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!",false);
}
/**
@ -124,7 +130,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
* @param message
* @return
*/
private AjaxResult formatEquItemCommon(List<EquPlanEqu> equPlanEquList, String planType, String message) {
private AjaxResult formatEquItemCommon(List<EquPlanEqu> equPlanEquList, String planType, String message,Boolean check) {
for (EquPlanEqu data : equPlanEquList) {
// 检查项名称临时对象
@ -139,7 +145,33 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
// 处理检查项信息
for (EquCheckItem checkItem : equCheckItemList) {
// 获取循环周期一致的检查项
if (checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType())) {
if (checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType()) && check) {
// 创建检查项返回对象
EquPlanDetail detail = new EquPlanDetail();
BeanUtils.copyProperties(checkItem, detail);
if (!detail.getItemCode().isEmpty()) {
// 累加检查项名称(前端信息回显)
itemTempName.append(detail.getItemName()).append(",");
// 通过检查项code获取标准信息列表
List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode());
// 处理标准信息
if (equCheckItemList.size() > 0) {
// 创建标准列表返回对象
List<EquPlanStandard> standardList = new ArrayList<>();
for (EquCheckItemDetail standardTemp : equCheckItemDetailList) {
// 创建标准返回对象
EquPlanStandard standard = new EquPlanStandard();
BeanUtils.copyProperties(standardTemp, standard);
standard.setShowFlag(true);// 设置默认值(用于前端)
standardList.add(standard);// 返回对象添加到返回列表对象
}
detail.setEquPlanStandardList(standardList);// 标准列表信息置入检查项
}
}
detailList.add(detail);// 返回对象添加到返回列表对象
}else {
// 创建检查项返回对象
EquPlanDetail detail = new EquPlanDetail();
BeanUtils.copyProperties(checkItem, detail);

@ -140,14 +140,14 @@
<select id="selectTodayTask" parameterType="String" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/>
where 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 order_code from equ_order_person where del_flag = '0' and user_name = #{userId} GROUP BY order_code
)
</select>
<select id="selectTaskRecord" parameterType="String" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/>
where del_flag = '0' and order_status = '1' and plan_type = #{planType} and order_code in (
select order_code from equ_order_person where del_flag = '0' and user_id = #{userId} GROUP BY order_code
select order_code from equ_order_person where del_flag = '0' and user_name = #{userId} GROUP BY order_code
)
</select>

@ -43,12 +43,13 @@
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
<if test="loginDate != null "> and login_date = #{loginDate}</if>
and del_flag = '0'
</where>
</select>
<select id="selectSysUserByUserId" parameterType="Long" resultMap="SysUserResult">
<select id="selectSysUserByUserId" parameterType="String" resultMap="SysUserResult">
<include refid="selectSysUserVo"/>
where user_id = #{userId}
where user_name = #{userId}
</select>
<insert id="insertSysUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">

@ -5,6 +5,7 @@ import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.open.service.OpenService;
import com.op.system.api.domain.device.EquRepairOrderDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import org.springframework.beans.factory.annotation.Autowired;
@ -70,6 +71,15 @@ public class OpenController extends BaseController {
return success(openService.getLGInfo(wcsDTO));
}
/**
*
* @return
*/
@PostMapping("/machineRepair")
public AjaxResult machineRepair(@RequestBody EquRepairOrderDTO equRepairOrderDTO){
return openService.machineRepair(equRepairOrderDTO);
}
public static void main(String args[]){
System.out.println(DateUtils.getDate());
}

@ -1,6 +1,7 @@
package com.op.open.mapper;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.device.DeviceRepairOrder;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
@ -46,5 +47,19 @@ public interface OpenMapper {
List<String> getSapWorkOrder(String workorderCode);
List<MesReportWorkConsumeDTO> selectMesReportWorkConsumeList(MesReportWorkConsumeDTO consumeqo);
/**
*
* @return
*/
int selectOrderCodeSerialNumber();
/**
*
*
* @param equRepairOrder
* @return
*/
public int insertEquRepairOrder(DeviceRepairOrder equRepairOrder);
}

@ -1,6 +1,8 @@
package com.op.open.service;
import com.op.common.core.domain.R;
import com.op.common.core.web.domain.AjaxResult;
import com.op.system.api.domain.device.EquRepairOrderDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
@ -19,4 +21,6 @@ public interface OpenService {
// R reportWork(MesReportWorkDTO mesReportWork);
List<WCSDTO> getLGInfo(WCSDTO wcsDTO);
AjaxResult machineRepair(EquRepairOrderDTO equRepairOrderDTO);
}

@ -3,14 +3,19 @@ package com.op.open.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils;
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.open.mapper.OpenMapper;
import com.op.open.service.OpenService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.device.DeviceRepairOrder;
import com.op.system.api.domain.device.EquRepairOrderDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataDTO;
import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
@ -25,7 +30,10 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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 java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@ -35,6 +43,8 @@ import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* wcs
*
@ -240,6 +250,34 @@ public class OpenServiceImpl implements OpenService {
return openMapper.getLGInfo(wcsDTO);
}
@Override
public AjaxResult machineRepair(EquRepairOrderDTO equRepairOrderDTO) {
DynamicDataSourceContextHolder.push("ds_"+equRepairOrderDTO.getFactory());// 这是数据源的key
// 创建报修单
DeviceRepairOrder equRepairOrder = new DeviceRepairOrder();
// 获取故障报修流水号
String serialNum = String.format("%03d", openMapper.selectOrderCodeSerialNumber());
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+equRepairOrderDTO.getEquipmentCode()+serialNum);// 报修单号
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());// id
equRepairOrder.setEquipmentCode(equRepairOrderDTO.getEquipmentCode());
equRepairOrder.setOrderSource("上位机");// 故障来源
equRepairOrder.setOrderTime(DateUtils.getNowDate());// 报修时间
equRepairOrder.setOrderBreakdownTime(DateUtils.getNowDate());// 故障时间
equRepairOrder.setOrderRepairmanCode(equRepairOrderDTO.getUserName());// 用户账号
equRepairOrder.setOrderRepairmanName(equRepairOrderDTO.getUserNickName());// 用户名称
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(equRepairOrderDTO.getUserName());
equRepairOrder.setOrderStatus("待审核");// 报修单状态
equRepairOrder.setFactoryCode(equRepairOrderDTO.getFactory());// 工厂
equRepairOrder.setOrderConnection(equRepairOrderDTO.getPhoneNumber());// 联系方式
openMapper.insertEquRepairOrder(equRepairOrder);
return success();
}
public static void main(String args[]){
DateTimeFormatter ymdhms = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate today = LocalDate.now();

@ -111,15 +111,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from pro_order_workorder where workorder_code = #{workorderCode}
</select>
<select id="getLGInfo" resultType="com.op.system.api.domain.dto.WCSDTO">
SELECT pw.workorder_id workorderId,
SELECT distinct
pw.bucket_code bucketCode,
pw.material_code materialCode,
pw.material_name materialName,
pw.shift_id shiftId,
pow.workorder_code workorderCode
pw.material_name materialName
from
pro_wet_material_plan_detail pw
left join pro_order_workorder pow on pw.workorder_id = pow.workorder_id
where CONVERT(varchar(10),plan_time, 120) = #{reqTime}
</select>
<select id="getSapWorkOrder" resultType="java.lang.String">
@ -136,4 +133,67 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
workorder_code = #{workorderCode} and del_flag = '0'
</select>
<!--流水单号-->
<select id="selectOrderCodeSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(order_id)+1 AS serialNum
FROM equ_repair_order
WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time)
</select>
<insert id="insertEquRepairOrder" parameterType="DeviceRepairOrder">
insert into equ_repair_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,</if>
<if test="orderCode != null">order_code,</if>
<if test="equipmentCode != null">equipment_code,</if>
<if test="orderDesc != null">order_desc,</if>
<if test="orderBreakdownTime != null">order_breakdown_time,</if>
<if test="orderSource != null">order_source,</if>
<if test="orderTime != null">order_time,</if>
<if test="orderHandle != null">order_handle,</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>
<if test="orderPicture != null">order_picture,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="repairDestination != null">repair_destination,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="equipmentCode != null">#{equipmentCode},</if>
<if test="orderDesc != null">#{orderDesc},</if>
<if test="orderBreakdownTime != null">#{orderBreakdownTime},</if>
<if test="orderSource != null">#{orderSource},</if>
<if test="orderTime != null">#{orderTime},</if>
<if test="orderHandle != null">#{orderHandle},</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>
<if test="orderPicture != null">#{orderPicture},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="repairDestination != null">#{repairDestination},</if>
</trim>
</insert>
</mapper>

@ -11,6 +11,7 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysUser;
import com.op.wms.domain.BaseTeamUser;
import com.op.wms.domain.EquSpareEquipment;
import com.op.wms.domain.WmsSparePartsLedger;
import com.op.wms.service.IBaseEquipmentService;
@ -230,4 +231,14 @@ public class BaseEquipmentController extends BaseController {
return toAjax(baseEquipmentService.updateBaseEquipmentStatus(baseEquipment));
}
/**
*
*/
@GetMapping("/getPersonList")
public TableDataInfo getRepairPersonList(BaseTeamUser baseTeamUser) {
startPage();
List<BaseTeamUser> list = baseEquipmentService.getPersonList(baseTeamUser);
return getDataTable(list);
}
}

@ -226,13 +226,25 @@ public class BaseEquipment extends BaseEntity {
//右侧绑定备件
private List<String> rightData;
//右侧绑定辅助设备
private List<String> auxiliaryEquipmentRightData;
//返回已经绑定备件列表
private List<EquSpareEquipment> selectedData;
//返回已经绑定辅助设备列表
private List<EquBindAuxiliaryEquipment> selectedEquipmentData;
public void setSelectedEquipmentData(List<EquBindAuxiliaryEquipment> selectedEquipmentData) {
this.selectedEquipmentData = selectedEquipmentData;
}
public List<EquBindAuxiliaryEquipment> getSelectedEquipmentData() {
return selectedEquipmentData;
}
public void setSelectedData(List<EquSpareEquipment> selectedData) {
this.selectedData = selectedData;
}
public List<EquSpareEquipment> getSelectedData() {
return selectedData;
}
@ -608,6 +620,14 @@ public class BaseEquipment extends BaseEntity {
}
//右侧的绑定备件
public void setAuxiliaryEquipmentRightData(List<String> auxiliaryEquipmentRightData) {
this.auxiliaryEquipmentRightData = auxiliaryEquipmentRightData;
}
public List<String> getAuxiliaryEquipmentRightData() {
return auxiliaryEquipmentRightData;
}
//右侧的绑定辅助设备
public void setRightData(List<String> rightData) {
this.rightData = rightData;
}

@ -41,6 +41,9 @@ public class BaseTeamUser extends BaseEntity {
@Excel(name = "人员拼接名字")
private String teamUserName;
//电话
private String phonenumber;
public void setId(String id) {
this.id = id;
}
@ -90,6 +93,14 @@ public class BaseTeamUser extends BaseEntity {
this.teamUserName = teamUserName;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPhonenumber() {
return phonenumber;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,170 @@
package com.op.wms.domain;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* equ_auxiliaryEquipment_equipment
*
* @author Open Platform
* @date 2023-10-24
*/
public class EquBindAuxiliaryEquipment extends BaseEntity {
private static final long serialVersionUID = 1L;
//主键
private String id;
/** 备件编码 */
@Excel(name = "备件编码")
private String auxiliaryEquipmentCode;
/** 备件类型 */
@Excel(name = "备件类型")
private String auxiliaryEquipmentType;
/** 备件名称 */
@Excel(name = "备件名称")
private String auxiliaryEquipmentName;
/** 设备名称 */
@Excel(name = "设备名称")
private String equipmentName;
/** 设备编码 */
@Excel(name = "设备编码")
private String equipmentCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除字段 */
private String delFlag;
/** 工厂号 */
@Excel(name = "工厂号")
private String factoryCode;
private List<String> rightData;
public void setRightData(List<String> rightData) {
this.rightData = rightData;
}
public List<String> getRightData() {
return rightData;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setAuxiliaryEquipmentCode(String auxiliaryEquipmentCode) {
this.auxiliaryEquipmentCode = auxiliaryEquipmentCode;
}
public String getAuxiliaryEquipmentCode() {
return auxiliaryEquipmentCode;
}
public void setAuxiliaryEquipmentType(String auxiliaryEquipmentType) {
this.auxiliaryEquipmentType = auxiliaryEquipmentType;
}
public String getAuxiliaryEquipmentType() {
return auxiliaryEquipmentType;
}
public void setAuxiliaryEquipmentName(String auxiliaryEquipmentName) {
this.auxiliaryEquipmentName = auxiliaryEquipmentName;
}
public String getAuxiliaryEquipmentName() {
return auxiliaryEquipmentName;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("auxiliaryEquipmentCode", getAuxiliaryEquipmentCode())
.append("auxiliaryEquipmentType", getAuxiliaryEquipmentType())
.append("auxiliaryEquipmentName", getAuxiliaryEquipmentName())
.append("equipmentName", getEquipmentName())
.append("equipmentCode", getEquipmentCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -5,9 +5,7 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.BaseFileData;
import com.op.wms.domain.BaseEquipment;
import com.op.wms.domain.EquSpareEquipment;
import com.op.wms.domain.WmsSparePartsLedger;
import com.op.wms.domain.*;
import org.apache.ibatis.annotations.Param;
/**
@ -110,4 +108,13 @@ public interface BaseEquipmentMapper {
//更新设备状态
Integer updateBaseEquipmentStatus(BaseEquipment baseEquipment);
//绑定辅助设备
public void bindAuxiliaryEquipment(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment);
//查询已经绑定的辅助设备
List<EquBindAuxiliaryEquipment> getAuxiliaryEquipmentCodeList(EquBindAuxiliaryEquipment equBindAuxiliaryEquipment);
//删除
void deleteAuxiliaryEquipmentByCode(String equipmentCode);
}

@ -73,4 +73,8 @@ public interface BaseTeamUserMapper {
//批量删除
public void deleteBaseTeamUserByTeamId(String teamId);
void deleteBaseTeamUserByTeamIds(String[] teamIds);
//人员
@DS("master")
List<BaseTeamUser> getPersonList(BaseTeamUser baseTeamUser);
}

@ -4,6 +4,7 @@ import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.wms.domain.BaseEquipment;
import com.op.wms.domain.BaseTeamUser;
import com.op.wms.domain.EquSpareEquipment;
import com.op.wms.domain.WmsSparePartsLedger;
@ -79,4 +80,7 @@ public interface IBaseEquipmentService {
//更改设备状态
int updateBaseEquipmentStatus(BaseEquipment baseEquipment);
//查询人员列表
List<BaseTeamUser> getPersonList(BaseTeamUser baseTeamUser);
}

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.op.wms.mapper.BaseTeamUserMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -44,6 +45,9 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
@Autowired
private BaseEquipmentMapper baseEquipmentMapper;
@Autowired
private BaseTeamUserMapper baseTeamUserMapper;
/**
*
*
@ -100,11 +104,17 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
list.setBarCodeFiles(barcodeFiles);
}
//查询备品备件列表
//查询绑定备品备件列表
EquSpareEquipment equSpareEquipment = new EquSpareEquipment();
equSpareEquipment.setEquipmentCode(list.getEquipmentCode());
List<EquSpareEquipment> spareCodeList = baseEquipmentMapper.getSpareCodeList(equSpareEquipment);
list.setSelectedData(spareCodeList);
//查询绑定辅助设备
EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment();
equBindAuxiliaryEquipment.setEquipmentCode(list.getEquipmentCode());
List<EquBindAuxiliaryEquipment> auxiliaryEquipmentCodeList = baseEquipmentMapper.getAuxiliaryEquipmentCodeList(equBindAuxiliaryEquipment);
list.setSelectedEquipmentData(auxiliaryEquipmentCodeList);
return list;
}
@ -192,6 +202,7 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
baseEquipmentMapper.insertBaseFileBatch(files3);
}
//绑定备件
if(baseEquipment.getRightData().size() >0 ){
List<String> rightSparePartsCodeList = baseEquipment.getRightData();
for(String code :rightSparePartsCodeList){
@ -205,6 +216,21 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
baseEquipmentMapper.bindSpareParts(equSpareEquipment);
}
}
//绑定辅助设备
if(baseEquipment.getAuxiliaryEquipmentRightData().size() >0 ){
List<String> auxiliaryEquipmentRightList = baseEquipment.getAuxiliaryEquipmentRightData();
for(String code :auxiliaryEquipmentRightList){
EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment();
equBindAuxiliaryEquipment.setAuxiliaryEquipmentCode(code);
equBindAuxiliaryEquipment.setEquipmentCode(baseEquipment.getEquipmentCode());
equBindAuxiliaryEquipment.setCreateBy(SecurityUtils.getUsername());
equBindAuxiliaryEquipment.setCreateTime(DateUtils.getNowDate());
equBindAuxiliaryEquipment.setId(IdUtils.fastSimpleUUID());
equBindAuxiliaryEquipment.setAuxiliaryEquipmentName(baseEquipment.getEquipmentName());
baseEquipmentMapper.bindAuxiliaryEquipment(equBindAuxiliaryEquipment);
}
}
return list;
}
@ -299,6 +325,24 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
baseEquipmentMapper.bindSpareParts(equSpareEquipment);
}
}
//绑定辅助设备
//先删除,后绑定
baseEquipmentMapper.deleteAuxiliaryEquipmentByCode(baseEquipment.getEquipmentCode());
if(baseEquipment.getAuxiliaryEquipmentRightData().size() > 0 ){
List<String> auxiliaryEquipmentRightList = baseEquipment.getAuxiliaryEquipmentRightData();
for(String code :auxiliaryEquipmentRightList){
EquBindAuxiliaryEquipment equBindAuxiliaryEquipment = new EquBindAuxiliaryEquipment();
equBindAuxiliaryEquipment.setAuxiliaryEquipmentCode(code);
equBindAuxiliaryEquipment.setEquipmentCode(baseEquipment.getEquipmentCode());
equBindAuxiliaryEquipment.setCreateBy(SecurityUtils.getUsername());
equBindAuxiliaryEquipment.setCreateTime(DateUtils.getNowDate());
equBindAuxiliaryEquipment.setId(IdUtils.fastSimpleUUID());
equBindAuxiliaryEquipment.setAuxiliaryEquipmentName(baseEquipment.getEquipmentName());
baseEquipmentMapper.bindAuxiliaryEquipment(equBindAuxiliaryEquipment);
}
}
return list;
}
@ -496,4 +540,16 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
return list;
}
/**
*
*
* @param baseTeamUser
* @return
*/
@Override
@DS("#header.poolName")
public List<BaseTeamUser> getPersonList(BaseTeamUser baseTeamUser) {
return baseTeamUserMapper.getPersonList(baseTeamUser);
}
}

@ -462,6 +462,38 @@
</trim>
</insert>
<insert id="bindAuxiliaryEquipment" parameterType="com.op.wms.domain.EquBindAuxiliaryEquipment">
insert into equ_bind_auxiliary_equipment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="auxiliaryEquipmentCode != null">auxiliary_equipment_code,</if>
<if test="auxiliaryEquipmentType != null">auxiliary_equipment_type,</if>
<if test="auxiliaryEquipmentName != null">auxiliary_equipment_name,</if>
<if test="equipmentName != null">equipment_name,</if>
<if test="equipmentCode != null">equipment_code,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="auxiliaryEquipmentCode != null">#{auxiliaryEquipmentCode},</if>
<if test="auxiliaryEquipmentType != null">#{auxiliaryEquipmentType},</if>
<if test="auxiliaryEquipmentName != null">#{auxiliaryEquipmentName},</if>
<if test="equipmentName != null">#{equipmentName},</if>
<if test="equipmentCode != null">#{equipmentCode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<insert id="insertBaseFileBatch">
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time,image_type)
VALUES
@ -515,6 +547,20 @@
where equipment_code = #{equipmentCode}
</select>
<select id="getAuxiliaryEquipmentCodeList" parameterType="com.op.wms.domain.EquBindAuxiliaryEquipment" resultType="com.op.wms.domain.EquBindAuxiliaryEquipment">
select
id,
auxiliary_equipment_code AS auxiliaryEquipmentCode,
auxiliary_equipment_name AS auxiliaryEquipmentName
from
equ_bind_auxiliary_equipment
where equipment_code = #{equipmentCode}
</select>
<delete id="deleteAuxiliaryEquipmentByCode" parameterType="String">
delete from equ_bind_auxiliary_equipment where equipment_code = #{equipmentCode}
</delete>
<select id="selectExistByEquipmentCode" parameterType="BaseEquipment" resultMap="BaseEquipmentResult">
<include refid="selectBaseEquipmentVo"/>
where equipment_code = #{equipmentCode}

@ -131,4 +131,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="getPersonList" parameterType="BaseTeamUser" resultType="com.op.wms.domain.BaseTeamUser">
select
user_id AS userId,
user_name AS userName,
nick_name AS nickName,
CONCAT(nick_name,user_name) AS teamUserName,
phonenumber AS phonenumber
from sys_user
<where>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
and del_flag = '0'
</where>
</select>
</mapper>
Loading…
Cancel
Save