fix 指令号生成

This commit is contained in:
USER-20220102CG\noblelift
2023-04-19 10:37:53 +08:00
parent 49a0c61938
commit 5f3acc4ddc
2 changed files with 15 additions and 9 deletions

View File

@@ -59,7 +59,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
private final ApplicationContext applicationContext;
private final InstructionService InstructionService;
private final InstructionService instructionService;
private final TaskService taskService;
private final DeviceService deviceService;
private final DeviceAppService deviceAppService;
@@ -784,7 +784,11 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
OutConfirmRequest outConfirmRequest = new OutConfirmRequest();
outConfirmRequest.setOutPortNo(device_code);
outConfirmRequest.setPalletCode(vehicle_code);
Instruction instruction = instructionService.findByCode(String.valueOf(task_code));
if(ObjectUtil.isNotEmpty(instruction)){
task_code = instruction.getInstruction_code();
outConfirmRequest.setOrderId(task_code);
}
Resp<OutConfirmReportResponse> resp = acsToLiKuService.outConfirm(outConfirmRequest);

View File

@@ -7,13 +7,15 @@ import java.util.HashMap;
public class CodeUtil {
public static synchronized String getNewCode(String ruleCode){
GenCodeService service=new GenCodeServiceImpl();
String flag = "1";
HashMap<String,String> map = new HashMap<>();
map.put("flag",flag);
map.put("code",ruleCode);
return service.codeDemo(map);
public static String getNewCode(String ruleCode){
synchronized (ruleCode) {
GenCodeService service=new GenCodeServiceImpl();
String flag = "1";
HashMap<String,String> map = new HashMap<>();
map.put("flag",flag);
map.put("code",ruleCode);
return service.codeDemo(map);
}
}
}