add:配盘看板
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package org.nl.wms.bigscreen_manage.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import org.nl.wms.bigscreen_manage.service.DisScreenService;
|
||||
import org.nl.wms.bigscreen_manage.service.dto.DistributionModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/disScreen")
|
||||
public class DisScreenController {
|
||||
|
||||
@Autowired
|
||||
private DisScreenService disScreenService;
|
||||
|
||||
@GetMapping
|
||||
@SaIgnore
|
||||
public ResponseEntity<DistributionModel> getData(@RequestParam String curSect){
|
||||
DistributionModel data = disScreenService.getData(curSect);
|
||||
return new ResponseEntity<>(data, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@SaIgnore
|
||||
public ResponseEntity setData(@RequestBody DistributionModel distributionModel){
|
||||
disScreenService.setData(distributionModel);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package org.nl.wms.bigscreen_manage.service;
|
||||
|
||||
import org.nl.wms.bigscreen_manage.service.dto.DistributionModel;
|
||||
|
||||
public interface DisScreenService {
|
||||
DistributionModel getData(String curSect);
|
||||
void setData(DistributionModel model);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.wms.bigscreen_manage.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DistributionModel {
|
||||
@JsonProperty("WorkOrderCode")
|
||||
private String WorkOrderCode;//工单号
|
||||
@JsonProperty("LoadPort")
|
||||
private String LoadPort;//上料口
|
||||
@JsonProperty("WorkSect")
|
||||
private String WorkSect;//工作区
|
||||
private List<Parts> partsList;
|
||||
|
||||
@Data
|
||||
public static class Parts {
|
||||
@JsonProperty("MaterialCode")
|
||||
private String MaterialCode;
|
||||
@JsonProperty("MaterialName")
|
||||
private String MaterialName;
|
||||
@JsonProperty("BomQty")
|
||||
private BigDecimal BomQty;
|
||||
@JsonProperty("Unit")
|
||||
private String Unit;
|
||||
@JsonProperty("PartsImage")
|
||||
private String PartsImage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.wms.bigscreen_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.bigscreen_manage.service.DisScreenService;
|
||||
import org.nl.wms.bigscreen_manage.service.dto.DistributionModel;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Service
|
||||
public class DisScreenServiceImpl implements DisScreenService {
|
||||
|
||||
private ConcurrentHashMap<String,DistributionModel> modelMap = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
public DistributionModel getData(String curSect) {
|
||||
return modelMap.get(curSect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(DistributionModel model) {
|
||||
if (StrUtil.isEmptyIfStr(model.getWorkSect())){
|
||||
throw new BadRequestException("参数WorkSect为空");
|
||||
}
|
||||
modelMap.put(model.getWorkSect(), model);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user