2024-07-05 设备-备品备件出入库和手持对接接口

master
A0010407 7 months ago
parent 0463d5b512
commit b418483af2

@ -8,6 +8,7 @@ import com.op.device.domain.*;
import com.op.device.domain.dto.PDADTO;
import com.op.device.service.IDevicePDAService;
import com.op.device.service.IEquRepairOrderService;
import com.op.device.service.IEquSparepartsInOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -29,6 +30,10 @@ public class DevicePDAController extends BaseController {
@Autowired
private IEquRepairOrderService equRepairOrderService;
@Autowired
private IEquSparepartsInOutService equSparepartsInOutService;
/**
* list
*
@ -198,4 +203,16 @@ public class DevicePDAController extends BaseController {
public AjaxResult getFaultReasonList(EquFaultReason equFaultReason) {
return devicePDAService.selectEquFaultReasonList(equFaultReason);
}
//备品备件查询接口
@GetMapping(value = "/querySpareDetailBySpareCode/{spareCode}")
public AjaxResult querySpareDetailBySpareCode(@PathVariable("spareCode") String spareCode) {
return devicePDAService.selectSpareDetailBySpareCode(spareCode);
}
//备品备件出入库
@PostMapping("/sparePartsInOutStorage")
public AjaxResult sparePartsInOutStorage(@RequestBody EquSparepartsInOut equSparepartsInOut) {
return equSparepartsInOutService.insertEquSparepartsInOut(equSparepartsInOut);
}
}

@ -1,5 +1,9 @@
package com.op.device.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
// 手持传参dto
public class PDADTO {
// 用户名
@ -10,6 +14,9 @@ public class PDADTO {
private String shutDown;
// @JsonFormat(pattern = "yyyy-MM-dd")
private Date createTime;
public String getOrderCode() {
return orderCode;
}
@ -41,4 +48,12 @@ public class PDADTO {
public void setPlanType(String planType) {
this.planType = planType;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -138,4 +138,6 @@ public interface IDevicePDAService {
*
*/
AjaxResult selectEquFaultReasonList(EquFaultReason equFaultReason);
AjaxResult selectSpareDetailBySpareCode(String spareCode);
}

@ -111,48 +111,48 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@DS("#header.poolName")
public AjaxResult getTodayTask(PDADTO pdadto) {
List<EquOrder> orderList = equOrderMapper.selectTodayTask(pdadto);
List<EquOrder> handleList = new ArrayList<>();
long nowTime = DateUtils.getNowDate().getTime();
long dayMs = 86400000l;
long hourMs = 1000 * 60 * 60;
if (orderList != null) {
for (EquOrder order : orderList) {
long diff = nowTime - order.getCreateTime().getTime();
switch (order.getPlanLoopType()) {
case "hour":
if (diff < 1000 * 60 * 60 * Long.valueOf(order.getPlanLoop())) {
handleList.add(order);
}
break;
case "day":
if (diff < (dayMs * Long.valueOf(order.getPlanLoop()))) {
handleList.add(order);
}
break;
case "week":
if (diff < (dayMs * 7 * Long.valueOf(order.getPlanLoop()))) {
handleList.add(order);
}
break;
case "month":
if (diff < (dayMs * 30 * Long.valueOf(order.getPlanLoop()))) {
handleList.add(order);
}
break;
case "season":
if (diff < (dayMs * 30 * 3 * Long.valueOf(order.getPlanLoop()))) {
handleList.add(order);
}
break;
case "year":
if (diff < (dayMs * 365 * Long.valueOf(order.getPlanLoop()))) {
handleList.add(order);
}
break;
}
}
}
return success(handleList);
// List<EquOrder> handleList = new ArrayList<>();
// long nowTime = DateUtils.getNowDate().getTime();
// long dayMs = 86400000l;
// long hourMs = 1000 * 60 * 60;
// if (orderList != null) {
// for (EquOrder order : orderList) {
// long diff = nowTime - order.getCreateTime().getTime();
// switch (order.getPlanLoopType()) {
// case "hour":
// if (diff < 1000 * 60 * 60 * Long.valueOf(order.getPlanLoop())) {
// handleList.add(order);
// }
// break;
// case "day":
// if (diff < (dayMs * Long.valueOf(order.getPlanLoop()))) {
// handleList.add(order);
// }
// break;
// case "week":
// if (diff < (dayMs * 7 * Long.valueOf(order.getPlanLoop()))) {
// handleList.add(order);
// }
// break;
// case "month":
// if (diff < (dayMs * 30 * Long.valueOf(order.getPlanLoop()))) {
// handleList.add(order);
// }
// break;
// case "season":
// if (diff < (dayMs * 30 * 3 * Long.valueOf(order.getPlanLoop()))) {
// handleList.add(order);
// }
// break;
// case "year":
// if (diff < (dayMs * 365 * Long.valueOf(order.getPlanLoop()))) {
// handleList.add(order);
// }
// break;
// }
// }
// }
return success(orderList);
}
/**
@ -1211,4 +1211,17 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
List<EquFaultReason> list = equFaultReasonMapper.selectEquFaultReasonList(equFaultReason);
return success(list);
}
/**
*
*
* @param
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult selectSpareDetailBySpareCode(String spareCode) {
SparePartsLedger list = sparePartsLedgerMapper.selectSpareDetailBySpareCode(spareCode);
return success(list);
}
}

Loading…
Cancel
Save