order action

camera_merge
王一鸣 5 years ago
parent d219e44980
commit 890b4e6ae1

@ -4,16 +4,14 @@ import com.zhehekeji.core.pojo.Result;
import com.zhehekeji.core.util.Assert;
import com.zhehekeji.web.entity.Street;
import com.zhehekeji.web.mapper.StreetMapper;
import com.zhehekeji.web.service.NettyClient;
import com.zhehekeji.web.service.PlcService;
import com.zhehekeji.web.service.StreetConn;
import com.zhehekeji.web.service.StreetService;
import com.zhehekeji.web.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Api(value = "PLCController",tags = "PLC管理")
@RestController(value = "PLCController")
@ -58,6 +56,12 @@ public class PLCController {
return Result.success(plcService.plcStatus());
}
@GetMapping("/orderAction")
@ApiOperation(value = "执行的工单情况")
public Result<Map> orderAction(){
return Result.success(OrderAction.get());
}
}

@ -22,19 +22,25 @@ public class OrderAction {
* @return
*/
public static Integer put(String orderNum){
if(orderActions.get(orderNum) == null){
orderActions.put(orderNum,1);
return 1;
synchronized (orderNum.intern()){
if(orderActions.get(orderNum) == null){
orderActions.put(orderNum,1);
return 1;
}
int times = orderActions.get(orderNum);
times++;
//该订单的任务达到4次了不会再有任务了清除缓存
//具体看取货、放货、货物库内转移的流程
if(times >= 4){
orderActions.remove(orderNum);
}else {
orderActions.put(orderNum,times);
}
return times;
}
int times = orderActions.get(orderNum);
times++;
//该订单的任务达到4次了不会再有任务了清除缓存
//具体看取货、放货、货物库内转移的流程
if(times >= 4){
orderActions.remove(orderNum);
}else {
orderActions.put(orderNum,times);
}
return times;
}
public static Map<String,Integer> get(){
return orderActions;
}
}

Loading…
Cancel
Save