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.domain.dto.PDADTO;
import com.op.device.service.IDevicePDAService; import com.op.device.service.IDevicePDAService;
import com.op.device.service.IEquRepairOrderService; import com.op.device.service.IEquRepairOrderService;
import com.op.device.service.IEquSparepartsInOutService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -29,6 +30,10 @@ public class DevicePDAController extends BaseController {
@Autowired @Autowired
private IEquRepairOrderService equRepairOrderService; private IEquRepairOrderService equRepairOrderService;
@Autowired
private IEquSparepartsInOutService equSparepartsInOutService;
/** /**
* list * list
* *
@ -198,4 +203,16 @@ public class DevicePDAController extends BaseController {
public AjaxResult getFaultReasonList(EquFaultReason equFaultReason) { public AjaxResult getFaultReasonList(EquFaultReason equFaultReason) {
return devicePDAService.selectEquFaultReasonList(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; package com.op.device.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
// 手持传参dto // 手持传参dto
public class PDADTO { public class PDADTO {
// 用户名 // 用户名
@ -10,6 +14,9 @@ public class PDADTO {
private String shutDown; private String shutDown;
// @JsonFormat(pattern = "yyyy-MM-dd")
private Date createTime;
public String getOrderCode() { public String getOrderCode() {
return orderCode; return orderCode;
} }
@ -41,4 +48,12 @@ public class PDADTO {
public void setPlanType(String planType) { public void setPlanType(String planType) {
this.planType = 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 selectEquFaultReasonList(EquFaultReason equFaultReason);
AjaxResult selectSpareDetailBySpareCode(String spareCode);
} }

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