当@PostConstruct注解不能使用代码提示补全,需要手动导包。**
import javax.annotation.PostConstruct;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.xxx.mapp.service.common.CommonService;
@Component
public class UnionPayCommonUtil {
@Autowired
private CommonService commonService;
private static UnionPayCommonUtil common;
@PostConstruct
public void init() {
common = this;
}
public static String getCommonNo() {
String commonNo=null;
try {
commonNo= common.commonService.getCommonNo();
} catch (Exception e) {
e.printStackTrace();
}
return commonNo;
}
}