Commit eb3f2377 LN

查找出库界面增加首次入库时间显示

1 个父辈 cd25d21c
......@@ -11,6 +11,8 @@ import lombok.Setter;
import org.springframework.data.annotation.Transient;
import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -220,4 +222,12 @@ public class BarcodeDto implements Serializable {
* 料箱中的物料信息
*/
private Map<String, BarcodeDto> subCodeMap;
public String getPutInTimeStr() {
if (putInTime == -1) {
return null;
}
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");
return dateFormat.format( new Date(putInTime));
}
}
......@@ -139,7 +139,7 @@ public class Barcode extends BasePo implements Serializable {
private long startWarmTime = -1;
/**
* 入库时间
* 最后一次 入库时间
*/
private Date putInDate;
......@@ -246,9 +246,9 @@ public class Barcode extends BasePo implements Serializable {
public void setPutInTime(long putInTime) {
if (this.putInTime == -1) {
this.putInTime = putInTime;
this.putInDate = new Date(putInTime);
}
this.putInDate = new Date(putInTime);
status = BARCODE_STATUS.IN_STORE;
updateExpTime();
......
......@@ -61,7 +61,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
private IHumitureManager humitureManager;
@Autowired
private IBarcodeManager barcodeManager;
protected IBarcodeManager barcodeManager;
@Autowired
protected TaskService taskService;
......
......@@ -143,6 +143,10 @@ public class SensorShelfHandler extends BaseDeviceHandler {
dataLog.setBarcode(reelId);
dataLog.setPartNumber(pn);
dataLog.setType(OP.PUT_IN);
barcode.setPutInTime(System.currentTimeMillis());
barcodeManager.saveBarcode(barcode);
dataLog.setNum(barcode.getAmount());
dataLog.setStatus(OP_STATUS.WAIT.name());
dataLog.setGroupId(groupId);
......
......@@ -82,6 +82,10 @@ public class TaskService {
task.setType(OP.PUT_IN);
task.setStatus(OP_STATUS.EXECUTING.name());
if(barcode!=null){
barcode.setPutInTime(System.currentTimeMillis());
barcodeManager.saveBarcode(barcode);
}
String loginUser = SecurityUtils.getLoginUsername();
task.setOperator(loginUser);
task = updateQueueTask(task);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!