no message
							parent
							
								
									745da96935
								
							
						
					
					
						commit
						995e83deca
					
				| 
						 | 
					@ -72,7 +72,7 @@ public interface LogService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void saveLog(Log log);
 | 
					    void saveLog(Log log);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void saveLogInfo(Object object, String url, String resultJson, String description, long time);
 | 
					    void saveLogInfo(Object object, String url, String resultJson, String description, long time,String logType);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 查询异常详情
 | 
					     * 查询异常详情
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -130,11 +130,11 @@ public class LogServiceImpl implements LogService {
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    @Async
 | 
					    @Async
 | 
				
			||||||
    public void saveLogInfo(Object object,String url, String resultJson, String description, long time) {
 | 
					    public void saveLogInfo(Object object,String url, String resultJson, String description, long time, String logtype) {
 | 
				
			||||||
        // 设置日志信息
 | 
					        // 设置日志信息
 | 
				
			||||||
        Log log_data = new Log();
 | 
					        Log log_data = new Log();
 | 
				
			||||||
        log_data.setDescription(description);
 | 
					        log_data.setDescription(description);
 | 
				
			||||||
        log_data.setLogType("INFO");
 | 
					        log_data.setLogType(logtype);
 | 
				
			||||||
        log_data.setMethod(url);
 | 
					        log_data.setMethod(url);
 | 
				
			||||||
        log_data.setParams(JSON.toJSONString(object));
 | 
					        log_data.setParams(JSON.toJSONString(object));
 | 
				
			||||||
        log_data.setReturnData(resultJson);
 | 
					        log_data.setReturnData(resultJson);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Generated(
 | 
					@Generated(
 | 
				
			||||||
    value = "org.mapstruct.ap.MappingProcessor",
 | 
					    value = "org.mapstruct.ap.MappingProcessor",
 | 
				
			||||||
    date = "2024-05-09T16:31:31+0800",
 | 
					    date = "2024-05-10T13:19:03+0800",
 | 
				
			||||||
    comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_202 (Oracle Corporation)"
 | 
					    comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_202 (Oracle Corporation)"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@Component
 | 
					@Component
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Generated(
 | 
					@Generated(
 | 
				
			||||||
    value = "org.mapstruct.ap.MappingProcessor",
 | 
					    value = "org.mapstruct.ap.MappingProcessor",
 | 
				
			||||||
    date = "2024-05-09T16:31:31+0800",
 | 
					    date = "2024-05-10T13:19:03+0800",
 | 
				
			||||||
    comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_202 (Oracle Corporation)"
 | 
					    comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_202 (Oracle Corporation)"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@Component
 | 
					@Component
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -293,7 +293,7 @@ public class PointController {
 | 
				
			||||||
    @AnonymousAccess
 | 
					    @AnonymousAccess
 | 
				
			||||||
    public ResponseEntity<Object> queryPointInfo(@RequestBody CurrentPage currentPage) {
 | 
					    public ResponseEntity<Object> queryPointInfo(@RequestBody CurrentPage currentPage) {
 | 
				
			||||||
       List<Point> pointList= pointService.getPoint(BaseStatus.STORAGE,"存储区",currentPage.getCurrentPage(),currentPage.getPageSize());
 | 
					       List<Point> pointList= pointService.getPoint(BaseStatus.STORAGE,"存储区",currentPage.getCurrentPage(),currentPage.getPageSize());
 | 
				
			||||||
       int total=pointService.getPoint(BaseStatus.STORAGE,"1F存储区").size();
 | 
					       int total=pointService.getPoint(BaseStatus.STORAGE,"存储区").size();
 | 
				
			||||||
       JSONObject object=new JSONObject();
 | 
					       JSONObject object=new JSONObject();
 | 
				
			||||||
        object.put("total",total);
 | 
					        object.put("total",total);
 | 
				
			||||||
        object.put("data",pointList);
 | 
					        object.put("data",pointList);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,6 +31,7 @@ import org.springframework.http.HttpStatus;
 | 
				
			||||||
import org.springframework.http.ResponseEntity;
 | 
					import org.springframework.http.ResponseEntity;
 | 
				
			||||||
import org.springframework.scheduling.annotation.Async;
 | 
					import org.springframework.scheduling.annotation.Async;
 | 
				
			||||||
import org.springframework.scheduling.annotation.EnableAsync;
 | 
					import org.springframework.scheduling.annotation.EnableAsync;
 | 
				
			||||||
 | 
					import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
					import org.springframework.web.bind.annotation.PostMapping;
 | 
				
			||||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
					import org.springframework.web.bind.annotation.RequestBody;
 | 
				
			||||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
					import org.springframework.web.bind.annotation.RequestMapping;
 | 
				
			||||||
| 
						 | 
					@ -41,6 +42,8 @@ import java.util.Date;
 | 
				
			||||||
import java.util.HashSet;
 | 
					import java.util.HashSet;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
import java.util.Set;
 | 
					import java.util.Set;
 | 
				
			||||||
 | 
					import java.util.concurrent.CompletableFuture;
 | 
				
			||||||
 | 
					import java.util.concurrent.ExecutionException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
 | 
					import static org.springframework.http.HttpStatus.BAD_REQUEST;
 | 
				
			||||||
import static org.springframework.http.HttpStatus.OK;
 | 
					import static org.springframework.http.HttpStatus.OK;
 | 
				
			||||||
| 
						 | 
					@ -135,14 +138,12 @@ public class KMReSController {
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param billCode
 | 
					     * @param billCode
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Async
 | 
					 | 
				
			||||||
    public void returnMo(String billCode) {
 | 
					    public void returnMo(String billCode) {
 | 
				
			||||||
        OrderDto orderDto = orderService.findByBarcodeNumber(billCode);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        OrderDto orderDto = orderService.findByBarcodeNumber(billCode);
 | 
				
			||||||
        if (orderDto == null) {
 | 
					        if (orderDto == null) {
 | 
				
			||||||
            throw new RuntimeException("系统无此送货单号: " + billCode);
 | 
					            throw new RuntimeException("系统无此送货单号: " + billCode);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        double receivedQty = agvTaskService.queryBillCodeSum(billCode);
 | 
					        double receivedQty = agvTaskService.queryBillCodeSum(billCode);
 | 
				
			||||||
        if (receivedQty == orderDto.getDeliveryQty()) {
 | 
					        if (receivedQty == orderDto.getDeliveryQty()) {
 | 
				
			||||||
            List<Task> tasks = taskService.findByBillCode(billCode);
 | 
					            List<Task> tasks = taskService.findByBillCode(billCode);
 | 
				
			||||||
| 
						 | 
					@ -153,10 +154,10 @@ public class KMReSController {
 | 
				
			||||||
            long endTime = System.currentTimeMillis();
 | 
					            long endTime = System.currentTimeMillis();
 | 
				
			||||||
            long time = endTime - startTime;
 | 
					            long time = endTime - startTime;
 | 
				
			||||||
            // 保存日志
 | 
					            // 保存日志
 | 
				
			||||||
            logService.saveLogInfo(returnMoInfo, UrlApi.publicApi, resultJson, "按MO票入库", time);
 | 
					            logService.saveLogInfo(returnMoInfo, UrlApi.publicApi, resultJson, "按MO票入库", time, "INFO");
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
| 
						 | 
					@ -164,7 +165,6 @@ public class KMReSController {
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param task
 | 
					     * @param task
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Async
 | 
					 | 
				
			||||||
    public void returnIssue(@RequestBody Task task) {
 | 
					    public void returnIssue(@RequestBody Task task) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ReturnIssueInfo returnIssueInfo = getReturnIssueInfo(task);
 | 
					        ReturnIssueInfo returnIssueInfo = getReturnIssueInfo(task);
 | 
				
			||||||
| 
						 | 
					@ -173,7 +173,7 @@ public class KMReSController {
 | 
				
			||||||
        long endTime = System.currentTimeMillis();
 | 
					        long endTime = System.currentTimeMillis();
 | 
				
			||||||
        long time = endTime - startTime;
 | 
					        long time = endTime - startTime;
 | 
				
			||||||
        // 保存日志
 | 
					        // 保存日志
 | 
				
			||||||
        logService.saveLogInfo(returnIssueInfo, UrlApi.publicApi, resultJson, "叫料结果回传", time);
 | 
					        logService.saveLogInfo(returnIssueInfo, UrlApi.publicApi, resultJson, "叫料结果回传", time, "INFO");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,22 +36,16 @@ public class MlsController {
 | 
				
			||||||
    @AnonymousAccess
 | 
					    @AnonymousAccess
 | 
				
			||||||
    public ResponseEntity<Object> getOrderInfo(@RequestBody OrderInfo orderInfo) {
 | 
					    public ResponseEntity<Object> getOrderInfo(@RequestBody OrderInfo orderInfo) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        String resultJson = "";
 | 
					 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            resultJson = mlsService.getOrderJson(orderInfo);//获取送货单JSON
 | 
					            String resultJson = mlsService.getOrderJson(orderInfo);//获取送货单JSON
 | 
				
			||||||
        } catch (Exception e) {
 | 
					            if (resultJson == null || resultJson.isEmpty()) {
 | 
				
			||||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
					                return ResponseEntity.badRequest().body(ApiResult.success(BAD_REQUEST.value(), "获取送货单接口异常!", ""));
 | 
				
			||||||
        }
 | 
					            } else {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (resultJson == null || resultJson.length() == 0) {
 | 
					 | 
				
			||||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), "接口异常!", ""), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            try {
 | 
					 | 
				
			||||||
                mlsService.getOrderInfo(resultJson);//获取送货单
 | 
					                mlsService.getOrderInfo(resultJson);//获取送货单
 | 
				
			||||||
                return new ResponseEntity<>(ApiResult.success(OK.value(), "", resultJson), HttpStatus.OK);
 | 
					                return ResponseEntity.ok().body(ApiResult.success(OK.value(), "", resultJson));
 | 
				
			||||||
            } catch (Exception e) {
 | 
					 | 
				
			||||||
                return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        } catch (Exception e) {
 | 
				
			||||||
 | 
					            return ResponseEntity.badRequest().body(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -61,22 +55,17 @@ public class MlsController {
 | 
				
			||||||
    @Log("获取MO票信息")
 | 
					    @Log("获取MO票信息")
 | 
				
			||||||
    @ApiOperation("获取MO票信息")
 | 
					    @ApiOperation("获取MO票信息")
 | 
				
			||||||
    public ResponseEntity<Object> getMoInfo(@RequestBody MoInfo moInfo) {
 | 
					    public ResponseEntity<Object> getMoInfo(@RequestBody MoInfo moInfo) {
 | 
				
			||||||
        String resultJson = "";
 | 
					 | 
				
			||||||
        try {
 | 
					 | 
				
			||||||
            resultJson = mlsService.getMoJson(moInfo);//获取Mo票JSON
 | 
					 | 
				
			||||||
        } catch (Exception e) {
 | 
					 | 
				
			||||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (resultJson == null || resultJson.length() == 0) {
 | 
					        try {
 | 
				
			||||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), "接口异常!", ""), HttpStatus.BAD_REQUEST);
 | 
					            String resultJson = mlsService.getMoJson(moInfo);//获取Mo票JSON
 | 
				
			||||||
        } else {
 | 
					            if (resultJson == null || resultJson.isEmpty()) {
 | 
				
			||||||
            try {
 | 
					                return ResponseEntity.badRequest().body(ApiResult.success(BAD_REQUEST.value(), "获取MO票接口异常!", ""));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
                mlsService.getMoInfo(resultJson);//获取Mo票
 | 
					                mlsService.getMoInfo(resultJson);//获取Mo票
 | 
				
			||||||
                return new ResponseEntity<>(ApiResult.success(OK.value(), "", resultJson), HttpStatus.OK);
 | 
					                return ResponseEntity.ok().body(ApiResult.success(OK.value(), "", resultJson));
 | 
				
			||||||
            } catch (Exception e) {
 | 
					 | 
				
			||||||
                return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        } catch (Exception e) {
 | 
				
			||||||
 | 
					            return ResponseEntity.badRequest().body(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -86,7 +75,7 @@ public class MlsController {
 | 
				
			||||||
    @AnonymousAccess
 | 
					    @AnonymousAccess
 | 
				
			||||||
    public ResponseEntity<Object> returnMo(@RequestBody ReturnMoInfo returnMoInfo) {
 | 
					    public ResponseEntity<Object> returnMo(@RequestBody ReturnMoInfo returnMoInfo) {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            String resultJson = mlsService.returnMo(returnMoInfo);//回传MO票J
 | 
					            String resultJson = mlsService.returnMo(returnMoInfo);//回传MO票
 | 
				
			||||||
            return new ResponseEntity<>(ApiResult.success(OK.value(), "", resultJson), HttpStatus.OK);
 | 
					            return new ResponseEntity<>(ApiResult.success(OK.value(), "", resultJson), HttpStatus.OK);
 | 
				
			||||||
        } catch (Exception e) {
 | 
					        } catch (Exception e) {
 | 
				
			||||||
            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
					            return new ResponseEntity<>(ApiResult.success(BAD_REQUEST.value(), e.getMessage(), ""), HttpStatus.BAD_REQUEST);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.*;
 | 
					import java.util.*;
 | 
				
			||||||
import java.util.concurrent.CompletableFuture;
 | 
					import java.util.concurrent.CompletableFuture;
 | 
				
			||||||
 | 
					import java.util.concurrent.ExecutionException;
 | 
				
			||||||
import java.util.stream.Collectors;
 | 
					import java.util.stream.Collectors;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Service
 | 
					@Service
 | 
				
			||||||
| 
						 | 
					@ -145,15 +146,20 @@ public class MlsServiceImpl implements MlsService {
 | 
				
			||||||
                ordersToCreate.add(createOrder(detail));
 | 
					                ordersToCreate.add(createOrder(detail));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        //批量新增订单
 | 
					 | 
				
			||||||
        if (!ordersToCreate.isEmpty()) {
 | 
					 | 
				
			||||||
            batchCreateOrUpdate.batchCreate(ordersToCreate);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //批量更新订单
 | 
					 | 
				
			||||||
        if (!ordersToUpdate.isEmpty()) {
 | 
					 | 
				
			||||||
            batchCreateOrUpdate.batchUpdate(ordersToUpdate);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CompletableFuture<Void> orderFutureCreate = CompletableFuture.runAsync(() -> {
 | 
				
			||||||
 | 
					            //批量新增订单
 | 
				
			||||||
 | 
					            if (!ordersToCreate.isEmpty()) {
 | 
				
			||||||
 | 
					                batchCreateOrUpdate.batchCreate(ordersToCreate);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CompletableFuture<Void> orderFutureUpdate = CompletableFuture.runAsync(() -> {
 | 
				
			||||||
 | 
					            //批量更新订单
 | 
				
			||||||
 | 
					            if (!ordersToUpdate.isEmpty()) {
 | 
				
			||||||
 | 
					                batchCreateOrUpdate.batchUpdate(ordersToUpdate);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
| 
						 | 
					@ -311,15 +317,21 @@ public class MlsServiceImpl implements MlsService {
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CompletableFuture<Void> moFutureCreate = CompletableFuture.runAsync(() -> {
 | 
				
			||||||
 | 
					            //批量新增Mo票
 | 
				
			||||||
 | 
					            if (!mosToCreate.isEmpty()) {
 | 
				
			||||||
 | 
					                batchCreateOrUpdate.batchCreate(mosToCreate);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CompletableFuture<Void> moFutureUpdate = CompletableFuture.runAsync(() -> {
 | 
				
			||||||
 | 
					            //批量更新Mo票
 | 
				
			||||||
 | 
					            if (!mosToUpdate.isEmpty()) {
 | 
				
			||||||
 | 
					                batchCreateOrUpdate.batchUpdate(mosToUpdate);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //批量新增Mo票
 | 
					 | 
				
			||||||
        if (!mosToCreate.isEmpty()) {
 | 
					 | 
				
			||||||
            batchCreateOrUpdate.batchCreate(mosToCreate);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        //批量更新Mo票
 | 
					 | 
				
			||||||
        if (!mosToUpdate.isEmpty()) {
 | 
					 | 
				
			||||||
            batchCreateOrUpdate.batchUpdate(mosToUpdate);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
| 
						 | 
					@ -391,7 +403,6 @@ public class MlsServiceImpl implements MlsService {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					 | 
				
			||||||
    public void getIssueInfo(IssueInfo issueInfo) {
 | 
					    public void getIssueInfo(IssueInfo issueInfo) {
 | 
				
			||||||
        String taskNumber = issueInfo.getTaskNumber();//任务号
 | 
					        String taskNumber = issueInfo.getTaskNumber();//任务号
 | 
				
			||||||
        // 指定Set的类型
 | 
					        // 指定Set的类型
 | 
				
			||||||
| 
						 | 
					@ -412,8 +423,8 @@ public class MlsServiceImpl implements MlsService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        List<Inventory> inventoryToUpdate = new ArrayList<>();
 | 
					        List<Inventory> inventoryToUpdate = new ArrayList<>();
 | 
				
			||||||
        List<PickDetail> pickDetailToCreate = new ArrayList<>();
 | 
					        List<PickDetail> pickDetailToCreate = new ArrayList<>();
 | 
				
			||||||
        List<Task> taskToCreate = new ArrayList<>();
 | 
					 | 
				
			||||||
        List<AgvTask> agvTaskToCreate = new ArrayList<>();
 | 
					        List<AgvTask> agvTaskToCreate = new ArrayList<>();
 | 
				
			||||||
 | 
					        List<Task> taskToCreate = new ArrayList<>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (Inventory inv : inventoryList) {
 | 
					        for (Inventory inv : inventoryList) {
 | 
				
			||||||
            //根据库存信息生成叫料任务
 | 
					            //根据库存信息生成叫料任务
 | 
				
			||||||
| 
						 | 
					@ -471,31 +482,27 @@ public class MlsServiceImpl implements MlsService {
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        CompletableFuture<Void> pickDetailFuture = CompletableFuture.runAsync(() -> {
 | 
					        CompletableFuture<Void> pickDetailFuture = inventoryFuture.runAsync(() -> {
 | 
				
			||||||
            //批量生成叫料明细
 | 
					            //批量生成叫料明细
 | 
				
			||||||
            if (!pickDetailToCreate.isEmpty()) {
 | 
					            if (!pickDetailToCreate.isEmpty()) {
 | 
				
			||||||
                batchCreateOrUpdate.batchCreate(pickDetailToCreate);
 | 
					                batchCreateOrUpdate.batchCreate(pickDetailToCreate);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        CompletableFuture<Void> agvTaskFuture = CompletableFuture.runAsync(() -> {
 | 
					        CompletableFuture<Void> agvTaskFuture = pickDetailFuture.thenRun(() -> {
 | 
				
			||||||
            //批量生成agv任务
 | 
					            // 批量生成agv任务
 | 
				
			||||||
            if (!agvTaskToCreate.isEmpty()) {
 | 
					            if (!agvTaskToCreate.isEmpty()) {
 | 
				
			||||||
                batchCreateOrUpdate.batchCreate(agvTaskToCreate);
 | 
					                batchCreateOrUpdate.batchCreate(agvTaskToCreate);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CompletableFuture<Void> taskFuture = agvTaskFuture.thenRun(() -> {
 | 
				
			||||||
        CompletableFuture<Void> taskFuture = CompletableFuture.runAsync(() -> {
 | 
					            // 批量生成任务
 | 
				
			||||||
            //批量生成任务
 | 
					 | 
				
			||||||
            if (!taskToCreate.isEmpty()) {
 | 
					            if (!taskToCreate.isEmpty()) {
 | 
				
			||||||
                batchCreateOrUpdate.batchCreate(taskToCreate);
 | 
					                batchCreateOrUpdate.batchCreate(taskToCreate);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        inventoryFuture.join();
 | 
					
 | 
				
			||||||
        pickDetailFuture.join();
 | 
					 | 
				
			||||||
        agvTaskFuture.join();
 | 
					 | 
				
			||||||
        taskFuture.join();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ public class moTask {
 | 
				
			||||||
        mlsService.getMoInfo(resultJson);
 | 
					        mlsService.getMoInfo(resultJson);
 | 
				
			||||||
        long time = System.currentTimeMillis() - startTime;
 | 
					        long time = System.currentTimeMillis() - startTime;
 | 
				
			||||||
        // 保存日志
 | 
					        // 保存日志
 | 
				
			||||||
        logService.saveLogInfo(moInfo, UrlApi.publicApi, resultJson, "获取MO票信息", time);
 | 
					        logService.saveLogInfo(moInfo, UrlApi.publicApi, resultJson, "获取MO票信息", time,"INFO");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public MoInfo getMoInfo() {
 | 
					    public MoInfo getMoInfo() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,7 +47,7 @@ public class orderTask {
 | 
				
			||||||
        mlsService.getOrderInfo(resultJson);
 | 
					        mlsService.getOrderInfo(resultJson);
 | 
				
			||||||
        long time = System.currentTimeMillis() - startTime;
 | 
					        long time = System.currentTimeMillis() - startTime;
 | 
				
			||||||
        // 保存日志
 | 
					        // 保存日志
 | 
				
			||||||
        logService.saveLogInfo(orderInfo, UrlApi.publicApi, resultJson, "获取送货单信息", time);
 | 
					        logService.saveLogInfo(orderInfo, UrlApi.publicApi, resultJson, "获取送货单信息", time,"INFO");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,7 @@
 | 
				
			||||||
package com.youchain.utils;
 | 
					package com.youchain.utils;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.springframework.scheduling.annotation.Async;
 | 
					 | 
				
			||||||
import org.springframework.stereotype.Component;
 | 
					import org.springframework.stereotype.Component;
 | 
				
			||||||
import org.springframework.transaction.annotation.Transactional;
 | 
					import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
 | 
					 | 
				
			||||||
import javax.persistence.EntityManager;
 | 
					import javax.persistence.EntityManager;
 | 
				
			||||||
import javax.persistence.PersistenceContext;
 | 
					import javax.persistence.PersistenceContext;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
| 
						 | 
					@ -21,7 +19,6 @@ public class BatchCreateOrUpdate {
 | 
				
			||||||
     * @param <T>      实体类型
 | 
					     * @param <T>      实体类型
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Transactional
 | 
					    @Transactional
 | 
				
			||||||
    @Async
 | 
					 | 
				
			||||||
    public <T> void batchCreate(List<T> entities) {
 | 
					    public <T> void batchCreate(List<T> entities) {
 | 
				
			||||||
        int batchSize = 100;
 | 
					        int batchSize = 100;
 | 
				
			||||||
        if (entities == null || entities.isEmpty()) {
 | 
					        if (entities == null || entities.isEmpty()) {
 | 
				
			||||||
| 
						 | 
					@ -46,6 +43,7 @@ public class BatchCreateOrUpdate {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 批量更新实体。
 | 
					     * 批量更新实体。
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
| 
						 | 
					@ -53,7 +51,6 @@ public class BatchCreateOrUpdate {
 | 
				
			||||||
     * @param <T>      实体类型
 | 
					     * @param <T>      实体类型
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Transactional
 | 
					    @Transactional
 | 
				
			||||||
    @Async
 | 
					 | 
				
			||||||
    public <T> void batchUpdate(List<T> entities) {
 | 
					    public <T> void batchUpdate(List<T> entities) {
 | 
				
			||||||
        int batchSize = 100;
 | 
					        int batchSize = 100;
 | 
				
			||||||
        if (entities == null || entities.isEmpty()) {
 | 
					        if (entities == null || entities.isEmpty()) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue