|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.bellmann.common.base.IBaseEnum; |
|
|
|
|
import com.bellmann.common.constant.ResConstants; |
|
|
|
|
import com.bellmann.common.constant.SecurityConstants; |
|
|
|
|
import com.bellmann.common.constant.StringUtilsConstants; |
|
|
|
|
import com.bellmann.common.constant.SystemConstants; |
|
|
|
@ -20,12 +21,14 @@ import com.bellmann.mapper.*; |
|
|
|
|
import com.bellmann.model.bo.DownloadInfo; |
|
|
|
|
import com.bellmann.model.bo.EquipmentBO; |
|
|
|
|
import com.bellmann.model.bo.RemoteEquipmentBO; |
|
|
|
|
import com.bellmann.model.bo.ResetServiceBO; |
|
|
|
|
import com.bellmann.model.dto.OperationTask; |
|
|
|
|
import com.bellmann.model.entity.*; |
|
|
|
|
import com.bellmann.model.form.*; |
|
|
|
|
import com.bellmann.model.query.DevOuiSnoQuery; |
|
|
|
|
import com.bellmann.model.query.SelectQuery; |
|
|
|
|
import com.bellmann.model.vo.*; |
|
|
|
|
import com.bellmann.runner.UIService; |
|
|
|
|
import com.bellmann.security.util.SecurityUtils; |
|
|
|
|
import com.bellmann.service.DeviceStaticService; |
|
|
|
|
import com.bellmann.service.FileOptionService; |
|
|
|
@ -34,11 +37,8 @@ import com.zznode.itms.api.NBIManager; |
|
|
|
|
import com.zznode.itms.api.OAMManager; |
|
|
|
|
import com.zznode.itms.api.Utils; |
|
|
|
|
import com.zznode.itms.idl.device.*; |
|
|
|
|
import com.zznode.itms.idl.order.OrderInfoStructListHolder; |
|
|
|
|
import com.zznode.itms.idl.order.OrderStatus; |
|
|
|
|
import com.zznode.itms.idl.order.OrderType; |
|
|
|
|
import com.zznode.itms.idl.resourcedefinition.RDeviceDetailListHolder; |
|
|
|
|
import com.zznode.itms.idl.resourcedefinition.RDeviceStaticStruct; |
|
|
|
|
import com.zznode.itms.idl.order.*; |
|
|
|
|
import com.zznode.itms.idl.resourcedefinition.*; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
@ -49,6 +49,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.math.RoundingMode; |
|
|
|
|
import java.sql.Timestamp; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
@ -100,6 +101,10 @@ public class DeviceStaticServiceImpl implements DeviceStaticService { |
|
|
|
|
|
|
|
|
|
private final CustomTaskMapper customTaskMapper; |
|
|
|
|
|
|
|
|
|
private final ServiceMapper serviceMapper; |
|
|
|
|
|
|
|
|
|
private final DeviceOrderFlowMapper deviceOrderFlowMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Page<EquipmentVO> resourcePage(SelectQuery query) { |
|
|
|
@ -987,4 +992,223 @@ public class DeviceStaticServiceImpl implements DeviceStaticService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void remoteResetService(Long devId, String serviceName) { |
|
|
|
|
DeviceStatic deviceStatic = deviceStaticMapper.selectOne(new LambdaQueryWrapper<DeviceStatic>() |
|
|
|
|
.eq(DeviceStatic::getDevId, devId) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
Customer customer = customerManager.findByCustomId(deviceStatic.getCustomId()); |
|
|
|
|
List<ResetServiceBO> list = serviceMapper.resetServiceByDevId(devId,serviceName); |
|
|
|
|
if (list.isEmpty()){ |
|
|
|
|
throw new BusinessException(ResultCode.DATA_NOT_FOUND); |
|
|
|
|
} |
|
|
|
|
RDevServiceInfoDetailStruct[] struct = new RDevServiceInfoDetailStruct[list.size()]; |
|
|
|
|
for (int index=0;index<list.size();index++){ |
|
|
|
|
ResetServiceBO bo = list.get(index); |
|
|
|
|
RDevServiceInfoDetailStruct devServiceInfoDetail = new RDevServiceInfoDetailStruct(); |
|
|
|
|
RServiceStruct service = new RServiceStruct(); |
|
|
|
|
RDevServiceStruct devService = new RDevServiceStruct(); |
|
|
|
|
service.servId = bo.getServId(); |
|
|
|
|
service.servName = Utils.convertStringNull(bo.getServName()); |
|
|
|
|
service.servVerName = Utils.convertStringNull(bo.getServVerName()); |
|
|
|
|
service.servDisplayName = Utils.convertStringNull(bo.getServDisplayName()); |
|
|
|
|
service.servDesc = Utils.convertStringNull(bo.getServDesc()); |
|
|
|
|
service.pluginFileId = Utils.setNumNull(bo.getPluginFileId()); |
|
|
|
|
devServiceInfoDetail.servInfo = service; |
|
|
|
|
|
|
|
|
|
devService.devId = bo.getDevId(); |
|
|
|
|
devService.servId = bo.getServId(); |
|
|
|
|
devService.orderId = Utils.setNumNull(bo.getOrderId()); |
|
|
|
|
devService.servMapStatus = RDevServStatus.from_int(new Integer(bo.getServMapStatus())); |
|
|
|
|
devService.servMapErrorCount = Utils.setNumNull(bo.getServMapErrorCount()); |
|
|
|
|
devService.servStatusTime = Utils.setTimestampNull(Timestamp.valueOf(bo.getServStatusTime())); |
|
|
|
|
devService.servMapRemark = Utils.convertStringNull(bo.getServMapRemark()); |
|
|
|
|
devServiceInfoDetail.devServ = devService; |
|
|
|
|
|
|
|
|
|
List<DeviceServiceArgs> args = deviceServiceArgsMapper.resetServiceByServIdAndDevId(bo.getServId(),bo.getDevId()); |
|
|
|
|
if (!args.isEmpty()){ |
|
|
|
|
RDevServArgsStruct[] devServArgsList = new RDevServArgsStruct[args.size()]; |
|
|
|
|
for (int i=0;i<args.size();i++){ |
|
|
|
|
DeviceServiceArgs entity = args.get(i); |
|
|
|
|
RDevServArgsStruct devServArgs = new RDevServArgsStruct(); |
|
|
|
|
devServArgs.devId = entity.getDevId(); |
|
|
|
|
devServArgs.servId = entity.getServId(); |
|
|
|
|
devServArgs.argsTr069Name = Utils.convertStringNull(entity.getArgsTr069Name()); |
|
|
|
|
devServArgs.argsValue = Utils.convertStringNull(entity.getArgsValue()); |
|
|
|
|
devServArgs.argsUpdateTime = Utils.setTimestampNull(Timestamp.valueOf(entity.getArgsUpdateTime())); |
|
|
|
|
devServArgs.servArgsRemark = Utils.convertStringNull(entity.getServArgsRemark()); |
|
|
|
|
devServArgsList[i] = devServArgs; |
|
|
|
|
} |
|
|
|
|
devServiceInfoDetail.devServArgsList = devServArgsList; |
|
|
|
|
} |
|
|
|
|
struct[index] = devServiceInfoDetail; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OrderInfoStruct orderInfoStruct = setResetOrderInfo(deviceStatic, customer, struct, serviceName); |
|
|
|
|
int result = NBIManager.receiveOrderInfo(orderInfoStruct); |
|
|
|
|
if (result!=0){ |
|
|
|
|
throw new BusinessException(ResultCode.NOT_GET_DEVICE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private OrderInfoStruct setResetOrderInfo(DeviceStatic device,Customer customer,RDevServiceInfoDetailStruct[] devServiceInfoDetail,String serviceName){ |
|
|
|
|
|
|
|
|
|
OrderInfoStruct orderInfo = new OrderInfoStruct(); |
|
|
|
|
orderInfo.receiveOrderId = "Z" + System.currentTimeMillis(); |
|
|
|
|
orderInfo.receiveOrderLhs = "" + System.currentTimeMillis(); |
|
|
|
|
orderInfo.orderTime = System.currentTimeMillis(); |
|
|
|
|
orderInfo.orderReceiveDate = System.currentTimeMillis(); |
|
|
|
|
orderInfo.orderServiceType = OrderType.ORDER_SERVICE_MODIFY; |
|
|
|
|
orderInfo.order_Status = OrderStatus.ORDER_UNSETTLE; |
|
|
|
|
orderInfo.order_Remark = OrderRemark.ORDER_NORMAL; |
|
|
|
|
orderInfo.customerAddrNew = ""; |
|
|
|
|
orderInfo.customerAddrOld = ""; |
|
|
|
|
orderInfo.customerNameNew = ""; |
|
|
|
|
orderInfo.customerNameOld = ""; |
|
|
|
|
orderInfo.contactPersonNew = ""; |
|
|
|
|
orderInfo.contactPersonOld = ""; |
|
|
|
|
orderInfo.orderCustomerKind = CustomerType.CUSTOMER_KIND_PERSONAL; |
|
|
|
|
orderInfo.pppoePassword = ""; |
|
|
|
|
if (customer != null) { |
|
|
|
|
orderInfo.customerAddrNew = customer.getCustomAddr(); |
|
|
|
|
orderInfo.customerNameNew = customer.getCustomName(); |
|
|
|
|
orderInfo.contactPersonNew = customer.getContactType(); |
|
|
|
|
if (Integer.parseInt(customer.getCustomType()) == RCustType.CORP.value()) { |
|
|
|
|
orderInfo.orderCustomerKind = CustomerType.CUSTOMER_KIND_ENTERPRISE; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
orderInfo.systemDomain = device.getRegionAreaId(); |
|
|
|
|
if (device.getCorpAreaId()!=null){ |
|
|
|
|
orderInfo.corpoationDomain = device.getCorpAreaId(); |
|
|
|
|
} |
|
|
|
|
if (device.getDevPppoe()!=null){ |
|
|
|
|
orderInfo.pppoeAcount = device.getDevPppoe(); |
|
|
|
|
} |
|
|
|
|
orderInfo.adNo = device.getDevAdNo(); |
|
|
|
|
orderInfo.dummy_Flag = DummyFlag.ORDER_DUMMY_TRUE; |
|
|
|
|
orderInfo.devOuiSno = device.getDevRemark3() + "-" + device.getDevSno(); |
|
|
|
|
orderInfo.remark = ""; |
|
|
|
|
orderInfo.orderDone_Flag = OrderDoneFlag.ORDER_RETURN_FALSE; |
|
|
|
|
|
|
|
|
|
String flowType = "0"; |
|
|
|
|
DeviceOrderFlow deviceOrderFlow = deviceOrderFlowMapper.selectOne(new LambdaQueryWrapper<DeviceOrderFlow>() |
|
|
|
|
.eq(DeviceOrderFlow::getDevId, device.getDevId()) |
|
|
|
|
); |
|
|
|
|
if (deviceOrderFlow!=null){ |
|
|
|
|
flowType = deviceOrderFlow.getOrderFlowRoot(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String loid = ""; |
|
|
|
|
if (null != device.getDevRemark4() && !device.getDevRemark4().isEmpty()) { |
|
|
|
|
loid = device.getDevRemark4().split("\\^")[0]; |
|
|
|
|
} |
|
|
|
|
if (ResConstants.HN_PROVICE.equals(UIService.getProvince())) { |
|
|
|
|
if (device.getDevRemark4() == null || device.getDevRemark4().isEmpty()) { |
|
|
|
|
orderInfo.flowType = flowType; |
|
|
|
|
orderInfo.uniqueUserId = ""; |
|
|
|
|
orderInfo.userSnKey = ""; |
|
|
|
|
orderInfo.userSnNo = ""; |
|
|
|
|
orderInfo.lifeTime = Utils.LONG_NULL; |
|
|
|
|
} else { |
|
|
|
|
orderInfo.flowType = flowType; |
|
|
|
|
orderInfo.uniqueUserId = device.getDevRemark4(); |
|
|
|
|
orderInfo.userSnKey = ""; |
|
|
|
|
orderInfo.userSnNo = device.getDevRemark4().split("\\^")[0]; |
|
|
|
|
orderInfo.lifeTime = -999; |
|
|
|
|
} |
|
|
|
|
} else if (ResConstants.YN_PROVICE.equals(UIService.getProvince())) { |
|
|
|
|
if (device.getDevRemark4() == null || device.getDevRemark4().isEmpty()) { |
|
|
|
|
orderInfo.flowType = flowType; |
|
|
|
|
orderInfo.uniqueUserId = ""; |
|
|
|
|
orderInfo.userSnKey = ""; |
|
|
|
|
orderInfo.userSnNo = ""; |
|
|
|
|
orderInfo.lifeTime = Utils.LONG_NULL; |
|
|
|
|
} else { |
|
|
|
|
orderInfo.flowType = flowType; |
|
|
|
|
orderInfo.uniqueUserId = device.getDevRemark4(); |
|
|
|
|
orderInfo.userSnKey = ""; |
|
|
|
|
orderInfo.userSnNo = device.getDevRemark4().split("\\^")[0]; |
|
|
|
|
orderInfo.lifeTime = -999; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (loid.length() == 11 || loid.length() == 18) { |
|
|
|
|
orderInfo.flowType = flowType; |
|
|
|
|
orderInfo.uniqueUserId = device.getDevRemark4(); |
|
|
|
|
orderInfo.userSnKey = ""; |
|
|
|
|
orderInfo.userSnNo = loid; |
|
|
|
|
orderInfo.lifeTime = -999; |
|
|
|
|
} else { |
|
|
|
|
orderInfo.flowType = flowType; |
|
|
|
|
orderInfo.uniqueUserId = ""; |
|
|
|
|
orderInfo.userSnKey = ""; |
|
|
|
|
orderInfo.userSnNo = ""; |
|
|
|
|
orderInfo.lifeTime = Utils.LONG_NULL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
orderInfo.operRemark = ""; |
|
|
|
|
orderInfo.remark1 = ""; |
|
|
|
|
orderInfo.remark2 = ""; |
|
|
|
|
orderInfo.remark3 = ""; |
|
|
|
|
List<OrderServiceStruct> orderServiceVec = new ArrayList<>(); |
|
|
|
|
for (RDevServiceInfoDetailStruct rDevServiceInfoDetailStruct : devServiceInfoDetail) { |
|
|
|
|
if (rDevServiceInfoDetailStruct.devServ.servStatusTime < orderInfo.orderTime) { |
|
|
|
|
orderInfo.orderTime = rDevServiceInfoDetailStruct.devServ.servStatusTime; |
|
|
|
|
} |
|
|
|
|
if (serviceName |
|
|
|
|
.equals(rDevServiceInfoDetailStruct.servInfo.servName)) { |
|
|
|
|
OrderServiceStruct orderService = new OrderServiceStruct(); |
|
|
|
|
orderService.servName = rDevServiceInfoDetailStruct.servInfo.servName; |
|
|
|
|
orderService.servFlag = "R"; // Reset
|
|
|
|
|
orderService.argsName = ""; |
|
|
|
|
orderService.argsValueNew = ""; |
|
|
|
|
orderService.argsValueOld = ""; |
|
|
|
|
orderService.orderId = Utils.LONG_NULL; |
|
|
|
|
orderService.orderServiceId = Utils.LONG_NULL; |
|
|
|
|
orderServiceVec.add(orderService); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
orderInfo.orderServiceList = new OrderServiceStruct[orderServiceVec |
|
|
|
|
.size()]; |
|
|
|
|
for (int i = 0; i < orderServiceVec.size(); i++) { |
|
|
|
|
orderInfo.orderServiceList[i] = orderServiceVec.get(i); |
|
|
|
|
} |
|
|
|
|
OrderInfoDetailStruct orderInfoDetail = new OrderInfoDetailStruct(); |
|
|
|
|
|
|
|
|
|
DeviceStaticDetail devStaticDetail = deviceStaticDetailMapper.selectOne(new LambdaQueryWrapper<DeviceStaticDetail>() |
|
|
|
|
.eq(DeviceStaticDetail::getDevId,device.getDevId()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (devStaticDetail == null) { |
|
|
|
|
orderInfoDetail.bandAccess = ""; |
|
|
|
|
orderInfoDetail.cardId = ""; |
|
|
|
|
orderInfoDetail.cardKey = ""; |
|
|
|
|
orderInfoDetail.detailRemark1 = ""; |
|
|
|
|
orderInfoDetail.detailRemark2 = ""; |
|
|
|
|
orderInfoDetail.detailRemark3 = ""; |
|
|
|
|
orderInfoDetail.downRate = ""; |
|
|
|
|
orderInfoDetail.iptvAccess = ""; |
|
|
|
|
orderInfoDetail.iptvPort = ""; |
|
|
|
|
orderInfoDetail.orderKind = ""; |
|
|
|
|
orderInfoDetail.upRate = ""; |
|
|
|
|
orderInfoDetail.voipPhone = ""; |
|
|
|
|
} else { |
|
|
|
|
orderInfoDetail.bandAccess = devStaticDetail.getBandAccess(); |
|
|
|
|
orderInfoDetail.iptvAccess = devStaticDetail.getIptvAccess(); |
|
|
|
|
orderInfoDetail.orderKind = devStaticDetail.getDevOwnerClass(); |
|
|
|
|
orderInfoDetail.cardId = ""; |
|
|
|
|
orderInfoDetail.cardKey = ""; |
|
|
|
|
orderInfoDetail.detailRemark1 = ""; |
|
|
|
|
orderInfoDetail.detailRemark2 = ""; |
|
|
|
|
orderInfoDetail.detailRemark3 = ""; |
|
|
|
|
orderInfoDetail.downRate = ""; |
|
|
|
|
orderInfoDetail.iptvPort = ""; |
|
|
|
|
orderInfoDetail.upRate = ""; |
|
|
|
|
orderInfoDetail.voipPhone = ""; |
|
|
|
|
} |
|
|
|
|
orderInfo.orderInfoDetail = orderInfoDetail; |
|
|
|
|
return orderInfo; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|