2025-1-9 DEVICE - 设备审核问题 -提醒不存在设备

master
元气满满(jgy) 3 months ago
parent 9811f49946
commit 0aafe49643

@ -190,4 +190,6 @@ public interface EquOrderMapper {
//获取组线信息
String getGroupLine(String auxiliaryEquipmentCode);
String selectEquipment(String equipmentCode);
}

@ -11,6 +11,7 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.exception.ServiceException;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
@ -249,6 +250,12 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@Override
@DS("#header.poolName")
public int checkEquRepairOrder(EquRepairOrder equRepairOrder) {
//查询设备是否存在
String equipment = equOrderMapper.selectEquipment(equRepairOrder.getEquipmentCode());
if(StringUtils.isBlank(equipment)){
throw new ServiceException("该设备不存在,请联系系统相关人员。");
}
String code = equRepairOrder.getOrderCode().substring(10); //不生成流水号,从报修单号第十位开始切割、拼接
String workCode = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + code;
if (equRepairOrder.getOrderSource().equals("点检") || equRepairOrder.getOrderSource().equals("巡检")) { //判断是否是点检、巡检过来的

@ -300,6 +300,10 @@
select equipment_name AS 'equipmentName' from base_equipment where equipment_code = #{equipmentCode} and del_flag = '0'
</select>
<select id="selectEquipment" resultType="java.lang.String">
select equipment_code from base_equipment where equipment_code = #{equipmentCode} and del_flag = '0'
</select>
<insert id="insertEquOrder" parameterType="EquOrder">
insert into equ_order
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save