whycxzp
2025-06-10 73bb5617e6aeb4ee8f7dfd4ad54b61d477969d86
src/main/java/com/whyc/service/WmsService.java
@@ -5,6 +5,7 @@
import com.google.gson.reflect.TypeToken;
import com.whyc.dto.*;
import com.whyc.pojo.db_abe_ram.AbeInf;
import com.whyc.pojo.db_wms.BattWarehouse;
import com.whyc.pojo.db_wms.Task;
import com.whyc.util.HttpUtil;
import com.whyc.util.JsonUtil;
@@ -25,6 +26,9 @@
    @Autowired
    private AbeInfService abeInfService;
    @Autowired
    private BattWarehouseService battWarehouseService;
    public Response getMaterialList() {
        String httpUrl = "http://192.168.10.133:8051"+"/api/Wms_material/get_all";
@@ -105,7 +109,7 @@
                String startLocationCode = taskDto.getStartlocation_code();
                //1=搬运空托,2=搬运电池. 转化到字段Des中,1001=搬运空托,1002=搬运电池
                Integer type = taskDto.getType();
                String taskNo = responseInside.getTask_no();
                String taskNo = (String) responseInside.getTask_no().get(0);
                Task task = new Task();
                task.setTaskNo(taskNo);
@@ -234,6 +238,25 @@
                task.setActivationChamberStartTime(statusTime);
            }break;
            case 14:
                //开始取活化结束的电池,如果任务编号在更新电池仓库中存在,则更新活化时间为当前时间
                BattWarehouse battWarehouse =battWarehouseService.getByTaskNo(taskNo);
                if(battWarehouse != null){
                    String activateTaskNo = battWarehouse.getTaskNo();
                    String chargeTaskNo = battWarehouse.getChargeTaskNo();
                    String dischargeTaskNo = battWarehouse.getDischargeTaskNo();
                    if(activateTaskNo.equals(taskNo)) {
                        //如果是活化任务,则更新数据库中该任务完成时间
                        battWarehouseService.finishActivationById(battWarehouse.getId());
                    }
                    else if (chargeTaskNo.equals(taskNo)) {
                        //如果是充电任务,则更新数据库中该任务完成时间
                        battWarehouseService.finishChargeById(battWarehouse.getId());
                    }
                    else if (dischargeTaskNo.equals(taskNo)) {
                        //如果是放电任务,则更新数据库中该任务完成时间
                        battWarehouseService.finishDischargeById(battWarehouse.getId());
                    }
                }
                task.setActivationChamberPickUpTime(statusTime);break;
            case 24:
                //测压任务,开始取测压结束的电池. 读取abe_inf表中的内阻,插入到任务里